#include <HLTCountNumberOfObject.h>
Public Member Functions | |
HLTCountNumberOfObject (const edm::ParameterSet &iConfig) | |
~HLTCountNumberOfObject () | |
Private Member Functions | |
virtual void | endJob () |
virtual bool | filter (edm::Event &iEvent, const edm::EventSetup &) |
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.
: src_(iConfig.getParameter<edm::InputTag>("src")), minN_(iConfig.getParameter<int>("MinN")), maxN_(iConfig.getParameter<int>("MaxN")) { produces<trigger::TriggerFilterObjectWithRefs>(); };
HLTCountNumberOfObject< OColl >::~HLTCountNumberOfObject | ( | ) | [inline] |
Definition at line 36 of file HLTCountNumberOfObject.h.
{};
virtual void HLTCountNumberOfObject< OColl >::endJob | ( | void | ) | [inline, private, virtual] |
virtual bool HLTCountNumberOfObject< OColl >::filter | ( | edm::Event & | iEvent, |
const edm::EventSetup & | |||
) | [inline, private, virtual] |
Implements HLTFilter.
Definition at line 39 of file HLTCountNumberOfObject.h.
References submit::answer, edm::Event::getByLabel(), LogDebug, HLTCountNumberOfObject< OColl >::maxN_, HLTCountNumberOfObject< OColl >::minN_, module(), path(), edm::Event::put(), asciidump::s, and HLTCountNumberOfObject< OColl >::src_.
{ // The filtered object. which is put empty. std::auto_ptr<trigger::TriggerFilterObjectWithRefs> filterproduct (new trigger::TriggerFilterObjectWithRefs(path(),module())); 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"); iEvent.put(filterproduct); return answer; }
int HLTCountNumberOfObject< OColl >::maxN_ [private] |
Definition at line 58 of file HLTCountNumberOfObject.h.
Referenced by HLTCountNumberOfObject< OColl >::filter().
int HLTCountNumberOfObject< OColl >::minN_ [private] |
Definition at line 58 of file HLTCountNumberOfObject.h.
Referenced by HLTCountNumberOfObject< OColl >::filter().
edm::InputTag HLTCountNumberOfObject< OColl >::src_ [private] |
Definition at line 55 of file HLTCountNumberOfObject.h.
Referenced by HLTCountNumberOfObject< OColl >::filter().