#include <HLTrigger/special/interface/HLTTrackWithHits.h>
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_ |
Definition at line 27 of file HLTTrackWithHits.h.
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] |
virtual void HLTTrackWithHits::beginJob | ( | const edm::EventSetup & | ) | [inline, private, virtual] |
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 }
int HLTTrackWithHits::maxN_ [private] |
int HLTTrackWithHits::MinBPX_ [private] |
int HLTTrackWithHits::MinFPX_ [private] |
int HLTTrackWithHits::minN_ [private] |
int HLTTrackWithHits::MinPXL_ [private] |
edm::InputTag HLTTrackWithHits::src_ [private] |