CMS 3D CMS Logo

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

#include <HLTGlobalSums.h>

Inheritance diagram for HLTGlobalSums< 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
 
 HLTGlobalSums (const edm::ParameterSet &)
 
 ~HLTGlobalSums () 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
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () 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
 
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::vector< ModuleDescription const * > &modules, 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
 
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 Attributes

edm::InputTag inputTag_
 
edm::EDGetTokenT< std::vector< T > > inputToken_
 
double max_
 
double min_
 
int min_N_
 
std::string observable_
 
int tid_
 
int triggerType_
 

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

template<typename T>
class HLTGlobalSums< T >

This class is an HLTFilter (-> EDFilter) implementing cuts on global sums such as the scalar sum of Et (a.k.a. H_T), available in the T=CaloMET or T=MET object.

Author
Martin Grunewald

Definition at line 26 of file HLTGlobalSums.h.

Constructor & Destructor Documentation

◆ HLTGlobalSums()

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

Definition at line 28 of file HLTGlobalSums.cc.

29  : HLTFilter(iConfig),
30  inputTag_(iConfig.template getParameter<edm::InputTag>("inputTag")),
31  inputToken_(consumes<std::vector<T>>(inputTag_)),
32  triggerType_(iConfig.template getParameter<int>("triggerType")),
33  observable_(iConfig.template getParameter<std::string>("observable")),
34  min_(iConfig.template getParameter<double>("Min")),
35  max_(iConfig.template getParameter<double>("Max")),
36  min_N_(iConfig.template getParameter<int>("MinN")),
38  LogDebug("") << "InputTags and cuts : " << inputTag_.encode() << " " << triggerType_ << " " << observable_
39  << " Range [" << min_ << " " << max_ << "]"
40  << " MinN =" << min_N_;
41 
42  if (observable_ == "sumEt") {
44  } else if (observable_ == "mEtSig") {
47  } else if (triggerType_ == trigger::TriggerTHT) {
49  } else {
51  }
52  } else if (observable_ == "e_longitudinal") {
55  } else if (triggerType_ == trigger::TriggerTHT) {
57  } else {
59  }
60  } else {
62  }
63 }

References edm::InputTag::encode(), HLTGlobalSums< T >::inputTag_, LogDebug, HLTGlobalSums< T >::max_, HLTGlobalSums< T >::min_, HLTGlobalSums< T >::min_N_, HLTGlobalSums< T >::observable_, HLTGlobalSums< T >::tid_, trigger::TriggerELongit, trigger::TriggerHLongit, trigger::TriggerMETSig, trigger::TriggerMHTSig, trigger::TriggerTET, trigger::TriggerTHT, and HLTGlobalSums< T >::triggerType_.

◆ ~HLTGlobalSums()

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

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 69 of file HLTGlobalSums.cc.

69  {
72  desc.add<edm::InputTag>("inputTag", edm::InputTag("hltCollection"));
73  desc.add<int>("triggerType", 0);
74  desc.add<std::string>("observable", "");
75  desc.add<double>("Min", -1e125);
76  desc.add<double>("Max", +1e125);
77  desc.add<int>("MinN", 1);
78  descriptions.add(defaultModuleLabel<HLTGlobalSums<T>>(), desc);
79 }

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), defaultModuleLabel(), HLT_2018_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ hltFilter()

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

Implements HLTFilter.

Definition at line 87 of file HLTGlobalSums.cc.

89  {
90  using namespace std;
91  using namespace edm;
92  using namespace reco;
93  using namespace trigger;
94 
95  typedef vector<T> TCollection;
96  typedef Ref<TCollection> TRef;
97 
98  // All HLT filters must create and fill an HLT filter object,
99  // recording any reconstructed physics objects satisfying (or not)
100  // this HLT filter, and place it in the Event.
101 
102  // The filter object
103  if (saveTags())
104  filterproduct.addCollectionTag(inputTag_);
105  // Ref to Candidate object to be recorded in filter object
106  TRef ref;
107 
108  // get hold of MET product from Event
110  iEvent.getByToken(inputToken_, objects);
111  if (!objects.isValid()) {
112  LogDebug("") << inputTag_ << " collection not found!";
113  return false;
114  }
115 
116  LogDebug("") << "Size of MET collection: " << objects->size();
117  if (objects->empty()) {
118  LogDebug("") << "MET collection does not contain a MET object!";
119  } else if (objects->size() > 1) {
120  LogDebug("") << "MET collection contains more than one MET object!";
121  }
122 
123  int n(0);
124  double value(0.0);
125  typename TCollection::const_iterator ibegin(objects->begin());
126  typename TCollection::const_iterator iend(objects->end());
127  typename TCollection::const_iterator iter;
128  for (iter = ibegin; iter != iend; iter++) {
129  // get hold of value of observable to cut on
130  if ((tid_ == TriggerTET) || (tid_ == TriggerTHT)) {
131  value = iter->sumEt();
132  } else if ((tid_ == TriggerMETSig) || (tid_ == TriggerMHTSig)) {
133  value = iter->mEtSig();
134  } else if ((tid_ == TriggerELongit) || (tid_ == TriggerHLongit)) {
135  value = iter->e_longitudinal();
136  } else {
137  value = 0.0;
138  }
139 
140  value = std::abs(value);
141 
142  if (((min_ < 0.0) || (min_ <= value)) && ((max_ < 0.0) || (value <= max_))) {
143  n++;
144  ref = TRef(objects, distance(ibegin, iter));
145  filterproduct.addObject(tid_, ref);
146  }
147  }
148 
149  // filter decision
150  const bool accept(n >= min_N_);
151 
152  return accept;
153 }

References funct::abs(), accept(), trigger::TriggerFilterObjectWithRefs::addCollectionTag(), trigger::TriggerRefsCollections::addObject(), HLT_2018_cff::distance, iEvent, LogDebug, dqmiodumpmetadata::n, BeamBkgSkim_cff::saveTags, trigger::TriggerELongit, trigger::TriggerHLongit, trigger::TriggerMETSig, trigger::TriggerMHTSig, trigger::TriggerTET, trigger::TriggerTHT, and relativeConstraints::value.

Member Data Documentation

◆ inputTag_

template<typename T >
edm::InputTag HLTGlobalSums< T >::inputTag_
private

Definition at line 37 of file HLTGlobalSums.h.

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

◆ inputToken_

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

Definition at line 38 of file HLTGlobalSums.h.

◆ max_

template<typename T >
double HLTGlobalSums< T >::max_
private

Definition at line 41 of file HLTGlobalSums.h.

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

◆ min_

template<typename T >
double HLTGlobalSums< T >::min_
private

Definition at line 41 of file HLTGlobalSums.h.

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

◆ min_N_

template<typename T >
int HLTGlobalSums< T >::min_N_
private

Definition at line 42 of file HLTGlobalSums.h.

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

◆ observable_

template<typename T >
std::string HLTGlobalSums< T >::observable_
private

Definition at line 40 of file HLTGlobalSums.h.

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

◆ tid_

template<typename T >
int HLTGlobalSums< T >::tid_
private

Definition at line 43 of file HLTGlobalSums.h.

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

◆ triggerType_

template<typename T >
int HLTGlobalSums< T >::triggerType_
private

Definition at line 39 of file HLTGlobalSums.h.

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

trigger::TriggerRefsCollections::addObject
void addObject(int id, const reco::RecoEcalCandidateRef &ref)
setters for L3 collections: (id=physics type, and Ref<C>)
Definition: TriggerRefsCollections.h:235
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
HLTGlobalSums::inputToken_
edm::EDGetTokenT< std::vector< T > > inputToken_
Definition: HLTGlobalSums.h:38
trigger::TriggerMHTSig
Definition: TriggerTypeDefs.h:80
edm
HLT enums.
Definition: AlignableModifier.h:19
objects
Definition: __init__.py:1
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
trigger::TriggerFilterObjectWithRefs::addCollectionTag
void addCollectionTag(const edm::InputTag &collectionTag)
collectionTags
Definition: TriggerFilterObjectWithRefs.h:55
HLT_2018_cff.distance
distance
Definition: HLT_2018_cff.py:6417
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
trigger::TriggerELongit
Definition: TriggerTypeDefs.h:79
trigger::TriggerTET
Definition: TriggerTypeDefs.h:73
edm::Handle
Definition: AssociativeIterator.h:50
HLTFilter::HLTFilter
HLTFilter(const edm::ParameterSet &config)
Definition: HLTFilter.cc:20
edm::Ref
Definition: AssociativeIterator.h:58
trigger::TriggerTHT
Definition: TriggerTypeDefs.h:74
accept
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:30
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
HLTGlobalSums::triggerType_
int triggerType_
Definition: HLTGlobalSums.h:39
HLTGlobalSums
Definition: HLTGlobalSums.h:26
HLTGlobalSums::max_
double max_
Definition: HLTGlobalSums.h:41
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
trigger::TriggerMETSig
Definition: TriggerTypeDefs.h:78
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
HLTFilter::saveTags
bool saveTags() const
Definition: HLTFilter.h:46
defaultModuleLabel
std::string defaultModuleLabel()
Definition: defaultModuleLabel.h:16
iEvent
int iEvent
Definition: GenABIO.cc:224
value
Definition: value.py:1
edm::InputTag::encode
std::string encode() const
Definition: InputTag.cc:159
HLTGlobalSums::tid_
int tid_
Definition: HLTGlobalSums.h:43
HLTGlobalSums::min_N_
int min_N_
Definition: HLTGlobalSums.h:42
std
Definition: JetResolutionObject.h:76
HLTGlobalSums::min_
double min_
Definition: HLTGlobalSums.h:41
relativeConstraints.value
value
Definition: relativeConstraints.py:53
trigger::TriggerHLongit
Definition: TriggerTypeDefs.h:81
HLTFilter::makeHLTFilterDescription
static void makeHLTFilterDescription(edm::ParameterSetDescription &desc)
Definition: HLTFilter.cc:25
HLTGlobalSums::observable_
std::string observable_
Definition: HLTGlobalSums.h:40
trigger
Definition: HLTPrescaleTableCond.h:8
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
edm::EDConsumerBase::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: EDConsumerBase.h:126
edm::InputTag
Definition: InputTag.h:15
HLTGlobalSums::inputTag_
edm::InputTag inputTag_
Definition: HLTGlobalSums.h:37