Selects PFCandidates basing on cuts provided with string cut parser. More...
#include <CommonTools/ParticleFlow/interface/GenericPFCandidateSelectorDefinition.h>
Public Member Functions | |
GenericPFCandidateSelectorDefinition (const edm::ParameterSet &cfg) | |
void | select (const HandleToCollection &hc, const edm::Event &e, const edm::EventSetup &s) |
Private Attributes | |
StringCutObjectSelector < reco::PFCandidate > | selector_ |
Selects PFCandidates basing on cuts provided with string cut parser.
Definition at line 19 of file GenericPFCandidateSelectorDefinition.h.
pf2pat::GenericPFCandidateSelectorDefinition::GenericPFCandidateSelectorDefinition | ( | const edm::ParameterSet & | cfg | ) | [inline] |
Definition at line 21 of file GenericPFCandidateSelectorDefinition.h.
: selector_( cfg.getParameter< std::string >( "cut" ) ) { }
void pf2pat::GenericPFCandidateSelectorDefinition::select | ( | const HandleToCollection & | hc, |
const edm::Event & | e, | ||
const edm::EventSetup & | s | ||
) | [inline] |
Definition at line 24 of file GenericPFCandidateSelectorDefinition.h.
References combine::key, pf2pat::PFCandidateSelectorDefinition::selected_, and selector_.
{ selected_.clear(); unsigned key=0; for( collection::const_iterator pfc = hc->begin(); pfc != hc->end(); ++pfc, ++key) { if( selector_(*pfc) ) { selected_.push_back( reco::PFCandidate(*pfc) ); reco::PFCandidatePtr ptrToMother( hc, key ); selected_.back().setSourceCandidatePtr( ptrToMother ); } } }
StringCutObjectSelector<reco::PFCandidate> pf2pat::GenericPFCandidateSelectorDefinition::selector_ [private] |
Definition at line 43 of file GenericPFCandidateSelectorDefinition.h.
Referenced by select().