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