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 
14 
15 namespace edm {
16  class Event;
17  class EventSetup;
18  class TriggerNames;
19 } // namespace edm
20 
21 namespace triggerExpression {
22 
23  class Data {
24  public:
25  // default c'tor
26  Data()
27  : // configuration
30  m_hltResultsTag(""),
32  m_l1tResultsTag(""),
36  m_throw(true),
37  // l1 values and status
38  m_l1tResults(nullptr),
39  m_l1tMenu(nullptr),
40  m_l1tCacheID(),
42  // hlt values and status
43  m_pathStatus(),
45  m_hltResults(nullptr),
46  m_hltMenu(nullptr),
47  m_hltCacheID(),
49  // event values
50  m_eventNumber() {}
51 
52  // explicit c'tor from a ParameterSet
54  : // configuration
55  m_usePathStatus(config.getParameter<bool>("usePathStatus")),
57  m_hltResultsTag(config.getParameter<edm::InputTag>("hltResults")),
59  m_l1tResultsTag(config.getParameter<edm::InputTag>("l1tResults")),
62  m_l1tIgnoreMaskAndPrescale(config.getParameter<bool>("l1tIgnoreMaskAndPrescale")),
63  m_throw(config.getParameter<bool>("throw")),
64  // l1 values and status
65  m_l1tResults(nullptr),
66  m_l1tMenu(nullptr),
67  m_l1tCacheID(),
69  // hlt values and status
70  m_pathStatus(),
72  m_hltResults(nullptr),
73  m_hltMenu(nullptr),
74  m_hltCacheID(),
76  // event values
77  m_eventNumber() {
78  if (not m_hltResultsTag.label().empty() && not m_usePathStatus)
80  if (not m_l1tResultsTag.label().empty())
82  }
83 
84  // explicit c'tor from single arguments
85  Data(bool const& usePathStatus,
86  edm::InputTag const& hltResultsTag,
87  edm::InputTag const& l1tResultsTag,
89  bool doThrow,
91  : // configuration
94  m_hltResultsTag(hltResultsTag),
96  m_l1tResultsTag(l1tResultsTag),
100  m_throw(doThrow),
101  // l1 values and status
102  m_l1tResults(nullptr),
103  m_l1tMenu(nullptr),
104  m_l1tCacheID(),
106  // hlt values and status
107  m_pathStatus(),
108  m_triggerNames(),
109  m_hltResults(nullptr),
110  m_hltMenu(nullptr),
111  m_hltCacheID(),
113  // event values
114  m_eventNumber() {
115  if (not m_hltResultsTag.label().empty() && not m_usePathStatus)
117  if (not m_l1tResultsTag.label().empty())
119  }
120 
121  // set path status token
123 
124  // set the new event
125  bool setEvent(const edm::Event& event, const edm::EventSetup& setup);
126 
127  // re-configuration accessors
128 
130 
132 
135  }
136 
137  void setThrow(bool doThrow) { m_throw = doThrow; }
138 
139  // read-only accessors
140 
141  bool usePathStatus() const { return m_usePathStatus; }
142 
143  bool hasL1T() const { return not m_l1tResultsTag.label().empty(); }
144 
145  bool hasHLT() const { return not m_hltResultsTag.label().empty(); }
146 
147  const edm::TriggerResults& hltResults() const { return *m_hltResults; }
148 
149  const edm::TriggerNames& hltMenu() const { return *m_hltMenu; }
150 
151  const std::vector<bool>& l1tResults() const { return *m_l1tResults; }
152 
153  const L1TUtmTriggerMenu& l1tMenu() const { return *m_l1tMenu; }
154 
155  bool hltConfigurationUpdated() const { return m_hltUpdated; }
156 
157  bool l1tConfigurationUpdated() const { return m_l1tUpdated; }
158 
160 
162 
163  bool shouldThrow() const { return m_throw; }
164 
166 
167  const std::vector<std::string>& triggerNames() const {
168  if (m_hltMenu)
169  return m_hltMenu->triggerNames();
170  return m_triggerNames;
171  }
172 
173  bool passHLT(unsigned int const& index) const {
174  if (usePathStatus())
175  return m_pathStatus[index];
177  }
178 
179  int triggerIndex(std::string const& p) const {
180  if (usePathStatus()) {
181  auto it = std::find(m_triggerNames.begin(), m_triggerNames.end(), p);
182  if (it != m_triggerNames.end())
183  return it - m_triggerNames.begin();
184  } else if (m_hltMenu) {
185  auto index = m_hltMenu->triggerIndex(p);
186  if (index < m_hltMenu->size())
187  return index;
188  }
189  return -1;
190  }
191 
192  // configuration
194  std::map<std::string, edm::EDGetTokenT<edm::HLTPathStatus> > m_pathStatusTokens;
201  bool m_throw;
202 
203  // l1 values and status
204  const std::vector<bool>* m_l1tResults;
206  unsigned long long m_l1tCacheID;
208 
209  // hlt values and status
210  std::vector<bool> m_pathStatus;
211  std::vector<std::string> m_triggerNames;
216 
217  // event values
219  };
220 
221 } // namespace triggerExpression
222 
223 #endif // HLTrigger_HLTfilters_TriggerExpressionData_h
triggerExpression::Data::Data
Data(bool const &usePathStatus, edm::InputTag const &hltResultsTag, edm::InputTag const &l1tResultsTag, bool l1tIgnoreMaskAndPrescale, bool doThrow, edm::ConsumesCollector &&iC)
Definition: TriggerExpressionData.h:85
electrons_cff.bool
bool
Definition: electrons_cff.py:366
funct::false
false
Definition: Factorize.h:29
dijetScouting_cff.l1tIgnoreMaskAndPrescale
l1tIgnoreMaskAndPrescale
Definition: dijetScouting_cff.py:35
triggerExpression::Data::hltResults
const edm::TriggerResults & hltResults() const
Definition: TriggerExpressionData.h:147
triggerExpression::Data::m_hltResults
const edm::TriggerResults * m_hltResults
Definition: TriggerExpressionData.h:212
TriggerResults.h
triggerExpression::Data::setL1tResultsTag
void setL1tResultsTag(edm::InputTag const &tag)
Definition: TriggerExpressionData.h:131
edm::EDGetTokenT< edm::TriggerResults >
MicroEventContent_cff.branch
branch
Definition: MicroEventContent_cff.py:174
edm
HLT enums.
Definition: AlignableModifier.h:19
triggerExpression::Data::m_usePathStatus
bool m_usePathStatus
Definition: TriggerExpressionData.h:193
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89301
triggerExpression::Data::hltConfigurationUpdated
bool hltConfigurationUpdated() const
Definition: TriggerExpressionData.h:155
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
triggerExpression::Data::m_eventNumber
edm::EventNumber_t m_eventNumber
Definition: TriggerExpressionData.h:218
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
L1TUtmTriggerMenu
Definition: L1TUtmTriggerMenu.h:25
BXVector
Definition: BXVector.h:15
config
Definition: config.py:1
edm::InputTag::label
std::string const & label() const
Definition: InputTag.h:36
triggerExpression::Data::m_hltCacheID
edm::ParameterSetID m_hltCacheID
Definition: TriggerExpressionData.h:214
triggerExpression::Data::triggerNames
const std::vector< std::string > & triggerNames() const
Definition: TriggerExpressionData.h:167
triggerExpression::Data::eventNumber
edm::EventNumber_t eventNumber() const
Definition: TriggerExpressionData.h:161
triggerExpression::Data::configurationUpdated
bool configurationUpdated() const
Definition: TriggerExpressionData.h:159
triggerExpression::Data::m_pathStatus
std::vector< bool > m_pathStatus
Definition: TriggerExpressionData.h:210
triggerExpression::Data::m_l1tUpdated
bool m_l1tUpdated
Definition: TriggerExpressionData.h:207
triggerExpression::Data::m_throw
bool m_throw
Definition: TriggerExpressionData.h:201
EventID.h
triggerExpression::Data::m_pathStatusTokens
std::map< std::string, edm::EDGetTokenT< edm::HLTPathStatus > > m_pathStatusTokens
Definition: TriggerExpressionData.h:194
triggerExpression::Data::hasL1T
bool hasL1T() const
Definition: TriggerExpressionData.h:143
Event
edm::Hash< ParameterSetType >
edm::EventNumber_t
unsigned long long EventNumber_t
Definition: RunLumiEventNumber.h:12
triggerExpression::Data::shouldThrow
bool shouldThrow() const
Definition: TriggerExpressionData.h:163
edm::TriggerNames::triggerNames
Strings const & triggerNames() const
Definition: TriggerNames.cc:48
triggerExpression::Data::l1tResults
const std::vector< bool > & l1tResults() const
Definition: TriggerExpressionData.h:151
triggerExpression::Data::setThrow
void setThrow(bool doThrow)
Definition: TriggerExpressionData.h:137
L1TUtmTriggerMenu.h
funct::true
true
Definition: Factorize.h:173
L1TUtmTriggerMenuRcd.h
triggerExpression::Data::m_l1tResults
const std::vector< bool > * m_l1tResults
Definition: TriggerExpressionData.h:204
triggerExpression::Data::m_l1tCacheID
unsigned long long m_l1tCacheID
Definition: TriggerExpressionData.h:206
triggerExpression::Data::triggerIndex
int triggerIndex(std::string const &p) const
Definition: TriggerExpressionData.h:179
triggerExpression::Data::l1tMenu
const L1TUtmTriggerMenu & l1tMenu() const
Definition: TriggerExpressionData.h:153
edm::ParameterSet
Definition: ParameterSet.h:47
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
makeGlobalPositionRcd_cfg.tag
tag
Definition: makeGlobalPositionRcd_cfg.py:6
triggerExpression::Data::ignoreL1MaskAndPrescale
bool ignoreL1MaskAndPrescale() const
Definition: TriggerExpressionData.h:165
triggerExpression::Data::m_l1tResultsTag
edm::InputTag m_l1tResultsTag
Definition: TriggerExpressionData.h:197
TriggerNames.h
triggerExpression::Data::setEvent
bool setEvent(const edm::Event &event, const edm::EventSetup &setup)
Definition: TriggerExpressionData.cc:21
GlobalAlgBlk.h
triggerExpression::Data::m_l1tIgnoreMaskAndPrescale
bool m_l1tIgnoreMaskAndPrescale
Definition: TriggerExpressionData.h:200
triggerExpression::Data
Definition: TriggerExpressionData.h:23
triggerExpression::Data::setHltResultsTag
void setHltResultsTag(edm::InputTag const &tag)
Definition: TriggerExpressionData.h:129
triggerExpression::Data::m_hltResultsToken
edm::EDGetTokenT< edm::TriggerResults > m_hltResultsToken
Definition: TriggerExpressionData.h:196
edm::EventSetup
Definition: EventSetup.h:58
triggerExpression::Data::setPathStatusToken
void setPathStatusToken(edm::BranchDescription const &branch, edm::ConsumesCollector &&iC)
Definition: TriggerExpressionData.cc:14
triggerExpression::Data::usePathStatus
bool usePathStatus() const
Definition: TriggerExpressionData.h:141
triggerExpression::Data::passHLT
bool passHLT(unsigned int const &index) const
Definition: TriggerExpressionData.h:173
edm::TriggerNames::triggerIndex
unsigned int triggerIndex(std::string_view name) const
Definition: TriggerNames.cc:52
edm::ESGetToken< L1TUtmTriggerMenu, L1TUtmTriggerMenuRcd >
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
triggerExpression::Data::l1tConfigurationUpdated
bool l1tConfigurationUpdated() const
Definition: TriggerExpressionData.h:157
InputTag.h
triggerExpression::Data::m_hltUpdated
bool m_hltUpdated
Definition: TriggerExpressionData.h:215
triggerExpression::Data::Data
Data(const edm::ParameterSet &config, edm::ConsumesCollector &&iC)
Definition: TriggerExpressionData.h:53
triggerExpression::Data::hasHLT
bool hasHLT() const
Definition: TriggerExpressionData.h:145
triggerExpression::Data::m_hltMenu
const edm::TriggerNames * m_hltMenu
Definition: TriggerExpressionData.h:213
triggerExpression::Data::m_l1tUtmTriggerMenuToken
const edm::ESGetToken< L1TUtmTriggerMenu, L1TUtmTriggerMenuRcd > m_l1tUtmTriggerMenuToken
Definition: TriggerExpressionData.h:199
edm::TriggerNames
Definition: TriggerNames.h:55
or
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
triggerExpression
Definition: TriggerExpressionConstant.h:6
edm::HLTGlobalStatus::accept
bool accept() const
Has at least one path accepted the event?
Definition: HLTGlobalStatus.h:49
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
edm::BranchDescription
Definition: BranchDescription.h:32
ParameterSetID.h
triggerExpression::Data::setL1tIgnoreMaskAndPrescale
void setL1tIgnoreMaskAndPrescale(bool l1tIgnoreMaskAndPrescale)
Definition: TriggerExpressionData.h:133
ConsumesCollector.h
EventSetup
triggerExpression::Data::m_triggerNames
std::vector< std::string > m_triggerNames
Definition: TriggerExpressionData.h:211
ParameterSet.h
triggerExpression::Data::Data
Data()
Definition: TriggerExpressionData.h:26
event
Definition: event.py:1
DeDxTools::esConsumes
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
edm::Event
Definition: Event.h:73
triggerExpression::Data::m_hltResultsTag
edm::InputTag m_hltResultsTag
Definition: TriggerExpressionData.h:195
triggerExpression::Data::m_l1tMenu
const L1TUtmTriggerMenu * m_l1tMenu
Definition: TriggerExpressionData.h:205
edm::InputTag
Definition: InputTag.h:15
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
edm::TriggerResults
Definition: TriggerResults.h:35
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
triggerExpression::Data::m_l1tResultsToken
edm::EDGetTokenT< GlobalAlgBlkBxCollection > m_l1tResultsToken
Definition: TriggerExpressionData.h:198
triggerExpression::Data::hltMenu
const edm::TriggerNames & hltMenu() const
Definition: TriggerExpressionData.h:149