CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
HLTSinglet< T > Class Template Reference

#include <HLTSinglet.h>

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

Public Member Functions

bool hltFilter (edm::Event &, const edm::EventSetup &, trigger::TriggerFilterObjectWithRefs &filterproduct) const override
 
 HLTSinglet (const edm::ParameterSet &)
 
 ~HLTSinglet () 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 noexcept final
 
bool wantsGlobalRuns () const noexcept final
 
bool wantsInputProcessBlocks () const noexcept final
 
bool wantsProcessBlocks () const noexcept final
 
bool wantsStreamLuminosityBlocks () const noexcept final
 
bool wantsStreamRuns () const noexcept 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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices 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 Attributes

const edm::InputTag inputTag_
 
const edm::EDGetTokenT< std::vector< T > > inputToken_
 
const double max_Eta_
 
const double max_Mass_
 
const double min_E_
 
const double min_Eta_
 
const double min_Mass_
 
const int min_N_
 
const double min_Pt_
 
const int triggerType_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDFilterBase
typedef EDFilterBase ModuleType
 
- Public Types inherited from edm::ProducerBase
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
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<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
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)
 
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 ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
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 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

template<typename T>
class HLTSinglet< T >

See header file for documentation

Author
Martin Grunewald

This class is an HLTFilter (-> EDFilter) implementing a basic HLT trigger for single objects of the same physics type, cutting on variables relating to their 4-momentum representation

Author
Martin Grunewald

Definition at line 26 of file HLTSinglet.h.

Constructor & Destructor Documentation

◆ HLTSinglet()

template<typename T >
HLTSinglet< T >::HLTSinglet ( const edm::ParameterSet iConfig)
explicit

Definition at line 75 of file HLTSinglet.cc.

References edm::InputTag::encode(), HLTSinglet< T >::inputTag_, LogDebug, HLTSinglet< T >::max_Eta_, HLTSinglet< T >::max_Mass_, HLTSinglet< T >::min_E_, HLTSinglet< T >::min_Eta_, HLTSinglet< T >::min_Mass_, HLTSinglet< T >::min_N_, and HLTSinglet< T >::min_Pt_.

76  : HLTFilter(iConfig),
77  inputTag_(iConfig.template getParameter<edm::InputTag>("inputTag")),
78  inputToken_(consumes<std::vector<T>>(inputTag_)),
79  triggerType_(iConfig.template getParameter<int>("triggerType")),
80  min_N_(iConfig.template getParameter<int>("MinN")),
81  min_E_(iConfig.template getParameter<double>("MinE")),
82  min_Pt_(iConfig.template getParameter<double>("MinPt")),
83  min_Mass_(iConfig.template getParameter<double>("MinMass")),
84  max_Mass_(iConfig.template getParameter<double>("MaxMass")),
85  min_Eta_(iConfig.template getParameter<double>("MinEta")),
86  max_Eta_(iConfig.template getParameter<double>("MaxEta")) {
87  LogDebug("") << "Input/ptcut/etacut/ncut : " << inputTag_.encode() << " " << min_E_ << " " << min_Pt_ << " "
88  << min_Mass_ << " " << max_Mass_ << " " << min_Eta_ << " " << max_Eta_ << " " << min_N_;
89 }
const double max_Mass_
Definition: HLTSinglet.h:43
std::string encode() const
Definition: InputTag.cc:159
const double min_E_
Definition: HLTSinglet.h:40
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
const double max_Eta_
Definition: HLTSinglet.h:45
const double min_Eta_
Definition: HLTSinglet.h:44
const double min_Mass_
Definition: HLTSinglet.h:42
const double min_Pt_
Definition: HLTSinglet.h:41
HLTFilter(const edm::ParameterSet &config)
Definition: HLTFilter.cc:20
const int min_N_
Definition: HLTSinglet.h:39
const int triggerType_
Definition: HLTSinglet.h:38
const edm::EDGetTokenT< std::vector< T > > inputToken_
Definition: HLTSinglet.h:37
const edm::InputTag inputTag_
Definition: HLTSinglet.h:36
#define LogDebug(id)

◆ ~HLTSinglet()

template<typename T >
HLTSinglet< T >::~HLTSinglet ( )
overridedefault

Member Function Documentation

◆ fillDescriptions()

template<typename T >
void HLTSinglet< T >::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 95 of file HLTSinglet.cc.

References edm::ConfigurationDescriptions::add(), defaultModuleLabel(), submitPVResolutionJobs::desc, and ProducerED_cfi::InputTag.

95  {
98  desc.add<edm::InputTag>("inputTag", edm::InputTag("hltCollection"));
99  desc.add<int>("triggerType", 0);
100  desc.add<double>("MinE", -1.0);
101  desc.add<double>("MinPt", -1.0);
102  desc.add<double>("MinMass", -1.0);
103  desc.add<double>("MaxMass", -1.0);
104  desc.add<double>("MinEta", -1.0);
105  desc.add<double>("MaxEta", -1.0);
106  desc.add<int>("MinN", 1);
107  descriptions.add(defaultModuleLabel<HLTSinglet<T>>(), desc);
108 }
std::string defaultModuleLabel()
static void makeHLTFilterDescription(edm::ParameterSetDescription &desc)
Definition: HLTFilter.cc:25
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ hltFilter()

template<typename T >
bool HLTSinglet< T >::hltFilter ( edm::Event iEvent,
const edm::EventSetup iSetup,
trigger::TriggerFilterObjectWithRefs filterproduct 
) const
overridevirtual

Implements HLTFilter.

Definition at line 116 of file HLTSinglet.cc.

References funct::abs(), accept(), trigger::TriggerFilterObjectWithRefs::addCollectionTag(), trigger::TriggerRefsCollections::addObject(), HLT_2024v14_cff::distance, mps_fire::i, iEvent, create_idmaps::n, L1TPhase2Offline_cfi::objects, and HLT_IsoTrack_cff::saveTags.

118  {
119  using namespace std;
120  using namespace edm;
121  using namespace reco;
122  using namespace trigger;
123 
124  typedef vector<T> TCollection;
125  typedef Ref<TCollection> TRef;
126 
127  // All HLT filters must create and fill an HLT filter object,
128  // recording any reconstructed physics objects satisfying (or not)
129  // this HLT filter, and place it in the Event.
130 
131  // The filter object
132  if (saveTags())
133  filterproduct.addCollectionTag(inputTag_);
134 
135  // Ref to Candidate object to be recorded in filter object
136  TRef ref;
137 
138  // get hold of collection of objects
140  iEvent.getByToken(inputToken_, objects);
141 
142  // look at all objects, check cuts and add to filter object
143  int n(0);
144  typename TCollection::const_iterator i(objects->begin());
145  for (; i != objects->end(); i++) {
146  if ((i->energy() >= min_E_) && (i->pt() >= min_Pt_) && (i->mass() >= min_Mass_) &&
147  ((max_Mass_ < 0.0) || (i->mass() <= max_Mass_)) && ((min_Eta_ < 0.0) || (std::abs(i->eta()) >= min_Eta_)) &&
148  ((max_Eta_ < 0.0) || (std::abs(i->eta()) <= max_Eta_))) {
149  n++;
150  ref = TRef(objects, distance(objects->begin(), i));
151  int tid = getObjectType<T>(*i);
152  if (tid == 0)
153  tid = triggerType_;
154  filterproduct.addObject(tid, ref);
155  }
156  }
157 
158  // filter decision
159  bool accept(n >= min_N_);
160 
161  return accept;
162 }
const double max_Mass_
Definition: HLTSinglet.h:43
const double min_E_
Definition: HLTSinglet.h:40
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:31
void addObject(int id, const reco::RecoEcalCandidateRef &ref)
setters for L3 collections: (id=physics type, and Ref<C>)
int iEvent
Definition: GenABIO.cc:224
const double max_Eta_
Definition: HLTSinglet.h:45
const double min_Eta_
Definition: HLTSinglet.h:44
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const double min_Mass_
Definition: HLTSinglet.h:42
const double min_Pt_
Definition: HLTSinglet.h:41
bool saveTags() const
Definition: HLTFilter.h:46
const int min_N_
Definition: HLTSinglet.h:39
const int triggerType_
Definition: HLTSinglet.h:38
void addCollectionTag(const edm::InputTag &collectionTag)
collectionTags
fixed size matrix
HLT enums.
const edm::EDGetTokenT< std::vector< T > > inputToken_
Definition: HLTSinglet.h:37
const edm::InputTag inputTag_
Definition: HLTSinglet.h:36

Member Data Documentation

◆ inputTag_

template<typename T >
const edm::InputTag HLTSinglet< T >::inputTag_
private

Definition at line 36 of file HLTSinglet.h.

Referenced by HLTSinglet< T >::HLTSinglet().

◆ inputToken_

template<typename T >
const edm::EDGetTokenT<std::vector<T> > HLTSinglet< T >::inputToken_
private

Definition at line 37 of file HLTSinglet.h.

◆ max_Eta_

template<typename T >
const double HLTSinglet< T >::max_Eta_
private

Definition at line 45 of file HLTSinglet.h.

Referenced by HLTSinglet< T >::HLTSinglet().

◆ max_Mass_

template<typename T >
const double HLTSinglet< T >::max_Mass_
private

Definition at line 43 of file HLTSinglet.h.

Referenced by HLTSinglet< T >::HLTSinglet().

◆ min_E_

template<typename T >
const double HLTSinglet< T >::min_E_
private

Definition at line 40 of file HLTSinglet.h.

Referenced by HLTSinglet< T >::HLTSinglet().

◆ min_Eta_

template<typename T >
const double HLTSinglet< T >::min_Eta_
private

Definition at line 44 of file HLTSinglet.h.

Referenced by HLTSinglet< T >::HLTSinglet().

◆ min_Mass_

template<typename T >
const double HLTSinglet< T >::min_Mass_
private

Definition at line 42 of file HLTSinglet.h.

Referenced by HLTSinglet< T >::HLTSinglet().

◆ min_N_

template<typename T >
const int HLTSinglet< T >::min_N_
private

Definition at line 39 of file HLTSinglet.h.

Referenced by HLTSinglet< T >::HLTSinglet().

◆ min_Pt_

template<typename T >
const double HLTSinglet< T >::min_Pt_
private

Definition at line 41 of file HLTSinglet.h.

Referenced by HLTSinglet< T >::HLTSinglet().

◆ triggerType_

template<typename T >
const int HLTSinglet< T >::triggerType_
private

Definition at line 38 of file HLTSinglet.h.