CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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
 
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)
 
 ~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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
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::TrackCollection
srcToken_
 

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
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

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

Author
Jean-Roch Vlimant

Definition at line 24 of file HLTTrackWithHits.h.

Constructor & Destructor Documentation

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

Definition at line 26 of file HLTTrackWithHits.h.

References src_, and srcToken_.

27  : HLTFilter(iConfig),
28  src_(iConfig.getParameter<edm::InputTag>("src")),
29  minN_(iConfig.getParameter<int>("MinN")),
30  maxN_(iConfig.getParameter<int>("MaxN")),
31  MinBPX_(iConfig.getParameter<int>("MinBPX")),
32  MinFPX_(iConfig.getParameter<int>("MinFPX")),
33  MinPXL_(iConfig.getParameter<int>("MinPXL")),
34  MinPT_(iConfig.getParameter<double>("MinPT")) {
35  srcToken_ = consumes<reco::TrackCollection>(src_);
36  }
HLTFilter(const edm::ParameterSet &config)
Definition: HLTFilter.cc:20
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EDGetTokenT< reco::TrackCollection > srcToken_
edm::InputTag src_
HLTTrackWithHits::~HLTTrackWithHits ( )
inlineoverride

Definition at line 38 of file HLTTrackWithHits.h.

38 {}

Member Function Documentation

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

Definition at line 40 of file HLTTrackWithHits.h.

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

40  {
43  desc.add<edm::InputTag>("src", edm::InputTag(""));
44  desc.add<int>("MinN", 0);
45  desc.add<int>("MaxN", 99999);
46  desc.add<int>("MinBPX", 0);
47  desc.add<int>("MinFPX", 0);
48  desc.add<int>("MinPXL", 0);
49  desc.add<double>("MinPT", 0.);
50  descriptions.add("hltTrackWithHits", desc);
51  }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static void makeHLTFilterDescription(edm::ParameterSetDescription &desc)
Definition: HLTFilter.cc:25
void add(std::string const &label, ParameterSetDescription const &psetDescription)
bool HLTTrackWithHits::hltFilter ( edm::Event iEvent,
const edm::EventSetup ,
trigger::TriggerFilterObjectWithRefs filterproduct 
) const
inlineoverrideprivatevirtual

Implements HLTFilter.

Definition at line 54 of file HLTTrackWithHits.h.

References submitPVResolutionJobs::count, edm::Event::getByToken(), reco::TrackBase::hitPattern(), mps_fire::i, LogDebug, maxN_, MinBPX_, MinFPX_, minN_, MinPT_, MinPXL_, HLTFilter::module(), reco::HitPattern::numberOfValidPixelBarrelHits(), reco::HitPattern::numberOfValidPixelEndcapHits(), reco::HitPattern::numberOfValidPixelHits(), reco::TrackBase::pt(), alignCSCRings::s, srcToken_, and HLT_FULL_cff::track.

56  {
58  iEvent.getByToken(srcToken_, oHandle);
59  int s = oHandle->size();
60  int count = 0;
61  for (int i = 0; i != s; ++i) {
62  const reco::Track& track = (*oHandle)[i];
63  if (track.pt() < MinPT_)
64  continue;
65  const reco::HitPattern& hits = track.hitPattern();
66  if (MinBPX_ > 0 && hits.numberOfValidPixelBarrelHits() >= MinBPX_) {
67  ++count;
68  continue;
69  }
70  if (MinFPX_ > 0 && hits.numberOfValidPixelEndcapHits() >= MinFPX_) {
71  ++count;
72  continue;
73  }
74  if (MinPXL_ > 0 && hits.numberOfValidPixelHits() >= MinPXL_) {
75  ++count;
76  continue;
77  }
78  }
79 
80  bool answer = (count >= minN_ && count <= maxN_);
81  LogDebug("HLTTrackWithHits") << module(iEvent) << " sees: " << s << " objects. Only: " << count
82  << " satisfy the hit requirement. Filter answer is: " << (answer ? "true" : "false")
83  << std::endl;
84  return answer;
85  }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
int numberOfValidPixelBarrelHits() const
Definition: HitPattern.h:835
double pt() const
track transverse momentum
Definition: TrackBase.h:637
int module(edm::Event const &) const
Definition: HLTFilter.cc:47
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Definition: TrackBase.h:504
int numberOfValidPixelEndcapHits() const
Definition: HitPattern.h:839
edm::EDGetTokenT< reco::TrackCollection > srcToken_
int numberOfValidPixelHits() const
Definition: HitPattern.h:831
#define LogDebug(id)

Member Data Documentation

int HLTTrackWithHits::maxN_
private

Definition at line 89 of file HLTTrackWithHits.h.

Referenced by hltFilter().

int HLTTrackWithHits::MinBPX_
private

Definition at line 89 of file HLTTrackWithHits.h.

Referenced by hltFilter().

int HLTTrackWithHits::MinFPX_
private

Definition at line 89 of file HLTTrackWithHits.h.

Referenced by hltFilter().

int HLTTrackWithHits::minN_
private

Definition at line 89 of file HLTTrackWithHits.h.

Referenced by hltFilter().

double HLTTrackWithHits::MinPT_
private

Definition at line 90 of file HLTTrackWithHits.h.

Referenced by hltFilter().

int HLTTrackWithHits::MinPXL_
private

Definition at line 89 of file HLTTrackWithHits.h.

Referenced by hltFilter().

edm::InputTag HLTTrackWithHits::src_
private

Definition at line 87 of file HLTTrackWithHits.h.

Referenced by HLTTrackWithHits().

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

Definition at line 88 of file HLTTrackWithHits.h.

Referenced by hltFilter(), and HLTTrackWithHits().