CMS 3D CMS Logo

TriggerExpressionData.h
Go to the documentation of this file.
1 #ifndef HLTrigger_HLTfilters_TriggerExpressionData_h
2 #define HLTrigger_HLTfilters_TriggerExpressionData_h
3 
11 
12 namespace edm {
13  class Event;
14  class EventSetup;
15  class TriggerNames;
16 } // namespace edm
17 
18 class L1TUtmTriggerMenu;
19 
20 namespace triggerExpression {
21 
22  class Data {
23  public:
24  // default c'tor
25  Data()
26  : // configuration
27  m_hltResultsTag(""),
28  m_hltResultsToken(),
29  m_l1tResultsTag(""),
30  m_l1tResultsToken(),
31  m_l1tIgnoreMaskAndPrescale(false),
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() {}
45 
46  // explicit c'tor from a ParameterSet
48  : // configuration
49  m_hltResultsTag(config.getParameter<edm::InputTag>("hltResults")),
50  m_hltResultsToken(),
51  m_l1tResultsTag(config.getParameter<edm::InputTag>("l1tResults")),
52  m_l1tResultsToken(),
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())
68  m_hltResultsToken = iC.consumes<edm::TriggerResults>(m_hltResultsTag);
69  if (not m_l1tResultsTag.label().empty())
70  m_l1tResultsToken = iC.consumes<GlobalAlgBlkBxCollection>(m_l1tResultsTag);
71  }
72 
73  // explicit c'tor from single arguments
74  Data(edm::InputTag const& hltResultsTag,
75  edm::InputTag const& l1tResultsTag,
77  bool doThrow,
79  : // configuration
80  m_hltResultsTag(hltResultsTag),
81  m_hltResultsToken(),
82  m_l1tResultsTag(l1tResultsTag),
83  m_l1tResultsToken(),
84  m_l1tIgnoreMaskAndPrescale(l1tIgnoreMaskAndPrescale),
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())
99  m_hltResultsToken = iC.consumes<edm::TriggerResults>(m_hltResultsTag);
100  if (not m_l1tResultsTag.label().empty())
101  m_l1tResultsToken = iC.consumes<GlobalAlgBlkBxCollection>(m_l1tResultsTag);
102  }
103 
104  // set the new event
105  bool setEvent(const edm::Event& event, const edm::EventSetup& setup);
106 
107  // re-configuration accessors
108 
109  void setHltResultsTag(edm::InputTag const& tag) { m_hltResultsTag = tag; }
110 
111  void setL1tResultsTag(edm::InputTag const& tag) { m_l1tResultsTag = tag; }
112 
114  m_l1tIgnoreMaskAndPrescale = l1tIgnoreMaskAndPrescale;
115  }
116 
117  void setThrow(bool doThrow) { m_throw = doThrow; }
118 
119  // read-only accessors
120 
121  bool hasL1T() const { return not m_l1tResultsTag.label().empty(); }
122 
123  bool hasHLT() const { return not m_hltResultsTag.label().empty(); }
124 
125  const edm::TriggerResults& hltResults() const { return *m_hltResults; }
126 
127  const edm::TriggerNames& hltMenu() const { return *m_hltMenu; }
128 
129  const std::vector<bool>& l1tResults() const { return *m_l1tResults; }
130 
131  const L1TUtmTriggerMenu& l1tMenu() const { return *m_l1tMenu; }
132 
133  bool hltConfigurationUpdated() const { return m_hltUpdated; }
134 
135  bool l1tConfigurationUpdated() const { return m_l1tUpdated; }
136 
137  bool configurationUpdated() const { return m_hltUpdated or m_l1tUpdated; }
138 
139  edm::EventNumber_t eventNumber() const { return m_eventNumber; }
140 
141  bool shouldThrow() const { return m_throw; }
142 
143  bool ignoreL1MaskAndPrescale() const { return m_l1tIgnoreMaskAndPrescale; }
144 
145  // configuration
151  bool m_throw;
152 
153  // l1 values and status
154  const std::vector<bool>* m_l1tResults;
156  unsigned long long m_l1tCacheID;
158 
159  // hlt values and status
164 
165  // event values
167  };
168 
169 } // namespace triggerExpression
170 
171 #endif // HLTrigger_HLTfilters_TriggerExpressionData_h
void setL1tResultsTag(edm::InputTag const &tag)
Data(const edm::ParameterSet &config, edm::ConsumesCollector &&iC)
const L1TUtmTriggerMenu & l1tMenu() const
Data(edm::InputTag const &hltResultsTag, edm::InputTag const &l1tResultsTag, bool l1tIgnoreMaskAndPrescale, bool doThrow, edm::ConsumesCollector &&iC)
#define nullptr
const edm::TriggerNames & hltMenu() const
edm::EDGetTokenT< GlobalAlgBlkBxCollection > m_l1tResultsToken
unsigned long long EventNumber_t
Definition: config.py:1
void setL1tIgnoreMaskAndPrescale(bool l1tIgnoreMaskAndPrescale)
edm::EventNumber_t eventNumber() const
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
void setHltResultsTag(edm::InputTag const &tag)
edm::EDGetTokenT< edm::TriggerResults > m_hltResultsToken
const edm::TriggerResults & hltResults() const
const edm::TriggerNames * m_hltMenu
const std::vector< bool > & l1tResults() const
const L1TUtmTriggerMenu * m_l1tMenu
const std::vector< bool > * m_l1tResults
edm::ParameterSetID m_hltCacheID
HLT enums.
edm::EventNumber_t m_eventNumber
unsigned long long m_l1tCacheID
Definition: event.py:1