78 srcToken_(consumes<edm::
View<
T> >(iConfig.getParameter<edm::InputTag>(
"src"))),
79 matchedToken_(consumes<std::vector<
reco::
GenParticle> >(iConfig.getParameter<edm::InputTag>(
"matched"))),
80 mcSel_(iConfig.getParameter<std::
string>(
"matchedSelector")),
83 produces<edm::Association<std::vector<reco::GenParticle> > >();
84 produces<edm::ValueMap<float> >(
"pulls");
104 typedef std::vector<reco::GenParticle> MCColl;
110 std::vector<uint8_t> candGood(cands->size(),1);
111 std::transform(cands->begin(), cands->end(), candGood.begin(), mcSel_);
113 std::vector<int> matches(src->size(),-1);
114 std::vector<float> pulls(src->size(), 1e39);
115 for (
size_t i = 0,
n = src->size();
i <
n; ++
i) {
116 const T &tk = (*src)[
i];
117 std::pair<int,float>
m =
algo_.match(tk, *cands, candGood);
118 matches[
i] = m.first;
124 MCAsso::Filler matchesFiller(*matchesMap);
125 matchesFiller.insert(src, matches.begin(), matches.end());
126 matchesFiller.fill();
127 iEvent.
put(matchesMap);
131 pullsFiller.
insert(src, pulls.begin(), pulls.end());
133 iEvent.
put(pullsMap,
"pulls");
algo_(conf.existsAs< bool >("Correct")?conf.getParameter< bool >("Correct"):true, conf.getParameter< double >("e9e25Cut"), conf.getParameter< double >("intercept2DCut"), conf.existsAs< bool >("intercept2DSlope")?conf.getParameter< double >("intercept2DSlope"):defaultSlope2D_, conf.getParameter< std::vector< double > >("e1e9Cut"), conf.getParameter< std::vector< double > >("eCOREe9Cut"), conf.getParameter< std::vector< double > >("eSeLCut"), hfvars_)
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.
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
edm::EDGetTokenT< std::vector< reco::GenParticle > > matchedToken_
The MC objects to match against.
pat::MatcherByPulls< reco::Track > TrackMatcherByPulls
MatcherByPulls(const edm::ParameterSet &)
virtual void produce(edm::Event &, const edm::EventSetup &) override
MatcherByPullsAlgorithm algo_