Selects PFCandidates basing on cuts provided with string cut parser. More...
#include <CommonTools/ParticleFlow/interface/MuonIDPFCandidateSelectorDefinition.h>
Public Member Functions | |
MuonIDPFCandidateSelectorDefinition (const edm::ParameterSet &cfg) | |
void | select (const HandleToCollection &hc, const edm::Event &e, const edm::EventSetup &s) |
Private Attributes | |
StringCutObjectSelector < pat::Muon > | muonCut_ |
Selects PFCandidates basing on cuts provided with string cut parser.
Definition at line 21 of file MuonIDPFCandidateSelectorDefinition.h.
pf2pat::MuonIDPFCandidateSelectorDefinition::MuonIDPFCandidateSelectorDefinition | ( | const edm::ParameterSet & | cfg | ) | [inline] |
Definition at line 23 of file MuonIDPFCandidateSelectorDefinition.h.
: muonCut_( cfg.getParameter< std::string >( "cut" ) ) { }
void pf2pat::MuonIDPFCandidateSelectorDefinition::select | ( | const HandleToCollection & | hc, |
const edm::Event & | e, | ||
const edm::EventSetup & | s | ||
) | [inline] |
Definition at line 28 of file MuonIDPFCandidateSelectorDefinition.h.
References edm::Ref< C, T, F >::isNull(), combine::key, muonCut_, and pf2pat::PFCandidateSelectorDefinition::selected_.
{ selected_.clear(); unsigned key=0; for( collection::const_iterator pfc = hc->begin(); pfc != hc->end(); ++pfc, ++key) { reco::MuonRef muR = pfc->muonRef(); // skip ones without a ref to a reco::Muon: they won't be matched anyway if (muR.isNull()) continue; // convert into a pat::Muon, so that the 'muonID' method is available pat::Muon patMu(*muR); // apply muon id if (muonCut_(patMu)) { selected_.push_back( reco::PFCandidate(*pfc) ); reco::PFCandidatePtr ptrToMother( hc, key ); selected_.back().setSourceCandidatePtr( ptrToMother ); } } }
Definition at line 55 of file MuonIDPFCandidateSelectorDefinition.h.
Referenced by select().