#include <PdgIdPFCandidateSelectorDefinition.h>
Public Member Functions | |
PdgIdPFCandidateSelectorDefinition (const edm::ParameterSet &cfg) | |
void | select (const HandleToCollection &hc, const edm::EventBase &e, const edm::EventSetup &s) |
Private Attributes | |
std::vector< int > | pdgIds_ |
Definition at line 10 of file PdgIdPFCandidateSelectorDefinition.h.
pf2pat::PdgIdPFCandidateSelectorDefinition::PdgIdPFCandidateSelectorDefinition | ( | const edm::ParameterSet & | cfg | ) | [inline] |
Definition at line 13 of file PdgIdPFCandidateSelectorDefinition.h.
: pdgIds_( cfg.getParameter< std::vector<int> >( "pdgId" ) ) { }
void pf2pat::PdgIdPFCandidateSelectorDefinition::select | ( | const HandleToCollection & | hc, |
const edm::EventBase & | e, | ||
const edm::EventSetup & | s | ||
) | [inline] |
Definition at line 16 of file PdgIdPFCandidateSelectorDefinition.h.
References combine::key, pdgIds_, and pf2pat::PFCandidateSelectorDefinition::selected_.
{ selected_.clear(); unsigned key=0; for( collection::const_iterator pfc = hc->begin(); pfc != hc->end(); ++pfc, ++key) { for(unsigned iId=0; iId<pdgIds_.size(); iId++) { if ( pfc->pdgId() == pdgIds_[iId] ) { selected_.push_back( reco::PFCandidate(*pfc) ); reco::PFCandidatePtr ptrToMother( hc, key ); selected_.back().setSourceCandidatePtr( ptrToMother ); break; } } } }
std::vector<int> pf2pat::PdgIdPFCandidateSelectorDefinition::pdgIds_ [private] |
Definition at line 37 of file PdgIdPFCandidateSelectorDefinition.h.
Referenced by select().