CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
tuple cfg
Definition: looper.py:293
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)
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
StringCutObjectSelector< reco::PFJet > selector_
susybsm::HSCParticleCollection hc
Definition: classes.h:25