test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1GtUtils.h
Go to the documentation of this file.
1 #ifndef GlobalTriggerAnalyzer_L1GtUtils_h
2 #define GlobalTriggerAnalyzer_L1GtUtils_h
3 
18 // system include files
19 #include <string>
20 #include <utility>
21 
22 // user include files
23 
25 
29 
32 
34 
35 // forward declarations
38 class L1GtTriggerMask;
39 class L1GtTriggerMenu;
40 
43 
44 // class declaration
45 
46 class L1GtUtils {
47 
48 public:
49 
51  explicit L1GtUtils();
52 
54  virtual ~L1GtUtils();
55 
56 public:
57 
60  };
61 
78 
79  public:
81 
85 
89  const edm::InputTag&, const edm::InputTag&);
90 
93 
94  public:
95 
97  inline bool isValid() {
99  }
100 
103  const int logicalExpressionRunUpdate(const edm::Run&,
104  const edm::EventSetup&, const std::string&);
105  //
107  const int logicalExpressionRunUpdate(const edm::Run&,
108  const edm::EventSetup&);
109 
111 
112  inline const std::vector<L1GtLogicParser::OperandToken>& expL1Triggers() {
113  return m_expL1Triggers;
114  }
115  const std::vector<std::pair<std::string, bool> >& decisionsBeforeMask();
116  const std::vector<std::pair<std::string, bool> >& decisionsAfterMask();
117  const std::vector<std::pair<std::string, int> >& prescaleFactors();
118  const std::vector<std::pair<std::string, int> >& triggerMasks();
119 
120  const std::vector<std::pair<std::string, int> >& errorCodes(
121  const edm::Event&);
122 
123  private:
124 
127  bool initialize();
128 
130  void reset(const std::vector<std::pair<std::string, bool> >&) const;
131  void reset(const std::vector<std::pair<std::string, int> >&) const;
132 
133  void
134  l1Results(const edm::Event& iEvent,
135  const edm::InputTag& l1GtRecordInputTag,
136  const edm::InputTag& l1GtReadoutRecordInputTag);
137 
138  private:
139 
141 
144 
146 
149 
150  private:
151 
152  // private members
153 
156 
159 
162 
166 
169 
170  std::vector<L1GtLogicParser::OperandToken> m_expL1Triggers;
172 
174  std::vector<L1GtUtils::TriggerCategory> m_expTriggerCategory;
175 
178 
181  std::vector<bool> m_expTriggerInMenu;
182 
184  std::vector<std::pair<std::string, bool> > m_decisionsBeforeMask;
185  std::vector<std::pair<std::string, bool> > m_decisionsAfterMask;
186  std::vector<std::pair<std::string, int> > m_prescaleFactors;
187  std::vector<std::pair<std::string, int> > m_triggerMasks;
188  std::vector<std::pair<std::string, int> > m_errorCodes;
189 
190  };
191 
192 public:
193 
195 
196  // enum to string for TriggerCategory
197  const std::string triggerCategory(const TriggerCategory&) const;
198 
201 
203 
207 
209 
212  void getL1GtRunCache(const edm::Run&, const edm::EventSetup&, const bool,
213  const bool, const edm::InputTag&);
215  void getL1GtRunCache(const edm::Run&, const edm::EventSetup&, const bool,
216  const bool);
217 
220  void getL1GtRunCache(const edm::Event&, const edm::EventSetup&, const bool,
221  const bool, const edm::InputTag&);
223  void getL1GtRunCache(const edm::Event&, const edm::EventSetup&, const bool,
224  const bool);
225 
230  edm::InputTag& l1GtRecordInputTag,
231  edm::InputTag& l1GtReadoutRecordInputTag) const;
232 
234  void getL1GtTriggerMenuLiteInputTag(const edm::Run& iRun,
235  edm::InputTag& l1GtTriggerMenuLiteInputTag) const;
236 
240  }
241 
244  }
245 
248  }
249 
258 
259  const bool l1AlgoTechTrigBitNumber(const std::string& nameAlgoTechTrig,
260  TriggerCategory& trigCategory, int& bitNumber) const;
261 
267 
268  const bool l1TriggerNameFromBit(const int& bitNumber,
269  const TriggerCategory& trigCategory, std::string& aliasL1Trigger,
270  std::string& nameL1Trigger) const;
271 
284 
285  const int
286  l1Results(const edm::Event& iEvent,
287  const edm::InputTag& l1GtRecordInputTag,
288  const edm::InputTag& l1GtReadoutRecordInputTag,
289  const std::string& nameAlgoTechTrig,
291  int& prescaleFactor, int& triggerMask) const;
292 
304 
305  const int
306  l1Results(const edm::Event& iEvent,
307  const std::string& nameAlgoTechTrig,
309  int& prescaleFactor, int& triggerMask) const;
310 
325 
327  const bool decisionBeforeMask(const edm::Event& iEvent,
328  const edm::InputTag& l1GtRecordInputTag,
329  const edm::InputTag& l1GtReadoutRecordInputTag,
330  const std::string& nameAlgoTechTrig, int& errorCode) const;
331 
332  const bool decisionBeforeMask(const edm::Event& iEvent,
333  const std::string& nameAlgoTechTrig, int& errorCode) const;
334 
336  const bool decisionAfterMask(const edm::Event& iEvent,
337  const edm::InputTag& l1GtRecordInputTag,
338  const edm::InputTag& l1GtReadoutRecordInputTag,
339  const std::string& nameAlgoTechTrig, int& errorCode) const;
340 
341  const bool decisionAfterMask(const edm::Event& iEvent,
342  const std::string& nameAlgoTechTrig, int& errorCode) const;
343 
346  const bool decision(const edm::Event& iEvent,
347  const edm::InputTag& l1GtRecordInputTag,
348  const edm::InputTag& l1GtReadoutRecordInputTag,
349  const std::string& nameAlgoTechTrig, int& errorCode) const;
350 
351  const bool decision(const edm::Event& iEvent,
352  const std::string& nameAlgoTechTrig, int& errorCode) const;
353 
355  const int prescaleFactor(const edm::Event& iEvent,
356  const edm::InputTag& l1GtRecordInputTag,
357  const edm::InputTag& l1GtReadoutRecordInputTag,
358  const std::string& nameAlgoTechTrig, int& errorCode) const;
359 
360  const int prescaleFactor(const edm::Event& iEvent,
361  const std::string& nameAlgoTechTrig, int& errorCode) const;
362 
364  const int triggerMask(const edm::Event& iEvent,
365  const edm::InputTag& l1GtRecordInputTag,
366  const edm::InputTag& l1GtReadoutRecordInputTag,
367  const std::string& nameAlgoTechTrig, int& errorCode) const;
368 
369  const int triggerMask(const edm::Event& iEvent,
370  const std::string& nameAlgoTechTrig, int& errorCode) const;
371 
374  const int
375  triggerMask(const std::string& nameAlgoTechTrig, int& errorCode) const;
376 
381 
382  const int prescaleFactorSetIndex(const edm::Event& iEvent,
383  const edm::InputTag& l1GtRecordInputTag,
384  const edm::InputTag& l1GtReadoutRecordInputTag,
385  const TriggerCategory& trigCategory, int& errorCode) const;
386 
387  const int prescaleFactorSetIndex(const edm::Event& iEvent,
388  const TriggerCategory& trigCategory, int& errorCode) const;
389 
390 
394 
395  const std::vector<int>& prescaleFactorSet(const edm::Event& iEvent,
396  const edm::InputTag& l1GtRecordInputTag,
397  const edm::InputTag& l1GtReadoutRecordInputTag,
398  const TriggerCategory& trigCategory, int& errorCode);
399 
400  const std::vector<int>& prescaleFactorSet(const edm::Event& iEvent,
401  const TriggerCategory& trigCategory, int& errorCode);
402 
403 
406  const std::vector<unsigned int>& triggerMaskSet(
407  const TriggerCategory& trigCategory, int& errorCode);
408 
409 
411  const std::string& l1TriggerMenu() const;
412 
415 
417  const L1GtTriggerMenu* ptrL1TriggerMenuEventSetup(int& errorCode);
418 
420  const L1GtTriggerMenuLite* ptrL1GtTriggerMenuLite(int& errorCode);
421 
424  const bool availableL1Configuration(int& errorCode, int& l1ConfCode) const;
425 
426 private:
427 
428  static const std::string EmptyString;
429  static const int L1GtNotValidError;
430 
434  const bool trigResult(const DecisionWord& decWord, const int bitNumber,
435  const std::string& nameAlgoTechTrig,
436  const TriggerCategory& trigCategory, int& errorCode) const;
437 
438 private:
439 
441 
444  unsigned long long m_l1GtStableParCacheID;
445 
448 
451 
454  unsigned long long m_l1GtPfAlgoCacheID;
455 
457  unsigned long long m_l1GtPfTechCacheID;
458 
459  const std::vector<std::vector<int> >* m_prescaleFactorsAlgoTrig;
460  const std::vector<std::vector<int> >* m_prescaleFactorsTechTrig;
461 
464  unsigned long long m_l1GtTmAlgoCacheID;
465 
467  unsigned long long m_l1GtTmTechCacheID;
468 
470  unsigned long long m_l1GtTmVetoAlgoCacheID;
471 
473  unsigned long long m_l1GtTmVetoTechCacheID;
474 
475  const std::vector<unsigned int>* m_triggerMaskAlgoTrig;
476  const std::vector<unsigned int>* m_triggerMaskTechTrig;
477 
478  const std::vector<unsigned int>* m_triggerMaskVetoAlgoTrig;
479  const std::vector<unsigned int>* m_triggerMaskVetoTechTrig;
480 
481  // trigger menu
483  unsigned long long m_l1GtMenuCacheID;
484 
488 
490 
492 
493 
496 
500 
501  const std::vector<unsigned int>* m_triggerMaskAlgoTrigLite;
502  const std::vector<unsigned int>* m_triggerMaskTechTrigLite;
503 
504  const std::vector<std::vector<int> >* m_prescaleFactorsAlgoTrigLite;
505  const std::vector<std::vector<int> >* m_prescaleFactorsTechTrigLite;
506 
508 
511 
513 
517 
521 
522 
523 private:
524 
526  unsigned int m_physicsDaqPartition;
527 
528  std::vector<unsigned int> m_triggerMaskSet;
529  std::vector<int> m_prescaleFactorSet;
530 
534 
535 };
536 
537 #endif /*GlobalTriggerAnalyzer_L1GtUtils_h*/
bool m_retrieveL1GtTriggerMenuLite
Definition: L1GtUtils.h:533
edm::RunID m_runIDCache
run cache ID
Definition: L1GtUtils.h:519
bool m_validLogicalExpression
true if the logical expression uses accepted L1GtLogicParser operators
Definition: L1GtUtils.h:161
const bool l1TriggerNameFromBit(const int &bitNumber, const TriggerCategory &trigCategory, std::string &aliasL1Trigger, std::string &nameL1Trigger) const
Definition: L1GtUtils.cc:675
const bool decisionAfterMask(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return decision after trigger mask for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1411
LogicalExpressionL1Results(const std::string &, L1GtUtils &)
constructor(s)
Definition: L1GtUtils.cc:2420
std::vector< std::pair< std::string, bool > > m_decisionsBeforeMask
Definition: L1GtUtils.h:184
const int l1Results(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, bool &decisionBeforeMask, bool &decisionAfterMask, int &prescaleFactor, int &triggerMask) const
Definition: L1GtUtils.cc:885
std::vector< unsigned int > m_triggerMaskSet
Definition: L1GtUtils.h:528
unsigned long long m_l1GtMenuCacheID
Definition: L1GtUtils.h:483
const std::vector< unsigned int > * m_triggerMaskAlgoTrig
Definition: L1GtUtils.h:475
const int logicalExpressionRunUpdate(const edm::Run &, const edm::EventSetup &, const std::string &)
Definition: L1GtUtils.cc:2578
const edm::InputTag & provL1GtReadoutRecordInputTag()
Definition: L1GtUtils.h:242
edm::InputTag m_provL1GtReadoutRecordInputTag
Definition: L1GtUtils.h:515
std::vector< L1GtLogicParser::OperandToken > m_expL1Triggers
Definition: L1GtUtils.h:170
void retrieveL1GtTriggerMenuLite(const edm::Run &, const edm::InputTag &)
retrieve L1GtTriggerMenuLite (per run product) and cache it to improve the speed
Definition: L1GtUtils.cc:269
const L1GtTriggerMenuLite * ptrL1GtTriggerMenuLite(int &errorCode)
return a pointer to the L1GtTriggerMenuLite product
Definition: L1GtUtils.cc:2256
int m_l1ConfCode
code for L1 trigger configuration
Definition: L1GtUtils.h:155
const std::vector< unsigned int > * m_triggerMaskTechTrig
Definition: L1GtUtils.h:476
void l1Results(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag)
Definition: L1GtUtils.cc:2797
const L1GtTriggerMask * m_l1GtTmVetoTech
Definition: L1GtUtils.h:472
std::map< std::string, L1GtAlgorithm > AlgorithmMap
map containing the algorithms
const bool l1AlgoTechTrigBitNumber(const std::string &nameAlgoTechTrig, TriggerCategory &trigCategory, int &bitNumber) const
Definition: L1GtUtils.cc:548
TriggerCategory
Definition: L1GtUtils.h:58
const bool availableL1Configuration(int &errorCode, int &l1ConfCode) const
Definition: L1GtUtils.cc:2293
edm::InputTag m_provL1GtTriggerMenuLiteInputTag
Definition: L1GtUtils.h:516
const std::vector< std::vector< int > > * m_prescaleFactorsAlgoTrigLite
Definition: L1GtUtils.h:504
const edm::InputTag & provL1GtRecordInputTag()
return the input tags found from provenance
Definition: L1GtUtils.h:238
virtual ~L1GtUtils()
destructor
Definition: L1GtUtils.cc:84
const edm::InputTag & provL1GtTriggerMenuLiteInputTag()
Definition: L1GtUtils.h:246
const L1GtTriggerMask * m_l1GtTmAlgo
trigger masks &amp; veto masks
Definition: L1GtUtils.h:463
const AlgorithmMap * m_algorithmMap
Definition: L1GtUtils.h:485
const std::vector< std::pair< std::string, int > > & prescaleFactors()
Definition: L1GtUtils.cc:2721
const std::vector< std::vector< int > > * m_prescaleFactorsTechTrig
Definition: L1GtUtils.h:460
const L1GtStableParameters * m_l1GtStablePar
event setup cached stuff
Definition: L1GtUtils.h:443
unsigned long long m_l1GtPfAlgoCacheID
Definition: L1GtUtils.h:454
const std::vector< unsigned int > & triggerMaskSet(const TriggerCategory &trigCategory, int &errorCode)
Definition: L1GtUtils.cc:2079
const std::vector< std::pair< std::string, int > > & triggerMasks()
Definition: L1GtUtils.cc:2734
const std::string & l1TriggerMenu() const
return the L1 trigger menu name
Definition: L1GtUtils.cc:2178
const std::vector< std::vector< int > > * m_prescaleFactorsAlgoTrig
Definition: L1GtUtils.h:459
const bool decisionBeforeMask(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return decision before trigger mask for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1374
const L1GtTriggerMenuLite::L1TriggerMap * m_algorithmAliasMapLite
Definition: L1GtUtils.h:498
std::map< unsigned int, std::string > L1TriggerMap
map containing the physics algorithms or the technical triggers
const L1GtTriggerMenuLite::L1TriggerMap * m_algorithmMapLite
Definition: L1GtUtils.h:497
unsigned long long m_l1GtTmVetoTechCacheID
Definition: L1GtUtils.h:473
const std::vector< std::pair< std::string, bool > > & decisionsAfterMask()
Definition: L1GtUtils.cc:2708
std::vector< std::pair< std::string, int > > m_errorCodes
Definition: L1GtUtils.h:188
void getL1GtRecordInputTag(const edm::Event &iEvent, edm::InputTag &l1GtRecordInputTag, edm::InputTag &l1GtReadoutRecordInputTag) const
Definition: L1GtUtils.cc:427
std::vector< std::pair< std::string, int > > m_triggerMasks
Definition: L1GtUtils.h:187
std::vector< std::pair< std::string, int > > m_prescaleFactors
Definition: L1GtUtils.h:186
const std::vector< std::pair< std::string, bool > > & decisionsBeforeMask()
Definition: L1GtUtils.cc:2695
int iEvent
Definition: GenABIO.cc:230
const bool decision(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
Definition: L1GtUtils.cc:1448
edm::InputTag m_provL1GtRecordInputTag
cached input tags from provenance - they are updated once per run only
Definition: L1GtUtils.h:514
edm::RunID m_provRunIDCache
Definition: L1GtUtils.h:520
const std::string & l1TriggerMenuImplementation() const
return the L1 trigger menu implementation
Definition: L1GtUtils.cc:2203
const AlgorithmMap * m_algorithmAliasMap
Definition: L1GtUtils.h:486
unsigned long long m_l1GtTmTechCacheID
Definition: L1GtUtils.h:467
const std::vector< std::vector< int > > * m_prescaleFactorsTechTrigLite
Definition: L1GtUtils.h:505
const L1GtTriggerMask * m_l1GtTmVetoAlgo
Definition: L1GtUtils.h:469
std::vector< bool > DecisionWord
typedefs
static const std::string EmptyString
Definition: L1GtUtils.h:428
const std::string triggerCategory(const TriggerCategory &) const
public methods
Definition: L1GtUtils.cc:90
std::string m_logicalExpression
private members as input parameters
Definition: L1GtUtils.h:143
const L1GtPrescaleFactors * m_l1GtPfAlgo
prescale factors
Definition: L1GtUtils.h:453
unsigned long long m_l1GtTmAlgoCacheID
Definition: L1GtUtils.h:464
const std::vector< int > & prescaleFactorSet(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const TriggerCategory &trigCategory, int &errorCode)
Definition: L1GtUtils.cc:1984
unsigned int m_numberTechnicalTriggers
number of technical triggers
Definition: L1GtUtils.h:450
std::vector< bool > m_expTriggerInMenu
Definition: L1GtUtils.h:181
void getL1GtTriggerMenuLiteInputTag(const edm::Run &iRun, edm::InputTag &l1GtTriggerMenuLiteInputTag) const
get the input tag for L1GtTriggerMenuLite
Definition: L1GtUtils.cc:494
const std::vector< L1GtLogicParser::OperandToken > & expL1Triggers()
list of triggers in the logical expression, trigger decisions, prescale factors and masks...
Definition: L1GtUtils.h:112
bool m_retrieveL1EventSetup
flags to check which method was used to retrieve L1 trigger configuration
Definition: L1GtUtils.h:532
void retrieveL1EventSetup(const edm::EventSetup &)
retrieve all the relevant L1 trigger event setup records and cache them to improve the speed ...
Definition: L1GtUtils.cc:111
unsigned int m_physicsDaqPartition
index of physics DAQ partition
Definition: L1GtUtils.h:526
unsigned int m_numberAlgorithmTriggers
number of algorithm triggers
Definition: L1GtUtils.h:447
bool m_l1ResultsAlreadyCalled
set to true if the method l1Results was called once
Definition: L1GtUtils.h:168
bool m_expBitsTechTrigger
flag true, if the logical expression is built from technical trigger bits
Definition: L1GtUtils.h:177
void getL1GtRunCache(const edm::Run &, const edm::EventSetup &, const bool, const bool, const edm::InputTag &)
get all the run-constant quantities for L1 trigger and cache them
Definition: L1GtUtils.cc:311
std::vector< L1GtUtils::TriggerCategory > m_expTriggerCategory
trigger category for each L1 trigger in the logical expression
Definition: L1GtUtils.h:174
const L1GtTriggerMask * m_l1GtTmTech
Definition: L1GtUtils.h:466
const L1GtTriggerMenuLite * m_l1GtMenuLite
L1GtTriggerMenuLite cached stuff.
Definition: L1GtUtils.h:495
void reset(const std::vector< std::pair< std::string, bool > > &) const
reset for each L1 trigger the value from pair.second
Definition: L1GtUtils.cc:2781
const L1GtPrescaleFactors * m_l1GtPfTech
Definition: L1GtUtils.h:456
const AlgorithmMap * m_technicalTriggerMap
Definition: L1GtUtils.h:487
const std::vector< unsigned int > * m_triggerMaskVetoAlgoTrig
Definition: L1GtUtils.h:478
const std::vector< unsigned int > * m_triggerMaskTechTrigLite
Definition: L1GtUtils.h:502
bool m_l1GtMenuLiteValid
Definition: L1GtUtils.h:507
const std::vector< unsigned int > * m_triggerMaskAlgoTrigLite
Definition: L1GtUtils.h:501
bool m_beginRunCache
flag for call of getL1GtRunCache in beginRun
Definition: L1GtUtils.h:510
const int prescaleFactorSetIndex(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const TriggerCategory &trigCategory, int &errorCode) const
Definition: L1GtUtils.cc:1760
const int triggerMask(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return trigger mask for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1520
const bool trigResult(const DecisionWord &decWord, const int bitNumber, const std::string &nameAlgoTechTrig, const TriggerCategory &trigCategory, int &errorCode) const
Definition: L1GtUtils.cc:2397
bool m_validL1Configuration
true if valid L1 configuration - if not, reset all quantities and return
Definition: L1GtUtils.h:158
const L1GtTriggerMenu * m_l1GtMenu
Definition: L1GtUtils.h:482
unsigned long long m_l1GtPfTechCacheID
Definition: L1GtUtils.h:457
static const int L1GtNotValidError
Definition: L1GtUtils.h:429
std::vector< std::pair< std::string, bool > > m_decisionsAfterMask
Definition: L1GtUtils.h:185
bool m_l1EventSetupValid
Definition: L1GtUtils.h:489
unsigned long long m_l1GtTmVetoAlgoCacheID
Definition: L1GtUtils.h:470
std::vector< int > m_prescaleFactorSet
Definition: L1GtUtils.h:529
const L1GtTriggerMenu * ptrL1TriggerMenuEventSetup(int &errorCode)
return a pointer to the L1 trigger menu from event setup
Definition: L1GtUtils.cc:2228
const int prescaleFactor(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return prescale factor for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1485
unsigned long long m_l1GtStableParCacheID
Definition: L1GtUtils.h:444
L1GtUtils()
constructor
Definition: L1GtUtils.cc:48
const L1GtTriggerMenuLite::L1TriggerMap * m_technicalTriggerMapLite
Definition: L1GtUtils.h:499
bool isValid()
return true if the logical expression is syntactically correct
Definition: L1GtUtils.h:97
Definition: Run.h:41
const std::vector< unsigned int > * m_triggerMaskVetoTechTrig
Definition: L1GtUtils.h:479
const std::vector< std::pair< std::string, int > > & errorCodes(const edm::Event &)
Definition: L1GtUtils.cc:2747