CMS 3D CMS Logo

HLTTrackWithHits Class Reference

Description: templated EDFilter to count the number of tracks with a given hit requirement. More...

#include <HLTrigger/special/interface/HLTTrackWithHits.h>

Inheritance diagram for HLTTrackWithHits:

HLTFilter edm::EDFilter edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

 HLTTrackWithHits (const edm::ParameterSet &iConfig)
 ~HLTTrackWithHits ()

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 MinBPX_
int MinFPX_
int minN_
int MinPXL_
edm::InputTag src_


Detailed Description

Description: templated EDFilter to count the number of tracks with a given hit requirement.

Author:
Jean-Roch Vlimant

Definition at line 27 of file HLTTrackWithHits.h.


Constructor & Destructor Documentation

HLTTrackWithHits::HLTTrackWithHits ( const edm::ParameterSet iConfig  )  [inline, explicit]

Definition at line 29 of file HLTTrackWithHits.h.

00029                                                             :
00030     src_(iConfig.getParameter<edm::InputTag>("src")),
00031     minN_(iConfig.getParameter<int>("MinN")),
00032     maxN_(iConfig.getParameter<int>("MaxN")),
00033     MinBPX_(iConfig.getParameter<int>("MinBPX")),
00034     MinFPX_(iConfig.getParameter<int>("MinFPX")),
00035     MinPXL_(iConfig.getParameter<int>("MinPXL"))
00036       {
00037         produces<trigger::TriggerFilterObjectWithRefs>();
00038       };
  

HLTTrackWithHits::~HLTTrackWithHits (  )  [inline]

Definition at line 40 of file HLTTrackWithHits.h.

00040 {};


Member Function Documentation

virtual void HLTTrackWithHits::beginJob ( const edm::EventSetup  )  [inline, private, virtual]

Reimplemented from edm::EDFilter.

Definition at line 43 of file HLTTrackWithHits.h.

00043 {};

virtual void HLTTrackWithHits::endJob ( void   )  [inline, private, virtual]

Reimplemented from edm::EDFilter.

Definition at line 67 of file HLTTrackWithHits.h.

00067 {};

virtual bool HLTTrackWithHits::filter ( edm::Event iEvent,
const edm::EventSetup  
) [inline, private, virtual]

Implements HLTFilter.

Definition at line 44 of file HLTTrackWithHits.h.

References count, lat::endl(), edm::Event::getByLabel(), reco::TrackBase::hitPattern(), i, LogDebug, maxN_, MinBPX_, MinFPX_, minN_, MinPXL_, module(), reco::HitPattern::numberOfValidPixelBarrelHits(), reco::HitPattern::numberOfValidPixelEndcapHits(), reco::HitPattern::numberOfValidPixelHits(), path(), edm::Event::put(), s, src_, and track.

00045   {
00046     // The filtered object. which is put empty.
00047     std::auto_ptr<trigger::TriggerFilterObjectWithRefs> filterproduct (new trigger::TriggerFilterObjectWithRefs(path(),module()));
00048 
00049     edm::Handle<reco::TrackCollection> oHandle;
00050     iEvent.getByLabel(src_, oHandle);
00051     int s=oHandle->size();
00052     int count=0;
00053     for (int i=0;i!=s;++i){
00054       const reco::Track & track = (*oHandle)[i];
00055       const reco::HitPattern & hits = track.hitPattern();
00056       if ( MinBPX_>0 && hits.numberOfValidPixelBarrelHits() >= MinBPX_ ) count++; continue;
00057       if ( MinFPX_>0 && hits.numberOfValidPixelEndcapHits() >= MinFPX_ ) count++; continue;
00058       if ( MinPXL_>0 && hits.numberOfValidPixelHits() >= MinPXL_ ) count++; continue;
00059     }
00060       
00061     bool answer=(count>=minN_ && count<=maxN_);
00062     LogDebug("HLTTrackWithHits")<<module()<<" sees: "<<s<<" objects. Only: "<<count<<" satisfy the hit requirement. Filter answer is: "<<(answer?"true":"false")<<std::endl;
00063 
00064     iEvent.put(filterproduct);
00065     return answer;
00066   }


Member Data Documentation

int HLTTrackWithHits::maxN_ [private]

Definition at line 70 of file HLTTrackWithHits.h.

Referenced by filter().

int HLTTrackWithHits::MinBPX_ [private]

Definition at line 70 of file HLTTrackWithHits.h.

Referenced by filter().

int HLTTrackWithHits::MinFPX_ [private]

Definition at line 70 of file HLTTrackWithHits.h.

Referenced by filter().

int HLTTrackWithHits::minN_ [private]

Definition at line 70 of file HLTTrackWithHits.h.

Referenced by filter().

int HLTTrackWithHits::MinPXL_ [private]

Definition at line 70 of file HLTTrackWithHits.h.

Referenced by filter().

edm::InputTag HLTTrackWithHits::src_ [private]

Definition at line 67 of file HLTTrackWithHits.h.

Referenced by filter().


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:24:44 2009 for CMSSW by  doxygen 1.5.4