CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

HLTCountNumberOfObject< OColl > Class Template Reference

#include <HLTCountNumberOfObject.h>

Inheritance diagram for HLTCountNumberOfObject< OColl >:
HLTFilter edm::EDFilter edm::ProducerBase edm::ProductRegistryHelper

List of all members.

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_

Detailed Description

template<class OColl>
class HLTCountNumberOfObject< OColl >

Description: templated EDFilter to count the number of object in a given collection, using View

Author:
Jean-Roch Vlimant

Definition at line 26 of file HLTCountNumberOfObject.h.


Constructor & Destructor Documentation

template<class OColl >
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"))
  { }
template<class OColl >
HLTCountNumberOfObject< OColl >::~HLTCountNumberOfObject ( ) [inline]

Definition at line 34 of file HLTCountNumberOfObject.h.

{ }

Member Function Documentation

template<class OColl >
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;
  }

Member Data Documentation

template<class OColl >
int HLTCountNumberOfObject< OColl >::maxN_ [private]

Definition at line 51 of file HLTCountNumberOfObject.h.

Referenced by HLTCountNumberOfObject< OColl >::hltFilter().

template<class OColl >
int HLTCountNumberOfObject< OColl >::minN_ [private]

Definition at line 51 of file HLTCountNumberOfObject.h.

Referenced by HLTCountNumberOfObject< OColl >::hltFilter().

template<class OColl >
edm::InputTag HLTCountNumberOfObject< OColl >::src_ [private]

Definition at line 50 of file HLTCountNumberOfObject.h.

Referenced by HLTCountNumberOfObject< OColl >::hltFilter().