CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
HLTTrackWithHits Class Reference

#include <HLTTrackWithHits.h>

Inheritance diagram for HLTTrackWithHits:
HLTFilter edm::EDFilter edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 HLTTrackWithHits (const edm::ParameterSet &iConfig)
 
 ~HLTTrackWithHits ()
 
- Public Member Functions inherited from HLTFilter
 HLTFilter (const edm::ParameterSet &config)
 
int module () const
 
const std::string * moduleLabel () const
 
int path () const
 
const std::string * pathName () const
 
std::pair< int, int > pmid () const
 
bool saveTags () const
 
virtual ~HLTFilter ()
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
virtual ~EDFilter ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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_
 

Additional Inherited Members

- Public Types inherited from edm::EDFilter
typedef EDFilter ModuleType
 
typedef WorkerT< EDFilterWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from HLTFilter
static void makeHLTFilterDescription (edm::ParameterSetDescription &desc)
 
- Static Public Member Functions inherited from edm::EDFilter
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDFilter
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

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)
inlineexplicit

Definition at line 29 of file HLTTrackWithHits.h.

29  : HLTFilter(iConfig),
30  src_(iConfig.getParameter<edm::InputTag>("src")),
31  minN_(iConfig.getParameter<int>("MinN")),
32  maxN_(iConfig.getParameter<int>("MaxN")),
33  MinBPX_(iConfig.getParameter<int>("MinBPX")),
34  MinFPX_(iConfig.getParameter<int>("MinFPX")),
35  MinPXL_(iConfig.getParameter<int>("MinPXL"))
36  {
37  }
T getParameter(std::string const &) const
HLTFilter(const edm::ParameterSet &config)
Definition: HLTFilter.cc:18
edm::InputTag src_
HLTTrackWithHits::~HLTTrackWithHits ( )
inline

Definition at line 39 of file HLTTrackWithHits.h.

39 { }

Member Function Documentation

virtual bool HLTTrackWithHits::hltFilter ( edm::Event iEvent,
const edm::EventSetup ,
trigger::TriggerFilterObjectWithRefs filterproduct 
)
inlineprivatevirtual

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_.

43  {
45  iEvent.getByLabel(src_, oHandle);
46  int s=oHandle->size();
47  int count=0;
48  for (int i=0;i!=s;++i){
49  const reco::Track & track = (*oHandle)[i];
50  const reco::HitPattern & hits = track.hitPattern();
51  if ( MinBPX_>0 && hits.numberOfValidPixelBarrelHits() >= MinBPX_ ) { ++count; continue; }
52  if ( MinFPX_>0 && hits.numberOfValidPixelEndcapHits() >= MinFPX_ ) { ++count; continue; }
53  if ( MinPXL_>0 && hits.numberOfValidPixelHits() >= MinPXL_ ) { ++count; continue; }
54  }
55 
56  bool answer=(count>=minN_ && count<=maxN_);
57  LogDebug("HLTTrackWithHits")<<module()<<" sees: "<<s<<" objects. Only: "<<count<<" satisfy the hit requirement. Filter answer is: "<<(answer?"true":"false")<<std::endl;
58  return answer;
59  }
#define LogDebug(id)
answer
Definition: submit.py:44
int i
Definition: DBlmapReader.cc:9
int numberOfValidPixelBarrelHits() const
Definition: HitPattern.h:586
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Definition: TrackBase.h:223
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
int numberOfValidPixelEndcapHits() const
Definition: HitPattern.h:590
int numberOfValidPixelHits() const
Definition: HitPattern.h:582
edm::InputTag src_
int module() const
Definition: HLTFilter.cc:56

Member Data Documentation

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().