CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HLTCountNumberOfObject.h
Go to the documentation of this file.
1 #ifndef HLTrigger_HLTCountNumberOfObject_H
2 
8 // system include files
9 #include <memory>
10 
11 // user include files
14 
17 
19 
21 
24 
25 template <class OColl>
27 public:
28  explicit HLTCountNumberOfObject(const edm::ParameterSet& iConfig) : HLTFilter(iConfig),
29  src_(iConfig.getParameter<edm::InputTag>("src")),
30  minN_(iConfig.getParameter<int>("MinN")),
31  maxN_(iConfig.getParameter<int>("MaxN"))
32  { }
33 
35 
36 private:
38  {
39  edm::Handle<OColl> oHandle;
40  iEvent.getByLabel(src_, oHandle);
41  int s=oHandle->size();
42  bool answer=true;
43  if (minN_!=-1) answer = answer && (s>=minN_);
44  if (maxN_!=-1) answer = answer && (s<=maxN_);
45  LogDebug("HLTCountNumberOfObject")<<module()<<" sees: "<<s<<" objects. Filtere answer is: "<<(answer?"true":"false");
46 
47  return answer;
48  }
49 
51  int minN_,maxN_;
52 };
53 
54 
55 #endif
#define LogDebug(id)
virtual bool hltFilter(edm::Event &iEvent, const edm::EventSetup &, trigger::TriggerFilterObjectWithRefs &filterproduct)
answer
Definition: submit.py:44
int iEvent
Definition: GenABIO.cc:243
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
HLTCountNumberOfObject(const edm::ParameterSet &iConfig)
int module() const
Definition: HLTFilter.cc:56