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 
10 
11 namespace pf2pat {
12 
14 
16  selector_( cfg.getParameter< std::string >( "cut" ) ) { }
17 
18  void select( const HandleToCollection & hc,
19  const edm::Event & e,
20  const edm::EventSetup& s) {
21  selected_.clear();
22 
23  unsigned key=0;
24  for( collection::const_iterator pfc = hc->begin();
25  pfc != hc->end(); ++pfc, ++key) {
26 
27  if( selector_(*pfc) ) {
28  selected_.push_back( reco::PFJet(*pfc) );
29  reco::CandidatePtr ptrToMother( hc, key );
30  selected_.back().setSourceCandidatePtr( ptrToMother );
31 
32  }
33  }
34  }
35 
36  private:
38  };
39 }
40 
41 #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