#include <HLTTrackWithHits.h>
Public Member Functions | |
HLTTrackWithHits (const edm::ParameterSet &iConfig) | |
~HLTTrackWithHits () | |
Private Member Functions | |
virtual bool | hltFilter (edm::Event &iEvent, const edm::EventSetup &, trigger::TriggerFilterObjectWithRefs &filterproduct) |
Private Attributes | |
int | maxN_ |
int | MinBPX_ |
int | MinFPX_ |
int | minN_ |
int | MinPXL_ |
edm::InputTag | src_ |
Description: templated EDFilter to count the number of tracks with a given hit requirement
Definition at line 27 of file HLTTrackWithHits.h.
HLTTrackWithHits::HLTTrackWithHits | ( | const edm::ParameterSet & | iConfig | ) | [inline, explicit] |
Definition at line 29 of file HLTTrackWithHits.h.
: HLTFilter(iConfig), src_(iConfig.getParameter<edm::InputTag>("src")), minN_(iConfig.getParameter<int>("MinN")), maxN_(iConfig.getParameter<int>("MaxN")), MinBPX_(iConfig.getParameter<int>("MinBPX")), MinFPX_(iConfig.getParameter<int>("MinFPX")), MinPXL_(iConfig.getParameter<int>("MinPXL")) { }
HLTTrackWithHits::~HLTTrackWithHits | ( | ) | [inline] |
Definition at line 39 of file HLTTrackWithHits.h.
{ }
virtual bool HLTTrackWithHits::hltFilter | ( | edm::Event & | iEvent, |
const edm::EventSetup & | , | ||
trigger::TriggerFilterObjectWithRefs & | filterproduct | ||
) | [inline, private, virtual] |
Implements HLTFilter.
Definition at line 42 of file HLTTrackWithHits.h.
References submit::answer, prof2calltree::count, edm::Event::getByLabel(), reco::TrackBase::hitPattern(), i, LogDebug, maxN_, MinBPX_, MinFPX_, minN_, MinPXL_, HLTFilter::module(), reco::HitPattern::numberOfValidPixelBarrelHits(), reco::HitPattern::numberOfValidPixelEndcapHits(), reco::HitPattern::numberOfValidPixelHits(), alignCSCRings::s, and src_.
{ edm::Handle<reco::TrackCollection> oHandle; iEvent.getByLabel(src_, oHandle); int s=oHandle->size(); int count=0; for (int i=0;i!=s;++i){ const reco::Track & track = (*oHandle)[i]; const reco::HitPattern & hits = track.hitPattern(); if ( MinBPX_>0 && hits.numberOfValidPixelBarrelHits() >= MinBPX_ ) { ++count; continue; } if ( MinFPX_>0 && hits.numberOfValidPixelEndcapHits() >= MinFPX_ ) { ++count; continue; } if ( MinPXL_>0 && hits.numberOfValidPixelHits() >= MinPXL_ ) { ++count; continue; } } bool answer=(count>=minN_ && count<=maxN_); LogDebug("HLTTrackWithHits")<<module()<<" sees: "<<s<<" objects. Only: "<<count<<" satisfy the hit requirement. Filter answer is: "<<(answer?"true":"false")<<std::endl; return answer; }
int HLTTrackWithHits::maxN_ [private] |
Definition at line 62 of file HLTTrackWithHits.h.
Referenced by hltFilter().
int HLTTrackWithHits::MinBPX_ [private] |
Definition at line 62 of file HLTTrackWithHits.h.
Referenced by hltFilter().
int HLTTrackWithHits::MinFPX_ [private] |
Definition at line 62 of file HLTTrackWithHits.h.
Referenced by hltFilter().
int HLTTrackWithHits::minN_ [private] |
Definition at line 62 of file HLTTrackWithHits.h.
Referenced by hltFilter().
int HLTTrackWithHits::MinPXL_ [private] |
Definition at line 62 of file HLTTrackWithHits.h.
Referenced by hltFilter().
edm::InputTag HLTTrackWithHits::src_ [private] |
Definition at line 61 of file HLTTrackWithHits.h.
Referenced by hltFilter().