CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
tuple cfg
Definition: looper.py:296
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)
tuple key
prepare the HTCondor submission files and eventually submit them
StringCutObjectSelector< reco::PFJet > selector_