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