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 }
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(0),
36  m_l1tCacheID(),
37  m_l1tUpdated(false),
38  // hlt values and status
39  m_hltResults(0),
40  m_hltMenu(0),
41  m_hltCacheID(),
42  m_hltUpdated(false),
43  // event values
44  m_eventNumber()
45  { }
46 
47  // explicit c'tor from a ParameterSet
49  // configuration
50  m_hltResultsTag(config.getParameter<edm::InputTag>("hltResults")),
51  m_hltResultsToken(),
52  m_l1tResultsTag(config.getParameter<edm::InputTag>("l1tResults")),
53  m_l1tResultsToken(),
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(0),
59  m_l1tCacheID(),
60  m_l1tUpdated(false),
61  // hlt values and status
62  m_hltResults(0),
63  m_hltMenu(0),
64  m_hltCacheID(),
65  m_hltUpdated(false),
66  // event values
67  m_eventNumber()
68  {
69  if (not m_hltResultsTag.label().empty()) m_hltResultsToken = iC.consumes<edm::TriggerResults>(m_hltResultsTag);
70  if (not m_l1tResultsTag.label().empty()) m_l1tResultsToken = iC.consumes<GlobalAlgBlkBxCollection>(m_l1tResultsTag);
71  }
72 
73  // explicit c'tor from single arguments
75  edm::InputTag const & hltResultsTag,
76  edm::InputTag const & l1tResultsTag,
77  bool l1tIgnoreMaskAndPrescale,
78  bool doThrow,
79  edm::ConsumesCollector && iC ) :
80  // configuration
81  m_hltResultsTag(hltResultsTag),
82  m_hltResultsToken(),
83  m_l1tResultsTag(l1tResultsTag),
84  m_l1tResultsToken(),
85  m_l1tIgnoreMaskAndPrescale(l1tIgnoreMaskAndPrescale),
86  m_throw(doThrow),
87  // l1 values and status
88  m_l1tResults(nullptr),
89  m_l1tMenu(0),
90  m_l1tCacheID(),
91  m_l1tUpdated(false),
92  // hlt values and status
93  m_hltResults(0),
94  m_hltMenu(0),
95  m_hltCacheID(),
96  m_hltUpdated(false),
97  // event values
98  m_eventNumber()
99  {
100  if (not m_hltResultsTag.label().empty()) m_hltResultsToken = iC.consumes<edm::TriggerResults>(m_hltResultsTag);
101  if (not m_l1tResultsTag.label().empty()) 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 
110  m_hltResultsTag = tag;
111  }
112 
114  m_l1tResultsTag = tag;
115  }
116 
117  void setL1tIgnoreMaskAndPrescale(bool l1tIgnoreMaskAndPrescale) {
118  m_l1tIgnoreMaskAndPrescale = l1tIgnoreMaskAndPrescale;
119  }
120 
121  void setThrow(bool doThrow) {
122  m_throw = doThrow;
123  }
124 
125  // read-only accessors
126 
127  bool hasL1T() const {
128  return not m_l1tResultsTag.label().empty();
129  }
130 
131  bool hasHLT() const {
132  return not m_hltResultsTag.label().empty();
133  }
134 
135  const edm::TriggerResults & hltResults() const {
136  return * m_hltResults;
137  }
138 
139  const edm::TriggerNames & hltMenu() const {
140  return * m_hltMenu;
141  }
142 
143  const std::vector<bool> & l1tResults() const {
144  return * m_l1tResults;
145  }
146 
147  const L1TUtmTriggerMenu & l1tMenu() const {
148  return * m_l1tMenu;
149  }
150 
151  bool hltConfigurationUpdated() const {
152  return m_hltUpdated;
153  }
154 
155  bool l1tConfigurationUpdated() const {
156  return m_l1tUpdated;
157  }
158 
159  bool configurationUpdated() const {
160  return m_hltUpdated or m_l1tUpdated;
161  }
162 
164  return m_eventNumber;
165  }
166 
167  bool shouldThrow() const {
168  return m_throw;
169  }
170 
171  bool ignoreL1MaskAndPrescale() const {
172  return m_l1tIgnoreMaskAndPrescale;
173  }
174 
175  // configuration
181  bool m_throw;
182 
183  // l1 values and status
184  const std::vector<bool> * m_l1tResults;
186  unsigned long long m_l1tCacheID;
188 
189  // hlt values and status
194 
195  // event values
197 };
198 
199 } // namespace triggerExpression
200 
201 #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)
const edm::TriggerNames & hltMenu() const
edm::EDGetTokenT< GlobalAlgBlkBxCollection > m_l1tResultsToken
unsigned long long EventNumber_t
def setup(process, global_tag, zero_tesla=False)
Definition: GeneralSetup.py:1
Definition: config.py:1
void setL1tIgnoreMaskAndPrescale(bool l1tIgnoreMaskAndPrescale)
#define nullptr
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