#include <HLTrigger/special/interface/HLTCountNumberOfObject.h>
Public Member Functions | |
HLTCountNumberOfObject (const edm::ParameterSet &iConfig) | |
~HLTCountNumberOfObject () | |
Private Member Functions | |
virtual void | beginJob (const edm::EventSetup &) |
virtual void | endJob () |
virtual bool | filter (edm::Event &iEvent, const edm::EventSetup &) |
Private Attributes | |
int | maxN_ |
int | minN_ |
edm::InputTag | src_ |
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.
00028 : 00029 src_(iConfig.getParameter<edm::InputTag>("src")), 00030 minN_(iConfig.getParameter<int>("MinN")), 00031 maxN_(iConfig.getParameter<int>("MaxN")) 00032 { 00033 produces<trigger::TriggerFilterObjectWithRefs>(); 00034 };
HLTCountNumberOfObject< OColl >::~HLTCountNumberOfObject | ( | ) | [inline] |
virtual void HLTCountNumberOfObject< OColl >::beginJob | ( | const edm::EventSetup & | ) | [inline, private, virtual] |
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 40 of file HLTCountNumberOfObject.h.
References edm::Event::getByLabel(), LogDebug, HLTCountNumberOfObject< OColl >::maxN_, HLTCountNumberOfObject< OColl >::minN_, module(), path(), edm::Event::put(), s, and HLTCountNumberOfObject< OColl >::src_.
00041 { 00042 // The filtered object. which is put empty. 00043 std::auto_ptr<trigger::TriggerFilterObjectWithRefs> filterproduct (new trigger::TriggerFilterObjectWithRefs(path(),module())); 00044 00045 edm::Handle<OColl> oHandle; 00046 iEvent.getByLabel(src_, oHandle); 00047 int s=oHandle->size(); 00048 bool answer=true; 00049 if (minN_!=-1) answer = answer && (s>=minN_); 00050 if (maxN_!=-1) answer = answer && (s<=maxN_); 00051 LogDebug("HLTCountNumberOfObject")<<module()<<" sees: "<<s<<" objects. Filtere answer is: "<<(answer?"true":"false"); 00052 00053 iEvent.put(filterproduct); 00054 return answer; 00055 }
int HLTCountNumberOfObject< OColl >::maxN_ [private] |
Definition at line 59 of file HLTCountNumberOfObject.h.
Referenced by HLTCountNumberOfObject< OColl >::filter().
int HLTCountNumberOfObject< OColl >::minN_ [private] |
Definition at line 59 of file HLTCountNumberOfObject.h.
Referenced by HLTCountNumberOfObject< OColl >::filter().
edm::InputTag HLTCountNumberOfObject< OColl >::src_ [private] |
Definition at line 56 of file HLTCountNumberOfObject.h.
Referenced by HLTCountNumberOfObject< OColl >::filter().