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.

25  :
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
45  { }
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 48 of file TriggerExpressionData.h.

48  :
49  // configuration
50  m_hltResultsTag(config.getParameter<edm::InputTag>("hltResults")),
52  m_l1tResultsTag(config.getParameter<edm::InputTag>("l1tResults")),
54  m_l1tIgnoreMaskAndPrescale(config.getParameter<bool>("l1tIgnoreMaskAndPrescale")),
55  m_throw(config.getParameter<bool>("throw")),
56  // l1 values and status
57  m_l1tResults(nullptr),
58  m_l1tMenu(nullptr),
59  m_l1tCacheID(),
60  m_l1tUpdated(false),
61  // hlt values and status
62  m_hltResults(nullptr),
63  m_hltMenu(nullptr),
64  m_hltCacheID(),
65  m_hltUpdated(false),
66  // event values
68  {
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 GeneralSetup::setup().

79  :
80  // configuration
81  m_hltResultsTag(hltResultsTag),
83  m_l1tResultsTag(l1tResultsTag),
85  m_l1tIgnoreMaskAndPrescale(l1tIgnoreMaskAndPrescale),
86  m_throw(doThrow),
87  // l1 values and status
88  m_l1tResults(nullptr),
89  m_l1tMenu(nullptr),
90  m_l1tCacheID(),
91  m_l1tUpdated(false),
92  // hlt values and status
93  m_hltResults(nullptr),
94  m_hltMenu(nullptr),
95  m_hltCacheID(),
96  m_hltUpdated(false),
97  // event values
99  {
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 159 of file TriggerExpressionData.h.

References or.

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

159  {
161  }
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 163 of file TriggerExpressionData.h.

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

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

Definition at line 131 of file TriggerExpressionData.h.

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

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

Definition at line 127 of file TriggerExpressionData.h.

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

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

Definition at line 151 of file TriggerExpressionData.h.

151  {
152  return m_hltUpdated;
153  }
const edm::TriggerNames& triggerExpression::Data::hltMenu ( ) const
inline

Definition at line 139 of file TriggerExpressionData.h.

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

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

Definition at line 135 of file TriggerExpressionData.h.

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

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

Definition at line 171 of file TriggerExpressionData.h.

171  {
173  }
bool triggerExpression::Data::l1tConfigurationUpdated ( ) const
inline

Definition at line 155 of file TriggerExpressionData.h.

155  {
156  return m_l1tUpdated;
157  }
const L1TUtmTriggerMenu& triggerExpression::Data::l1tMenu ( ) const
inline

Definition at line 147 of file TriggerExpressionData.h.

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

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

Definition at line 143 of file TriggerExpressionData.h.

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

143  {
144  return * m_l1tResults;
145  }
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(), GeneralSetup::setup(), and edm::TriggerNames::triggerNames().

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

18  {
19 
20  // cache the event number
21  m_eventNumber = event.id().event();
22 
23  // access L1 objects only if L1 is used
24  if (hasL1T()) {
25  // cache the L1 GT results objects
26  auto const& l1t = edm::get(event, m_l1tResultsToken);
27  if (l1t.size() == 0 or l1t.isEmpty(0)) {
28  m_l1tResults = nullptr;
29  return false;
30  }
32  m_l1tResults = & l1t.at(0, 0).getAlgoDecisionInitial();
33  else
34  m_l1tResults = & l1t.at(0, 0).getAlgoDecisionFinal();
35 
36  // cache the L1 trigger menu
37  unsigned long long l1tCacheID = setup.get<L1TUtmTriggerMenuRcd>().cacheIdentifier();
38  if (m_l1tCacheID == l1tCacheID) {
39  m_l1tUpdated = false;
40  } else {
41  m_l1tMenu = & edm::get<L1TUtmTriggerMenu, L1TUtmTriggerMenuRcd>(setup);
42  m_l1tCacheID = l1tCacheID;
43  m_l1tUpdated = true;
44  }
45  }
46 
47  // access HLT objects only if HLT is used
48  if (hasHLT()) {
49  // cache the HLT TriggerResults
51  if (not m_hltResults)
52  return false;
53 
54  // access the TriggerNames, and check if it has changed
55  m_hltMenu = & event.triggerNames(* m_hltResults);
57  m_hltUpdated = false;
58  } else {
60  m_hltUpdated = true;
61  }
62  }
63 
64  return true;
65 }
edm::EDGetTokenT< GlobalAlgBlkBxCollection > m_l1tResultsToken
def setup(process, global_tag, zero_tesla=False)
Definition: GeneralSetup.py:1
delete x;
Definition: CaloConfig.h:22
Strings const & triggerNames() const
Definition: TriggerNames.cc:24
ParameterSetID const & parameterSetID() const
Definition: TriggerNames.cc:42
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
T const & get(Event const &event, InputTag const &tag)
Definition: Event.h:630
edm::EDGetTokenT< edm::TriggerResults > m_hltResultsToken
const edm::TriggerNames * m_hltMenu
const L1TUtmTriggerMenu * m_l1tMenu
const std::vector< bool > * m_l1tResults
const T & get() const
Definition: EventSetup.h:59
edm::ParameterSetID m_hltCacheID
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

Definition at line 117 of file TriggerExpressionData.h.

117  {
118  m_l1tIgnoreMaskAndPrescale = l1tIgnoreMaskAndPrescale;
119  }
void triggerExpression::Data::setL1tResultsTag ( edm::InputTag const &  tag)
inline
void triggerExpression::Data::setThrow ( bool  doThrow)
inline

Definition at line 121 of file TriggerExpressionData.h.

121  {
122  m_throw = doThrow;
123  }
bool triggerExpression::Data::shouldThrow ( ) const
inline

Member Data Documentation

edm::EventNumber_t triggerExpression::Data::m_eventNumber

Definition at line 196 of file TriggerExpressionData.h.

Referenced by setEvent().

edm::ParameterSetID triggerExpression::Data::m_hltCacheID

Definition at line 192 of file TriggerExpressionData.h.

Referenced by setEvent().

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

Definition at line 191 of file TriggerExpressionData.h.

Referenced by setEvent().

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

Definition at line 190 of file TriggerExpressionData.h.

Referenced by setEvent().

edm::InputTag triggerExpression::Data::m_hltResultsTag

Definition at line 176 of file TriggerExpressionData.h.

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

Definition at line 177 of file TriggerExpressionData.h.

Referenced by setEvent().

bool triggerExpression::Data::m_hltUpdated

Definition at line 193 of file TriggerExpressionData.h.

Referenced by setEvent().

unsigned long long triggerExpression::Data::m_l1tCacheID

Definition at line 186 of file TriggerExpressionData.h.

Referenced by setEvent().

bool triggerExpression::Data::m_l1tIgnoreMaskAndPrescale

Definition at line 180 of file TriggerExpressionData.h.

Referenced by setEvent().

const L1TUtmTriggerMenu* triggerExpression::Data::m_l1tMenu

Definition at line 185 of file TriggerExpressionData.h.

Referenced by setEvent().

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

Definition at line 184 of file TriggerExpressionData.h.

Referenced by setEvent().

edm::InputTag triggerExpression::Data::m_l1tResultsTag

Definition at line 178 of file TriggerExpressionData.h.

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

Definition at line 179 of file TriggerExpressionData.h.

Referenced by setEvent().

bool triggerExpression::Data::m_l1tUpdated

Definition at line 187 of file TriggerExpressionData.h.

Referenced by setEvent().

bool triggerExpression::Data::m_throw

Definition at line 181 of file TriggerExpressionData.h.