CMS 3D CMS Logo

GenericPFJetSelectorDefinition.h
Go to the documentation of this file.
1 #ifndef CommonTools_ParticleFlow_GenericPFJetSelectorDefinition
2 #define CommonTools_ParticleFlow_GenericPFJetSelectorDefinition
3 
11 
12 namespace pf2pat {
13 
16  : selector_(cfg.getParameter<std::string>("cut")) {}
17 
18  void select(const HandleToCollection& hc, const edm::Event& e, const edm::EventSetup& s) {
19  selected_.clear();
20 
21  unsigned key = 0;
22  for (collection::const_iterator pfc = hc->begin(); pfc != hc->end(); ++pfc, ++key) {
23  if (selector_(*pfc)) {
24  selected_.push_back(reco::PFJet(*pfc));
25  reco::CandidatePtr ptrToMother(hc, key);
26  selected_.back().setSourceCandidatePtr(ptrToMother);
27  }
28  }
29  }
30 
31  private:
33  };
34 } // namespace pf2pat
35 
36 #endif
GenericPFJetSelectorDefinition(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
Jets made from PFObjects.
Definition: PFJet.h:20
void select(const HandleToCollection &hc, const edm::Event &e, const edm::EventSetup &s)
StringCutObjectSelector< reco::PFJet > selector_
susybsm::HSCParticleCollection hc
Definition: classes.h:25