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