#include <HLTCountNumberOfObject.h>
Public Member Functions | |
HLTCountNumberOfObject (const edm::ParameterSet &iConfig) | |
~HLTCountNumberOfObject () | |
Private Member Functions | |
virtual bool | hltFilter (edm::Event &iEvent, const edm::EventSetup &, trigger::TriggerFilterObjectWithRefs &filterproduct) |
Private Attributes | |
int | maxN_ |
int | minN_ |
edm::InputTag | src_ |
Description: templated EDFilter to count the number of object in a given collection, using View
Definition at line 26 of file HLTCountNumberOfObject.h.
HLTCountNumberOfObject< OColl >::HLTCountNumberOfObject | ( | const edm::ParameterSet & | iConfig | ) | [inline, explicit] |
Definition at line 28 of file HLTCountNumberOfObject.h.
: HLTFilter(iConfig), src_(iConfig.getParameter<edm::InputTag>("src")), minN_(iConfig.getParameter<int>("MinN")), maxN_(iConfig.getParameter<int>("MaxN")) { }
HLTCountNumberOfObject< OColl >::~HLTCountNumberOfObject | ( | ) | [inline] |
Definition at line 34 of file HLTCountNumberOfObject.h.
{ }
virtual bool HLTCountNumberOfObject< OColl >::hltFilter | ( | edm::Event & | iEvent, |
const edm::EventSetup & | , | ||
trigger::TriggerFilterObjectWithRefs & | filterproduct | ||
) | [inline, private, virtual] |
Implements HLTFilter.
Definition at line 37 of file HLTCountNumberOfObject.h.
References submit::answer, edm::Event::getByLabel(), LogDebug, HLTCountNumberOfObject< OColl >::maxN_, HLTCountNumberOfObject< OColl >::minN_, HLTFilter::module(), alignCSCRings::s, and HLTCountNumberOfObject< OColl >::src_.
{ edm::Handle<OColl> oHandle; iEvent.getByLabel(src_, oHandle); int s=oHandle->size(); bool answer=true; if (minN_!=-1) answer = answer && (s>=minN_); if (maxN_!=-1) answer = answer && (s<=maxN_); LogDebug("HLTCountNumberOfObject")<<module()<<" sees: "<<s<<" objects. Filtere answer is: "<<(answer?"true":"false"); return answer; }
int HLTCountNumberOfObject< OColl >::maxN_ [private] |
Definition at line 51 of file HLTCountNumberOfObject.h.
Referenced by HLTCountNumberOfObject< OColl >::hltFilter().
int HLTCountNumberOfObject< OColl >::minN_ [private] |
Definition at line 51 of file HLTCountNumberOfObject.h.
Referenced by HLTCountNumberOfObject< OColl >::hltFilter().
edm::InputTag HLTCountNumberOfObject< OColl >::src_ [private] |
Definition at line 50 of file HLTCountNumberOfObject.h.
Referenced by HLTCountNumberOfObject< OColl >::hltFilter().