CMS 3D CMS Logo

L1GtAnalyzer.cc
Go to the documentation of this file.
1 
15 // this class header
17 
18 // system include files
19 #include <memory>
20 #include <iomanip>
21 
22 // user include files
27 
29 
33 
36 
39 
41 
42 // constructor(s)
44  :
45 
46  m_retrieveL1Extra(parSet.getParameter<edm::ParameterSet>("L1ExtraInputTags"), consumesCollector()),
47 
48  m_printOutput(parSet.getUntrackedParameter<int>("PrintOutput", 3)),
49 
50  m_analyzeDecisionReadoutRecordEnable(parSet.getParameter<bool>("analyzeDecisionReadoutRecordEnable")),
51  //
52  m_analyzeL1GtUtilsMenuLiteEnable(parSet.getParameter<bool>("analyzeL1GtUtilsMenuLiteEnable")),
53  m_analyzeL1GtUtilsEventSetupEnable(parSet.getParameter<bool>("analyzeL1GtUtilsEventSetupEnable")),
54  m_analyzeL1GtUtilsEnable(parSet.getParameter<bool>("analyzeL1GtUtilsEnable")),
55  m_analyzeTriggerEnable(parSet.getParameter<bool>("analyzeTriggerEnable")),
56  //
57  m_analyzeObjectMapEnable(parSet.getParameter<bool>("analyzeObjectMapEnable")),
58  //
59  m_analyzeL1GtTriggerMenuLiteEnable(parSet.getParameter<bool>("analyzeL1GtTriggerMenuLiteEnable")),
60  //
61  m_analyzeConditionsInRunBlockEnable(parSet.getParameter<bool>("analyzeConditionsInRunBlockEnable")),
62  m_analyzeConditionsInLumiBlockEnable(parSet.getParameter<bool>("analyzeConditionsInLumiBlockEnable")),
63  m_analyzeConditionsInEventBlockEnable(parSet.getParameter<bool>("analyzeConditionsInEventBlockEnable")),
64 
65  // input tag for GT DAQ product
66  m_l1GtDaqReadoutRecordInputTag(parSet.getParameter<edm::InputTag>("L1GtDaqReadoutRecordInputTag")),
67 
68  // input tag for L1GlobalTriggerRecord
69  m_l1GtRecordInputTag(parSet.getParameter<edm::InputTag>("L1GtRecordInputTag")),
70 
71  // input tag for GT object map collection L1GlobalTriggerObjectMapRecord
72  m_l1GtObjectMapTag(parSet.getParameter<edm::InputTag>("L1GtObjectMapTag")),
73 
74  // input tag for GT object map collection L1GlobalTriggerObjectMaps
75  m_l1GtObjectMapsInputTag(parSet.getParameter<edm::InputTag>("L1GtObjectMapsInputTag")),
76 
77  // input tag for muon collection from GMT
78  m_l1GmtInputTag(parSet.getParameter<edm::InputTag>("L1GmtInputTag")),
79 
80  // input tag for L1GtTriggerMenuLite
81  m_l1GtTmLInputTag(parSet.getParameter<edm::InputTag>("L1GtTmLInputTag")),
82 
83  // input tag for ConditionInEdm products
84  m_condInEdmInputTag(parSet.getParameter<edm::InputTag>("CondInEdmInputTag")),
85 
86  // an algorithm and a condition in that algorithm to test the object maps
87  m_nameAlgTechTrig(parSet.getParameter<std::string>("AlgorithmName")),
88  m_condName(parSet.getParameter<std::string>("ConditionName")),
89  m_bitNumber(parSet.getParameter<unsigned int>("BitNumber")),
90 
91  m_l1GtUtilsConfiguration(parSet.getParameter<unsigned int>("L1GtUtilsConfiguration")),
92  m_l1GtTmLInputTagProv(parSet.getParameter<bool>("L1GtTmLInputTagProv")),
93  m_l1GtRecordsInputTagProv(parSet.getParameter<bool>("L1GtRecordsInputTagProv")),
94  m_l1GtUtilsConfigureBeginRun(parSet.getParameter<bool>("L1GtUtilsConfigureBeginRun")),
95  m_l1GtUtilsLogicalExpression(parSet.getParameter<std::string>("L1GtUtilsLogicalExpression")),
96  m_l1GtUtilsProv(parSet,
97  consumesCollector(),
98  m_l1GtUtilsConfiguration == 0 || m_l1GtUtilsConfiguration == 100000,
99  *this,
100  edm::InputTag(),
101  edm::InputTag(),
102  m_l1GtTmLInputTagProv ? edm::InputTag() : m_l1GtTmLInputTag),
103  m_l1GtUtils(parSet,
104  consumesCollector(),
105  m_l1GtUtilsConfiguration == 0 || m_l1GtUtilsConfiguration == 100000,
106  *this,
107  m_l1GtRecordInputTag,
108  m_l1GtDaqReadoutRecordInputTag,
109  m_l1GtTmLInputTagProv ? edm::InputTag() : m_l1GtTmLInputTag),
110  m_logicalExpressionL1ResultsProv(m_l1GtUtilsLogicalExpression, m_l1GtUtilsProv),
111  m_logicalExpressionL1Results(m_l1GtUtilsLogicalExpression, m_l1GtUtils) {
112  m_l1GtDaqReadoutRecordToken = consumes<L1GlobalTriggerReadoutRecord>(m_l1GtDaqReadoutRecordInputTag);
113  m_l1GtObjectMapToken = consumes<L1GlobalTriggerObjectMapRecord>(m_l1GtObjectMapTag);
114  m_l1GtObjectMapsToken = consumes<L1GlobalTriggerObjectMaps>(m_l1GtObjectMapsInputTag);
115  m_l1GtTmLToken = consumes<L1GtTriggerMenuLite, edm::InRun>(m_l1GtTmLInputTag);
116  m_condInRunToken = consumes<edm::ConditionsInRunBlock, edm::InRun>(m_condInEdmInputTag);
117  m_condInLumiToken = consumes<edm::ConditionsInLumiBlock, edm::InLumi>(m_condInEdmInputTag);
118  m_condInEventToken = consumes<edm::ConditionsInEventBlock>(m_condInEdmInputTag);
119 
120  LogDebug("L1GtAnalyzer") << "\n Input parameters for L1 GT test analyzer"
121  << "\n L1 GT DAQ product: " << m_l1GtDaqReadoutRecordInputTag
122  << "\n L1GlobalTriggerRecord product: " << m_l1GtRecordInputTag
123  << "\n L1 GT object map collection: " << m_l1GtObjectMapTag
124  << "\n Muon collection from GMT: " << m_l1GmtInputTag
125  << "\n L1 trigger menu lite product: " << m_l1GtTmLInputTag
126  << "\n Algorithm name or alias, technical trigger name: " << m_nameAlgTechTrig
127  << "\n Condition, if an algorithm trigger is requested: " << m_condName
128  << "\n Bit number for an algorithm or technical trigger: " << m_bitNumber
129  << "\n Requested L1 trigger configuration: " << m_l1GtUtilsConfiguration
130  << "\n Retrieve input tag from provenance for L1GtTriggerMenuLite in the L1GtUtils: "
132  << "\n Retrieve input tag from provenance for L1GlobalTriggerReadoutRecord "
133  << "\n and / or L1GlobalTriggerRecord in the L1GtUtils: " << m_l1GtRecordsInputTagProv
134  << "\n Configure L1GtUtils in beginRun(...): " << m_l1GtUtilsConfigureBeginRun << " \n"
135  << std::endl;
136 }
137 
138 // destructor
140  // empty
141 }
142 
143 // method called once each job just before starting event loop
145  // empty
146 }
147 
148 void L1GtAnalyzer::beginRun(const edm::Run& iRun, const edm::EventSetup& evSetup) {
150  analyzeConditionsInRunBlock(iRun, evSetup);
151  }
152 
153  // L1GtUtils
154 
156  // for tests, use only one of the following methods for m_l1GtUtilsConfiguration
157 
158  bool useL1EventSetup = false;
159  bool useL1GtTriggerMenuLite = false;
160 
161  switch (m_l1GtUtilsConfiguration) {
162  case 0: {
163  useL1EventSetup = false;
164  useL1GtTriggerMenuLite = true;
165 
166  } break;
167  case 100000: {
168  useL1EventSetup = true;
169  useL1GtTriggerMenuLite = true;
170 
171  } break;
172  case 200000: {
173  useL1EventSetup = true;
174  useL1GtTriggerMenuLite = false;
175 
176  } break;
177  default: {
178  // do nothing
179  } break;
180  }
181 
183 
185 
186  // check if the parsing of the logical expression was successful
187 
190  } else {
191  // do whatever is necessary if parsing fails - the size of all vectors with L1 results is zero in this case
192  // a LogWarning message is written in L1GtUtils
193  }
194 
195  // if (m_logicalExpressionL1Results.isValid()) {
196  // m_logicalExpressionL1Results.logicalExpressionRunUpdate(iRun,
197  // evSetup);
198  // } else {
199  // // do whatever is necessary if parsing fails - the size of all vectors with L1 results is zero in this case
200  // // a LogWarning message is written in L1GtUtils
201  // }
202 
203  // if the logical expression is changed, one has to check it's validity after the logicalExpressionRunUpdate call
204  // (...dirty testing with the same logical expression)
207  // do whatever is necessary if parsing fails - the size of all vectors with L1 results is zero in this case
208  // a LogWarning message is written in L1GtUtils
209  }
210  }
211 }
212 
215  analyzeConditionsInLumiBlock(iLumi, evSetup);
216  }
217 }
218 
219 // member functions
220 
221 // analyze: decision and decision word
222 // bunch cross in event BxInEvent = 0 - L1Accept event
224  LogDebug("L1GtAnalyzer") << "\n**** L1GtAnalyzer::analyzeDecisionReadoutRecord ****\n" << std::endl;
225 
226  // define an output stream to print into
227  // it can then be directed to whatever log level is desired
228  std::ostringstream myCoutStream;
229 
230  // get L1GlobalTriggerReadoutRecord
232  iEvent.getByToken(m_l1GtDaqReadoutRecordToken, gtReadoutRecord);
233 
234  if (!gtReadoutRecord.isValid()) {
235  LogDebug("L1GtAnalyzer") << "\nL1GlobalTriggerReadoutRecord with \n " << m_l1GtDaqReadoutRecordInputTag
236  << "\nrequested in configuration, but not found in the event."
237  << "\nExit the method.\n"
238  << std::endl;
239 
240  return;
241  }
242 
243  // get Global Trigger decision and the decision word
244  bool gtDecision = gtReadoutRecord->decision();
245  DecisionWord gtDecisionWord = gtReadoutRecord->decisionWord();
246 
247  // print Global Trigger decision and the decision word
248  edm::LogVerbatim("L1GtAnalyzer") << "\n GlobalTrigger decision: " << gtDecision << std::endl;
249 
250  // print via supplied "print" function (
251  gtReadoutRecord->printGtDecision(myCoutStream);
252 
253  // print technical trigger word via supplied "print" function
254  gtReadoutRecord->printTechnicalTrigger(myCoutStream);
255 
256  printOutput(myCoutStream);
257 }
258 
260  // define an output stream to print into
261  // it can then be directed to whatever log level is desired
262  std::ostringstream myCoutStream;
263 
264  // example to access L1 trigger results using public methods from L1GtUtils
265  // methods must be called after retrieving the L1 configuration
266 
267  // testing which environment is used
268 
269  int iErrorCode = -1;
270  int l1ConfCode = -1;
271 
272  const bool l1Conf = m_l1GtUtils.availableL1Configuration(iErrorCode, l1ConfCode);
273 
274  myCoutStream << "\nL1 configuration code: \n"
275  << "\n Legend: "
276  << "\n 0 - Retrieve L1 trigger configuration from L1GtTriggerMenuLite only"
277  << "\n 10000 L1GtTriggerMenuLite product is valid"
278  << "\n 99999 L1GtTriggerMenuLite product not valid. Error."
279  << "\n"
280  << "\n 100000 - Fall through: try first L1GtTriggerMenuLite; if not valid,try event setup."
281  << "\n 110000 L1GtTriggerMenuLite product is valid"
282  << "\n 120000 L1GtTriggerMenuLite product not valid, event setup valid."
283  << "\n 199999 L1GtTriggerMenuLite product not valid, event setup not valid. Error."
284  << "\n"
285  << "\n 200000 - Retrieve L1 trigger configuration from event setup only."
286  << "\n 210000 Event setup valid."
287  << "\n 299999 Event setup not valid. Error."
288  << "\n"
289  << "\n 300000 - No L1 trigger configuration requested to be retrieved. Error"
290  << "\n Must call before using L1GtUtils methods: "
291  << "\n getL1GtRunCache(const edm::Event& iEvent, const edm::EventSetup& evSetup,"
292  << "\n const bool useL1EventSetup, const bool useL1GtTriggerMenuLite)"
293  << "\n"
294  << std::endl;
295 
296  if (l1Conf) {
297  myCoutStream << "\nL1 configuration code:" << l1ConfCode << "\nValid L1 trigger configuration." << std::endl;
298 
299  myCoutStream << "\nL1 trigger menu name and implementation:"
300  << "\n"
301  << m_l1GtUtils.l1TriggerMenu() << "\n"
302  << m_l1GtUtils.l1TriggerMenuImplementation() << std::endl;
303 
304  } else {
305  myCoutStream << "\nL1 configuration code:" << l1ConfCode << "\nNo valid L1 trigger configuration available."
306  << "\nSee text above for error code interpretation"
307  << "\nNo return here, in order to test each method, protected against configuration error."
308  << std::endl;
309  }
310 
311  myCoutStream << "\n******** Results found with input tags retrieved from provenance ******** \n" << std::endl;
312 
313  //
314  // no input tags; for the appropriate EDM product, it will be found
315  // from provenance
316 
317  // the following methods share the same error code, therefore one can check only once
318  // the validity of the result
319 
320  iErrorCode = -1;
321 
322  bool decisionBeforeMaskAlgTechTrig = m_l1GtUtilsProv.decisionBeforeMask(iEvent, m_nameAlgTechTrig, iErrorCode);
323 
324  bool decisionAfterMaskAlgTechTrig = m_l1GtUtilsProv.decisionAfterMask(iEvent, m_nameAlgTechTrig, iErrorCode);
325 
326  bool decisionAlgTechTrig = m_l1GtUtilsProv.decision(iEvent, m_nameAlgTechTrig, iErrorCode);
327 
328  int prescaleFactorAlgTechTrig = m_l1GtUtilsProv.prescaleFactor(iEvent, m_nameAlgTechTrig, iErrorCode);
329 
330  int triggerMaskAlgTechTrig = m_l1GtUtilsProv.triggerMask(iEvent, m_nameAlgTechTrig, iErrorCode);
331 
332  myCoutStream << "\n\nMethods:"
333  << "\n decisionBeforeMask(iEvent, m_nameAlgTechTrig, iErrorCode)"
334  << "\n decisionAfterMask(iEvent, m_nameAlgTechTrig, iErrorCode)"
335  << "\n decision(iEvent, m_nameAlgTechTrig, iErrorCode)"
336  << "\n prescaleFactor(iEvent, m_nameAlgTechTrig, iErrorCode)"
337  << "\n triggerMask(iEvent, m_nameAlgTechTrig, iErrorCode)"
338  << "\n triggerMask(m_nameAlgTechTrig,iErrorCode)"
339  << "\n\n"
340  << std::endl;
341 
342  if (iErrorCode == 0) {
343  myCoutStream << "\nDecision before trigger mask for " << m_nameAlgTechTrig << ": "
344  << decisionBeforeMaskAlgTechTrig << std::endl;
345  myCoutStream << "Decision after trigger mask for " << m_nameAlgTechTrig << ": " << decisionAfterMaskAlgTechTrig
346  << std::endl;
347  myCoutStream << "Decision (after trigger mask) for " << m_nameAlgTechTrig << ": " << decisionAlgTechTrig
348  << std::endl;
349 
350  myCoutStream << "Prescale factor for " << m_nameAlgTechTrig << ": " << prescaleFactorAlgTechTrig
351  << std::endl;
352 
353  myCoutStream << "Trigger mask for " << m_nameAlgTechTrig << ": " << triggerMaskAlgTechTrig
354  << std::endl;
355 
356  } else if (iErrorCode == 1) {
357  myCoutStream << "\n"
358  << m_nameAlgTechTrig << " does not exist in the L1 menu " << m_l1GtUtilsProv.l1TriggerMenu() << "\n"
359  << std::endl;
360 
361  } else {
362  myCoutStream << "\nError: "
363  << "\n An error was encountered when retrieving decision, mask and prescale factor for "
364  << m_nameAlgTechTrig << "\n L1 Menu: " << m_l1GtUtilsProv.l1TriggerMenu()
365  << "\n Error code: " << iErrorCode << std::endl;
366  }
367 
368  // another method to get the trigger mask (no common errorCode)
369 
370  iErrorCode = -1;
371  triggerMaskAlgTechTrig = m_l1GtUtilsProv.triggerMask(m_nameAlgTechTrig, iErrorCode);
372 
373  if (iErrorCode == 0) {
374  myCoutStream << "\nTrigger mask for " << m_nameAlgTechTrig << "(faster method): " << triggerMaskAlgTechTrig
375  << std::endl;
376 
377  } else if (iErrorCode == 1) {
378  myCoutStream << "\n"
379  << m_nameAlgTechTrig << " does not exist in the L1 menu " << m_l1GtUtilsProv.l1TriggerMenu() << "\n"
380  << std::endl;
381 
382  } else {
383  myCoutStream << "\nError: "
384  << "\n An error was encountered when fast retrieving trigger mask for " << m_nameAlgTechTrig
385  << "\n L1 Menu: " << m_l1GtUtilsProv.l1TriggerMenu() << "\n Error code: " << iErrorCode << std::endl;
386  }
387 
388  // index of the actual prescale factor set, and the actual prescale
389  // factor set for algorithm triggers
390 
392 
393  myCoutStream << "\nMethods:"
394  << "\n prescaleFactorSetIndex(iEvent, trigCategory, iErrorCode)"
395  << "\n prescaleFactorSet(iEvent, trigCategory,iErrorCode)\n"
396  << std::endl;
397 
398  iErrorCode = -1;
399  const int pfSetIndexAlgorithmTrigger = m_l1GtUtilsProv.prescaleFactorSetIndex(iEvent, trigCategory, iErrorCode);
400 
401  if (iErrorCode == 0) {
402  myCoutStream << "\nAlgorithm triggers: index for prescale factor set = " << pfSetIndexAlgorithmTrigger
403  << "\nfor run " << iEvent.run() << ", luminosity block " << iEvent.luminosityBlock()
404  << ", with L1 menu \n " << m_l1GtUtilsProv.l1TriggerMenu() << std::endl;
405 
406  } else {
407  myCoutStream << "\nError encountered when retrieving the prescale factor set index"
408  << "\n for algorithm triggers, for run " << iEvent.run() << ", luminosity block "
409  << iEvent.luminosityBlock() << " with L1 menu \n " << m_l1GtUtilsProv.l1TriggerMenu()
410  << "\n Error code: " << iErrorCode << "\n"
411  << std::endl;
412  }
413 
414  iErrorCode = -1;
415  const std::vector<int>& pfSetAlgorithmTrigger = m_l1GtUtilsProv.prescaleFactorSet(iEvent, trigCategory, iErrorCode);
416 
417  if (iErrorCode == 0) {
418  myCoutStream << "\nAlgorithm triggers: prescale factor set index = " << pfSetIndexAlgorithmTrigger << "\nfor run "
419  << iEvent.run() << ", luminosity block " << iEvent.luminosityBlock() << ", with L1 menu \n "
420  << m_l1GtUtilsProv.l1TriggerMenu() << std::endl;
421 
422  int iBit = -1;
423  for (std::vector<int>::const_iterator cItBit = pfSetAlgorithmTrigger.begin(); cItBit != pfSetAlgorithmTrigger.end();
424  ++cItBit) {
425  iBit++;
426  myCoutStream << "Bit number " << std::right << std::setw(4) << iBit << ": prescale factor = " << (*cItBit)
427  << std::endl;
428  }
429 
430  } else {
431  myCoutStream << "\nError encountered when retrieving the prescale factor set "
432  << "\n for algorithm triggers, for run " << iEvent.run() << ", luminosity block "
433  << iEvent.luminosityBlock() << " with L1 menu \n " << m_l1GtUtilsProv.l1TriggerMenu()
434  << "\n Error code: " << iErrorCode << "\n"
435  << std::endl;
436  }
437 
438  // the actual trigger mask set for algorithm triggers
439 
440  myCoutStream << "\nMethod:"
441  << "\n triggerMaskSet(trigCategory, iErrorCode)" << std::endl;
442 
443  iErrorCode = -1;
444  const std::vector<unsigned int>& tmSetAlgorithmTrigger = m_l1GtUtilsProv.triggerMaskSet(trigCategory, iErrorCode);
445 
446  if (iErrorCode == 0) {
447  myCoutStream << "\nAlgorithm triggers: trigger mask set for run " << iEvent.run() << ", luminosity block "
448  << iEvent.luminosityBlock() << ", with L1 menu \n " << m_l1GtUtilsProv.l1TriggerMenu() << "\n"
449  << std::endl;
450 
451  int iBit = -1;
452  for (std::vector<unsigned int>::const_iterator cItBit = tmSetAlgorithmTrigger.begin();
453  cItBit != tmSetAlgorithmTrigger.end();
454  ++cItBit) {
455  iBit++;
456  myCoutStream << "Bit number " << std::right << std::setw(4) << iBit << ": trigger mask = " << (*cItBit)
457  << std::endl;
458  }
459 
460  } else {
461  myCoutStream << "\nError encountered when retrieving the trigger mask set "
462  << "\n for algorithm triggers, for run " << iEvent.run() << ", luminosity block "
463  << iEvent.luminosityBlock() << " with L1 menu \n " << m_l1GtUtilsProv.l1TriggerMenu()
464  << "\n Error code: " << iErrorCode << "\n"
465  << std::endl;
466  }
467 
468  // index of the actual prescale factor set, and the actual prescale
469  // factor set for technical triggers
470 
471  trigCategory = L1GtUtils::TechnicalTrigger;
472 
473  myCoutStream << "\nMethods:"
474  << "\n prescaleFactorSetIndex(iEvent, trigCategory, iErrorCode)"
475  << "\n prescaleFactorSet(iEvent, trigCategory,iErrorCode)\n"
476  << std::endl;
477 
478  iErrorCode = -1;
479  const int pfSetIndexTechnicalTrigger = m_l1GtUtilsProv.prescaleFactorSetIndex(iEvent, trigCategory, iErrorCode);
480 
481  if (iErrorCode == 0) {
482  myCoutStream << "\nTechnical triggers: index for prescale factor set = " << pfSetIndexTechnicalTrigger
483  << "\nfor run " << iEvent.run() << ", luminosity block " << iEvent.luminosityBlock()
484  << ", with L1 menu \n " << m_l1GtUtilsProv.l1TriggerMenu()
485  << "\nMethod: prescaleFactorSetIndex(iEvent, trigCategory, iErrorCode)\n"
486  << std::endl;
487 
488  } else {
489  myCoutStream << "\nError encountered when retrieving the prescale factor set index"
490  << "\n for technical triggers, for run " << iEvent.run() << ", luminosity block "
491  << iEvent.luminosityBlock() << " with L1 menu \n " << m_l1GtUtilsProv.l1TriggerMenu()
492  << "\n Error code: " << iErrorCode << "\n"
493  << std::endl;
494  }
495 
496  iErrorCode = -1;
497  const std::vector<int>& pfSetTechnicalTrigger = m_l1GtUtilsProv.prescaleFactorSet(iEvent, trigCategory, iErrorCode);
498 
499  if (iErrorCode == 0) {
500  myCoutStream << "\nTechnical triggers: prescale factor set index = " << pfSetIndexTechnicalTrigger << "\nfor run "
501  << iEvent.run() << ", luminosity block " << iEvent.luminosityBlock() << ", with L1 menu \n "
502  << m_l1GtUtilsProv.l1TriggerMenu() << "\nMethod: prescaleFactorSet(iEvent, trigCategory,iErrorCode)\n"
503  << std::endl;
504 
505  int iBit = -1;
506  for (std::vector<int>::const_iterator cItBit = pfSetTechnicalTrigger.begin(); cItBit != pfSetTechnicalTrigger.end();
507  ++cItBit) {
508  iBit++;
509  myCoutStream << "Bit number " << std::right << std::setw(4) << iBit << ": prescale factor = " << (*cItBit)
510  << std::endl;
511  }
512 
513  } else {
514  myCoutStream << "\nError encountered when retrieving the prescale factor set "
515  << "\n for technical triggers, for run " << iEvent.run() << ", luminosity block "
516  << iEvent.luminosityBlock() << " with L1 menu \n " << m_l1GtUtilsProv.l1TriggerMenu()
517  << "\n Error code: " << iErrorCode << "\n"
518  << std::endl;
519  }
520 
521  // the actual trigger mask set for technical triggers
522 
523  myCoutStream << "\nMethod:"
524  << "\n triggerMaskSet(trigCategory, iErrorCode)" << std::endl;
525 
526  iErrorCode = -1;
527  const std::vector<unsigned int>& tmSetTechnicalTrigger = m_l1GtUtilsProv.triggerMaskSet(trigCategory, iErrorCode);
528 
529  if (iErrorCode == 0) {
530  myCoutStream << "\nTechnical triggers: trigger mask set for run " << iEvent.run() << ", luminosity block "
531  << iEvent.luminosityBlock() << ", with L1 menu \n " << m_l1GtUtilsProv.l1TriggerMenu() << "\n"
532  << std::endl;
533 
534  int iBit = -1;
535  for (std::vector<unsigned int>::const_iterator cItBit = tmSetTechnicalTrigger.begin();
536  cItBit != tmSetTechnicalTrigger.end();
537  ++cItBit) {
538  iBit++;
539  myCoutStream << "Bit number " << std::right << std::setw(4) << iBit << ": trigger mask = " << (*cItBit)
540  << std::endl;
541  }
542 
543  } else {
544  myCoutStream << "\nError encountered when retrieving the trigger mask set "
545  << "\n for technical triggers, for run " << iEvent.run() << ", luminosity block "
546  << iEvent.luminosityBlock() << " with L1 menu \n " << m_l1GtUtilsProv.l1TriggerMenu()
547  << "\n Error code: " << iErrorCode << "\n"
548  << std::endl;
549  }
550 
551  // results for logical expressions
552 
553  // errorCodes must be called before any other method is used
554  const std::vector<std::pair<std::string, int> >& errorCodesProv = m_logicalExpressionL1ResultsProv.errorCodes(iEvent);
555 
556  const std::vector<L1GtLogicParser::OperandToken>& expL1TriggersProv =
558 
559  const std::vector<std::pair<std::string, bool> >& decisionsBeforeMaskProv =
561  const std::vector<std::pair<std::string, bool> >& decisionsAfterMaskProv =
563  const std::vector<std::pair<std::string, int> >& prescaleFactorsProv =
565  const std::vector<std::pair<std::string, int> >& triggerMasksProv = m_logicalExpressionL1ResultsProv.triggerMasks();
566 
567  myCoutStream << std::endl;
568  myCoutStream << "\nLogical expression\n " << m_l1GtUtilsLogicalExpression << std::endl;
569 
570  for (size_t iTrig = 0; iTrig < errorCodesProv.size(); ++iTrig) {
571  if ((errorCodesProv[iTrig]).second != 0) {
572  myCoutStream << "\nError encountered when retrieving L1 results for trigger " << (errorCodesProv[iTrig]).first
573  << " (bit number " << (expL1TriggersProv[iTrig]).tokenNumber << ")\n for run " << iEvent.run()
574  << ", luminosity block " << iEvent.luminosityBlock() << " with L1 menu \n "
575  << m_l1GtUtilsProv.l1TriggerMenu() << "\n Error code: " << (errorCodesProv[iTrig]).second << "\n"
576  << std::endl;
577 
578  } else {
579  myCoutStream << "\n"
580  << (errorCodesProv[iTrig]).first << " - bit number " << (expL1TriggersProv[iTrig]).tokenNumber
581  << std::endl;
582 
583  myCoutStream << " decision before mask = " << (decisionsBeforeMaskProv[iTrig]).second << std::endl;
584 
585  myCoutStream << " decision after mask = " << (decisionsAfterMaskProv[iTrig]).second << std::endl;
586 
587  myCoutStream << " prescale factor = " << (prescaleFactorsProv[iTrig]).second << std::endl;
588 
589  myCoutStream << " trigger mask = " << (triggerMasksProv[iTrig]).second << std::endl;
590 
591  myCoutStream << " error code = " << (errorCodesProv[iTrig]).second << std::endl;
592  }
593  }
594 
595  //
596  // same methods as above, but with input tag given explicitly, allowing to select
597  // the EDM products used to get the results
598 
599  myCoutStream << "\n******** Results found with input tags provided in the configuration file ******** \n"
600  << "\n L1GlobalTriggerRecord: " << m_l1GtRecordInputTag
601  << "\n L1GlobalTriggerReadoutRecord: " << m_l1GtDaqReadoutRecordInputTag << std::endl;
602 
603  // the following methods share the same error code, therefore one can check only once
604  // the validity of the result
605 
606  iErrorCode = -1;
607 
608  bool decisionBeforeMaskAlgTechTrigITag = m_l1GtUtils.decisionBeforeMask(iEvent, m_nameAlgTechTrig, iErrorCode);
609 
610  bool decisionAfterMaskAlgTechTrigITag = m_l1GtUtils.decisionAfterMask(iEvent, m_nameAlgTechTrig, iErrorCode);
611 
612  bool decisionAlgTechTrigITag = m_l1GtUtils.decision(iEvent, m_nameAlgTechTrig, iErrorCode);
613 
614  int prescaleFactorAlgTechTrigITag = m_l1GtUtils.prescaleFactor(iEvent, m_nameAlgTechTrig, iErrorCode);
615 
616  int triggerMaskAlgTechTrigITag = m_l1GtUtils.triggerMask(iEvent, m_nameAlgTechTrig, iErrorCode);
617 
618  myCoutStream
619  << "\n\nMethods:"
620  << "\n decisionBeforeMask(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, m_nameAlgTechTrig, "
621  "iErrorCode)"
622  << "\n decisionAfterMask(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, m_nameAlgTechTrig, "
623  "iErrorCode)"
624  << "\n decision(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, m_nameAlgTechTrig, iErrorCode)"
625  << "\n prescaleFactor(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, m_nameAlgTechTrig, "
626  "iErrorCode)"
627  << "\n triggerMask(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, m_nameAlgTechTrig, iErrorCode)"
628  << "\n\n"
629  << std::endl;
630 
631  if (iErrorCode == 0) {
632  myCoutStream << "\nDecision before trigger mask for " << m_nameAlgTechTrig << ": "
633  << decisionBeforeMaskAlgTechTrigITag << std::endl;
634  myCoutStream << "Decision after trigger mask for " << m_nameAlgTechTrig << ": "
635  << decisionAfterMaskAlgTechTrigITag << std::endl;
636  myCoutStream << "Decision (after trigger mask) for " << m_nameAlgTechTrig << ": " << decisionAlgTechTrigITag
637  << std::endl;
638 
639  myCoutStream << "Prescale factor for " << m_nameAlgTechTrig << ": " << prescaleFactorAlgTechTrigITag
640  << std::endl;
641 
642  myCoutStream << "Trigger mask for " << m_nameAlgTechTrig << ": " << triggerMaskAlgTechTrigITag
643  << std::endl;
644 
645  } else if (iErrorCode == 1) {
646  myCoutStream << "\n"
647  << m_nameAlgTechTrig << " does not exist in the L1 menu " << m_l1GtUtils.l1TriggerMenu() << "\n"
648  << std::endl;
649 
650  } else {
651  myCoutStream << "\nError: "
652  << "\n An error was encountered when retrieving decision, mask and prescale factor for "
653  << m_nameAlgTechTrig << "\n L1 Menu: " << m_l1GtUtils.l1TriggerMenu()
654  << "\n Error code: " << iErrorCode << std::endl;
655  }
656 
657  // index of the actual prescale factor set, and the actual prescale
658  // factor set for algorithm triggers
659 
660  trigCategory = L1GtUtils::AlgorithmTrigger;
661 
662  myCoutStream << "\nMethods:"
663  << "\n prescaleFactorSetIndex(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, "
664  "trigCategory, iErrorCode)"
665  << "\n prescaleFactorSet(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, "
666  "trigCategory,iErrorCode)\n"
667  << std::endl;
668 
669  iErrorCode = -1;
670  const int pfSetIndexAlgorithmTriggerITag = m_l1GtUtils.prescaleFactorSetIndex(iEvent, trigCategory, iErrorCode);
671 
672  if (iErrorCode == 0) {
673  myCoutStream << "\nAlgorithm triggers: index for prescale factor set = " << pfSetIndexAlgorithmTriggerITag
674  << "\nfor run " << iEvent.run() << ", luminosity block " << iEvent.luminosityBlock()
675  << ", with L1 menu \n " << m_l1GtUtils.l1TriggerMenu() << std::endl;
676 
677  } else {
678  myCoutStream << "\nError encountered when retrieving the prescale factor set index"
679  << "\n for algorithm triggers, for run " << iEvent.run() << ", luminosity block "
680  << iEvent.luminosityBlock() << " with L1 menu \n " << m_l1GtUtils.l1TriggerMenu()
681  << "\n Error code: " << iErrorCode << "\n"
682  << std::endl;
683  }
684 
685  iErrorCode = -1;
686  const std::vector<int>& pfSetAlgorithmTriggerITag = m_l1GtUtils.prescaleFactorSet(iEvent, trigCategory, iErrorCode);
687 
688  if (iErrorCode == 0) {
689  myCoutStream << "\nAlgorithm triggers: prescale factor set index = " << pfSetIndexAlgorithmTriggerITag
690  << "\nfor run " << iEvent.run() << ", luminosity block " << iEvent.luminosityBlock()
691  << ", with L1 menu \n " << m_l1GtUtils.l1TriggerMenu() << std::endl;
692 
693  int iBit = -1;
694  for (std::vector<int>::const_iterator cItBit = pfSetAlgorithmTriggerITag.begin();
695  cItBit != pfSetAlgorithmTriggerITag.end();
696  ++cItBit) {
697  iBit++;
698  myCoutStream << "Bit number " << std::right << std::setw(4) << iBit << ": prescale factor = " << (*cItBit)
699  << std::endl;
700  }
701 
702  } else {
703  myCoutStream << "\nError encountered when retrieving the prescale factor set "
704  << "\n for algorithm triggers, for run " << iEvent.run() << ", luminosity block "
705  << iEvent.luminosityBlock() << " with L1 menu \n " << m_l1GtUtils.l1TriggerMenu()
706  << "\n Error code: " << iErrorCode << "\n"
707  << std::endl;
708  }
709 
710  // index of the actual prescale factor set, and the actual prescale
711  // factor set for technical triggers
712 
713  trigCategory = L1GtUtils::TechnicalTrigger;
714 
715  myCoutStream << "\nMethods:"
716  << "\n prescaleFactorSetIndex(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, "
717  "trigCategory, iErrorCode)"
718  << "\n prescaleFactorSet(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, "
719  "trigCategory,iErrorCode)\n"
720  << std::endl;
721 
722  iErrorCode = -1;
723  const int pfSetIndexTechnicalTriggerITag = m_l1GtUtils.prescaleFactorSetIndex(iEvent, trigCategory, iErrorCode);
724 
725  if (iErrorCode == 0) {
726  myCoutStream << "\nTechnical triggers: index for prescale factor set = " << pfSetIndexTechnicalTriggerITag
727  << "\nfor run " << iEvent.run() << ", luminosity block " << iEvent.luminosityBlock()
728  << ", with L1 menu \n " << m_l1GtUtils.l1TriggerMenu() << std::endl;
729 
730  } else {
731  myCoutStream << "\nError encountered when retrieving the prescale factor set index"
732  << "\n for technical triggers, for run " << iEvent.run() << ", luminosity block "
733  << iEvent.luminosityBlock() << " with L1 menu \n " << m_l1GtUtils.l1TriggerMenu()
734  << "\n Error code: " << iErrorCode << "\n"
735  << std::endl;
736  }
737 
738  iErrorCode = -1;
739  const std::vector<int>& pfSetTechnicalTriggerITag = m_l1GtUtils.prescaleFactorSet(iEvent, trigCategory, iErrorCode);
740 
741  if (iErrorCode == 0) {
742  myCoutStream << "\nTechnical triggers: prescale factor set index = " << pfSetIndexTechnicalTriggerITag
743  << "\nfor run " << iEvent.run() << ", luminosity block " << iEvent.luminosityBlock()
744  << ", with L1 menu \n " << m_l1GtUtils.l1TriggerMenu() << std::endl;
745 
746  int iBit = -1;
747  for (std::vector<int>::const_iterator cItBit = pfSetTechnicalTriggerITag.begin();
748  cItBit != pfSetTechnicalTriggerITag.end();
749  ++cItBit) {
750  iBit++;
751  myCoutStream << "Bit number " << std::right << std::setw(4) << iBit << ": prescale factor = " << (*cItBit)
752  << std::endl;
753  }
754 
755  } else {
756  myCoutStream << "\nError encountered when retrieving the prescale factor set "
757  << "\n for technical triggers, for run " << iEvent.run() << ", luminosity block "
758  << iEvent.luminosityBlock() << " with L1 menu \n " << m_l1GtUtils.l1TriggerMenu()
759  << "\n Error code: " << iErrorCode << "\n"
760  << std::endl;
761  }
762 
763  // results for logical expressions
764 
765  // errorCodes must be called before any other method is used
766  const std::vector<std::pair<std::string, int> >& errorCodes = m_logicalExpressionL1Results.errorCodes(iEvent);
767 
768  const std::vector<L1GtLogicParser::OperandToken>& expL1Triggers = m_logicalExpressionL1Results.expL1Triggers();
769 
770  const std::vector<std::pair<std::string, bool> >& decisionsBeforeMask =
772  const std::vector<std::pair<std::string, bool> >& decisionsAfterMask =
774  const std::vector<std::pair<std::string, int> >& prescaleFactors = m_logicalExpressionL1Results.prescaleFactors();
775  const std::vector<std::pair<std::string, int> >& triggerMasks = m_logicalExpressionL1Results.triggerMasks();
776 
777  myCoutStream << std::endl;
778  myCoutStream << "\nLogical expression\n " << m_l1GtUtilsLogicalExpression << std::endl;
779 
780  for (size_t iTrig = 0; iTrig < errorCodes.size(); ++iTrig) {
781  if ((errorCodes[iTrig]).second != 0) {
782  myCoutStream << "\nError encountered when retrieving L1 results for trigger " << (errorCodes[iTrig]).first
783  << " (bit number " << (expL1Triggers[iTrig]).tokenNumber << ")\n for run " << iEvent.run()
784  << ", luminosity block " << iEvent.luminosityBlock() << " with L1 menu \n "
785  << m_l1GtUtils.l1TriggerMenu() << "\n Error code: " << (errorCodes[iTrig]).second << "\n"
786  << std::endl;
787 
788  } else {
789  myCoutStream << "\n"
790  << (errorCodes[iTrig]).first << " - bit number " << (expL1Triggers[iTrig]).tokenNumber << std::endl;
791 
792  myCoutStream << " decision before mask = " << (decisionsBeforeMask[iTrig]).second << std::endl;
793 
794  myCoutStream << " decision after mask = " << (decisionsAfterMask[iTrig]).second << std::endl;
795 
796  myCoutStream << " prescale factor = " << (prescaleFactors[iTrig]).second << std::endl;
797 
798  myCoutStream << " trigger mask = " << (triggerMasks[iTrig]).second << std::endl;
799 
800  myCoutStream << " error code = " << (errorCodes[iTrig]).second << std::endl;
801  }
802  }
803 
804  printOutput(myCoutStream);
805 }
806 
808  LogDebug("L1GtAnalyzer") << "\n**** L1GtAnalyzer::analyzeL1GtUtilsMenuLite ****\n" << std::endl;
809 
810  // before accessing any result from L1GtUtils, one must retrieve and cache
811  // the L1GtTriggerMenuLite product
812  // add this call in the analyze / produce / filter method of your
813  // analyzer / producer / filter
814 
815  bool useL1EventSetup = false;
816  bool useL1GtTriggerMenuLite = true;
817 
819 
821 
822  analyzeL1GtUtilsCore(iEvent, evSetup);
823 }
824 
826  LogDebug("L1GtAnalyzer") << "\n**** L1GtAnalyzer::analyzeL1GtUtilsEventSetup ****\n" << std::endl;
827 
828  // before accessing any result from L1GtUtils, one must retrieve and cache
829  // the L1 trigger event setup
830  // add this call in the analyze / produce / filter method of your
831  // analyzer / producer / filter
832 
833  bool useL1EventSetup = true;
834  bool useL1GtTriggerMenuLite = false;
835 
837 
839 
840  analyzeL1GtUtilsCore(iEvent, evSetup);
841 }
842 
844  LogDebug("L1GtAnalyzer") << "\n**** L1GtAnalyzer::analyzeL1GtUtils: fall-through case ****\n" << std::endl;
845 
846  // before accessing any result from L1GtUtils, one must retrieve and cache
847  // the L1 trigger event setup and the L1GtTriggerMenuLite product
848  // add this call in the analyze / produce / filter method of your
849  // analyzer / producer / filter
850 
851  bool useL1EventSetup = true;
852  bool useL1GtTriggerMenuLite = true;
853 
855 
857 
858  analyzeL1GtUtilsCore(iEvent, evSetup);
859 }
860 
862  LogDebug("L1GtAnalyzer") << "\n**** L1GtAnalyzer::analyzeTrigger ****\n" << std::endl;
863 
864  // define an output stream to print into
865  // it can then be directed to whatever log level is desired
866  std::ostringstream myCoutStream;
867 
868  // print all the stuff if at LogDebug level
869  myCoutStream << "\n\nFull analysis of an algorithm or technical trigger"
870  << "\nMethod: L1GtAnalyzer::analyzeTrigger"
871  << "\nTrigger: " << m_nameAlgTechTrig << "\n"
872  << std::endl;
873 
874  const unsigned int runNumber = iEvent.run();
875  const unsigned int lsNumber = iEvent.luminosityBlock();
876  const unsigned int eventNumber = iEvent.id().event();
877 
878  myCoutStream << "Run: " << runNumber << " LS: " << lsNumber << " Event: " << eventNumber << "\n\n" << std::endl;
879 
880  // before accessing any result from L1GtUtils, one must retrieve and cache
881  // the L1 trigger event setup and the L1GtTriggerMenuLite product
882  // add this call in the analyze / produce / filter method of your
883  // analyzer / producer / filter
884 
885  bool useL1EventSetup = false;
886  bool useL1GtTriggerMenuLite = false;
887 
888  switch (m_l1GtUtilsConfiguration) {
889  case 0: {
890  useL1EventSetup = false;
891  useL1GtTriggerMenuLite = true;
892 
893  } break;
894  case 100000: {
895  useL1EventSetup = true;
896  useL1GtTriggerMenuLite = true;
897 
898  } break;
899  case 200000: {
900  useL1EventSetup = true;
901  useL1GtTriggerMenuLite = false;
902 
903  } break;
904  default: {
905  // do nothing
906  } break;
907  }
908 
910 
912 
913  // testing which environment is used
914 
915  int iErrorCode = -1;
916  int l1ConfCode = -1;
917 
918  const bool l1Conf = m_l1GtUtils.availableL1Configuration(iErrorCode, l1ConfCode);
919 
920  if (l1Conf) {
921  LogDebug("L1GtAnalyzer") << "\nL1 configuration code:" << l1ConfCode << "\nValid L1 trigger configuration.\n"
922  << std::endl;
923 
924  LogTrace("L1GtAnalyzer") << "\nL1 trigger menu name and implementation:"
925  << "\n"
926  << m_l1GtUtils.l1TriggerMenu() << "\n"
928  << std::endl;
929 
930  } else {
931  myCoutStream << "\nL1 configuration code:" << l1ConfCode << "\nNo valid L1 trigger configuration available."
932  << "\nCheck L1GtUtils wiki page for error code interpretation\n"
933  << std::endl;
934  return;
935  }
936 
937  // the following methods share the same error code, therefore one can check only once
938  // the validity of the result
939 
940  iErrorCode = -1;
941 
942  bool decisionBeforeMaskAlgTechTrig = false;
943  bool decisionAfterMaskAlgTechTrig = false;
944  bool decisionAlgTechTrig = false;
945  int prescaleFactorAlgTechTrig = -1;
946  int triggerMaskAlgTechTrig = -1;
947 
949  decisionBeforeMaskAlgTechTrig = m_l1GtUtilsProv.decisionBeforeMask(iEvent, m_nameAlgTechTrig, iErrorCode);
950 
951  decisionAfterMaskAlgTechTrig = m_l1GtUtilsProv.decisionAfterMask(iEvent, m_nameAlgTechTrig, iErrorCode);
952 
953  decisionAlgTechTrig = m_l1GtUtilsProv.decision(iEvent, m_nameAlgTechTrig, iErrorCode);
954 
955  prescaleFactorAlgTechTrig = m_l1GtUtilsProv.prescaleFactor(iEvent, m_nameAlgTechTrig, iErrorCode);
956 
957  triggerMaskAlgTechTrig = m_l1GtUtilsProv.triggerMask(iEvent, m_nameAlgTechTrig, iErrorCode);
958 
959  } else {
960  decisionBeforeMaskAlgTechTrig = m_l1GtUtils.decisionBeforeMask(iEvent, m_nameAlgTechTrig, iErrorCode);
961 
962  decisionAfterMaskAlgTechTrig = m_l1GtUtils.decisionAfterMask(iEvent, m_nameAlgTechTrig, iErrorCode);
963 
964  decisionAlgTechTrig = m_l1GtUtils.decision(iEvent, m_nameAlgTechTrig, iErrorCode);
965 
966  prescaleFactorAlgTechTrig = m_l1GtUtils.prescaleFactor(iEvent, m_nameAlgTechTrig, iErrorCode);
967 
968  triggerMaskAlgTechTrig = m_l1GtUtils.triggerMask(iEvent, m_nameAlgTechTrig, iErrorCode);
969  }
970 
971  switch (iErrorCode) {
972  case 0: {
973  // do nothing here
974  } break;
975  case 1: {
976  myCoutStream << "\n"
977  << m_nameAlgTechTrig << " does not exist in the L1 menu " << m_l1GtUtils.l1TriggerMenu() << "\n"
978  << std::endl;
979  return;
980  } break;
981  default: {
982  myCoutStream << "\nError: "
983  << "\n An error was encountered when retrieving decision, mask and prescale factor for "
984  << m_nameAlgTechTrig << "\n L1 Menu: " << m_l1GtUtils.l1TriggerMenu()
985  << "\n Error code: " << iErrorCode << "\n Check L1GtUtils wiki page for error code interpretation"
986  << std::endl;
987  } break;
988  }
989 
990  // retrieve L1Extra
991  // for object maps, only BxInEvent = 0 (aka L1A bunch cross) is relevant
992 
994 
995  // print all L1Extra collections from all BxInEvent
996  myCoutStream << "\nL1Extra collections from all BxInEvent" << std::endl;
997  m_retrieveL1Extra.printL1Extra(myCoutStream);
998 
999  int bxInEvent = 0;
1000  myCoutStream << "\nL1Extra collections from BxInEvent = 0 (BX for L1A)" << std::endl;
1001  m_retrieveL1Extra.printL1Extra(myCoutStream, bxInEvent);
1002 
1003  // retrieve L1GlobalTriggerObjectMapRecord and L1GlobalTriggerObjectMaps products
1004  // the module returns an error code only if both payloads are missing
1005 
1006  int iErrorRecord = 0;
1007 
1008  bool validRecord = false;
1009  bool gtObjectMapRecordValid = false;
1010 
1012  iEvent.getByToken(m_l1GtObjectMapsToken, gtObjectMaps);
1013 
1014  if (gtObjectMaps.isValid()) {
1015  validRecord = true;
1016 
1017  } else {
1018  iErrorRecord = 10;
1019  LogDebug("L1GtAnalyzer") << "\nL1GlobalTriggerObjectMaps with \n " << m_l1GtObjectMapsInputTag
1020  << "\nnot found in the event." << std::endl;
1021  }
1022 
1024  iEvent.getByToken(m_l1GtObjectMapToken, gtObjectMapRecord);
1025 
1026  if (gtObjectMapRecord.isValid()) {
1027  gtObjectMapRecordValid = true;
1028  validRecord = true;
1029 
1030  } else {
1031  iErrorRecord = iErrorRecord + 100;
1032  LogDebug("L1GtAnalyzer") << "\nL1GlobalTriggerObjectMapRecord with \n " << m_l1GtObjectMapTag
1033  << "\nnot found in the event." << std::endl;
1034  }
1035 
1036  //FIXME remove when validRecord and gtObjectMapRecordValid are used - avoid warning here :-)
1037  if (validRecord && gtObjectMapRecordValid) {
1038  // do nothing
1039  }
1040 
1041  // get the RPN vector
1042 
1043  // int pfIndexTechTrig = -1;
1044  // int pfIndexAlgoTrig = -1;
1045  //
1046  // if (validRecord) {
1047  // if (gtObjectMapRecordValid) {
1048  //
1049  // pfIndexTechTrig
1050  // = (gtObjectMapRecord->gtFdlWord()).gtPrescaleFactorIndexTech();
1051  // pfIndexAlgoTrig
1052  // = (gtObjectMapRecord->gtFdlWord()).gtPrescaleFactorIndexAlgo();
1053  //
1054  // } else {
1055  //
1056  // pfIndexTechTrig
1057  // = static_cast<int> (gtObjectMaps->gtPrescaleFactorIndexTech());
1058  // pfIndexAlgoTrig
1059  // = static_cast<int> (gtObjectMaps->gtPrescaleFactorIndexAlgo());
1060  //
1061  // }
1062  //
1063  // } else {
1064  //
1065  // LogDebug("L1GtAnalyzer") << "\nError: "
1066  // << "\nNo valid L1GlobalTriggerRecord with \n "
1067  // << l1GtRecordInputTag << "\nfound in the event."
1068  // << "\nNo valid L1GlobalTriggerReadoutRecord with \n "
1069  // << l1GtReadoutRecordInputTag << "\nfound in the event."
1070  // << std::endl;
1071  //
1072  // iError = l1ConfCode + iErrorRecord;
1073  // return;
1074  //
1075  // }
1076 
1077  //
1078  myCoutStream << "\nResults for trigger " << m_nameAlgTechTrig
1079  << "\n Trigger mask: " << triggerMaskAlgTechTrig
1080  << "\n Prescale factor: " << prescaleFactorAlgTechTrig
1081  << "\n Decision before mask: " << decisionBeforeMaskAlgTechTrig
1082  << "\n Decision after mask: " << decisionAfterMaskAlgTechTrig
1083  << "\n Decision (after mask): " << decisionAlgTechTrig << "\n"
1084  << std::endl;
1085 
1086  printOutput(myCoutStream);
1087 }
1088 
1089 // analyze: object map product
1091  LogDebug("L1GtAnalyzer") << "\n**** L1GtAnalyzer::analyzeObjectMap object map product ****\n" << std::endl;
1092 
1093  // define an output stream to print into
1094  // it can then be directed to whatever log level is desired
1095  std::ostringstream myCoutStream;
1096 
1097  // get a handle to the object map product
1098  // the product can come only from emulator - no hardware ObjectMapRecord
1100  iEvent.getByToken(m_l1GtObjectMapToken, gtObjectMapRecord);
1101 
1102  if (!gtObjectMapRecord.isValid()) {
1103  LogDebug("L1GtAnalyzer") << "\nWarning: L1GlobalTriggerObjectMapRecord with input tag " << m_l1GtObjectMapTag
1104  << "\nrequested in configuration, but not found in the event."
1105  << "\nExit the method.\n"
1106  << std::endl;
1107 
1108  return;
1109  }
1110 
1111  // get all object maps
1112  const std::vector<L1GlobalTriggerObjectMap>& objMapVec = gtObjectMapRecord->gtObjectMap();
1113 
1114  // print every object map via the implemented print
1115  for (std::vector<L1GlobalTriggerObjectMap>::const_iterator it = objMapVec.begin(); it != objMapVec.end(); ++it) {
1116  (*it).print(myCoutStream);
1117  }
1118 
1119  //
1121 
1122  // number of combinations
1123  if (comb != nullptr) {
1124  myCoutStream << "\n Number of combinations passing (" << m_nameAlgTechTrig << ", " << m_condName
1125  << "): " << comb->size() << std::endl;
1126  } else {
1127  myCoutStream << "\n No combination passes (" << m_nameAlgTechTrig << ", " << m_condName << ") " << std::endl;
1128  }
1129 
1130  // condition result
1131  const bool result = gtObjectMapRecord->getConditionResult(m_nameAlgTechTrig, m_condName);
1132 
1133  myCoutStream << "\n Result for condition " << m_condName << " in algorithm " << m_nameAlgTechTrig << ": " << result
1134  << std::endl;
1135 
1136  printOutput(myCoutStream);
1137 }
1138 
1139 // analyze: usage of L1GtTriggerMenuLite
1141  LogDebug("L1GtAnalyzer") << "\n**** L1GtAnalyzer::analyzeL1GtTriggerMenuLite ****\n" << std::endl;
1142 
1143  // define an output stream to print into
1144  // it can then be directed to whatever log level is desired
1145  std::ostringstream myCoutStream;
1146 
1147  // get Run Data - the same code can be run in beginRun, with getByLabel from edm::Run
1148  const edm::Run& iRun = iEvent.getRun();
1149 
1150  // get L1GtTriggerMenuLite
1151  edm::Handle<L1GtTriggerMenuLite> triggerMenuLite;
1152  iRun.getByToken(m_l1GtTmLToken, triggerMenuLite);
1153 
1154  if (!triggerMenuLite.isValid()) {
1155  LogDebug("L1GtAnalyzer") << "\nL1GtTriggerMenuLite with \n " << m_l1GtTmLInputTag
1156  << "\nrequested in configuration, but not found in the event."
1157  << "\nExit the method.\n"
1158  << std::endl;
1159 
1160  return;
1161  }
1162 
1163  // print via supplied "print" function
1164  myCoutStream << (*triggerMenuLite);
1165 
1166  // test the individual methods
1167 
1168  const std::string& triggerMenuInterface = triggerMenuLite->gtTriggerMenuInterface();
1169  const std::string& triggerMenuName = triggerMenuLite->gtTriggerMenuName();
1170  const std::string& triggerMenuImplementation = triggerMenuLite->gtTriggerMenuImplementation();
1171  const std::string& scaleDbKey = triggerMenuLite->gtScaleDbKey();
1172 
1173  const L1GtTriggerMenuLite::L1TriggerMap& algorithmMap = triggerMenuLite->gtAlgorithmMap();
1174  const L1GtTriggerMenuLite::L1TriggerMap& algorithmAliasMap = triggerMenuLite->gtAlgorithmAliasMap();
1175  const L1GtTriggerMenuLite::L1TriggerMap& technicalTriggerMap = triggerMenuLite->gtTechnicalTriggerMap();
1176 
1177  const std::vector<unsigned int>& triggerMaskAlgoTrig = triggerMenuLite->gtTriggerMaskAlgoTrig();
1178  const std::vector<unsigned int>& triggerMaskTechTrig = triggerMenuLite->gtTriggerMaskTechTrig();
1179 
1180  const std::vector<std::vector<int> >& prescaleFactorsAlgoTrig = triggerMenuLite->gtPrescaleFactorsAlgoTrig();
1181  const std::vector<std::vector<int> >& prescaleFactorsTechTrig = triggerMenuLite->gtPrescaleFactorsTechTrig();
1182 
1183  // print in the same format as in L1GtTriggerMenuLite definition
1184 
1185  size_t nrDefinedAlgo = algorithmMap.size();
1186  size_t nrDefinedTech = technicalTriggerMap.size();
1187 
1188  // header for printing algorithms
1189 
1190  myCoutStream << "\n ********** L1 Trigger Menu - printing ********** \n"
1191  << "\nL1 Trigger Menu Interface: " << triggerMenuInterface
1192  << "\nL1 Trigger Menu Name: " << triggerMenuName
1193  << "\nL1 Trigger Menu Implementation: " << triggerMenuImplementation
1194  << "\nAssociated Scale DB Key: " << scaleDbKey << "\n\n"
1195  << "\nL1 Physics Algorithms: " << nrDefinedAlgo << " algorithms defined."
1196  << "\n\n"
1197  << "Bit Number " << std::right << std::setw(35) << "Algorithm Name"
1198  << " " << std::right << std::setw(35) << "Algorithm Alias"
1199  << " " << std::right << std::setw(12) << "Trigger Mask";
1200  for (unsigned iSet = 0; iSet < prescaleFactorsAlgoTrig.size(); iSet++) {
1201  myCoutStream << std::right << std::setw(10) << "PF Set " << std::right << std::setw(2) << iSet;
1202  }
1203 
1204  myCoutStream << std::endl;
1205 
1206  for (L1GtTriggerMenuLite::CItL1Trig itTrig = algorithmMap.begin(); itTrig != algorithmMap.end(); itTrig++) {
1207  const unsigned int bitNumber = itTrig->first;
1208  const std::string& aName = itTrig->second;
1209 
1210  std::string aAlias;
1211  L1GtTriggerMenuLite::CItL1Trig itAlias = algorithmAliasMap.find(bitNumber);
1212  if (itAlias != algorithmAliasMap.end()) {
1213  aAlias = itAlias->second;
1214  }
1215 
1216  myCoutStream << std::setw(6) << bitNumber << " " << std::right << std::setw(35) << aName << " " << std::right
1217  << std::setw(35) << aAlias << " " << std::right << std::setw(12) << triggerMaskAlgoTrig[bitNumber];
1218  for (unsigned iSet = 0; iSet < prescaleFactorsAlgoTrig.size(); iSet++) {
1219  myCoutStream << std::right << std::setw(12) << prescaleFactorsAlgoTrig[iSet][bitNumber];
1220  }
1221 
1222  myCoutStream << std::endl;
1223  }
1224 
1225  myCoutStream << "\nL1 Technical Triggers: " << nrDefinedTech << " technical triggers defined."
1226  << "\n\n"
1227  << std::endl;
1228  if (nrDefinedTech) {
1229  myCoutStream << std::right << std::setw(6) << "Bit Number " << std::right << std::setw(45)
1230  << " Technical trigger name "
1231  << " " << std::right << std::setw(12) << "Trigger Mask";
1232  for (unsigned iSet = 0; iSet < prescaleFactorsTechTrig.size(); iSet++) {
1233  myCoutStream << std::right << std::setw(10) << "PF Set " << std::right << std::setw(2) << iSet;
1234  }
1235 
1236  myCoutStream << std::endl;
1237  }
1238 
1239  for (L1GtTriggerMenuLite::CItL1Trig itTrig = technicalTriggerMap.begin(); itTrig != technicalTriggerMap.end();
1240  itTrig++) {
1241  unsigned int bitNumber = itTrig->first;
1242  std::string aName = itTrig->second;
1243 
1244  myCoutStream << std::setw(6) << bitNumber << " " << std::right << std::setw(45) << aName << std::right
1245  << std::setw(12) << triggerMaskTechTrig[bitNumber];
1246  for (unsigned iSet = 0; iSet < prescaleFactorsTechTrig.size(); iSet++) {
1247  myCoutStream << std::right << std::setw(12) << prescaleFactorsTechTrig[iSet][bitNumber];
1248  }
1249 
1250  myCoutStream << std::endl;
1251  }
1252 
1253  // individual methods
1254 
1255  int errorCode = -1;
1256  const std::string* algorithmAlias = triggerMenuLite->gtAlgorithmAlias(m_bitNumber, errorCode);
1257  if (errorCode) {
1258  myCoutStream << "\nError code retrieving alias for algorithm with bit number " << m_bitNumber << ": " << errorCode
1259  << std::endl;
1260  } else {
1261  myCoutStream << "\nAlias for algorithm with bit number " << m_bitNumber << ": " << (*algorithmAlias) << std::endl;
1262  }
1263 
1264  errorCode = -1;
1265  const std::string* algorithmName = triggerMenuLite->gtAlgorithmName(m_bitNumber, errorCode);
1266  if (errorCode) {
1267  myCoutStream << "\nError code retrieving name for algorithm with bit number " << m_bitNumber << ": " << errorCode
1268  << std::endl;
1269  } else {
1270  myCoutStream << "\nName for algorithm with bit number " << m_bitNumber << ": " << (*algorithmName) << std::endl;
1271  }
1272 
1273  errorCode = -1;
1274  const std::string* techTrigName = triggerMenuLite->gtTechTrigName(m_bitNumber, errorCode);
1275  if (errorCode) {
1276  myCoutStream << "\nError code retrieving name for technical trigger with bit number " << m_bitNumber << ": "
1277  << errorCode << std::endl;
1278  } else {
1279  myCoutStream << "\nName for technical trigger with bit number " << m_bitNumber << ": " << (*techTrigName)
1280  << std::endl;
1281  }
1282 
1283  errorCode = -1;
1284  const unsigned int bitNumber = triggerMenuLite->gtBitNumber(m_nameAlgTechTrig, errorCode);
1285  if (errorCode) {
1286  myCoutStream << "\nError code retrieving bit number for algorithm/technical trigger " << m_nameAlgTechTrig << ": "
1287  << errorCode << std::endl;
1288  } else {
1289  myCoutStream << "\nBit number for algorithm/technical trigger " << m_nameAlgTechTrig << ": " << bitNumber
1290  << std::endl;
1291  }
1292 
1293  // not tested
1294  //errorCode = -1;
1295  //const bool triggerMenuLite->gtTriggerResult( m_nameAlgTechTrig,
1296  // const std::vector<bool>& decWord, errorCode);
1297 
1298  printOutput(myCoutStream);
1299 }
1300 
1301 // analyze: usage of ConditionsInEdm
1303  LogDebug("L1GtAnalyzer") << "\n**** L1GtAnalyzer::analyzeConditionsInRunBlock ****\n" << std::endl;
1304 
1305  // define an output stream to print into
1306  // it can then be directed to whatever log level is desired
1307  std::ostringstream myCoutStream;
1308 
1309  // get ConditionsInRunBlock
1311  iRun.getByToken(m_condInRunToken, condInRunBlock);
1312 
1313  if (!condInRunBlock.isValid()) {
1314  LogDebug("L1GtAnalyzer") << "\nConditionsInRunBlock with \n " << m_condInEdmInputTag
1315  << "\nrequested in configuration, but not found in the event."
1316  << "\nExit the method.\n"
1317  << std::endl;
1318 
1319  return;
1320  }
1321 
1322  const uint16_t beamModeVal = condInRunBlock->beamMode;
1323  const uint16_t beamMomentumVal = condInRunBlock->beamMomentum;
1324  const uint32_t lhcFillNumberVal = condInRunBlock->lhcFillNumber;
1325 
1326  // print via supplied "print" function
1327  myCoutStream << "\nLHC quantities in run " << iRun.run() << "\n Beam Mode = " << beamModeVal
1328  << "\n Beam Momentum = " << beamMomentumVal << " GeV"
1329  << "\n LHC Fill Number = " << lhcFillNumberVal << std::endl;
1330 
1331  printOutput(myCoutStream);
1332 }
1333 
1335  LogDebug("L1GtAnalyzer") << "\n**** L1GtAnalyzer::analyzeConditionsInLumiBlock ****\n" << std::endl;
1336 
1337  // define an output stream to print into
1338  // it can then be directed to whatever log level is desired
1339  std::ostringstream myCoutStream;
1340 
1341  // get ConditionsInLumiBlock
1343  iLumi.getByToken(m_condInLumiToken, condInLumiBlock);
1344 
1345  if (!condInLumiBlock.isValid()) {
1346  LogDebug("L1GtAnalyzer") << "\nConditionsInLumiBlock with \n " << m_condInEdmInputTag
1347  << "\nrequested in configuration, but not found in the event."
1348  << "\nExit the method.\n"
1349  << std::endl;
1350 
1351  return;
1352  }
1353 
1354  const uint32_t totalIntensityBeam1Val = condInLumiBlock->totalIntensityBeam1;
1355  const uint32_t totalIntensityBeam2Val = condInLumiBlock->totalIntensityBeam2;
1356 
1357  myCoutStream << "\nLHC quantities in luminosity section "
1358 
1359  << iLumi.luminosityBlock() << " from run " << iLumi.run()
1360  << "\n Total Intensity Beam 1 (Integer × 10E10 charges) = " << totalIntensityBeam1Val
1361  << "\n Total Intensity Beam 2 (Integer × 10E10 charges) = " << totalIntensityBeam2Val << std::endl;
1362 
1363  printOutput(myCoutStream);
1364 }
1365 
1367  // define an output stream to print into
1368  // it can then be directed to whatever log level is desired
1369  std::ostringstream myCoutStream;
1370 
1371  // get ConditionsInEventBlock
1373  iEvent.getByToken(m_condInEventToken, condInEventBlock);
1374 
1375  if (!condInEventBlock.isValid()) {
1376  LogDebug("L1GtAnalyzer") << "\nConditionsInEventBlock with \n " << m_condInEdmInputTag
1377  << "\nrequested in configuration, but not found in the event."
1378  << "\nExit the method.\n"
1379  << std::endl;
1380 
1381  return;
1382  }
1383 
1384  const uint16_t bstMasterStatusVal = condInEventBlock->bstMasterStatus;
1385  const uint32_t turnCountNumberVal = condInEventBlock->turnCountNumber;
1386 
1387  myCoutStream << "\nLHC quantities in event " << iEvent.id().event() << " from luminosity section "
1388  << iEvent.luminosityBlock() << " from run " << iEvent.run()
1389  << "\n BST Master Status = " << bstMasterStatusVal << "\n Turn count number = " << turnCountNumberVal
1390  << std::endl;
1391 
1392  printOutput(myCoutStream);
1393 }
1394 
1395 void L1GtAnalyzer::printOutput(std::ostringstream& myCout) {
1396  switch (m_printOutput) {
1397  case 0: {
1398  std::cout << myCout.str() << std::endl;
1399 
1400  }
1401 
1402  break;
1403  case 1: {
1404  LogTrace("L1GtAnalyzer") << myCout.str() << std::endl;
1405 
1406  } break;
1407 
1408  case 2: {
1409  edm::LogVerbatim("L1GtAnalyzer") << myCout.str() << std::endl;
1410 
1411  }
1412 
1413  break;
1414  case 3: {
1415  edm::LogInfo("L1GtAnalyzer") << myCout.str();
1416 
1417  }
1418 
1419  break;
1420  default: {
1421  std::cout << "\n\n L1GtAnalyzer: Error - no print output = " << m_printOutput
1422  << " defined! \n Check available values in the cfi file."
1423  << "\n"
1424  << std::endl;
1425 
1426  } break;
1427  }
1428 
1429  myCout.str("");
1430  myCout.clear();
1431 }
1432 
1433 // analyze each event: event loop
1435  // analyze: decision and decision word
1436  // bunch cross in event BxInEvent = 0 - L1Accept event
1439  }
1440 
1441  // analyze: decision for a given algorithm using L1GtUtils functions
1442  // for tests, use only one of the following methods
1443 
1444  switch (m_l1GtUtilsConfiguration) {
1445  case 0: {
1447  analyzeL1GtUtilsMenuLite(iEvent, evSetup);
1448  }
1449 
1450  // full analysis of an algorithm or technical trigger
1451  if (m_analyzeTriggerEnable) {
1452  analyzeTrigger(iEvent, evSetup);
1453  }
1454 
1455  } break;
1456  case 100000: {
1458  analyzeL1GtUtils(iEvent, evSetup);
1459  }
1460 
1461  // full analysis of an algorithm or technical trigger
1462  if (m_analyzeTriggerEnable) {
1463  analyzeTrigger(iEvent, evSetup);
1464  }
1465 
1466  } break;
1467  case 200000: {
1470  }
1471 
1472  // full analysis of an algorithm or technical trigger
1473  if (m_analyzeTriggerEnable) {
1474  analyzeTrigger(iEvent, evSetup);
1475  }
1476 
1477  } break;
1478  default: {
1479  // do nothing
1480  } break;
1481  }
1482 
1483  // analyze: object map product
1485  analyzeObjectMap(iEvent, evSetup);
1486  }
1487 
1488  // analyze: L1GtTriggerMenuLite
1491  }
1492 
1493  // analyze: usage of ConditionsInEdm
1496  }
1497 }
1498 
1499 // end section
1501  // empty
1502 }
1503 void L1GtAnalyzer::endRun(const edm::Run& iRun, const edm::EventSetup& evSetup) {
1504  // empty
1505 }
1506 
1507 // method called once each job just after ending the event loop
1509  // empty
1510 }
const int prescaleFactorSetIndex(const edm::Event &iEvent, const TriggerCategory &trigCategory, int &errorCode) const
Definition: L1GtUtils.cc:1269
void beginRun(const edm::Run &, const edm::EventSetup &) override
Log< level::Info, true > LogVerbatim
virtual void analyzeObjectMap(const edm::Event &, const edm::EventSetup &)
analyze: object map product
edm::InputTag m_l1GmtInputTag
input tag for muon collection from GMT
Definition: L1GtAnalyzer.h:139
edm::EDGetTokenT< edm::ConditionsInRunBlock > m_condInRunToken
Definition: L1GtAnalyzer.h:147
const int logicalExpressionRunUpdate(const edm::Run &, const edm::EventSetup &, const std::string &)
Definition: L1GtUtils.cc:1895
edm::EDGetTokenT< L1GtTriggerMenuLite > m_l1GtTmLToken
Definition: L1GtAnalyzer.h:143
virtual void analyzeDecisionReadoutRecord(const edm::Event &, const edm::EventSetup &)
const int prescaleFactor(const edm::Event &iEvent, const std::string &nameAlgoTechTrig, int &errorCode) const
return prescale factor for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1078
edm::InputTag m_condInEdmInputTag
input tag for ConditionInEdm products
Definition: L1GtAnalyzer.h:146
edm::InputTag m_l1GtRecordInputTag
input tags for GT lite product
Definition: L1GtAnalyzer.h:128
bool m_analyzeObjectMapEnable
Definition: L1GtAnalyzer.h:114
bool m_analyzeConditionsInRunBlockEnable
Definition: L1GtAnalyzer.h:118
edm::EDGetTokenT< L1GlobalTriggerObjectMaps > m_l1GtObjectMapsToken
Definition: L1GtAnalyzer.h:136
const std::vector< std::pair< std::string, int > > & prescaleFactors()
Definition: L1GtUtils.cc:2023
const DecisionWord & decisionWord(int bxInEventValue) const
std::string m_l1GtUtilsLogicalExpression
Definition: L1GtAnalyzer.h:176
const std::vector< unsigned int > & triggerMaskSet(const TriggerCategory &trigCategory, int &errorCode)
Definition: L1GtUtils.cc:1497
bool m_analyzeDecisionReadoutRecordEnable
enable / disable various analysis methods
Definition: L1GtAnalyzer.h:107
const std::vector< std::pair< std::string, int > > & triggerMasks()
Definition: L1GtUtils.cc:2035
void beginJob() override
void analyzeConditionsInEventBlock(const edm::Event &, const edm::EventSetup &)
to be used in analyze/produce/filter
#define LogTrace(id)
const std::vector< L1GlobalTriggerObjectMap > & gtObjectMap() const
get / set the vector of object maps
void endRun(const edm::Run &, const edm::EventSetup &) override
const std::string & l1TriggerMenuImplementation() const
return the L1 trigger menu implementation
Definition: L1GtUtils.cc:1598
std::map< unsigned int, std::string > L1TriggerMap
map containing the physics algorithms or the technical triggers
U second(std::pair< T, U > const &p)
void analyzeConditionsInRunBlock(const edm::Run &, const edm::EventSetup &)
const std::vector< std::pair< std::string, bool > > & decisionsAfterMask()
Definition: L1GtUtils.cc:2011
bool m_analyzeConditionsInEventBlockEnable
Definition: L1GtAnalyzer.h:120
void analyzeL1GtUtils(const edm::Event &, const edm::EventSetup &)
std::string m_nameAlgTechTrig
an algorithm trigger (name or alias) or a technical trigger name
Definition: L1GtAnalyzer.h:152
void printOutput(std::ostringstream &)
print the output stream to the required output, given by m_printOutput
const std::vector< std::pair< std::string, bool > > & decisionsBeforeMask()
Definition: L1GtUtils.cc:1999
int iEvent
Definition: GenABIO.cc:224
std::string m_condName
a condition in the algorithm trigger to test the object maps
Definition: L1GtAnalyzer.h:155
RunNumber_t run() const
Definition: RunBase.h:40
void analyzeL1GtTriggerMenuLite(const edm::Event &, const edm::EventSetup &)
analyze: usage of L1GtTriggerMenuLite
edm::InputTag m_l1GtObjectMapTag
input tags for GT object map collection L1GlobalTriggerObjectMapRecord
Definition: L1GtAnalyzer.h:131
L1RetrieveL1Extra m_retrieveL1Extra
Definition: L1GtAnalyzer.h:101
const bool availableL1Configuration(int &errorCode, int &l1ConfCode) const
Definition: L1GtUtils.cc:1679
std::vector< bool > DecisionWord
typedefs
bool m_analyzeTriggerEnable
Definition: L1GtAnalyzer.h:112
edm::EDGetTokenT< edm::ConditionsInLumiBlock > m_condInLumiToken
Definition: L1GtAnalyzer.h:148
const CombinationsInCond * getCombinationsInCond(const std::string &algoNameVal, const std::string &condNameVal) const
const std::string & l1TriggerMenu() const
return the L1 trigger menu name
Definition: L1GtUtils.cc:1577
~L1GtAnalyzer() override
bool m_analyzeL1GtUtilsEventSetupEnable
Definition: L1GtAnalyzer.h:110
edm::EDGetTokenT< edm::ConditionsInEventBlock > m_condInEventToken
Definition: L1GtAnalyzer.h:149
const std::vector< L1GtLogicParser::OperandToken > & expL1Triggers()
list of triggers in the logical expression, trigger decisions, prescale factors and masks...
Definition: L1GtUtils.h:180
unsigned int m_bitNumber
a bit number to retrieve the name and the alias
Definition: L1GtAnalyzer.h:158
bool getConditionResult(const std::string &algoNameVal, const std::string &condNameVal) const
L1GtUtils m_l1GtUtilsProv
Definition: L1GtAnalyzer.h:179
L1GtUtils m_l1GtUtils
Definition: L1GtAnalyzer.h:180
L1TriggerMap::const_iterator CItL1Trig
iterators through map containing the physics algorithms or the technical triggers ...
int m_printOutput
print output
Definition: L1GtAnalyzer.h:104
void analyzeConditionsInLumiBlock(const edm::LuminosityBlock &, const edm::EventSetup &)
to be used in beginLuminosityBlock
const std::vector< int > & prescaleFactorSet(const edm::Event &iEvent, const TriggerCategory &trigCategory, int &errorCode)
Definition: L1GtUtils.cc:1441
Log< level::Info, false > LogInfo
void beginLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > m_l1GtDaqReadoutRecordToken
Definition: L1GtAnalyzer.h:125
const bool decision(int bxInEventValue) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Run.h:315
static const bool useL1GtTriggerMenuLite(true)
const int triggerMask(const edm::Event &iEvent, const std::string &nameAlgoTechTrig, int &errorCode) const
return trigger mask for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1092
unsigned int m_l1GtUtilsConfiguration
L1 configuration code for L1GtUtils.
Definition: L1GtAnalyzer.h:161
bool m_analyzeConditionsInLumiBlockEnable
Definition: L1GtAnalyzer.h:119
void printL1Extra(std::ostream &oStr, const L1GtObject &gtObject, const bool checkBxInEvent, const int bxInEvent, const bool checkObjIndexInColl, const int objIndexInColl) const
void endLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) override
end section
edm::InputTag m_l1GtDaqReadoutRecordInputTag
input tags for GT DAQ product
Definition: L1GtAnalyzer.h:124
L1GtUtils::LogicalExpressionL1Results m_logicalExpressionL1ResultsProv
Definition: L1GtAnalyzer.h:181
bool m_l1GtUtilsConfigureBeginRun
if true, configure (partially) L1GtUtils in beginRun using getL1GtRunCache
Definition: L1GtAnalyzer.h:172
void endJob() override
end of job
bool isValid() const
Definition: HandleBase.h:70
L1GtAnalyzer(const edm::ParameterSet &)
Definition: L1GtAnalyzer.cc:43
edm::InputTag m_l1GtObjectMapsInputTag
input tags for GT object map collection L1GlobalTriggerObjectMaps
Definition: L1GtAnalyzer.h:135
const bool decision(const edm::Event &iEvent, const std::string &nameAlgoTechTrig, int &errorCode) const
Definition: L1GtUtils.cc:1066
void printTechnicalTrigger(std::ostream &myCout, int bxInEventValue) const
print technical triggers
void printGtDecision(std::ostream &myCout, int bxInEventValue) const
print global decision and algorithm decision word
HLT enums.
void getL1GtRunCache(const edm::Run &, const edm::EventSetup &, const bool, const bool)
get all the run-constant quantities for L1 trigger and cache them
Definition: L1GtUtils.cc:314
bool m_l1GtTmLInputTagProv
Definition: L1GtAnalyzer.h:165
bool m_analyzeL1GtUtilsMenuLiteEnable
Definition: L1GtAnalyzer.h:109
bool m_analyzeL1GtUtilsEnable
Definition: L1GtAnalyzer.h:111
const bool decisionAfterMask(const edm::Event &iEvent, const std::string &nameAlgoTechTrig, int &errorCode) const
return decision after trigger mask for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1052
bool m_l1GtRecordsInputTagProv
Definition: L1GtAnalyzer.h:169
void analyzeL1GtUtilsEventSetup(const edm::Event &, const edm::EventSetup &)
edm::EDGetTokenT< L1GlobalTriggerObjectMapRecord > m_l1GtObjectMapToken
Definition: L1GtAnalyzer.h:132
std::vector< SingleCombInCond > CombinationsInCond
all the object combinations evaluated to true in the condition
LuminosityBlockNumber_t luminosityBlock() const
const bool decisionBeforeMask(const edm::Event &iEvent, const std::string &nameAlgoTechTrig, int &errorCode) const
return decision before trigger mask for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1038
void analyzeTrigger(const edm::Event &, const edm::EventSetup &)
full analysis of an algorithm or technical trigger
void analyze(const edm::Event &, const edm::EventSetup &) override
analyze each event: event loop over various code snippets
bool isValid()
return true if the logical expression is syntactically correct
Definition: L1GtUtils.h:169
void retrieveL1ExtraObjects(const edm::Event &, const edm::EventSetup &)
static const bool useL1EventSetup(true)
Definition: Run.h:45
void analyzeL1GtUtilsMenuLite(const edm::Event &, const edm::EventSetup &)
for tests, use only one of the following methods
L1GtUtils::LogicalExpressionL1Results m_logicalExpressionL1Results
Definition: L1GtAnalyzer.h:182
#define LogDebug(id)
edm::InputTag m_l1GtTmLInputTag
input tag for L1GtTriggerMenuLite
Definition: L1GtAnalyzer.h:142
const std::vector< std::pair< std::string, int > > & errorCodes(const edm::Event &)
Definition: L1GtUtils.cc:2047
void analyzeL1GtUtilsCore(const edm::Event &, const edm::EventSetup &)
analyze: usage of L1GtUtils