77 : srcToken_(consumes<edm::
View<
T> >(iConfig.getParameter<edm::
InputTag>(
"src"))),
79 mcSel_(iConfig.getParameter<std::
string>(
"matchedSelector")),
81 produces<edm::Association<std::vector<reco::GenParticle> > >();
82 produces<edm::ValueMap<float> >(
"pulls");
98 typedef std::vector<reco::GenParticle> MCColl;
104 std::vector<uint8_t> candGood(cands->size(), 1);
105 std::transform(cands->begin(), cands->end(), candGood.begin(), mcSel_);
107 std::vector<int> matches(src->size(), -1);
108 std::vector<float> pulls(src->size(), 1e39);
109 for (
size_t i = 0,
n = src->size();
i <
n; ++
i) {
110 const T& tk = (*src)[
i];
111 std::pair<int, float>
m =
algo_.match(tk, *cands, candGood);
112 matches[
i] = m.first;
118 MCAsso::Filler matchesFiller(*matchesMap);
119 matchesFiller.insert(src, matches.begin(), matches.end());
120 matchesFiller.fill();
125 pullsFiller.
insert(src, pulls.begin(), pulls.end());
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
edm::EDGetTokenT< edm::View< T > > srcToken_
The RECO objects.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
void insert(const H &h, I begin, I end)
pat::MatcherByPulls< reco::RecoCandidate > MatcherByPulls
StringCutObjectSelector< reco::GenParticle > mcSel_
Preselection cut on MC objects.
edm::EDGetTokenT< std::vector< reco::GenParticle > > matchedToken_
The MC objects to match against.
~MatcherByPulls() override
pat::MatcherByPulls< reco::Track > TrackMatcherByPulls
MatcherByPulls(const edm::ParameterSet &)
void produce(edm::Event &, const edm::EventSetup &) override
MatcherByPullsAlgorithm algo_