79 src_(iConfig.getParameter<edm::InputTag>(
"src")),
80 matched_(iConfig.getParameter<edm::InputTag>(
"matched")),
81 mcSel_(iConfig.getParameter<std::
string>(
"matchedSelector")),
84 produces<edm::Association<std::vector<reco::GenParticle> > >();
85 produces<edm::ValueMap<float> >(
"pulls");
105 typedef std::vector<reco::GenParticle> MCColl;
111 std::vector<uint8_t> candGood(cands->size(),1);
112 std::transform(cands->begin(), cands->end(), candGood.begin(), mcSel_);
114 std::vector<int> matches(src->size(),-1);
115 std::vector<float> pulls(src->size(), 1e39);
116 for (
size_t i = 0,
n = src->size();
i <
n; ++
i) {
117 const T &tk = (*src)[
i];
118 std::pair<int,float>
m = algo_.match(tk, *cands, candGood);
119 matches[
i] = m.first;
125 MCAsso::Filler matchesFiller(*matchesMap);
126 matchesFiller.insert(src, matches.begin(), matches.end());
127 matchesFiller.fill();
128 iEvent.
put(matchesMap);
132 pullsFiller.
insert(src, pulls.begin(), pulls.end());
134 iEvent.
put(pullsMap,
"pulls");
#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::InputTag matched_
The MC objects to match against.
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
pat::MatcherByPulls< reco::Track > TrackMatcherByPulls
MatcherByPulls(const edm::ParameterSet &)
virtual void produce(edm::Event &, const edm::EventSetup &) override
edm::InputTag src_
The RECO objects.
MatcherByPullsAlgorithm algo_