CMS 3D CMS Logo

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

#include <HLTTrackWithHits.h>

Inheritance diagram for HLTTrackWithHits:
HLTFilter edm::global::EDFilter<> edm::global::EDFilterBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 HLTTrackWithHits (const edm::ParameterSet &iConfig)
 
 ~HLTTrackWithHits () override
 
- Public Member Functions inherited from HLTFilter
 HLTFilter (const edm::ParameterSet &config)
 
int module (edm::Event const &) const
 
const std::string * moduleLabel () const
 
int path (edm::Event const &) const
 
const std::string * pathName (edm::Event const &) const
 
std::pair< int, int > pmid (edm::Event const &) const
 
bool saveTags () const
 
 ~HLTFilter () override
 
- Public Member Functions inherited from edm::global::EDFilter<>
 EDFilter ()=default
 
 EDFilter (const EDFilter &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDFilteroperator= (const EDFilter &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDFilterBase
 EDFilterBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDFilterBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from HLTFilter
static void makeHLTFilterDescription (edm::ParameterSetDescription &desc)
 
- Static Public Member Functions inherited from edm::global::EDFilterBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

bool hltFilter (edm::Event &iEvent, const edm::EventSetup &, trigger::TriggerFilterObjectWithRefs &filterproduct) const override
 

Private Attributes

int maxN_
 
int MinBPX_
 
int MinFPX_
 
int minN_
 
double MinPT_
 
int MinPXL_
 
edm::InputTag src_
 
edm::EDGetTokenT< reco::TrackCollectionsrcToken_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDFilterBase
typedef EDFilterBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (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 25 of file HLTTrackWithHits.h.

Constructor & Destructor Documentation

◆ HLTTrackWithHits()

HLTTrackWithHits::HLTTrackWithHits ( const edm::ParameterSet iConfig)
inlineexplicit

Definition at line 27 of file HLTTrackWithHits.h.

28  : HLTFilter(iConfig),
29  src_(iConfig.getParameter<edm::InputTag>("src")),
30  minN_(iConfig.getParameter<int>("MinN")),
31  maxN_(iConfig.getParameter<int>("MaxN")),
32  MinBPX_(iConfig.getParameter<int>("MinBPX")),
33  MinFPX_(iConfig.getParameter<int>("MinFPX")),
34  MinPXL_(iConfig.getParameter<int>("MinPXL")),
35  MinPT_(iConfig.getParameter<double>("MinPT")) {
36  srcToken_ = consumes<reco::TrackCollection>(src_);
37  }

References src_, and srcToken_.

◆ ~HLTTrackWithHits()

HLTTrackWithHits::~HLTTrackWithHits ( )
inlineoverride

Definition at line 39 of file HLTTrackWithHits.h.

39 {}

Member Function Documentation

◆ fillDescriptions()

static void HLTTrackWithHits::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
inlinestatic

Definition at line 41 of file HLTTrackWithHits.h.

41  {
44  desc.add<edm::InputTag>("src", edm::InputTag(""));
45  desc.add<int>("MinN", 0);
46  desc.add<int>("MaxN", 99999);
47  desc.add<int>("MinBPX", 0);
48  desc.add<int>("MinFPX", 0);
49  desc.add<int>("MinPXL", 0);
50  desc.add<double>("MinPT", 0.);
51  descriptions.add("hltTrackWithHits", desc);
52  }

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, HLT_FULL_cff::InputTag, and HLTFilter::makeHLTFilterDescription().

◆ hltFilter()

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

Implements HLTFilter.

Definition at line 55 of file HLTTrackWithHits.h.

57  {
59  iEvent.getByToken(srcToken_, oHandle);
60  int s = oHandle->size();
61  int count = 0;
62  for (int i = 0; i != s; ++i) {
63  const reco::Track& track = (*oHandle)[i];
64  if (track.pt() < MinPT_)
65  continue;
66  const reco::HitPattern& hits = track.hitPattern();
67  if (MinBPX_ > 0 && hits.numberOfValidPixelBarrelHits() >= MinBPX_) {
68  ++count;
69  continue;
70  }
71  if (MinFPX_ > 0 && hits.numberOfValidPixelEndcapHits() >= MinFPX_) {
72  ++count;
73  continue;
74  }
75  if (MinPXL_ > 0 && hits.numberOfValidPixelHits() >= MinPXL_) {
76  ++count;
77  continue;
78  }
79  }
80 
81  bool answer = (count >= minN_ && count <= maxN_);
82  LogDebug("HLTTrackWithHits") << module(iEvent) << " sees: " << s << " objects. Only: " << count
83  << " satisfy the hit requirement. Filter answer is: " << (answer ? "true" : "false")
84  << std::endl;
85  return answer;
86  }

References submitPVResolutionJobs::count, hfClusterShapes_cfi::hits, mps_fire::i, iEvent, LogDebug, maxN_, MinBPX_, MinFPX_, minN_, MinPT_, MinPXL_, HLTFilter::module(), alignCSCRings::s, srcToken_, and HLT_FULL_cff::track.

Member Data Documentation

◆ maxN_

int HLTTrackWithHits::maxN_
private

Definition at line 90 of file HLTTrackWithHits.h.

Referenced by hltFilter().

◆ MinBPX_

int HLTTrackWithHits::MinBPX_
private

Definition at line 90 of file HLTTrackWithHits.h.

Referenced by hltFilter().

◆ MinFPX_

int HLTTrackWithHits::MinFPX_
private

Definition at line 90 of file HLTTrackWithHits.h.

Referenced by hltFilter().

◆ minN_

int HLTTrackWithHits::minN_
private

Definition at line 90 of file HLTTrackWithHits.h.

Referenced by hltFilter().

◆ MinPT_

double HLTTrackWithHits::MinPT_
private

Definition at line 91 of file HLTTrackWithHits.h.

Referenced by hltFilter().

◆ MinPXL_

int HLTTrackWithHits::MinPXL_
private

Definition at line 90 of file HLTTrackWithHits.h.

Referenced by hltFilter().

◆ src_

edm::InputTag HLTTrackWithHits::src_
private

Definition at line 88 of file HLTTrackWithHits.h.

Referenced by HLTTrackWithHits().

◆ srcToken_

edm::EDGetTokenT<reco::TrackCollection> HLTTrackWithHits::srcToken_
private

Definition at line 89 of file HLTTrackWithHits.h.

Referenced by hltFilter(), and HLTTrackWithHits().

mps_fire.i
i
Definition: mps_fire.py:428
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11724
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
HLTTrackWithHits::MinFPX_
int MinFPX_
Definition: HLTTrackWithHits.h:90
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89301
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
HLTTrackWithHits::maxN_
int maxN_
Definition: HLTTrackWithHits.h:90
edm::Handle< reco::TrackCollection >
HLTFilter::HLTFilter
HLTFilter(const edm::ParameterSet &config)
Definition: HLTFilter.cc:20
alignCSCRings.s
s
Definition: alignCSCRings.py:92
reco::HitPattern
Definition: HitPattern.h:147
HLTTrackWithHits::srcToken_
edm::EDGetTokenT< reco::TrackCollection > srcToken_
Definition: HLTTrackWithHits.h:89
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
HLTTrackWithHits::src_
edm::InputTag src_
Definition: HLTTrackWithHits.h:88
reco::Track
Definition: Track.h:27
submitPVResolutionJobs.count
count
Definition: submitPVResolutionJobs.py:352
HLTTrackWithHits::MinPT_
double MinPT_
Definition: HLTTrackWithHits.h:91
HLTTrackWithHits::MinPXL_
int MinPXL_
Definition: HLTTrackWithHits.h:90
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
iEvent
int iEvent
Definition: GenABIO.cc:224
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
HLTTrackWithHits::minN_
int minN_
Definition: HLTTrackWithHits.h:90
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
HLTFilter::makeHLTFilterDescription
static void makeHLTFilterDescription(edm::ParameterSetDescription &desc)
Definition: HLTFilter.cc:25
HLTFilter::module
int module(edm::Event const &) const
Definition: HLTFilter.cc:47
HLTTrackWithHits::MinBPX_
int MinBPX_
Definition: HLTTrackWithHits.h:90
edm::InputTag
Definition: InputTag.h:15