CMS 3D CMS Logo

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