![]() |
![]() |
#include <PATLeptonCountFilter.h>
Public Member Functions | |
PATLeptonCountFilter (const edm::ParameterSet &iConfig) | |
virtual | ~PATLeptonCountFilter () |
Private Member Functions | |
virtual bool | filter (edm::Event &iEvent, const edm::EventSetup &iSetup) |
Private Attributes | |
bool | countElectrons_ |
bool | countMuons_ |
bool | countTaus_ |
edm::InputTag | electronSource_ |
unsigned int | maxNumber_ |
unsigned int | minNumber_ |
edm::InputTag | muonSource_ |
edm::InputTag | tauSource_ |
Definition at line 17 of file PATLeptonCountFilter.h.
PATLeptonCountFilter::PATLeptonCountFilter | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 18 of file PATLeptonCountFilter.cc.
References countElectrons_, countMuons_, countTaus_, electronSource_, edm::ParameterSet::getParameter(), maxNumber_, minNumber_, muonSource_, and tauSource_.
{ electronSource_ = iConfig.getParameter<edm::InputTag>( "electronSource" ); muonSource_ = iConfig.getParameter<edm::InputTag>( "muonSource" ); tauSource_ = iConfig.getParameter<edm::InputTag>( "tauSource" ); countElectrons_ = iConfig.getParameter<bool> ( "countElectrons" ); countMuons_ = iConfig.getParameter<bool> ( "countMuons" ); countTaus_ = iConfig.getParameter<bool> ( "countTaus" ); minNumber_ = iConfig.getParameter<unsigned int> ( "minNumber" ); maxNumber_ = iConfig.getParameter<unsigned int> ( "maxNumber" ); }
PATLeptonCountFilter::~PATLeptonCountFilter | ( | ) | [virtual] |
Definition at line 30 of file PATLeptonCountFilter.cc.
{ }
bool PATLeptonCountFilter::filter | ( | edm::Event & | iEvent, |
const edm::EventSetup & | iSetup | ||
) | [private, virtual] |
Implements edm::EDFilter.
Definition at line 34 of file PATLeptonCountFilter.cc.
References countElectrons_, countMuons_, countTaus_, electronSource_, edm::Event::getByLabel(), maxNumber_, minNumber_, patZpeak::muons, muonSource_, and tauSource_.
{ edm::Handle<edm::View<Electron> > electrons; if (countElectrons_) iEvent.getByLabel(electronSource_, electrons); edm::Handle<edm::View<Muon> > muons; if (countMuons_) iEvent.getByLabel(muonSource_, muons); edm::Handle<edm::View<Tau> > taus; if (countTaus_) iEvent.getByLabel(tauSource_, taus); unsigned int nrLeptons = 0; nrLeptons += (countElectrons_ ? electrons->size() : 0); nrLeptons += (countMuons_ ? muons->size() : 0); nrLeptons += (countTaus_ ? taus->size() : 0); return nrLeptons >= minNumber_ && nrLeptons <= maxNumber_; }
bool pat::PATLeptonCountFilter::countElectrons_ [private] |
Definition at line 33 of file PATLeptonCountFilter.h.
Referenced by filter(), and PATLeptonCountFilter().
bool pat::PATLeptonCountFilter::countMuons_ [private] |
Definition at line 34 of file PATLeptonCountFilter.h.
Referenced by filter(), and PATLeptonCountFilter().
bool pat::PATLeptonCountFilter::countTaus_ [private] |
Definition at line 35 of file PATLeptonCountFilter.h.
Referenced by filter(), and PATLeptonCountFilter().
Definition at line 30 of file PATLeptonCountFilter.h.
Referenced by filter(), and PATLeptonCountFilter().
unsigned int pat::PATLeptonCountFilter::maxNumber_ [private] |
Definition at line 37 of file PATLeptonCountFilter.h.
Referenced by filter(), and PATLeptonCountFilter().
unsigned int pat::PATLeptonCountFilter::minNumber_ [private] |
Definition at line 36 of file PATLeptonCountFilter.h.
Referenced by filter(), and PATLeptonCountFilter().
Definition at line 31 of file PATLeptonCountFilter.h.
Referenced by filter(), and PATLeptonCountFilter().
Definition at line 32 of file PATLeptonCountFilter.h.
Referenced by filter(), and PATLeptonCountFilter().