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
pf2pat
Definition: ElectronIDPFCandidateSelectorDefinition.h:22
PFJet.h
pf2pat::GenericPFJetSelectorDefinition::select
void select(const HandleToCollection &hc, const edm::Event &e, const edm::EventSetup &s)
Definition: GenericPFJetSelectorDefinition.h:18
edm::Handle
Definition: AssociativeIterator.h:50
pf2pat::GenericPFJetSelectorDefinition::GenericPFJetSelectorDefinition
GenericPFJetSelectorDefinition(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
Definition: GenericPFJetSelectorDefinition.h:15
alignCSCRings.s
s
Definition: alignCSCRings.py:92
pf2pat::PFJetSelectorDefinition::selected_
container selected_
Definition: PFJetSelectorDefinition.h:33
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
pf2pat::PFJetSelectorDefinition
Definition: PFJetSelectorDefinition.h:10
pf2pat::GenericPFJetSelectorDefinition::selector_
StringCutObjectSelector< reco::PFJet > selector_
Definition: GenericPFJetSelectorDefinition.h:32
edm::EventSetup
Definition: EventSetup.h:58
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::Ptr< Candidate >
looper.cfg
cfg
Definition: looper.py:296
std
Definition: JetResolutionObject.h:76
pf2pat::GenericPFJetSelectorDefinition
Definition: GenericPFJetSelectorDefinition.h:14
StringCutObjectSelector.h
PFJetSelectorDefinition.h
StringCutObjectSelector< reco::PFJet >
reco::PFJet
Jets made from PFObjects.
Definition: PFJet.h:20
ConsumesCollector.h
ParameterSet.h
edm::Event
Definition: Event.h:73
crabWrapper.key
key
Definition: crabWrapper.py:19
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
PFCandidateFwd.h
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37