CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
25 
30 
32 
34 
36 
38 
42 
45 
48 
50 
51 // constructor(s)
53 
54  m_retrieveL1Extra(
55  parSet.getParameter<edm::ParameterSet> ("L1ExtraInputTags"),consumesCollector()),
56 
57  m_printOutput(parSet.getUntrackedParameter<int>("PrintOutput", 3)),
58 
59  m_analyzeDecisionReadoutRecordEnable(parSet.getParameter<bool> ("analyzeDecisionReadoutRecordEnable")),
60  //
61  m_analyzeL1GtUtilsMenuLiteEnable(parSet.getParameter<bool> ("analyzeL1GtUtilsMenuLiteEnable")),
62  m_analyzeL1GtUtilsEventSetupEnable(parSet.getParameter<bool> ("analyzeL1GtUtilsEventSetupEnable")),
63  m_analyzeL1GtUtilsEnable(parSet.getParameter<bool> ("analyzeL1GtUtilsEnable")),
64  m_analyzeTriggerEnable(parSet.getParameter<bool> ("analyzeTriggerEnable")),
65  //
66  m_analyzeObjectMapEnable(parSet.getParameter<bool> ("analyzeObjectMapEnable")),
67  //
68  m_analyzeL1GtTriggerMenuLiteEnable(parSet.getParameter<bool> ("analyzeL1GtTriggerMenuLiteEnable")),
69  //
70  m_analyzeConditionsInRunBlockEnable(parSet.getParameter<bool> ("analyzeConditionsInRunBlockEnable")),
71  m_analyzeConditionsInLumiBlockEnable(parSet.getParameter<bool> ("analyzeConditionsInLumiBlockEnable")),
72  m_analyzeConditionsInEventBlockEnable(parSet.getParameter<bool> ("analyzeConditionsInEventBlockEnable")),
73 
74 
75  // input tag for GT DAQ product
76  m_l1GtDaqReadoutRecordInputTag(parSet.getParameter<edm::InputTag>(
77  "L1GtDaqReadoutRecordInputTag")),
78 
79  // input tag for L1GlobalTriggerRecord
80  m_l1GtRecordInputTag(parSet.getParameter<edm::InputTag>(
81  "L1GtRecordInputTag")),
82 
83  // input tag for GT object map collection L1GlobalTriggerObjectMapRecord
84  m_l1GtObjectMapTag(parSet.getParameter<edm::InputTag>(
85  "L1GtObjectMapTag")),
86 
87  // input tag for GT object map collection L1GlobalTriggerObjectMaps
88  m_l1GtObjectMapsInputTag(parSet.getParameter<edm::InputTag>(
89  "L1GtObjectMapsInputTag")),
90 
91  // input tag for muon collection from GMT
92  m_l1GmtInputTag(parSet.getParameter<edm::InputTag>(
93  "L1GmtInputTag")),
94 
95  // input tag for L1GtTriggerMenuLite
96  m_l1GtTmLInputTag(parSet.getParameter<edm::InputTag> (
97  "L1GtTmLInputTag")),
98 
99  // input tag for ConditionInEdm products
100  m_condInEdmInputTag(parSet.getParameter<edm::InputTag> (
101  "CondInEdmInputTag")),
102 
103  // an algorithm and a condition in that algorithm to test the object maps
104  m_nameAlgTechTrig(parSet.getParameter<std::string> ("AlgorithmName")),
105  m_condName(parSet.getParameter<std::string> ("ConditionName")),
106  m_bitNumber(parSet.getParameter<unsigned int> ("BitNumber")),
107 
108  m_l1GtUtilsConfiguration(parSet.getParameter<unsigned int> ("L1GtUtilsConfiguration")),
109  m_l1GtTmLInputTagProv(parSet.getParameter<bool> ("L1GtTmLInputTagProv")),
110  m_l1GtRecordsInputTagProv(parSet.getParameter<bool> ("L1GtRecordsInputTagProv")),
111  m_l1GtUtilsConfigureBeginRun(parSet.getParameter<bool> ("L1GtUtilsConfigureBeginRun")),
112  m_l1GtUtilsLogicalExpression(parSet.getParameter<std::string>("L1GtUtilsLogicalExpression")),
113  m_logicalExpressionL1ResultsProv(m_l1GtUtilsLogicalExpression, m_l1GtUtils),
114  m_logicalExpressionL1Results(m_l1GtUtilsLogicalExpression, m_l1GtUtils, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag)
115 
116 {
117 
118 
119  LogDebug("L1GtAnalyzer")
120  << "\n Input parameters for L1 GT test analyzer"
121  << "\n L1 GT DAQ product: "
123  << "\n L1GlobalTriggerRecord product: "
125  << "\n L1 GT object map collection: "
127  << "\n Muon collection from GMT: "
128  << m_l1GmtInputTag
129  << "\n L1 trigger menu lite product: "
131  << "\n Algorithm name or alias, technical trigger name: " << m_nameAlgTechTrig
132  << "\n Condition, if an algorithm trigger is requested: " << m_condName
133  << "\n Bit number for an algorithm or technical trigger: " << m_bitNumber
134  << "\n Requested L1 trigger configuration: " << m_l1GtUtilsConfiguration
135  << "\n Retrieve input tag from provenance for L1GtTriggerMenuLite in the L1GtUtils: "
137  << "\n Retrieve input tag from provenance for L1GlobalTriggerReadoutRecord "
138  << "\n and / or L1GlobalTriggerRecord in the L1GtUtils: "
140  << "\n Configure L1GtUtils in beginRun(...): "
142  << " \n" << std::endl;
143 
144 }
145 
146 // destructor
148 
149  // empty
150 
151 }
152 
153 // method called once each job just before starting event loop
155 {
156 
157  // empty
158 
159 }
160 
162  const edm::EventSetup& evSetup) {
163 
165  analyzeConditionsInRunBlock(iRun, evSetup);
166  }
167 
168  // L1GtUtils
169 
171 
172  // for tests, use only one of the following methods for m_l1GtUtilsConfiguration
173 
174  bool useL1EventSetup = false;
175  bool useL1GtTriggerMenuLite = false;
176 
177  switch (m_l1GtUtilsConfiguration) {
178  case 0: {
179  useL1EventSetup = false;
180  useL1GtTriggerMenuLite = true;
181 
182  }
183  break;
184  case 100000: {
185  useL1EventSetup = true;
186  useL1GtTriggerMenuLite = true;
187 
188  }
189  break;
190  case 200000: {
191  useL1EventSetup = true;
192  useL1GtTriggerMenuLite = false;
193 
194  }
195  break;
196  default: {
197  // do nothing
198  }
199  break;
200  }
201 
202  if (m_l1GtTmLInputTagProv) {
203  // L1GtTriggerMenuLite input tag from provenance
204  m_l1GtUtils.getL1GtRunCache(iRun, evSetup, useL1EventSetup,
205  useL1GtTriggerMenuLite);
206 
207  } else {
208 
209  // L1GtTriggerMenuLite input tag given in configuration file
210  m_l1GtUtils.getL1GtRunCache(iRun, evSetup, useL1EventSetup,
211  useL1GtTriggerMenuLite, m_l1GtTmLInputTag);
212  }
213 
214  // check if the parsing of the logical expression was successful
215 
218  evSetup);
219  } else {
220  // do whatever is necessary if parsing fails - the size of all vectors with L1 results is zero in this case
221  // a LogWarning message is written in L1GtUtils
222  }
223 
224 // if (m_logicalExpressionL1Results.isValid()) {
225 // m_logicalExpressionL1Results.logicalExpressionRunUpdate(iRun,
226 // evSetup);
227 // } else {
228 // // do whatever is necessary if parsing fails - the size of all vectors with L1 results is zero in this case
229 // // a LogWarning message is written in L1GtUtils
230 // }
231 
232  // if the logical expression is changed, one has to check it's validity after the logicalExpressionRunUpdate call
233  // (...dirty testing with the same logical expression)
237  // do whatever is necessary if parsing fails - the size of all vectors with L1 results is zero in this case
238  // a LogWarning message is written in L1GtUtils
239  }
240 
241  }
242 
243 }
244 
245 
247  const edm::EventSetup& evSetup) {
248 
250  analyzeConditionsInLumiBlock(iLumi, evSetup);
251  }
252 
253 }
254 
255 
256 // member functions
257 
258 // analyze: decision and decision word
259 // bunch cross in event BxInEvent = 0 - L1Accept event
261 {
262 
263  LogDebug("L1GtAnalyzer")
264  << "\n**** L1GtAnalyzer::analyzeDecisionReadoutRecord ****\n"
265  << std::endl;
266 
267  // define an output stream to print into
268  // it can then be directed to whatever log level is desired
269  std::ostringstream myCoutStream;
270 
271  // get L1GlobalTriggerReadoutRecord
273  iEvent.getByLabel(m_l1GtDaqReadoutRecordInputTag, gtReadoutRecord);
274 
275  if (!gtReadoutRecord.isValid()) {
276 
277  LogDebug("L1GtAnalyzer") << "\nL1GlobalTriggerReadoutRecord with \n "
279  << "\nrequested in configuration, but not found in the event."
280  << "\nExit the method.\n" << std::endl;
281 
282  return;
283  }
284 
285  // get Global Trigger decision and the decision word
286  bool gtDecision = gtReadoutRecord->decision();
287  DecisionWord gtDecisionWord = gtReadoutRecord->decisionWord();
288 
289  // print Global Trigger decision and the decision word
290  edm::LogVerbatim("L1GtAnalyzer")
291  << "\n GlobalTrigger decision: " << gtDecision << std::endl;
292 
293  // print via supplied "print" function (
294  gtReadoutRecord->printGtDecision(myCoutStream);
295 
296  // print technical trigger word via supplied "print" function
297  gtReadoutRecord->printTechnicalTrigger(myCoutStream);
298 
299  printOutput(myCoutStream);
300 
301 }
302 
303 
305  const edm::EventSetup& evSetup) {
306 
307 
308  // define an output stream to print into
309  // it can then be directed to whatever log level is desired
310  std::ostringstream myCoutStream;
311 
312 
313  // example to access L1 trigger results using public methods from L1GtUtils
314  // methods must be called after retrieving the L1 configuration
315 
316  // testing which environment is used
317 
318  int iErrorCode = -1;
319  int l1ConfCode = -1;
320 
321  const bool l1Conf = m_l1GtUtils.availableL1Configuration(iErrorCode, l1ConfCode);
322 
323  myCoutStream << "\nL1 configuration code: \n"
324  << "\n Legend: "
325  << "\n 0 - Retrieve L1 trigger configuration from L1GtTriggerMenuLite only"
326  << "\n 10000 L1GtTriggerMenuLite product is valid"
327  << "\n 99999 L1GtTriggerMenuLite product not valid. Error."
328  << "\n"
329  << "\n 100000 - Fall through: try first L1GtTriggerMenuLite; if not valid,try event setup."
330  << "\n 110000 L1GtTriggerMenuLite product is valid"
331  << "\n 120000 L1GtTriggerMenuLite product not valid, event setup valid."
332  << "\n 199999 L1GtTriggerMenuLite product not valid, event setup not valid. Error."
333  << "\n"
334  << "\n 200000 - Retrieve L1 trigger configuration from event setup only."
335  << "\n 210000 Event setup valid."
336  << "\n 299999 Event setup not valid. Error."
337  << "\n"
338  << "\n 300000 - No L1 trigger configuration requested to be retrieved. Error"
339  << "\n Must call before using L1GtUtils methods: "
340  << "\n getL1GtRunCache(const edm::Event& iEvent, const edm::EventSetup& evSetup,"
341  << "\n const bool useL1EventSetup, const bool useL1GtTriggerMenuLite)"
342  << "\n"
343  << std::endl;
344 
345 
346  if (l1Conf) {
347  myCoutStream << "\nL1 configuration code:" << l1ConfCode
348  << "\nValid L1 trigger configuration." << std::endl;
349 
350  myCoutStream << "\nL1 trigger menu name and implementation:" << "\n"
351  << m_l1GtUtils.l1TriggerMenu() << "\n"
352  << m_l1GtUtils.l1TriggerMenuImplementation() << std::endl;
353 
354  } else {
355  myCoutStream << "\nL1 configuration code:" << l1ConfCode
356  << "\nNo valid L1 trigger configuration available."
357  << "\nSee text above for error code interpretation"
358  << "\nNo return here, in order to test each method, protected against configuration error."
359  << std::endl;
360  }
361 
362 
363 
364  myCoutStream
365  << "\n******** Results found with input tags retrieved from provenance ******** \n"
366  << std::endl;
367 
368  //
369  // no input tags; for the appropriate EDM product, it will be found
370  // from provenance
371 
372  // the following methods share the same error code, therefore one can check only once
373  // the validity of the result
374 
375  iErrorCode = -1;
376 
377  bool decisionBeforeMaskAlgTechTrig = m_l1GtUtils.decisionBeforeMask(iEvent,
378  m_nameAlgTechTrig, iErrorCode);
379 
380  bool decisionAfterMaskAlgTechTrig = m_l1GtUtils.decisionAfterMask(iEvent,
381  m_nameAlgTechTrig, iErrorCode);
382 
383  bool decisionAlgTechTrig = m_l1GtUtils.decision(iEvent, m_nameAlgTechTrig,
384  iErrorCode);
385 
386  int prescaleFactorAlgTechTrig = m_l1GtUtils.prescaleFactor(iEvent,
387  m_nameAlgTechTrig, iErrorCode);
388 
389  int triggerMaskAlgTechTrig = m_l1GtUtils.triggerMask(iEvent,
390  m_nameAlgTechTrig, iErrorCode);
391 
392  myCoutStream << "\n\nMethods:"
393  << "\n decisionBeforeMask(iEvent, m_nameAlgTechTrig, iErrorCode)"
394  << "\n decisionAfterMask(iEvent, m_nameAlgTechTrig, iErrorCode)"
395  << "\n decision(iEvent, m_nameAlgTechTrig, iErrorCode)"
396  << "\n prescaleFactor(iEvent, m_nameAlgTechTrig, iErrorCode)"
397  << "\n triggerMask(iEvent, m_nameAlgTechTrig, iErrorCode)"
398  << "\n triggerMask(m_nameAlgTechTrig,iErrorCode)"
399  << "\n\n" << std::endl;
400 
401 
402  if (iErrorCode == 0) {
403  myCoutStream << "\nDecision before trigger mask for "
404  << m_nameAlgTechTrig << ": " << decisionBeforeMaskAlgTechTrig
405  << std::endl;
406  myCoutStream << "Decision after trigger mask for " << m_nameAlgTechTrig
407  << ": " << decisionAfterMaskAlgTechTrig << std::endl;
408  myCoutStream << "Decision (after trigger mask) for "
409  << m_nameAlgTechTrig << ": " << decisionAlgTechTrig
410  << std::endl;
411 
412  myCoutStream << "Prescale factor for " << m_nameAlgTechTrig
413  << ": " << prescaleFactorAlgTechTrig
414  << std::endl;
415 
416  myCoutStream << "Trigger mask for " << m_nameAlgTechTrig
417  << ": " << triggerMaskAlgTechTrig
418  << std::endl;
419 
420  } else if (iErrorCode == 1) {
421  myCoutStream << "\n" << m_nameAlgTechTrig
422  << " does not exist in the L1 menu "
423  << m_l1GtUtils.l1TriggerMenu() << "\n" << std::endl;
424 
425  } else {
426  myCoutStream << "\nError: "
427  << "\n An error was encountered when retrieving decision, mask and prescale factor for "
428  << m_nameAlgTechTrig << "\n L1 Menu: "
429  << m_l1GtUtils.l1TriggerMenu() << "\n Error code: "
430  << iErrorCode << std::endl;
431 
432  }
433 
434  // another method to get the trigger mask (no common errorCode)
435 
436  iErrorCode = -1;
437  triggerMaskAlgTechTrig = m_l1GtUtils.triggerMask(m_nameAlgTechTrig,
438  iErrorCode);
439 
440  if (iErrorCode == 0) {
441  myCoutStream << "\nTrigger mask for " << m_nameAlgTechTrig
442  << "(faster method): " << triggerMaskAlgTechTrig
443  << std::endl;
444 
445  } else if (iErrorCode == 1) {
446  myCoutStream << "\n" << m_nameAlgTechTrig
447  << " does not exist in the L1 menu "
448  << m_l1GtUtils.l1TriggerMenu() << "\n" << std::endl;
449 
450  } else {
451  myCoutStream << "\nError: "
452  << "\n An error was encountered when fast retrieving trigger mask for "
453  << m_nameAlgTechTrig << "\n L1 Menu: "
454  << m_l1GtUtils.l1TriggerMenu() << "\n Error code: "
455  << iErrorCode << std::endl;
456 
457  }
458 
459  // index of the actual prescale factor set, and the actual prescale
460  // factor set for algorithm triggers
461 
462 
463 
465 
466  myCoutStream << "\nMethods:"
467  << "\n prescaleFactorSetIndex(iEvent, trigCategory, iErrorCode)"
468  << "\n prescaleFactorSet(iEvent, trigCategory,iErrorCode)\n"
469  << std::endl;
470 
471  iErrorCode = -1;
472  const int pfSetIndexAlgorithmTrigger = m_l1GtUtils.prescaleFactorSetIndex(
473  iEvent, trigCategory, iErrorCode);
474 
475  if (iErrorCode == 0) {
476  myCoutStream
477  << "\nAlgorithm triggers: index for prescale factor set = "
478  << pfSetIndexAlgorithmTrigger << "\nfor run " << iEvent.run()
479  << ", luminosity block " << iEvent.luminosityBlock()
480  << ", with L1 menu \n " << m_l1GtUtils.l1TriggerMenu()
481  << std::endl;
482 
483 
484  } else {
485  myCoutStream
486  << "\nError encountered when retrieving the prescale factor set index"
487  << "\n for algorithm triggers, for run " << iEvent.run()
488  << ", luminosity block " << iEvent.luminosityBlock()
489  << " with L1 menu \n " << m_l1GtUtils.l1TriggerMenu()
490  << "\n Error code: " << iErrorCode << "\n" << std::endl;
491  }
492 
493  iErrorCode = -1;
494  const std::vector<int>& pfSetAlgorithmTrigger =
495  m_l1GtUtils.prescaleFactorSet(iEvent, trigCategory, iErrorCode);
496 
497  if (iErrorCode == 0) {
498  myCoutStream << "\nAlgorithm triggers: prescale factor set index = "
499  << pfSetIndexAlgorithmTrigger << "\nfor run " << iEvent.run()
500  << ", luminosity block " << iEvent.luminosityBlock()
501  << ", with L1 menu \n " << m_l1GtUtils.l1TriggerMenu()
502  << std::endl;
503 
504  int iBit = -1;
505  for (std::vector<int>::const_iterator cItBit =
506  pfSetAlgorithmTrigger.begin(); cItBit
507  != pfSetAlgorithmTrigger.end(); ++cItBit) {
508 
509  iBit++;
510  myCoutStream << "Bit number " << std::right << std::setw(4) << iBit
511  << ": prescale factor = " << (*cItBit) << std::endl;
512 
513  }
514 
515  } else {
516  myCoutStream
517  << "\nError encountered when retrieving the prescale factor set "
518  << "\n for algorithm triggers, for run " << iEvent.run()
519  << ", luminosity block " << iEvent.luminosityBlock()
520  << " with L1 menu \n " << m_l1GtUtils.l1TriggerMenu()
521  << "\n Error code: " << iErrorCode << "\n" << std::endl;
522  }
523 
524  // the actual trigger mask set for algorithm triggers
525 
526  myCoutStream << "\nMethod:"
527  << "\n triggerMaskSet(trigCategory, iErrorCode)"
528  << std::endl;
529 
530  iErrorCode = -1;
531  const std::vector<unsigned int>& tmSetAlgorithmTrigger =
532  m_l1GtUtils.triggerMaskSet(trigCategory, iErrorCode);
533 
534  if (iErrorCode == 0) {
535  myCoutStream << "\nAlgorithm triggers: trigger mask set for run "
536  << iEvent.run() << ", luminosity block "
537  << iEvent.luminosityBlock() << ", with L1 menu \n "
538  << m_l1GtUtils.l1TriggerMenu() << "\n" << std::endl;
539 
540  int iBit = -1;
541  for (std::vector<unsigned int>::const_iterator cItBit =
542  tmSetAlgorithmTrigger.begin(); cItBit
543  != tmSetAlgorithmTrigger.end(); ++cItBit) {
544 
545  iBit++;
546  myCoutStream << "Bit number " << std::right << std::setw(4) << iBit
547  << ": trigger mask = " << (*cItBit) << std::endl;
548 
549  }
550 
551  } else {
552  myCoutStream
553  << "\nError encountered when retrieving the trigger mask set "
554  << "\n for algorithm triggers, for run " << iEvent.run()
555  << ", luminosity block " << iEvent.luminosityBlock()
556  << " with L1 menu \n " << m_l1GtUtils.l1TriggerMenu()
557  << "\n Error code: " << iErrorCode << "\n" << std::endl;
558  }
559 
560 
561 
562 
563  // index of the actual prescale factor set, and the actual prescale
564  // factor set for technical triggers
565 
566  trigCategory = L1GtUtils::TechnicalTrigger;
567 
568  myCoutStream << "\nMethods:"
569  << "\n prescaleFactorSetIndex(iEvent, trigCategory, iErrorCode)"
570  << "\n prescaleFactorSet(iEvent, trigCategory,iErrorCode)\n"
571  << std::endl;
572 
573  iErrorCode = -1;
574  const int pfSetIndexTechnicalTrigger = m_l1GtUtils.prescaleFactorSetIndex(
575  iEvent, trigCategory, iErrorCode);
576 
577  if (iErrorCode == 0) {
578  myCoutStream
579  << "\nTechnical triggers: index for prescale factor set = "
580  << pfSetIndexTechnicalTrigger << "\nfor run " << iEvent.run()
581  << ", luminosity block " << iEvent.luminosityBlock()
582  << ", with L1 menu \n " << m_l1GtUtils.l1TriggerMenu()
583  << "\nMethod: prescaleFactorSetIndex(iEvent, trigCategory, iErrorCode)\n"
584  << std::endl;
585 
586  } else {
587  myCoutStream
588  << "\nError encountered when retrieving the prescale factor set index"
589  << "\n for technical triggers, for run " << iEvent.run()
590  << ", luminosity block " << iEvent.luminosityBlock()
591  << " with L1 menu \n " << m_l1GtUtils.l1TriggerMenu()
592  << "\n Error code: " << iErrorCode << "\n" << std::endl;
593  }
594 
595  iErrorCode = -1;
596  const std::vector<int>& pfSetTechnicalTrigger =
597  m_l1GtUtils.prescaleFactorSet(iEvent, trigCategory, iErrorCode);
598 
599  if (iErrorCode == 0) {
600  myCoutStream << "\nTechnical triggers: prescale factor set index = "
601  << pfSetIndexTechnicalTrigger << "\nfor run " << iEvent.run()
602  << ", luminosity block " << iEvent.luminosityBlock()
603  << ", with L1 menu \n " << m_l1GtUtils.l1TriggerMenu()
604  << "\nMethod: prescaleFactorSet(iEvent, trigCategory,iErrorCode)\n"
605  << std::endl;
606 
607  int iBit = -1;
608  for (std::vector<int>::const_iterator cItBit =
609  pfSetTechnicalTrigger.begin(); cItBit
610  != pfSetTechnicalTrigger.end(); ++cItBit) {
611 
612  iBit++;
613  myCoutStream << "Bit number " << std::right << std::setw(4) << iBit
614  << ": prescale factor = " << (*cItBit) << std::endl;
615 
616  }
617 
618  } else {
619  myCoutStream
620  << "\nError encountered when retrieving the prescale factor set "
621  << "\n for technical triggers, for run " << iEvent.run()
622  << ", luminosity block " << iEvent.luminosityBlock()
623  << " with L1 menu \n " << m_l1GtUtils.l1TriggerMenu()
624  << "\n Error code: " << iErrorCode << "\n" << std::endl;
625  }
626 
627  // the actual trigger mask set for technical triggers
628 
629  myCoutStream << "\nMethod:"
630  << "\n triggerMaskSet(trigCategory, iErrorCode)"
631  << std::endl;
632 
633  iErrorCode = -1;
634  const std::vector<unsigned int>& tmSetTechnicalTrigger =
635  m_l1GtUtils.triggerMaskSet(trigCategory, iErrorCode);
636 
637  if (iErrorCode == 0) {
638  myCoutStream << "\nTechnical triggers: trigger mask set for run "
639  << iEvent.run() << ", luminosity block "
640  << iEvent.luminosityBlock() << ", with L1 menu \n "
641  << m_l1GtUtils.l1TriggerMenu() << "\n" << std::endl;
642 
643  int iBit = -1;
644  for (std::vector<unsigned int>::const_iterator cItBit =
645  tmSetTechnicalTrigger.begin(); cItBit
646  != tmSetTechnicalTrigger.end(); ++cItBit) {
647 
648  iBit++;
649  myCoutStream << "Bit number " << std::right << std::setw(4) << iBit
650  << ": trigger mask = " << (*cItBit) << std::endl;
651 
652  }
653 
654  } else {
655  myCoutStream
656  << "\nError encountered when retrieving the trigger mask set "
657  << "\n for technical triggers, for run " << iEvent.run()
658  << ", luminosity block " << iEvent.luminosityBlock()
659  << " with L1 menu \n " << m_l1GtUtils.l1TriggerMenu()
660  << "\n Error code: " << iErrorCode << "\n" << std::endl;
661  }
662 
663 
664  // results for logical expressions
665 
666  // errorCodes must be called before any other method is used
667  const std::vector<std::pair<std::string, int> >& errorCodesProv =
669 
670  const std::vector<L1GtLogicParser::OperandToken>& expL1TriggersProv =
672 
673  const std::vector<std::pair<std::string, bool> >& decisionsBeforeMaskProv =
675  const std::vector<std::pair<std::string, bool> >& decisionsAfterMaskProv =
677  const std::vector<std::pair<std::string, int> >& prescaleFactorsProv =
679  const std::vector<std::pair<std::string, int> >& triggerMasksProv =
681 
682  myCoutStream << std::endl;
683  myCoutStream << "\nLogical expression\n "
684  << m_l1GtUtilsLogicalExpression << std::endl;
685 
686  for (size_t iTrig = 0; iTrig < errorCodesProv.size(); ++iTrig) {
687  if ((errorCodesProv[iTrig]).second != 0) {
688  myCoutStream
689  << "\nError encountered when retrieving L1 results for trigger "
690  << (errorCodesProv[iTrig]).first << " (bit number "
691  << (expL1TriggersProv[iTrig]).tokenNumber << ")\n for run "
692  << iEvent.run() << ", luminosity block "
693  << iEvent.luminosityBlock() << " with L1 menu \n "
694  << m_l1GtUtils.l1TriggerMenu() << "\n Error code: "
695  << (errorCodesProv[iTrig]).second << "\n" << std::endl;
696 
697  } else {
698 
699  myCoutStream << "\n" << (errorCodesProv[iTrig]).first
700  << " - bit number " << (expL1TriggersProv[iTrig]).tokenNumber
701  << std::endl;
702 
703  myCoutStream << " decision before mask = "
704  << (decisionsBeforeMaskProv[iTrig]).second << std::endl;
705 
706  myCoutStream << " decision after mask = "
707  << (decisionsAfterMaskProv[iTrig]).second << std::endl;
708 
709  myCoutStream << " prescale factor = "
710  << (prescaleFactorsProv[iTrig]).second << std::endl;
711 
712  myCoutStream << " trigger mask = "
713  << (triggerMasksProv[iTrig]).second << std::endl;
714 
715  myCoutStream << " error code = "
716  << (errorCodesProv[iTrig]).second << std::endl;
717 
718  }
719  }
720 
721  //
722  // same methods as above, but with input tag given explicitly, allowing to select
723  // the EDM products used to get the results
724 
725 
726 
727  myCoutStream
728  << "\n******** Results found with input tags provided in the configuration file ******** \n"
729  << "\n L1GlobalTriggerRecord: " << m_l1GtRecordInputTag
730  << "\n L1GlobalTriggerReadoutRecord: "
731  << m_l1GtDaqReadoutRecordInputTag << std::endl;
732 
733 
734  // the following methods share the same error code, therefore one can check only once
735  // the validity of the result
736 
737  iErrorCode = -1;
738 
739  bool decisionBeforeMaskAlgTechTrigITag = m_l1GtUtils.decisionBeforeMask(iEvent,
741  m_nameAlgTechTrig, iErrorCode);
742 
743  bool decisionAfterMaskAlgTechTrigITag = m_l1GtUtils.decisionAfterMask(iEvent,
745  m_nameAlgTechTrig, iErrorCode);
746 
747  bool decisionAlgTechTrigITag = m_l1GtUtils.decision(iEvent,
749  m_nameAlgTechTrig, iErrorCode);
750 
751  int prescaleFactorAlgTechTrigITag = m_l1GtUtils.prescaleFactor(iEvent,
753  m_nameAlgTechTrig, iErrorCode);
754 
755  int triggerMaskAlgTechTrigITag = m_l1GtUtils.triggerMask(iEvent,
757  m_nameAlgTechTrig, iErrorCode);
758 
759  myCoutStream << "\n\nMethods:"
760  << "\n decisionBeforeMask(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, m_nameAlgTechTrig, iErrorCode)"
761  << "\n decisionAfterMask(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, m_nameAlgTechTrig, iErrorCode)"
762  << "\n decision(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, m_nameAlgTechTrig, iErrorCode)"
763  << "\n prescaleFactor(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, m_nameAlgTechTrig, iErrorCode)"
764  << "\n triggerMask(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, m_nameAlgTechTrig, iErrorCode)"
765  << "\n\n"
766  << std::endl;
767 
768 
769  if (iErrorCode == 0) {
770  myCoutStream << "\nDecision before trigger mask for "
771  << m_nameAlgTechTrig << ": " << decisionBeforeMaskAlgTechTrigITag
772  << std::endl;
773  myCoutStream << "Decision after trigger mask for " << m_nameAlgTechTrig
774  << ": " << decisionAfterMaskAlgTechTrigITag << std::endl;
775  myCoutStream << "Decision (after trigger mask) for "
776  << m_nameAlgTechTrig << ": " << decisionAlgTechTrigITag
777  << std::endl;
778 
779  myCoutStream << "Prescale factor for " << m_nameAlgTechTrig
780  << ": " << prescaleFactorAlgTechTrigITag
781  << std::endl;
782 
783  myCoutStream << "Trigger mask for " << m_nameAlgTechTrig
784  << ": " << triggerMaskAlgTechTrigITag
785  << std::endl;
786 
787  } else if (iErrorCode == 1) {
788  myCoutStream << "\n" << m_nameAlgTechTrig
789  << " does not exist in the L1 menu "
790  << m_l1GtUtils.l1TriggerMenu() << "\n" << std::endl;
791 
792  } else {
793  myCoutStream << "\nError: "
794  << "\n An error was encountered when retrieving decision, mask and prescale factor for "
795  << m_nameAlgTechTrig << "\n L1 Menu: "
796  << m_l1GtUtils.l1TriggerMenu() << "\n Error code: "
797  << iErrorCode << std::endl;
798 
799  }
800 
801 
802  // index of the actual prescale factor set, and the actual prescale
803  // factor set for algorithm triggers
804 
805 
806 
807  trigCategory = L1GtUtils::AlgorithmTrigger;
808 
809  myCoutStream << "\nMethods:"
810  << "\n prescaleFactorSetIndex(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, trigCategory, iErrorCode)"
811  << "\n prescaleFactorSet(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, trigCategory,iErrorCode)\n"
812  << std::endl;
813 
814  iErrorCode = -1;
815  const int pfSetIndexAlgorithmTriggerITag = m_l1GtUtils.prescaleFactorSetIndex(
817  trigCategory, iErrorCode);
818 
819  if (iErrorCode == 0) {
820  myCoutStream
821  << "\nAlgorithm triggers: index for prescale factor set = "
822  << pfSetIndexAlgorithmTriggerITag << "\nfor run " << iEvent.run()
823  << ", luminosity block " << iEvent.luminosityBlock()
824  << ", with L1 menu \n " << m_l1GtUtils.l1TriggerMenu()
825  << std::endl;
826 
827 
828  } else {
829  myCoutStream
830  << "\nError encountered when retrieving the prescale factor set index"
831  << "\n for algorithm triggers, for run " << iEvent.run()
832  << ", luminosity block " << iEvent.luminosityBlock()
833  << " with L1 menu \n " << m_l1GtUtils.l1TriggerMenu()
834  << "\n Error code: " << iErrorCode << "\n" << std::endl;
835  }
836 
837  iErrorCode = -1;
838  const std::vector<int>& pfSetAlgorithmTriggerITag =
840  m_l1GtDaqReadoutRecordInputTag, trigCategory, iErrorCode);
841 
842  if (iErrorCode == 0) {
843  myCoutStream << "\nAlgorithm triggers: prescale factor set index = "
844  << pfSetIndexAlgorithmTriggerITag << "\nfor run " << iEvent.run()
845  << ", luminosity block " << iEvent.luminosityBlock()
846  << ", with L1 menu \n " << m_l1GtUtils.l1TriggerMenu()
847  << std::endl;
848 
849  int iBit = -1;
850  for (std::vector<int>::const_iterator cItBit =
851  pfSetAlgorithmTriggerITag.begin(); cItBit
852  != pfSetAlgorithmTriggerITag.end(); ++cItBit) {
853 
854  iBit++;
855  myCoutStream << "Bit number " << std::right << std::setw(4) << iBit
856  << ": prescale factor = " << (*cItBit) << std::endl;
857 
858  }
859 
860  } else {
861  myCoutStream
862  << "\nError encountered when retrieving the prescale factor set "
863  << "\n for algorithm triggers, for run " << iEvent.run()
864  << ", luminosity block " << iEvent.luminosityBlock()
865  << " with L1 menu \n " << m_l1GtUtils.l1TriggerMenu()
866  << "\n Error code: " << iErrorCode << "\n" << std::endl;
867  }
868 
869 
870 
871 
872 
873 
874  // index of the actual prescale factor set, and the actual prescale
875  // factor set for technical triggers
876 
877  trigCategory = L1GtUtils::TechnicalTrigger;
878 
879  myCoutStream << "\nMethods:"
880  << "\n prescaleFactorSetIndex(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, trigCategory, iErrorCode)"
881  << "\n prescaleFactorSet(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, trigCategory,iErrorCode)\n"
882  << std::endl;
883 
884  iErrorCode = -1;
885  const int pfSetIndexTechnicalTriggerITag = m_l1GtUtils.prescaleFactorSetIndex(
887  trigCategory, iErrorCode);
888 
889  if (iErrorCode == 0) {
890  myCoutStream
891  << "\nTechnical triggers: index for prescale factor set = "
892  << pfSetIndexTechnicalTriggerITag << "\nfor run " << iEvent.run()
893  << ", luminosity block " << iEvent.luminosityBlock()
894  << ", with L1 menu \n " << m_l1GtUtils.l1TriggerMenu()
895  << std::endl;
896 
897  } else {
898  myCoutStream
899  << "\nError encountered when retrieving the prescale factor set index"
900  << "\n for technical triggers, for run " << iEvent.run()
901  << ", luminosity block " << iEvent.luminosityBlock()
902  << " with L1 menu \n " << m_l1GtUtils.l1TriggerMenu()
903  << "\n Error code: " << iErrorCode << "\n" << std::endl;
904  }
905 
906  iErrorCode = -1;
907  const std::vector<int>& pfSetTechnicalTriggerITag =
909  m_l1GtDaqReadoutRecordInputTag, trigCategory, iErrorCode);
910 
911  if (iErrorCode == 0) {
912  myCoutStream << "\nTechnical triggers: prescale factor set index = "
913  << pfSetIndexTechnicalTriggerITag << "\nfor run " << iEvent.run()
914  << ", luminosity block " << iEvent.luminosityBlock()
915  << ", with L1 menu \n " << m_l1GtUtils.l1TriggerMenu()
916  << std::endl;
917 
918  int iBit = -1;
919  for (std::vector<int>::const_iterator cItBit =
920  pfSetTechnicalTriggerITag.begin(); cItBit
921  != pfSetTechnicalTriggerITag.end(); ++cItBit) {
922 
923  iBit++;
924  myCoutStream << "Bit number " << std::right << std::setw(4) << iBit
925  << ": prescale factor = " << (*cItBit) << std::endl;
926 
927  }
928 
929  } else {
930  myCoutStream
931  << "\nError encountered when retrieving the prescale factor set "
932  << "\n for technical triggers, for run " << iEvent.run()
933  << ", luminosity block " << iEvent.luminosityBlock()
934  << " with L1 menu \n " << m_l1GtUtils.l1TriggerMenu()
935  << "\n Error code: " << iErrorCode << "\n" << std::endl;
936  }
937 
938 
939  // results for logical expressions
940 
941  // errorCodes must be called before any other method is used
942  const std::vector<std::pair<std::string, int> >& errorCodes =
944 
945  const std::vector<L1GtLogicParser::OperandToken>& expL1Triggers =
947 
948 
949  const std::vector<std::pair<std::string, bool> >& decisionsBeforeMask =
951  const std::vector<std::pair<std::string, bool> >& decisionsAfterMask =
953  const std::vector<std::pair<std::string, int> >& prescaleFactors =
955  const std::vector<std::pair<std::string, int> >& triggerMasks =
957 
958  myCoutStream << std::endl;
959  myCoutStream << "\nLogical expression\n "
960  << m_l1GtUtilsLogicalExpression << std::endl;
961 
962  for (size_t iTrig = 0; iTrig < errorCodes.size(); ++iTrig) {
963  if ((errorCodes[iTrig]).second != 0) {
964  myCoutStream
965  << "\nError encountered when retrieving L1 results for trigger "
966  << (errorCodes[iTrig]).first << " (bit number "
967  << (expL1Triggers[iTrig]).tokenNumber << ")\n for run "
968  << iEvent.run() << ", luminosity block "
969  << iEvent.luminosityBlock() << " with L1 menu \n "
970  << m_l1GtUtils.l1TriggerMenu() << "\n Error code: "
971  << (errorCodes[iTrig]).second << "\n" << std::endl;
972 
973  } else {
974 
975  myCoutStream << "\n" << (errorCodes[iTrig]).first
976  << " - bit number " << (expL1Triggers[iTrig]).tokenNumber
977  << std::endl;
978 
979  myCoutStream << " decision before mask = "
980  << (decisionsBeforeMask[iTrig]).second << std::endl;
981 
982  myCoutStream << " decision after mask = "
983  << (decisionsAfterMask[iTrig]).second << std::endl;
984 
985  myCoutStream << " prescale factor = "
986  << (prescaleFactors[iTrig]).second << std::endl;
987 
988  myCoutStream << " trigger mask = "
989  << (triggerMasks[iTrig]).second << std::endl;
990 
991  myCoutStream << " error code = "
992  << (errorCodes[iTrig]).second << std::endl;
993 
994  }
995  }
996 
997 
998  printOutput(myCoutStream);
999 }
1000 
1002  const edm::EventSetup& evSetup) {
1003 
1004  LogDebug("L1GtAnalyzer")
1005  << "\n**** L1GtAnalyzer::analyzeL1GtUtilsMenuLite ****\n"
1006  << std::endl;
1007 
1008  // before accessing any result from L1GtUtils, one must retrieve and cache
1009  // the L1GtTriggerMenuLite product
1010  // add this call in the analyze / produce / filter method of your
1011  // analyzer / producer / filter
1012 
1013  bool useL1EventSetup = false;
1014  bool useL1GtTriggerMenuLite = true;
1015 
1016  if (m_l1GtTmLInputTagProv) {
1017 
1018  // input tag for L1GtTriggerMenuLite retrieved from provenance
1019  m_l1GtUtils.getL1GtRunCache(iEvent, evSetup, useL1EventSetup,
1020  useL1GtTriggerMenuLite);
1021 
1022  } else {
1023 
1024  // input tag for L1GtTriggerMenuLite explicitly given
1025  m_l1GtUtils.getL1GtRunCache(iEvent, evSetup, useL1EventSetup,
1026  useL1GtTriggerMenuLite, m_l1GtTmLInputTag);
1027  }
1028 
1029  analyzeL1GtUtilsCore(iEvent, evSetup);
1030 
1031 }
1032 
1034  const edm::EventSetup& evSetup) {
1035 
1036  LogDebug("L1GtAnalyzer")
1037  << "\n**** L1GtAnalyzer::analyzeL1GtUtilsEventSetup ****\n"
1038  << std::endl;
1039 
1040  // before accessing any result from L1GtUtils, one must retrieve and cache
1041  // the L1 trigger event setup
1042  // add this call in the analyze / produce / filter method of your
1043  // analyzer / producer / filter
1044 
1045  bool useL1EventSetup = true;
1046  bool useL1GtTriggerMenuLite = false;
1047 
1048  m_l1GtUtils.getL1GtRunCache(iEvent, evSetup, useL1EventSetup,
1049  useL1GtTriggerMenuLite);
1050 
1051  analyzeL1GtUtilsCore(iEvent, evSetup);
1052 
1053 }
1054 
1056  const edm::EventSetup& evSetup) {
1057 
1058  LogDebug("L1GtAnalyzer")
1059  << "\n**** L1GtAnalyzer::analyzeL1GtUtils: fall-through case ****\n"
1060  << std::endl;
1061 
1062  // before accessing any result from L1GtUtils, one must retrieve and cache
1063  // the L1 trigger event setup and the L1GtTriggerMenuLite product
1064  // add this call in the analyze / produce / filter method of your
1065  // analyzer / producer / filter
1066 
1067  bool useL1EventSetup = true;
1068  bool useL1GtTriggerMenuLite = true;
1069 
1070  if (m_l1GtTmLInputTagProv) {
1071 
1072  // input tag for L1GtTriggerMenuLite retrieved from provenance
1073  m_l1GtUtils.getL1GtRunCache(iEvent, evSetup, useL1EventSetup,
1074  useL1GtTriggerMenuLite);
1075 
1076  } else {
1077 
1078  // input tag for L1GtTriggerMenuLite explicitly given
1079  m_l1GtUtils.getL1GtRunCache(iEvent, evSetup, useL1EventSetup,
1080  useL1GtTriggerMenuLite, m_l1GtTmLInputTag);
1081 
1082  }
1083 
1084  analyzeL1GtUtilsCore(iEvent, evSetup);
1085 
1086 }
1087 
1089  const edm::EventSetup& evSetup) {
1090 
1091  LogDebug("L1GtAnalyzer") << "\n**** L1GtAnalyzer::analyzeTrigger ****\n"
1092  << std::endl;
1093 
1094  // define an output stream to print into
1095  // it can then be directed to whatever log level is desired
1096  std::ostringstream myCoutStream;
1097 
1098  // print all the stuff if at LogDebug level
1099  myCoutStream << "\n\nFull analysis of an algorithm or technical trigger"
1100  << "\nMethod: L1GtAnalyzer::analyzeTrigger" << "\nTrigger: "
1101  << m_nameAlgTechTrig << "\n" << std::endl;
1102 
1103  const unsigned int runNumber = iEvent.run();
1104  const unsigned int lsNumber = iEvent.luminosityBlock();
1105  const unsigned int eventNumber = iEvent.id().event();
1106 
1107  myCoutStream << "Run: " << runNumber << " LS: " << lsNumber << " Event: "
1108  << eventNumber << "\n\n" << std::endl;
1109 
1110 
1111  // before accessing any result from L1GtUtils, one must retrieve and cache
1112  // the L1 trigger event setup and the L1GtTriggerMenuLite product
1113  // add this call in the analyze / produce / filter method of your
1114  // analyzer / producer / filter
1115 
1116  bool useL1EventSetup = false;
1117  bool useL1GtTriggerMenuLite = false;
1118 
1119  switch (m_l1GtUtilsConfiguration) {
1120  case 0: {
1121  useL1EventSetup = false;
1122  useL1GtTriggerMenuLite = true;
1123 
1124  }
1125  break;
1126  case 100000: {
1127  useL1EventSetup = true;
1128  useL1GtTriggerMenuLite = true;
1129 
1130  }
1131  break;
1132  case 200000: {
1133  useL1EventSetup = true;
1134  useL1GtTriggerMenuLite = false;
1135 
1136  }
1137  break;
1138  default: {
1139  // do nothing
1140  }
1141  break;
1142  }
1143 
1144  if (m_l1GtTmLInputTagProv) {
1145 
1146  // input tag for L1GtTriggerMenuLite retrieved from provenance
1147  m_l1GtUtils.getL1GtRunCache(iEvent, evSetup, useL1EventSetup,
1148  useL1GtTriggerMenuLite);
1149 
1150  } else {
1151 
1152  // input tag for L1GtTriggerMenuLite explicitly given
1153  m_l1GtUtils.getL1GtRunCache(iEvent, evSetup, useL1EventSetup,
1154  useL1GtTriggerMenuLite, m_l1GtTmLInputTag);
1155 
1156  }
1157 
1158  // testing which environment is used
1159 
1160  int iErrorCode = -1;
1161  int l1ConfCode = -1;
1162 
1163  const bool l1Conf = m_l1GtUtils.availableL1Configuration(iErrorCode,
1164  l1ConfCode);
1165 
1166  if (l1Conf) {
1167  LogDebug("L1GtAnalyzer") << "\nL1 configuration code:" << l1ConfCode
1168  << "\nValid L1 trigger configuration.\n" << std::endl;
1169 
1170  LogTrace("L1GtAnalyzer") << "\nL1 trigger menu name and implementation:"
1171  << "\n" << m_l1GtUtils.l1TriggerMenu() << "\n"
1173  << std::endl;
1174 
1175  } else {
1176  myCoutStream << "\nL1 configuration code:" << l1ConfCode
1177  << "\nNo valid L1 trigger configuration available."
1178  << "\nCheck L1GtUtils wiki page for error code interpretation\n"
1179  << std::endl;
1180  return;
1181  }
1182 
1183  // the following methods share the same error code, therefore one can check only once
1184  // the validity of the result
1185 
1186  iErrorCode = -1;
1187 
1188  bool decisionBeforeMaskAlgTechTrig = false;
1189  bool decisionAfterMaskAlgTechTrig = false;
1190  bool decisionAlgTechTrig = false;
1191  int prescaleFactorAlgTechTrig = -1;
1192  int triggerMaskAlgTechTrig = -1;
1193 
1195  decisionBeforeMaskAlgTechTrig = m_l1GtUtils.decisionBeforeMask(iEvent,
1196  m_nameAlgTechTrig, iErrorCode);
1197 
1198  decisionAfterMaskAlgTechTrig = m_l1GtUtils.decisionAfterMask(iEvent,
1199  m_nameAlgTechTrig, iErrorCode);
1200 
1201  decisionAlgTechTrig = m_l1GtUtils.decision(iEvent, m_nameAlgTechTrig,
1202  iErrorCode);
1203 
1204  prescaleFactorAlgTechTrig = m_l1GtUtils.prescaleFactor(iEvent,
1205  m_nameAlgTechTrig, iErrorCode);
1206 
1207  triggerMaskAlgTechTrig = m_l1GtUtils.triggerMask(iEvent,
1208  m_nameAlgTechTrig, iErrorCode);
1209 
1210  } else {
1211  decisionBeforeMaskAlgTechTrig = m_l1GtUtils.decisionBeforeMask(iEvent,
1213  m_nameAlgTechTrig, iErrorCode);
1214 
1215  decisionAfterMaskAlgTechTrig = m_l1GtUtils.decisionAfterMask(iEvent,
1217  m_nameAlgTechTrig, iErrorCode);
1218 
1219  decisionAlgTechTrig = m_l1GtUtils.decision(iEvent,
1221  m_nameAlgTechTrig, iErrorCode);
1222 
1223  prescaleFactorAlgTechTrig = m_l1GtUtils.prescaleFactor(iEvent,
1225  m_nameAlgTechTrig, iErrorCode);
1226 
1227  triggerMaskAlgTechTrig = m_l1GtUtils.triggerMask(iEvent,
1229  m_nameAlgTechTrig, iErrorCode);
1230 
1231  }
1232 
1233  switch (iErrorCode) {
1234  case 0: {
1235  // do nothing here
1236  }
1237  break;
1238  case 1: {
1239  myCoutStream << "\n" << m_nameAlgTechTrig
1240  << " does not exist in the L1 menu "
1241  << m_l1GtUtils.l1TriggerMenu() << "\n" << std::endl;
1242  return;
1243  }
1244  break;
1245  default: {
1246  myCoutStream << "\nError: "
1247  << "\n An error was encountered when retrieving decision, mask and prescale factor for "
1248  << m_nameAlgTechTrig << "\n L1 Menu: "
1249  << m_l1GtUtils.l1TriggerMenu() << "\n Error code: "
1250  << iErrorCode
1251  << "\n Check L1GtUtils wiki page for error code interpretation"
1252  << std::endl;
1253  }
1254  break;
1255  }
1256 
1257  // retrieve L1Extra
1258  // for object maps, only BxInEvent = 0 (aka L1A bunch cross) is relevant
1259 
1260  m_retrieveL1Extra.retrieveL1ExtraObjects(iEvent, evSetup);
1261 
1262  // print all L1Extra collections from all BxInEvent
1263  myCoutStream << "\nL1Extra collections from all BxInEvent" << std::endl;
1264  m_retrieveL1Extra.printL1Extra(myCoutStream);
1265 
1266  int bxInEvent = 0;
1267  myCoutStream << "\nL1Extra collections from BxInEvent = 0 (BX for L1A)" << std::endl;
1268  m_retrieveL1Extra.printL1Extra(myCoutStream, bxInEvent);
1269 
1270  // retrieve L1GlobalTriggerObjectMapRecord and L1GlobalTriggerObjectMaps products
1271  // the module returns an error code only if both payloads are missing
1272 
1273  int iErrorRecord = 0;
1274 
1275  bool validRecord = false;
1276  bool gtObjectMapRecordValid = false;
1277 
1279  iEvent.getByLabel(m_l1GtObjectMapsInputTag, gtObjectMaps);
1280 
1281  if (gtObjectMaps.isValid()) {
1282 
1283  validRecord = true;
1284 
1285  } else {
1286 
1287  iErrorRecord = 10;
1288  LogDebug("L1GtAnalyzer") << "\nL1GlobalTriggerObjectMaps with \n "
1289  << m_l1GtObjectMapsInputTag << "\nnot found in the event."
1290  << std::endl;
1291  }
1292 
1294  iEvent.getByLabel(m_l1GtObjectMapTag, gtObjectMapRecord);
1295 
1296  if (gtObjectMapRecord.isValid()) {
1297 
1298  gtObjectMapRecordValid = true;
1299  validRecord = true;
1300 
1301  } else {
1302 
1303  iErrorRecord = iErrorRecord + 100;
1304  LogDebug("L1GtAnalyzer") << "\nL1GlobalTriggerObjectMapRecord with \n "
1305  << m_l1GtObjectMapTag << "\nnot found in the event."
1306  << std::endl;
1307 
1308  }
1309 
1310  //FIXME remove when validRecord and gtObjectMapRecordValid are used - avoid warning here :-)
1311  if (validRecord && gtObjectMapRecordValid) {
1312  // do nothing
1313  }
1314 
1315 
1316  // get the RPN vector
1317 
1318 
1319 // int pfIndexTechTrig = -1;
1320 // int pfIndexAlgoTrig = -1;
1321 //
1322 // if (validRecord) {
1323 // if (gtObjectMapRecordValid) {
1324 //
1325 // pfIndexTechTrig
1326 // = (gtObjectMapRecord->gtFdlWord()).gtPrescaleFactorIndexTech();
1327 // pfIndexAlgoTrig
1328 // = (gtObjectMapRecord->gtFdlWord()).gtPrescaleFactorIndexAlgo();
1329 //
1330 // } else {
1331 //
1332 // pfIndexTechTrig
1333 // = static_cast<int> (gtObjectMaps->gtPrescaleFactorIndexTech());
1334 // pfIndexAlgoTrig
1335 // = static_cast<int> (gtObjectMaps->gtPrescaleFactorIndexAlgo());
1336 //
1337 // }
1338 //
1339 // } else {
1340 //
1341 // LogDebug("L1GtAnalyzer") << "\nError: "
1342 // << "\nNo valid L1GlobalTriggerRecord with \n "
1343 // << l1GtRecordInputTag << "\nfound in the event."
1344 // << "\nNo valid L1GlobalTriggerReadoutRecord with \n "
1345 // << l1GtReadoutRecordInputTag << "\nfound in the event."
1346 // << std::endl;
1347 //
1348 // iError = l1ConfCode + iErrorRecord;
1349 // return;
1350 //
1351 // }
1352 
1353  //
1354  myCoutStream << "\nResults for trigger " << m_nameAlgTechTrig
1355  << "\n Trigger mask: " << triggerMaskAlgTechTrig
1356  << "\n Prescale factor: " << prescaleFactorAlgTechTrig
1357  << "\n Decision before mask: " << decisionBeforeMaskAlgTechTrig
1358  << "\n Decision after mask: " << decisionAfterMaskAlgTechTrig
1359  << "\n Decision (after mask): " << decisionAlgTechTrig << "\n"
1360  << std::endl;
1361 
1362 
1363  printOutput(myCoutStream);
1364 }
1365 
1366 // analyze: object map product
1368  const edm::EventSetup& evSetup) {
1369 
1370  LogDebug("L1GtAnalyzer")
1371  << "\n**** L1GtAnalyzer::analyzeObjectMap object map product ****\n"
1372  << std::endl;
1373 
1374  // define an output stream to print into
1375  // it can then be directed to whatever log level is desired
1376  std::ostringstream myCoutStream;
1377 
1378  // get a handle to the object map product
1379  // the product can come only from emulator - no hardware ObjectMapRecord
1381  iEvent.getByLabel(m_l1GtObjectMapTag, gtObjectMapRecord);
1382 
1383  if (!gtObjectMapRecord.isValid()) {
1384  LogDebug("L1GtAnalyzer")
1385  << "\nWarning: L1GlobalTriggerObjectMapRecord with input tag "
1387  << "\nrequested in configuration, but not found in the event."
1388  << "\nExit the method.\n" << std::endl;
1389 
1390  return;
1391  }
1392 
1393  // get all object maps
1394  const std::vector<L1GlobalTriggerObjectMap>& objMapVec =
1395  gtObjectMapRecord->gtObjectMap();
1396 
1397  // print every object map via the implemented print
1398  for (std::vector<L1GlobalTriggerObjectMap>::const_iterator it =
1399  objMapVec.begin(); it != objMapVec.end(); ++it) {
1400 
1401  (*it).print(myCoutStream);
1402  }
1403 
1404  //
1405  const CombinationsInCond* comb = gtObjectMapRecord->getCombinationsInCond(
1407 
1408  // number of combinations
1409  if (comb != 0) {
1410  myCoutStream << "\n Number of combinations passing ("
1411  << m_nameAlgTechTrig << ", " << m_condName << "): "
1412  << comb->size() << std::endl;
1413  } else {
1414  myCoutStream << "\n No combination passes (" << m_nameAlgTechTrig
1415  << ", " << m_condName << ") " << std::endl;
1416 
1417  }
1418 
1419  // condition result
1420  const bool result = gtObjectMapRecord->getConditionResult(
1422 
1423  myCoutStream << "\n Result for condition " << m_condName
1424  << " in algorithm " << m_nameAlgTechTrig << ": " << result
1425  << std::endl;
1426 
1427  printOutput(myCoutStream);
1428 
1429 }
1430 
1431 // analyze: usage of L1GtTriggerMenuLite
1433  const edm::EventSetup& evSetup) {
1434 
1435  LogDebug("L1GtAnalyzer")
1436  << "\n**** L1GtAnalyzer::analyzeL1GtTriggerMenuLite ****\n"
1437  << std::endl;
1438 
1439  // define an output stream to print into
1440  // it can then be directed to whatever log level is desired
1441  std::ostringstream myCoutStream;
1442 
1443  // get Run Data - the same code can be run in beginRun, with getByLabel from edm::Run
1444  const edm::Run& iRun = iEvent.getRun();
1445 
1446 
1447  // get L1GtTriggerMenuLite
1448  edm::Handle<L1GtTriggerMenuLite> triggerMenuLite;
1449  iRun.getByLabel(m_l1GtTmLInputTag, triggerMenuLite);
1450 
1451  if (!triggerMenuLite.isValid()) {
1452 
1453  LogDebug("L1GtAnalyzer") << "\nL1GtTriggerMenuLite with \n "
1455  << "\nrequested in configuration, but not found in the event."
1456  << "\nExit the method.\n" << std::endl;
1457 
1458  return;
1459  }
1460 
1461  // print via supplied "print" function
1462  myCoutStream << (*triggerMenuLite);
1463 
1464  // test the individual methods
1465 
1466  const std::string& triggerMenuInterface =
1467  triggerMenuLite->gtTriggerMenuInterface();
1468  const std::string& triggerMenuName = triggerMenuLite->gtTriggerMenuName();
1469  const std::string& triggerMenuImplementation =
1470  triggerMenuLite->gtTriggerMenuImplementation();
1471  const std::string& scaleDbKey = triggerMenuLite->gtScaleDbKey();
1472 
1473  const L1GtTriggerMenuLite::L1TriggerMap& algorithmMap = triggerMenuLite->gtAlgorithmMap();
1474  const L1GtTriggerMenuLite::L1TriggerMap& algorithmAliasMap =
1475  triggerMenuLite->gtAlgorithmAliasMap();
1476  const L1GtTriggerMenuLite::L1TriggerMap& technicalTriggerMap =
1477  triggerMenuLite->gtTechnicalTriggerMap();
1478 
1479  const std::vector<unsigned int>& triggerMaskAlgoTrig =
1480  triggerMenuLite->gtTriggerMaskAlgoTrig();
1481  const std::vector<unsigned int>& triggerMaskTechTrig =
1482  triggerMenuLite->gtTriggerMaskTechTrig();
1483 
1484  const std::vector<std::vector<int> >& prescaleFactorsAlgoTrig =
1485  triggerMenuLite->gtPrescaleFactorsAlgoTrig();
1486  const std::vector<std::vector<int> >& prescaleFactorsTechTrig =
1487  triggerMenuLite->gtPrescaleFactorsTechTrig();
1488 
1489  // print in the same format as in L1GtTriggerMenuLite definition
1490 
1491  size_t nrDefinedAlgo = algorithmMap.size();
1492  size_t nrDefinedTech = technicalTriggerMap.size();
1493 
1494  // header for printing algorithms
1495 
1496  myCoutStream << "\n ********** L1 Trigger Menu - printing ********** \n"
1497  << "\nL1 Trigger Menu Interface: " << triggerMenuInterface
1498  << "\nL1 Trigger Menu Name: " << triggerMenuName
1499  << "\nL1 Trigger Menu Implementation: " << triggerMenuImplementation
1500  << "\nAssociated Scale DB Key: " << scaleDbKey << "\n\n"
1501  << "\nL1 Physics Algorithms: " << nrDefinedAlgo << " algorithms defined." << "\n\n"
1502  << "Bit Number "
1503  << std::right << std::setw(35) << "Algorithm Name" << " "
1504  << std::right << std::setw(35) << "Algorithm Alias" << " "
1505  << std::right << std::setw(12) << "Trigger Mask";
1506  for (unsigned iSet = 0; iSet < prescaleFactorsAlgoTrig.size(); iSet++) {
1507  myCoutStream << std::right << std::setw(10) << "PF Set "
1508  << std::right << std::setw(2) << iSet;
1509  }
1510 
1511  myCoutStream << std::endl;
1512 
1513 
1514  for (L1GtTriggerMenuLite::CItL1Trig itTrig = algorithmMap.begin(); itTrig
1515  != algorithmMap.end(); itTrig++) {
1516 
1517  const unsigned int bitNumber = itTrig->first;
1518  const std::string& aName = itTrig->second;
1519 
1520  std::string aAlias;
1521  L1GtTriggerMenuLite::CItL1Trig itAlias = algorithmAliasMap.find(bitNumber);
1522  if (itAlias != algorithmAliasMap.end()) {
1523  aAlias = itAlias->second;
1524  }
1525 
1526  myCoutStream << std::setw(6) << bitNumber << " "
1527  << std::right << std::setw(35) << aName << " "
1528  << std::right << std::setw(35) << aAlias << " "
1529  << std::right << std::setw(12) << triggerMaskAlgoTrig[bitNumber];
1530  for (unsigned iSet = 0; iSet < prescaleFactorsAlgoTrig.size(); iSet++) {
1531  myCoutStream << std::right << std::setw(12) << prescaleFactorsAlgoTrig[iSet][bitNumber];
1532  }
1533 
1534  myCoutStream << std::endl;
1535  }
1536 
1537  myCoutStream << "\nL1 Technical Triggers: " << nrDefinedTech
1538  << " technical triggers defined." << "\n\n" << std::endl;
1539  if (nrDefinedTech) {
1540  myCoutStream
1541  << std::right << std::setw(6) << "Bit Number "
1542  << std::right << std::setw(45) << " Technical trigger name " << " "
1543  << std::right << std::setw(12) << "Trigger Mask";
1544  for (unsigned iSet = 0; iSet < prescaleFactorsTechTrig.size(); iSet++) {
1545  myCoutStream << std::right << std::setw(10) << "PF Set "
1546  << std::right << std::setw(2) << iSet;
1547  }
1548 
1549  myCoutStream << std::endl;
1550  }
1551 
1552  for (L1GtTriggerMenuLite::CItL1Trig itTrig = technicalTriggerMap.begin(); itTrig
1553  != technicalTriggerMap.end(); itTrig++) {
1554 
1555  unsigned int bitNumber = itTrig->first;
1556  std::string aName = itTrig->second;
1557 
1558  myCoutStream << std::setw(6) << bitNumber << " "
1559  << std::right << std::setw(45) << aName
1560  << std::right << std::setw(12) << triggerMaskTechTrig[bitNumber];
1561  for (unsigned iSet = 0; iSet < prescaleFactorsTechTrig.size(); iSet++) {
1562  myCoutStream << std::right << std::setw(12) << prescaleFactorsTechTrig[iSet][bitNumber];
1563  }
1564 
1565  myCoutStream << std::endl;
1566 
1567  }
1568 
1569  // individual methods
1570 
1571  int errorCode = -1;
1572  const std::string* algorithmAlias = triggerMenuLite->gtAlgorithmAlias(
1573  m_bitNumber, errorCode);
1574  if (errorCode) {
1575  myCoutStream
1576  << "\nError code retrieving alias for algorithm with bit number "
1577  << m_bitNumber << ": " << errorCode << std::endl;
1578  } else {
1579  myCoutStream << "\nAlias for algorithm with bit number " << m_bitNumber
1580  << ": " << (*algorithmAlias) << std::endl;
1581  }
1582 
1583  errorCode = -1;
1584  const std::string* algorithmName = triggerMenuLite->gtAlgorithmName(
1585  m_bitNumber, errorCode);
1586  if (errorCode) {
1587  myCoutStream
1588  << "\nError code retrieving name for algorithm with bit number "
1589  << m_bitNumber << ": " << errorCode << std::endl;
1590  } else {
1591  myCoutStream << "\nName for algorithm with bit number " << m_bitNumber
1592  << ": " << (*algorithmName) << std::endl;
1593  }
1594 
1595  errorCode = -1;
1596  const std::string* techTrigName = triggerMenuLite->gtTechTrigName(
1597  m_bitNumber, errorCode);
1598  if (errorCode) {
1599  myCoutStream
1600  << "\nError code retrieving name for technical trigger with bit number "
1601  << m_bitNumber << ": " << errorCode << std::endl;
1602  } else {
1603  myCoutStream << "\nName for technical trigger with bit number "
1604  << m_bitNumber << ": " << (*techTrigName) << std::endl;
1605  }
1606 
1607  errorCode = -1;
1608  const unsigned int bitNumber = triggerMenuLite->gtBitNumber(
1609  m_nameAlgTechTrig, errorCode);
1610  if (errorCode) {
1611  myCoutStream
1612  << "\nError code retrieving bit number for algorithm/technical trigger "
1613  << m_nameAlgTechTrig << ": " << errorCode << std::endl;
1614  } else {
1615  myCoutStream << "\nBit number for algorithm/technical trigger "
1616  << m_nameAlgTechTrig << ": " << bitNumber << std::endl;
1617  }
1618 
1619  // not tested
1620  //errorCode = -1;
1621  //const bool triggerMenuLite->gtTriggerResult( m_nameAlgTechTrig,
1622  // const std::vector<bool>& decWord, errorCode);
1623 
1624 
1625  printOutput(myCoutStream);
1626 
1627 }
1628 
1629 // analyze: usage of ConditionsInEdm
1631  const edm::EventSetup& evSetup) {
1632 
1633  LogDebug("L1GtAnalyzer")
1634  << "\n**** L1GtAnalyzer::analyzeConditionsInRunBlock ****\n"
1635  << std::endl;
1636 
1637  // define an output stream to print into
1638  // it can then be directed to whatever log level is desired
1639  std::ostringstream myCoutStream;
1640 
1641  // get ConditionsInRunBlock
1643  iRun.getByLabel(m_condInEdmInputTag, condInRunBlock);
1644 
1645  if (!condInRunBlock.isValid()) {
1646 
1647  LogDebug("L1GtAnalyzer") << "\nConditionsInRunBlock with \n "
1649  << "\nrequested in configuration, but not found in the event."
1650  << "\nExit the method.\n" << std::endl;
1651 
1652  return;
1653  }
1654 
1655  const boost::uint16_t beamModeVal = condInRunBlock->beamMode;
1656  const boost::uint16_t beamMomentumVal = condInRunBlock->beamMomentum;
1657  const boost::uint32_t lhcFillNumberVal = condInRunBlock->lhcFillNumber;
1658 
1659  // print via supplied "print" function
1660  myCoutStream << "\nLHC quantities in run " << iRun.run()
1661  << "\n Beam Mode = " << beamModeVal
1662  << "\n Beam Momentum = " << beamMomentumVal << " GeV"
1663  << "\n LHC Fill Number = " << lhcFillNumberVal
1664  << std::endl;
1665 
1666  printOutput(myCoutStream);
1667 
1668 }
1669 
1670 
1672  const edm::LuminosityBlock& iLumi, const edm::EventSetup& evSetup) {
1673  LogDebug("L1GtAnalyzer")
1674  << "\n**** L1GtAnalyzer::analyzeConditionsInLumiBlock ****\n"
1675  << std::endl;
1676 
1677  // define an output stream to print into
1678  // it can then be directed to whatever log level is desired
1679  std::ostringstream myCoutStream;
1680 
1681  // get ConditionsInLumiBlock
1683  iLumi.getByLabel(m_condInEdmInputTag, condInLumiBlock);
1684 
1685  if (!condInLumiBlock.isValid()) {
1686 
1687  LogDebug("L1GtAnalyzer") << "\nConditionsInLumiBlock with \n "
1689  << "\nrequested in configuration, but not found in the event."
1690  << "\nExit the method.\n" << std::endl;
1691 
1692  return;
1693  }
1694 
1695  const boost::uint32_t totalIntensityBeam1Val =
1696  condInLumiBlock->totalIntensityBeam1;
1697  const boost::uint32_t totalIntensityBeam2Val =
1698  condInLumiBlock->totalIntensityBeam2;
1699 
1700  myCoutStream << "\nLHC quantities in luminosity section "
1701 
1702  << iLumi.luminosityBlock() << " from run " << iLumi.run()
1703  << "\n Total Intensity Beam 1 (Integer × 10E10 charges) = "
1704  << totalIntensityBeam1Val
1705  << "\n Total Intensity Beam 2 (Integer × 10E10 charges) = "
1706  << totalIntensityBeam2Val << std::endl;
1707 
1708  printOutput(myCoutStream);
1709 
1710 }
1711 
1713  const edm::EventSetup& evSetup) {
1714  // define an output stream to print into
1715  // it can then be directed to whatever log level is desired
1716  std::ostringstream myCoutStream;
1717 
1718  // get ConditionsInEventBlock
1720  iEvent.getByLabel(m_condInEdmInputTag, condInEventBlock);
1721 
1722  if (!condInEventBlock.isValid()) {
1723 
1724  LogDebug("L1GtAnalyzer") << "\nConditionsInEventBlock with \n "
1726  << "\nrequested in configuration, but not found in the event."
1727  << "\nExit the method.\n" << std::endl;
1728 
1729  return;
1730  }
1731 
1732  const boost::uint16_t bstMasterStatusVal =
1733  condInEventBlock->bstMasterStatus;
1734  const boost::uint32_t turnCountNumberVal =
1735  condInEventBlock->turnCountNumber;
1736 
1737  myCoutStream << "\nLHC quantities in event " << iEvent.id().event()
1738  << " from luminosity section " << iEvent.luminosityBlock()
1739  << " from run " << iEvent.run() << "\n BST Master Status = "
1740  << bstMasterStatusVal << "\n Turn count number = "
1741  << turnCountNumberVal << std::endl;
1742 
1743  printOutput(myCoutStream);
1744 
1745 }
1746 
1747 void L1GtAnalyzer::printOutput(std::ostringstream& myCout) {
1748 
1749  switch (m_printOutput) {
1750  case 0: {
1751 
1752  std::cout << myCout.str() << std::endl;
1753 
1754  }
1755 
1756  break;
1757  case 1: {
1758 
1759  LogTrace("L1GtAnalyzer") << myCout.str() << std::endl;
1760 
1761  }
1762  break;
1763 
1764  case 2: {
1765 
1766  edm::LogVerbatim("L1GtAnalyzer") << myCout.str() << std::endl;
1767 
1768  }
1769 
1770  break;
1771  case 3: {
1772 
1773  edm::LogInfo("L1GtAnalyzer") << myCout.str();
1774 
1775  }
1776 
1777  break;
1778  default: {
1779  std::cout << "\n\n L1GtAnalyzer: Error - no print output = "
1780  << m_printOutput
1781  << " defined! \n Check available values in the cfi file."
1782  << "\n" << std::endl;
1783 
1784  }
1785  break;
1786  }
1787 
1788  myCout.str("");
1789  myCout.clear();
1790 
1791 }
1792 
1793 // analyze each event: event loop
1795  const edm::EventSetup& evSetup) {
1796 
1797  // analyze: decision and decision word
1798  // bunch cross in event BxInEvent = 0 - L1Accept event
1800  analyzeDecisionReadoutRecord(iEvent, evSetup);
1801  }
1802 
1803  // analyze: decision for a given algorithm using L1GtUtils functions
1804  // for tests, use only one of the following methods
1805 
1806  switch (m_l1GtUtilsConfiguration) {
1807  case 0: {
1809  analyzeL1GtUtilsMenuLite(iEvent, evSetup);
1810  }
1811 
1812  // full analysis of an algorithm or technical trigger
1813  if (m_analyzeTriggerEnable) {
1814  analyzeTrigger(iEvent, evSetup);
1815  }
1816 
1817  }
1818  break;
1819  case 100000: {
1821  analyzeL1GtUtils(iEvent, evSetup);
1822  }
1823 
1824  // full analysis of an algorithm or technical trigger
1825  if (m_analyzeTriggerEnable) {
1826  analyzeTrigger(iEvent, evSetup);
1827  }
1828 
1829  }
1830  break;
1831  case 200000: {
1833  analyzeL1GtUtilsEventSetup(iEvent, evSetup);
1834  }
1835 
1836  // full analysis of an algorithm or technical trigger
1837  if (m_analyzeTriggerEnable) {
1838  analyzeTrigger(iEvent, evSetup);
1839  }
1840 
1841  }
1842  break;
1843  default: {
1844  // do nothing
1845  }
1846  break;
1847  }
1848 
1849  // analyze: object map product
1851  analyzeObjectMap(iEvent, evSetup);
1852  }
1853 
1854  // analyze: L1GtTriggerMenuLite
1856  analyzeL1GtTriggerMenuLite(iEvent, evSetup);
1857  }
1858 
1859  // analyze: usage of ConditionsInEdm
1861  analyzeConditionsInEventBlock(iEvent, evSetup);
1862  }
1863 
1864 }
1865 
1866 // end section
1868  const edm::EventSetup& evSetup) {
1869 
1870  // empty
1871 
1872 }
1873 void L1GtAnalyzer::endRun(const edm::Run& iRun, const edm::EventSetup& evSetup) {
1874 
1875  // empty
1876 
1877 }
1878 
1879 // method called once each job just after ending the event loop
1881 
1882  // empty
1883 
1884 }
1885 
#define LogDebug(id)
virtual void analyzeObjectMap(const edm::Event &, const edm::EventSetup &)
analyze: object map product
EventNumber_t event() const
Definition: EventID.h:41
bool getByLabel(std::string const &label, Handle< PROD > &result) const
Definition: Run.h:214
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
edm::InputTag m_l1GmtInputTag
input tag for muon collection from GMT
Definition: L1GtAnalyzer.h:135
static const bool useL1GtTriggerMenuLite(false)
const int logicalExpressionRunUpdate(const edm::Run &, const edm::EventSetup &, const std::string &)
Definition: L1GtUtils.cc:2578
RunNumber_t run() const
Definition: RunBase.h:42
virtual void analyzeDecisionReadoutRecord(const edm::Event &, const edm::EventSetup &)
edm::InputTag m_condInEdmInputTag
input tag for ConditionInEdm products
Definition: L1GtAnalyzer.h:141
edm::InputTag m_l1GtRecordInputTag
input tags for GT lite product
Definition: L1GtAnalyzer.h:126
TriggerCategory
Definition: L1GtUtils.h:58
virtual void endJob()
end of job
const bool availableL1Configuration(int &errorCode, int &l1ConfCode) const
Definition: L1GtUtils.cc:2293
bool m_analyzeObjectMapEnable
Definition: L1GtAnalyzer.h:112
virtual void analyze(const edm::Event &, const edm::EventSetup &)
analyze each event: event loop over various code snippets
bool m_analyzeConditionsInRunBlockEnable
Definition: L1GtAnalyzer.h:116
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:59
const std::vector< std::pair< std::string, int > > & prescaleFactors()
Definition: L1GtUtils.cc:2721
std::string m_l1GtUtilsLogicalExpression
Definition: L1GtAnalyzer.h:168
Run const & getRun() const
Definition: Event.cc:58
const std::vector< unsigned int > & triggerMaskSet(const TriggerCategory &trigCategory, int &errorCode)
Definition: L1GtUtils.cc:2079
bool m_analyzeDecisionReadoutRecordEnable
enable / disable various analysis methods
Definition: L1GtAnalyzer.h:105
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
virtual void endLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &)
end section
bool getByLabel(std::string const &label, Handle< PROD > &result) const
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
void analyzeConditionsInEventBlock(const edm::Event &, const edm::EventSetup &)
to be used in analyze/produce/filter
void printL1Extra(std::ostream &oStr, const L1GtObject &gtObject, const bool checkBxInEvent, const int bxInEvent, const bool checkObjIndexInColl, const int objIndexInColl) const
std::map< unsigned int, std::string > L1TriggerMap
map containing the physics algorithms or the technical triggers
LuminosityBlockNumber_t luminosityBlock() const
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:2708
bool m_analyzeConditionsInEventBlockEnable
Definition: L1GtAnalyzer.h:118
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:144
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:2695
virtual void endRun(const edm::Run &, const edm::EventSetup &)
int iEvent
Definition: GenABIO.cc:230
std::string m_condName
a condition in the algorithm trigger to test the object maps
Definition: L1GtAnalyzer.h:147
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
void analyzeL1GtTriggerMenuLite(const edm::Event &, const edm::EventSetup &)
analyze: usage of L1GtTriggerMenuLite
const std::string & l1TriggerMenuImplementation() const
return the L1 trigger menu implementation
Definition: L1GtUtils.cc:2203
edm::InputTag m_l1GtObjectMapTag
input tags for GT object map collection L1GlobalTriggerObjectMapRecord
Definition: L1GtAnalyzer.h:129
L1RetrieveL1Extra m_retrieveL1Extra
Definition: L1GtAnalyzer.h:98
std::vector< bool > DecisionWord
typedefs
dictionary comb
tuple result
Definition: query.py:137
bool m_analyzeTriggerEnable
Definition: L1GtAnalyzer.h:110
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
RunNumber_t run() const
Definition: Event.h:85
RunNumber_t run() const
bool m_analyzeL1GtUtilsEventSetupEnable
Definition: L1GtAnalyzer.h:108
const std::vector< L1GtLogicParser::OperandToken > & expL1Triggers()
list of triggers in the logical expression, trigger decisions, prescale factors and masks...
Definition: L1GtUtils.h:112
unsigned int m_bitNumber
a bit number to retrieve the name and the alias
Definition: L1GtAnalyzer.h:150
static const bool useL1EventSetup(true)
bool first
Definition: L1TdeRCT.cc:75
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:402
#define LogTrace(id)
L1GtUtils m_l1GtUtils
Definition: L1GtAnalyzer.h:172
L1TriggerMap::const_iterator CItL1Trig
iterators through map containing the physics algorithms or the technical triggers ...
int m_printOutput
print output
Definition: L1GtAnalyzer.h:101
void analyzeConditionsInLumiBlock(const edm::LuminosityBlock &, const edm::EventSetup &)
to be used in beginLuminosityBlock
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
virtual void beginJob()
unsigned int m_l1GtUtilsConfiguration
L1 configuration code for L1GtUtils.
Definition: L1GtAnalyzer.h:153
bool m_analyzeConditionsInLumiBlockEnable
Definition: L1GtAnalyzer.h:117
edm::InputTag m_l1GtDaqReadoutRecordInputTag
input tags for GT DAQ product
Definition: L1GtAnalyzer.h:123
L1GtUtils::LogicalExpressionL1Results m_logicalExpressionL1ResultsProv
Definition: L1GtAnalyzer.h:173
bool m_l1GtUtilsConfigureBeginRun
if true, configure (partially) L1GtUtils in beginRun using getL1GtRunCache
Definition: L1GtAnalyzer.h:164
L1GtAnalyzer(const edm::ParameterSet &)
Definition: L1GtAnalyzer.cc:52
edm::InputTag m_l1GtObjectMapsInputTag
input tags for GT object map collection L1GlobalTriggerObjectMaps
Definition: L1GtAnalyzer.h:132
edm::EventID id() const
Definition: EventBase.h:56
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
bool m_l1GtTmLInputTagProv
Definition: L1GtAnalyzer.h:157
bool m_analyzeL1GtUtilsMenuLiteEnable
Definition: L1GtAnalyzer.h:107
bool m_analyzeL1GtUtilsEnable
Definition: L1GtAnalyzer.h:109
tuple cout
Definition: gather_cfg.py:121
bool m_l1GtRecordsInputTagProv
Definition: L1GtAnalyzer.h:161
void analyzeL1GtUtilsEventSetup(const edm::Event &, const edm::EventSetup &)
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
std::vector< SingleCombInCond > CombinationsInCond
all the object combinations evaluated to true in the condition
void analyzeTrigger(const edm::Event &, const edm::EventSetup &)
full analysis of an algorithm or technical trigger
virtual void beginLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &)
bool isValid()
return true if the logical expression is syntactically correct
Definition: L1GtUtils.h:97
void retrieveL1ExtraObjects(const edm::Event &, const edm::EventSetup &)
Definition: Run.h:41
void analyzeL1GtUtilsMenuLite(const edm::Event &, const edm::EventSetup &)
for tests, use only one of the following methods
L1GtUtils::LogicalExpressionL1Results m_logicalExpressionL1Results
Definition: L1GtAnalyzer.h:174
virtual void beginRun(const edm::Run &, const edm::EventSetup &)
edm::InputTag m_l1GtTmLInputTag
input tag for L1GtTriggerMenuLite
Definition: L1GtAnalyzer.h:138
const std::vector< std::pair< std::string, int > > & errorCodes(const edm::Event &)
Definition: L1GtUtils.cc:2747
void analyzeL1GtUtilsCore(const edm::Event &, const edm::EventSetup &)
analyze: usage of L1GtUtils