CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
triggerExpression::Data Class Reference

#include <TriggerExpressionData.h>

Public Member Functions

bool configurationUpdated () const
 
 Data ()
 
 Data (const edm::ParameterSet &config, edm::ConsumesCollector &&iC)
 
 Data (edm::InputTag const &hltResultsTag, edm::InputTag const &l1tResultsTag, bool l1tIgnoreMaskAndPrescale, bool doThrow, edm::ConsumesCollector &&iC)
 
edm::EventNumber_t eventNumber () const
 
bool hasHLT () const
 
bool hasL1T () const
 
bool hltConfigurationUpdated () const
 
const edm::TriggerNameshltMenu () const
 
const edm::TriggerResultshltResults () const
 
bool ignoreL1MaskAndPrescale () const
 
bool l1tConfigurationUpdated () const
 
const L1TUtmTriggerMenul1tMenu () const
 
const std::vector< bool > & l1tResults () const
 
bool setEvent (const edm::Event &event, const edm::EventSetup &setup)
 
void setHltResultsTag (edm::InputTag const &tag)
 
void setL1tIgnoreMaskAndPrescale (bool l1tIgnoreMaskAndPrescale)
 
void setL1tResultsTag (edm::InputTag const &tag)
 
void setThrow (bool doThrow)
 
bool shouldThrow () const
 

Public Attributes

edm::EventNumber_t m_eventNumber
 
edm::ParameterSetID m_hltCacheID
 
const edm::TriggerNamesm_hltMenu
 
const edm::TriggerResultsm_hltResults
 
edm::InputTag m_hltResultsTag
 
edm::EDGetTokenT< edm::TriggerResultsm_hltResultsToken
 
bool m_hltUpdated
 
unsigned long long m_l1tCacheID
 
bool m_l1tIgnoreMaskAndPrescale
 
const L1TUtmTriggerMenum_l1tMenu
 
const std::vector< bool > * m_l1tResults
 
edm::InputTag m_l1tResultsTag
 
edm::EDGetTokenT< GlobalAlgBlkBxCollectionm_l1tResultsToken
 
bool m_l1tUpdated
 
bool m_throw
 

Detailed Description

Definition at line 22 of file TriggerExpressionData.h.

Constructor & Destructor Documentation

triggerExpression::Data::Data ( )
inline

Definition at line 25 of file TriggerExpressionData.h.

26  : // configuration
27  m_hltResultsTag(""),
29  m_l1tResultsTag(""),
32  m_throw(true),
33  // l1 values and status
34  m_l1tResults(nullptr),
35  m_l1tMenu(nullptr),
36  m_l1tCacheID(),
37  m_l1tUpdated(false),
38  // hlt values and status
39  m_hltResults(nullptr),
40  m_hltMenu(nullptr),
41  m_hltCacheID(),
42  m_hltUpdated(false),
43  // event values
44  m_eventNumber() {}
edm::EDGetTokenT< GlobalAlgBlkBxCollection > m_l1tResultsToken
const edm::TriggerResults * m_hltResults
edm::EDGetTokenT< edm::TriggerResults > m_hltResultsToken
const edm::TriggerNames * m_hltMenu
const L1TUtmTriggerMenu * m_l1tMenu
const std::vector< bool > * m_l1tResults
edm::ParameterSetID m_hltCacheID
edm::EventNumber_t m_eventNumber
unsigned long long m_l1tCacheID
triggerExpression::Data::Data ( const edm::ParameterSet config,
edm::ConsumesCollector &&  iC 
)
inlineexplicit

Definition at line 47 of file TriggerExpressionData.h.

48  : // configuration
49  m_hltResultsTag(config.getParameter<edm::InputTag>("hltResults")),
51  m_l1tResultsTag(config.getParameter<edm::InputTag>("l1tResults")),
53  m_l1tIgnoreMaskAndPrescale(config.getParameter<bool>("l1tIgnoreMaskAndPrescale")),
54  m_throw(config.getParameter<bool>("throw")),
55  // l1 values and status
56  m_l1tResults(nullptr),
57  m_l1tMenu(nullptr),
58  m_l1tCacheID(),
59  m_l1tUpdated(false),
60  // hlt values and status
61  m_hltResults(nullptr),
62  m_hltMenu(nullptr),
63  m_hltCacheID(),
64  m_hltUpdated(false),
65  // event values
66  m_eventNumber() {
67  if (not m_hltResultsTag.label().empty())
69  if (not m_l1tResultsTag.label().empty())
71  }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
edm::EDGetTokenT< GlobalAlgBlkBxCollection > m_l1tResultsToken
const edm::TriggerResults * m_hltResults
edm::EDGetTokenT< edm::TriggerResults > m_hltResultsToken
const edm::TriggerNames * m_hltMenu
const L1TUtmTriggerMenu * m_l1tMenu
const std::vector< bool > * m_l1tResults
std::string const & label() const
Definition: InputTag.h:36
edm::ParameterSetID m_hltCacheID
edm::EventNumber_t m_eventNumber
unsigned long long m_l1tCacheID
triggerExpression::Data::Data ( edm::InputTag const &  hltResultsTag,
edm::InputTag const &  l1tResultsTag,
bool  l1tIgnoreMaskAndPrescale,
bool  doThrow,
edm::ConsumesCollector &&  iC 
)
inline

Definition at line 74 of file TriggerExpressionData.h.

References singleTopDQM_cfi::setup.

79  : // configuration
80  m_hltResultsTag(hltResultsTag),
82  m_l1tResultsTag(l1tResultsTag),
85  m_throw(doThrow),
86  // l1 values and status
87  m_l1tResults(nullptr),
88  m_l1tMenu(nullptr),
89  m_l1tCacheID(),
90  m_l1tUpdated(false),
91  // hlt values and status
92  m_hltResults(nullptr),
93  m_hltMenu(nullptr),
94  m_hltCacheID(),
95  m_hltUpdated(false),
96  // event values
97  m_eventNumber() {
98  if (not m_hltResultsTag.label().empty())
100  if (not m_l1tResultsTag.label().empty())
102  }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetTokenT< GlobalAlgBlkBxCollection > m_l1tResultsToken
const edm::TriggerResults * m_hltResults
edm::EDGetTokenT< edm::TriggerResults > m_hltResultsToken
const edm::TriggerNames * m_hltMenu
const L1TUtmTriggerMenu * m_l1tMenu
const std::vector< bool > * m_l1tResults
std::string const & label() const
Definition: InputTag.h:36
edm::ParameterSetID m_hltCacheID
edm::EventNumber_t m_eventNumber
unsigned long long m_l1tCacheID

Member Function Documentation

bool triggerExpression::Data::configurationUpdated ( ) const
inline

Definition at line 137 of file TriggerExpressionData.h.

References or.

Referenced by DiJetVarAnalyzer::analyze(), TriggerResultsFilterFromDB::filter(), and TriggerResultsFilter::filter().

137 { return m_hltUpdated or m_l1tUpdated; }
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
edm::EventNumber_t triggerExpression::Data::eventNumber ( ) const
inline

Definition at line 139 of file TriggerExpressionData.h.

Referenced by triggerExpression::Prescaler::init().

139 { return m_eventNumber; }
edm::EventNumber_t m_eventNumber
bool triggerExpression::Data::hasHLT ( ) const
inline

Definition at line 123 of file TriggerExpressionData.h.

Referenced by triggerExpression::PathReader::operator()(), and setEvent().

123 { return not m_hltResultsTag.label().empty(); }
std::string const & label() const
Definition: InputTag.h:36
bool triggerExpression::Data::hasL1T ( ) const
inline

Definition at line 121 of file TriggerExpressionData.h.

Referenced by triggerExpression::L1uGTReader::init(), triggerExpression::L1uGTReader::operator()(), and setEvent().

121 { return not m_l1tResultsTag.label().empty(); }
std::string const & label() const
Definition: InputTag.h:36
bool triggerExpression::Data::hltConfigurationUpdated ( ) const
inline

Definition at line 133 of file TriggerExpressionData.h.

const edm::TriggerNames& triggerExpression::Data::hltMenu ( ) const
inline

Definition at line 127 of file TriggerExpressionData.h.

Referenced by triggerExpression::PathReader::init().

127 { return *m_hltMenu; }
const edm::TriggerNames * m_hltMenu
const edm::TriggerResults& triggerExpression::Data::hltResults ( ) const
inline

Definition at line 125 of file TriggerExpressionData.h.

Referenced by triggerExpression::PathReader::operator()().

125 { return *m_hltResults; }
const edm::TriggerResults * m_hltResults
bool triggerExpression::Data::ignoreL1MaskAndPrescale ( ) const
inline

Definition at line 143 of file TriggerExpressionData.h.

bool triggerExpression::Data::l1tConfigurationUpdated ( ) const
inline

Definition at line 135 of file TriggerExpressionData.h.

const L1TUtmTriggerMenu& triggerExpression::Data::l1tMenu ( ) const
inline

Definition at line 131 of file TriggerExpressionData.h.

Referenced by triggerExpression::L1uGTReader::init().

131 { return *m_l1tMenu; }
const L1TUtmTriggerMenu * m_l1tMenu
const std::vector<bool>& triggerExpression::Data::l1tResults ( ) const
inline

Definition at line 129 of file TriggerExpressionData.h.

Referenced by triggerExpression::L1uGTReader::operator()().

129 { return *m_l1tResults; }
const std::vector< bool > * m_l1tResults
bool triggerExpression::Data::setEvent ( const edm::Event event,
const edm::EventSetup setup 
)

Definition at line 18 of file TriggerExpressionData.cc.

References edm::EventSetup::get(), edm::get(), hasHLT(), hasL1T(), m_eventNumber, m_hltCacheID, m_hltMenu, m_hltResults, m_hltResultsToken, m_hltUpdated, m_l1tCacheID, m_l1tIgnoreMaskAndPrescale, m_l1tMenu, m_l1tResults, m_l1tResultsToken, m_l1tUpdated, or, edm::TriggerNames::parameterSetID(), singleTopDQM_cfi::setup, and edm::TriggerNames::triggerNames().

Referenced by DiJetVarAnalyzer::analyze(), FSQDiJetAve::analyze(), TriggerResultsFilterFromDB::filter(), and TriggerResultsFilter::filter().

18  {
19  // cache the event number
20  m_eventNumber = event.id().event();
21 
22  // access L1 objects only if L1 is used
23  if (hasL1T()) {
24  // cache the L1 GT results objects
25  auto const& l1t = edm::get(event, m_l1tResultsToken);
26  if (l1t.size() == 0 or l1t.isEmpty(0)) {
27  m_l1tResults = nullptr;
28  return false;
29  }
31  m_l1tResults = &l1t.at(0, 0).getAlgoDecisionInitial();
32  else
33  m_l1tResults = &l1t.at(0, 0).getAlgoDecisionFinal();
34 
35  // cache the L1 trigger menu
36  unsigned long long l1tCacheID = setup.get<L1TUtmTriggerMenuRcd>().cacheIdentifier();
37  if (m_l1tCacheID == l1tCacheID) {
38  m_l1tUpdated = false;
39  } else {
40  m_l1tMenu = &edm::get<L1TUtmTriggerMenu, L1TUtmTriggerMenuRcd>(setup);
41  m_l1tCacheID = l1tCacheID;
42  m_l1tUpdated = true;
43  }
44  }
45 
46  // access HLT objects only if HLT is used
47  if (hasHLT()) {
48  // cache the HLT TriggerResults
50  if (not m_hltResults)
51  return false;
52 
53  // access the TriggerNames, and check if it has changed
54  m_hltMenu = &event.triggerNames(*m_hltResults);
56  m_hltUpdated = false;
57  } else {
59  m_hltUpdated = true;
60  }
61  }
62 
63  return true;
64  }
edm::EDGetTokenT< GlobalAlgBlkBxCollection > m_l1tResultsToken
delete x;
Definition: CaloConfig.h:22
Strings const & triggerNames() const
Definition: TriggerNames.cc:20
ParameterSetID const & parameterSetID() const
Definition: TriggerNames.cc:33
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
const edm::TriggerResults * m_hltResults
edm::EDGetTokenT< edm::TriggerResults > m_hltResultsToken
const edm::TriggerNames * m_hltMenu
const L1TUtmTriggerMenu * m_l1tMenu
const std::vector< bool > * m_l1tResults
T const & get(Event const &event, InputTag const &tag)(false)
Definition: Event.h:666
edm::ParameterSetID m_hltCacheID
T get() const
Definition: EventSetup.h:73
edm::EventNumber_t m_eventNumber
unsigned long long m_l1tCacheID
void triggerExpression::Data::setHltResultsTag ( edm::InputTag const &  tag)
inline
void triggerExpression::Data::setL1tIgnoreMaskAndPrescale ( bool  l1tIgnoreMaskAndPrescale)
inline
void triggerExpression::Data::setL1tResultsTag ( edm::InputTag const &  tag)
inline
void triggerExpression::Data::setThrow ( bool  doThrow)
inline

Definition at line 117 of file TriggerExpressionData.h.

117 { m_throw = doThrow; }
bool triggerExpression::Data::shouldThrow ( ) const
inline

Member Data Documentation

edm::EventNumber_t triggerExpression::Data::m_eventNumber

Definition at line 166 of file TriggerExpressionData.h.

Referenced by setEvent().

edm::ParameterSetID triggerExpression::Data::m_hltCacheID

Definition at line 162 of file TriggerExpressionData.h.

Referenced by setEvent().

const edm::TriggerNames* triggerExpression::Data::m_hltMenu

Definition at line 161 of file TriggerExpressionData.h.

Referenced by setEvent().

const edm::TriggerResults* triggerExpression::Data::m_hltResults

Definition at line 160 of file TriggerExpressionData.h.

Referenced by setEvent().

edm::InputTag triggerExpression::Data::m_hltResultsTag

Definition at line 146 of file TriggerExpressionData.h.

edm::EDGetTokenT<edm::TriggerResults> triggerExpression::Data::m_hltResultsToken

Definition at line 147 of file TriggerExpressionData.h.

Referenced by setEvent().

bool triggerExpression::Data::m_hltUpdated

Definition at line 163 of file TriggerExpressionData.h.

Referenced by setEvent().

unsigned long long triggerExpression::Data::m_l1tCacheID

Definition at line 156 of file TriggerExpressionData.h.

Referenced by setEvent().

bool triggerExpression::Data::m_l1tIgnoreMaskAndPrescale

Definition at line 150 of file TriggerExpressionData.h.

Referenced by setEvent().

const L1TUtmTriggerMenu* triggerExpression::Data::m_l1tMenu

Definition at line 155 of file TriggerExpressionData.h.

Referenced by setEvent().

const std::vector<bool>* triggerExpression::Data::m_l1tResults

Definition at line 154 of file TriggerExpressionData.h.

Referenced by setEvent().

edm::InputTag triggerExpression::Data::m_l1tResultsTag

Definition at line 148 of file TriggerExpressionData.h.

edm::EDGetTokenT<GlobalAlgBlkBxCollection> triggerExpression::Data::m_l1tResultsToken

Definition at line 149 of file TriggerExpressionData.h.

Referenced by setEvent().

bool triggerExpression::Data::m_l1tUpdated

Definition at line 157 of file TriggerExpressionData.h.

Referenced by setEvent().

bool triggerExpression::Data::m_throw

Definition at line 151 of file TriggerExpressionData.h.