CMS 3D CMS Logo

GenericPFCandidateSelectorDefinition.h
Go to the documentation of this file.
1 #ifndef CommonTools_ParticleFlow_GenericPFCandidateSelectorDefinition
2 #define CommonTools_ParticleFlow_GenericPFCandidateSelectorDefinition
3 
19 
20 namespace pf2pat {
21 
24  : selector_(cfg.getParameter<std::string>("cut")) {}
25 
26  void select(const HandleToCollection& hc, const edm::Event& e, const edm::EventSetup& s) {
27  selected_.clear();
28 
29  unsigned key = 0;
30  for (collection::const_iterator pfc = hc->begin(); pfc != hc->end(); ++pfc, ++key) {
31  if (selector_(*pfc)) {
32  selected_.push_back(reco::PFCandidate(*pfc));
33  reco::PFCandidatePtr ptrToMother(hc, key);
34  selected_.back().setSourceCandidatePtr(ptrToMother);
35  }
36  }
37  }
38 
39  private:
41  };
42 } // namespace pf2pat
43 
44 #endif
pf2pat::GenericPFCandidateSelectorDefinition::selector_
StringCutObjectSelector< reco::PFCandidate > selector_
Definition: GenericPFCandidateSelectorDefinition.h:40
PFCandidate.h
pf2pat
Definition: ElectronIDPFCandidateSelectorDefinition.h:22
edm::Handle
Definition: AssociativeIterator.h:50
alignCSCRings.s
s
Definition: alignCSCRings.py:92
pf2pat::PFCandidateSelectorDefinition::selected_
container selected_
Definition: PFCandidateSelectorDefinition.h:33
PFCandidateSelectorDefinition.h
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
edm::EventSetup
Definition: EventSetup.h:58
pf2pat::GenericPFCandidateSelectorDefinition::GenericPFCandidateSelectorDefinition
GenericPFCandidateSelectorDefinition(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
Definition: GenericPFCandidateSelectorDefinition.h:23
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::Ptr< PFCandidate >
looper.cfg
cfg
Definition: looper.py:296
pf2pat::GenericPFCandidateSelectorDefinition
Selects PFCandidates basing on cuts provided with string cut parser.
Definition: GenericPFCandidateSelectorDefinition.h:22
std
Definition: JetResolutionObject.h:76
StringCutObjectSelector.h
StringCutObjectSelector< reco::PFCandidate >
reco::PFCandidate
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:41
ConsumesCollector.h
pf2pat::PFCandidateSelectorDefinition
Definition: PFCandidateSelectorDefinition.h:10
ParameterSet.h
edm::Event
Definition: Event.h:73
crabWrapper.key
key
Definition: crabWrapper.py:19
pf2pat::GenericPFCandidateSelectorDefinition::select
void select(const HandleToCollection &hc, const edm::Event &e, const edm::EventSetup &s)
Definition: GenericPFCandidateSelectorDefinition.h:26
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
PFCandidateFwd.h
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37