CMS 3D CMS Logo

L1GtTriggerMenuTester.cc
Go to the documentation of this file.
1 
15 // this class header
17 
18 // system include files
19 #include <iomanip>
20 #include <boost/algorithm/string/erase.hpp>
21 
22 // user include files
23 // base class
25 
28 
31 
34 
37 
39 
42 
44 
47 
50 
52 
55 
56 // forward declarations
57 
58 // constructor(s)
60  : m_overwriteHtmlFile(parSet.getParameter<bool>("OverwriteHtmlFile")),
61  m_htmlFile(parSet.getParameter<std::string>("HtmlFile")),
62  m_useHltMenu(parSet.getParameter<bool>("UseHltMenu")),
63  m_hltProcessName(parSet.getParameter<std::string>("HltProcessName")),
64  m_noThrowIncompatibleMenu(parSet.getParameter<bool>("NoThrowIncompatibleMenu")),
65  m_printPfsRates(parSet.getParameter<bool>("PrintPfsRates")),
66  m_indexPfSet(parSet.getParameter<int>("IndexPfSet")),
67  m_numberAlgorithmTriggers(0),
68  m_numberTechnicalTriggers(0) {
69  // empty
70 }
71 
72 // destructor
74  // empty
75 }
76 
77 // begin job
79 
80 // begin run
81 void L1GtTriggerMenuTester::beginRun(const edm::Run& iRun, const edm::EventSetup& evSetup) {
82  // retrieve L1 trigger configuration
83  retrieveL1EventSetup(evSetup);
84 
85  // print with various level of verbosity
86 
87  // define an output stream to print into
88  // it can then be directed to whatever log level is desired
89  std::ostringstream myCout;
90 
91  int printVerbosity = 0;
92  m_l1GtMenu->print(myCout, printVerbosity);
93  myCout << std::flush << std::endl;
94 
95  printVerbosity = 1;
96  m_l1GtMenu->print(myCout, printVerbosity);
97  myCout << std::flush << std::endl;
98 
99  printVerbosity = 2;
100  m_l1GtMenu->print(myCout, printVerbosity);
101  myCout << std::flush << std::endl;
102 
103  // redirect myCout to edm::LogVerbatim TODO - parameter to choose the log
104  edm::LogVerbatim("L1GtTriggerMenuTester") << myCout.str() << std::endl;
105 
106  // prepare L1 - HLT
107  if (m_useHltMenu) {
108  associateL1SeedsHltPath(iRun, evSetup);
109 
111  edm::LogVerbatim("L1GtTriggerMenuTester")
112  << "\n List of algorithm triggers used as L1 seeds but not in L1 menu" << std::endl;
113 
114  for (std::vector<std::string>::const_iterator strIter = m_algoTriggerSeedNotInL1Menu.begin();
115  strIter != m_algoTriggerSeedNotInL1Menu.end();
116  ++strIter) {
117  edm::LogVerbatim("L1GtTriggerMenuTester") << " " << (*strIter) << std::endl;
118  }
119  }
120  }
121 
122  // print in wiki format
123  printWiki();
124 }
125 
126 // begin luminosity block
128  const edm::EventSetup& evSetup) {}
129 
130 // loop over events
132  // empty
133 }
134 
135 // end luminosity block
137 
138 }
139 
140 // end run
142 
143 // end job
145 
147  // get / update the stable parameters from the EventSetup
148 
150  evSetup.get<L1GtStableParametersRcd>().get(l1GtStablePar);
151  m_l1GtStablePar = l1GtStablePar.product();
152 
153  // number of algorithm triggers
155 
156  // number of technical triggers
158 
159  // int maxNumberTrigger = std::max(m_numberAlgorithmTriggers,
160  // m_numberTechnicalTriggers);
161 
162  // m_triggerMaskSet.reserve(maxNumberTrigger);
163  // m_prescaleFactorSet.reserve(maxNumberTrigger);
164 
165  // get / update the prescale factors from the EventSetup
166 
168  evSetup.get<L1GtPrescaleFactorsAlgoTrigRcd>().get(l1GtPfAlgo);
169  m_l1GtPfAlgo = l1GtPfAlgo.product();
170 
172 
174  evSetup.get<L1GtPrescaleFactorsTechTrigRcd>().get(l1GtPfTech);
175  m_l1GtPfTech = l1GtPfTech.product();
176 
178 
179  // get / update the trigger mask from the EventSetup
180 
182  evSetup.get<L1GtTriggerMaskAlgoTrigRcd>().get(l1GtTmAlgo);
183  m_l1GtTmAlgo = l1GtTmAlgo.product();
184 
186 
188  evSetup.get<L1GtTriggerMaskTechTrigRcd>().get(l1GtTmTech);
189  m_l1GtTmTech = l1GtTmTech.product();
190 
192 
193  edm::ESHandle<L1GtTriggerMask> l1GtTmVetoAlgo;
194  evSetup.get<L1GtTriggerMaskVetoAlgoTrigRcd>().get(l1GtTmVetoAlgo);
195  m_l1GtTmVetoAlgo = l1GtTmVetoAlgo.product();
196 
198 
199  edm::ESHandle<L1GtTriggerMask> l1GtTmVetoTech;
200  evSetup.get<L1GtTriggerMaskVetoTechTrigRcd>().get(l1GtTmVetoTech);
201  m_l1GtTmVetoTech = l1GtTmVetoTech.product();
202 
204 
205  // get / update the trigger menu from the EventSetup
206 
208  evSetup.get<L1GtTriggerMenuRcd>().get(l1GtMenu);
209  m_l1GtMenu = l1GtMenu.product();
213 }
214 
216  bool hltChanged = true;
217 
218  if (m_hltConfig.init(iRun, evSetup, m_hltProcessName, hltChanged)) {
219  // if init returns TRUE, initialization has succeeded!
220  if (hltChanged) {
221  // HLT configuration has actually changed wrt the previous run
223 
224  edm::LogVerbatim("L1GtTriggerMenuTester") << "\nHLT ConfDB menu name: \n " << m_hltTableName << std::endl;
225 
226  // loop over trigger paths, get the HLTLevel1GTSeed logical expression, and add the path to
227  // each L1 trigger
228 
231 
234 
235  for (unsigned int iHlt = 0; iHlt < m_hltConfig.size(); ++iHlt) {
236  const std::string& hltPathName = m_hltConfig.triggerName(iHlt);
237 
238  const std::vector<std::pair<bool, std::string> >& hltL1Seed = m_hltConfig.hltL1GTSeeds(hltPathName);
239 
240  unsigned int numberHltL1GTSeeds = hltL1Seed.size();
241 
242  edm::LogVerbatim("L1GtTriggerMenuTester") << "\nPath: " << hltPathName << " : <== " << numberHltL1GTSeeds
243  << " HLTLevel1GTSeed module(s)" << std::endl;
244 
245  for (unsigned int iSeedModule = 0; iSeedModule < numberHltL1GTSeeds; ++iSeedModule) {
246  // one needs a non-const logical expression... TODO check why
247  std::string m_l1SeedsLogicalExpression = (hltL1Seed[iSeedModule]).second;
248 
249  edm::LogVerbatim("L1GtTriggerMenuTester") << " '" << m_l1SeedsLogicalExpression << "'";
250 
251  // parse logical expression
252 
253  if (m_l1SeedsLogicalExpression != "L1GlobalDecision") {
254  // check also the logical expression - add/remove spaces if needed
255  L1GtLogicParser m_l1AlgoLogicParser = L1GtLogicParser(m_l1SeedsLogicalExpression);
256 
257  // list of required algorithms for seeding
258  std::vector<L1GtLogicParser::OperandToken> m_l1AlgoSeeds = m_l1AlgoLogicParser.expressionSeedsOperandList();
259  size_t l1AlgoSeedsSize = m_l1AlgoSeeds.size();
260 
261  edm::LogVerbatim("L1GtTriggerMenuTester") << " : <== " << l1AlgoSeedsSize << " L1 seeds" << std::endl;
262 
263  // for each algorithm trigger, check if it is in the L1 menu, get the bit number
264  // and add path to the vector of strings for that bit number
265 
266  for (size_t i = 0; i < l1AlgoSeedsSize; ++i) {
267  const std::string& trigNameOrAlias = (m_l1AlgoSeeds[i]).tokenName;
268 
269  CItAlgo itAlgo = m_algorithmAliasMap->find(trigNameOrAlias);
270  if (itAlgo != m_algorithmAliasMap->end()) {
271  int bitNr = (itAlgo->second).algoBitNumber();
272 
273  (m_hltPathsForL1AlgorithmTrigger.at(bitNr)).push_back(hltPathName);
274 
275  edm::LogVerbatim("L1GtTriggerMenuTester")
276  << " " << trigNameOrAlias << " bit " << bitNr << std::endl;
277 
278  } else {
280  edm::LogVerbatim("L1GtTriggerMenuTester")
281  << " " << trigNameOrAlias << " trigger not in L1 menu " << m_l1GtMenu->gtTriggerMenuName()
282  << std::endl;
283 
284  m_algoTriggerSeedNotInL1Menu.push_back(trigNameOrAlias);
285 
286  } else {
287  throw cms::Exception("FailModule")
288  << "\nAlgorithm " << trigNameOrAlias
289  << ", requested as seed by a HLT path, not found in the L1 trigger menu\n "
290  << m_l1GtMenu->gtTriggerMenuName() << "\nIncompatible L1 and HLT menus.\n"
291  << std::endl;
292  }
293  }
294  }
295  }
296  }
297  }
298  }
299  } else {
300  // if init returns FALSE, initialization has NOT succeeded, which indicates a problem
301  // with the file and/or code and needs to be investigated!
302  edm::LogError("MyAnalyzer") << " HLT config extraction failure with process name " << m_hltProcessName;
303  }
304 }
305 
306 // printing template for a trigger group
308  const std::map<std::string, const L1GtAlgorithm*>& trigGroup,
309  const bool compactPrint,
310  const bool printPfsRates) {
311  // FIXME get values - either read from a specific L1 menu file, or from
312  std::string lumiVal1 = "5.0E33";
313  std::string lumiVal2 = "7.0E33";
314  std::string trigComment;
315 
316  int trigPfVal1 = 0;
317  int trigPfVal2 = 0;
318 
319  int trigRateVal1 = 0;
320  int trigRateVal2 = 0;
321 
322  // cumulative list of L1 triggers not used as seed by HLT
323  std::vector<std::string> algoTriggerNotSeed;
324  algoTriggerNotSeed.reserve(m_numberAlgorithmTriggers);
325 
326  std::vector<std::string> techTriggerNotSeed;
327  techTriggerNotSeed.reserve(m_numberTechnicalTriggers);
328 
329  // force a page break before each group
330  edm::LogVerbatim("L1GtTriggerMenuTesterWiki") << "<p style=\"page-break-before: always\">&nbsp;</p>";
331 
332  edm::LogVerbatim("L1GtTriggerMenuTesterWiki") << "\n---++++ " << trigGroupName << "\n" << std::endl;
333 
334  if (compactPrint) {
335  edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
336  << "| *Trigger Name* | *Trigger Alias* | *Bit* | *Comments* |" << std::endl;
337 
338  } else {
339  if (printPfsRates) {
340  edm::LogVerbatim("L1GtTriggerMenuTesterWiki") << "| *Trigger Name* | *Trigger Alias* | *Bit* | "
341  "*Luminosity* |||| *Seed for !HLT path(s)* | *Comments* |"
342  << std::endl;
343 
344  edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
345  << "|^|^|^| *" << lumiVal1 << "* || *" << lumiVal2 << "* || ** | ** |" << std::endl;
346 
347  edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
348  << "|^|^|^| *PF* | *Rate* | *PF* | *Rate* | ** | ** |" << std::endl;
349 
350  } else {
351  edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
352  << "| *Trigger Name* | *Trigger Alias* | *Bit* | *Seed for !HLT path(s)* |" << std::endl;
353  }
354  }
355 
356  for (CItAlgoP itAlgo = trigGroup.begin(); itAlgo != trigGroup.end(); itAlgo++) {
357  const std::string& aName = (itAlgo->second)->algoName();
358  const std::string& aAlias = (itAlgo->second)->algoAlias();
359  const int& bitNumber = (itAlgo->second)->algoBitNumber();
360 
361  // concatenate in a string, to simplify the next print instruction
362  std::string seedsHlt;
363  if (m_useHltMenu) {
364  const std::vector<std::string>& hltPaths = m_hltPathsForL1AlgorithmTrigger.at(bitNumber);
365 
366  if (hltPaths.empty()) {
367  algoTriggerNotSeed.push_back(aAlias);
368  seedsHlt = "<font color = \"red\">Not used as seed by any !HLT path</font>";
369  } else {
370  for (std::vector<std::string>::const_iterator strIter = hltPaths.begin(); strIter != hltPaths.end();
371  ++strIter) {
372  seedsHlt = seedsHlt + (*strIter) + "<BR>";
373  }
374  }
375  }
376 
377  if (compactPrint) {
378  edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
379  << "|" << std::left << "[[" << (m_htmlFile + "#" + aName) << "][ " << aName << "]] "
380  << " |" << aAlias << " | " << bitNumber << "| |" << std::endl;
381 
382  } else {
383  if (printPfsRates) {
384  edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
385  << "|" << std::left << "[[" << (m_htmlFile + "#" + aName) << "][ " << aName << "]] "
386  << " |" << aAlias << " | " << bitNumber << "| " << ((trigPfVal1 != 0) ? trigPfVal1 : 0) << " | "
387  << ((trigRateVal1 != 0) ? trigRateVal1 : 0) << " | " << ((trigPfVal2 != 0) ? trigPfVal2 : 0) << " | "
388  << ((trigRateVal2 != 0) ? trigRateVal2 : 0) << " | " << seedsHlt << " | " << trigComment << " |"
389  << std::endl;
390 
391  } else {
392  edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
393  << "|" << std::left << "[[" << (m_htmlFile + "#" + aName) << "][ " << aName << "]] "
394  << " |" << aAlias << " | " << bitNumber << "|" << seedsHlt << " | " << std::endl;
395  }
396  }
397  }
398 
399  edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
400  << "\n"
401  << trigGroupName << ": " << (trigGroup.size()) << " bits defined." << std::endl;
402 
403  if (m_useHltMenu && (!compactPrint)) {
404  edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
405  << "\n Algorithm triggers from " << trigGroupName << " not used as seeds by !HLT:" << std::endl;
406 
407  if (!algoTriggerNotSeed.empty()) {
408  for (std::vector<std::string>::const_iterator strIter = algoTriggerNotSeed.begin();
409  strIter != algoTriggerNotSeed.end();
410  ++strIter) {
411  edm::LogVerbatim("L1GtTriggerMenuTesterWiki") << " * " << (*strIter) << std::endl;
412  }
413 
414  } else {
415  edm::LogVerbatim("L1GtTriggerMenuTesterWiki") << " * none" << std::endl;
416  }
417  }
418 }
419 
422  //
423  // print menu, prescale factors and trigger mask in wiki format
424  //
425 
426  // L1 GT prescale factors for algorithm triggers
427 
428  std::vector<int> prescaleFactorsAlgoTrig = m_prescaleFactorsAlgoTrig->at(m_indexPfSet);
429 
430  // L1 GT prescale factors for technical triggers
431 
432  std::vector<int> prescaleFactorsTechTrig = m_prescaleFactorsTechTrig->at(m_indexPfSet);
433 
434  // use another map <int, L1GtAlgorithm> to get the menu sorted after bit number
435  // both algorithm and bit numbers are unique
436  typedef std::map<int, const L1GtAlgorithm*>::const_iterator CItBit;
437 
438  // algorithm triggers
439 
440  std::map<int, const L1GtAlgorithm*> algoBitToAlgo;
441 
442  std::map<std::string, const L1GtAlgorithm*> jetAlgoTrig;
443  std::map<std::string, const L1GtAlgorithm*> egammaAlgoTrig;
444  std::map<std::string, const L1GtAlgorithm*> esumAlgoTrig;
445  std::map<std::string, const L1GtAlgorithm*> muonAlgoTrig;
446  std::map<std::string, const L1GtAlgorithm*> crossAlgoTrig;
447  std::map<std::string, const L1GtAlgorithm*> bkgdAlgoTrig;
448 
449  int algoTrigNumber = 0;
450  int freeAlgoTrigNumber = 0;
451 
452  int jetAlgoTrigNumber = 0;
453  int egammaAlgoTrigNumber = 0;
454  int esumAlgoTrigNumber = 0;
455  int muonAlgoTrigNumber = 0;
456  int crossAlgoTrigNumber = 0;
457  int bkgdAlgoTrigNumber = 0;
458 
459  for (CItAlgo itAlgo = m_algorithmMap->begin(); itAlgo != m_algorithmMap->end(); itAlgo++) {
460  const int bitNumber = (itAlgo->second).algoBitNumber();
461  const std::string& algName = (itAlgo->second).algoName();
462 
463  algoBitToAlgo[bitNumber] = &(itAlgo->second);
464 
465  algoTrigNumber++;
466 
467  // per category
468 
469  const ConditionMap& conditionMap = (m_l1GtMenu->gtConditionMap()).at((itAlgo->second).algoChipNumber());
470 
471  const std::vector<L1GtLogicParser::TokenRPN>& rpnVector = (itAlgo->second).algoRpnVector();
473 
474  std::list<L1GtObject> listObjects;
475 
476  for (size_t i = 0; i < rpnVector.size(); ++i) {
477  if ((rpnVector[i]).operation == condOperand) {
478  const std::string& cndName = (rpnVector[i]).operand;
479 
480  // search the condition in the condition list
481 
482  bool foundCond = false;
483 
484  CItCond itCond = conditionMap.find(cndName);
485  if (itCond != conditionMap.end()) {
486  foundCond = true;
487 
488  // loop through object types and add them to the list
489 
490  const std::vector<L1GtObject>& objType = (itCond->second)->objectType();
491 
492  for (std::vector<L1GtObject>::const_iterator itObject = objType.begin(); itObject != objType.end();
493  itObject++) {
494  listObjects.push_back(*itObject);
495 
496  edm::LogVerbatim("L1GtTriggerMenuTester") << (*itObject) << std::endl;
497  }
498 
499  // FIXME for XML parser, add GtExternal to objType correctly
500  if ((itCond->second)->condCategory() == CondExternal) {
501  listObjects.push_back(GtExternal);
502  }
503  }
504 
505  if (!foundCond) {
506  // it should never be happen, all conditions are in the maps
507  throw cms::Exception("FailModule") << "\nCondition " << cndName << " not found in the condition map"
508  << " for chip number " << ((itAlgo->second).algoChipNumber()) << std::endl;
509  }
510  }
511  }
512 
513  // eliminate duplicates
514  listObjects.sort();
515  listObjects.unique();
516 
517  // add the algorithm to the corresponding group
518 
519  bool jetGroup = false;
520  bool egammaGroup = false;
521  bool esumGroup = false;
522  bool muonGroup = false;
523  bool crossGroup = false;
524  bool bkgdGroup = false;
525 
526  for (std::list<L1GtObject>::const_iterator itObj = listObjects.begin(); itObj != listObjects.end(); ++itObj) {
527  switch (*itObj) {
528  case Mu: {
529  muonGroup = true;
530  }
531 
532  break;
533  case NoIsoEG: {
534  egammaGroup = true;
535  }
536 
537  break;
538  case IsoEG: {
539  egammaGroup = true;
540  }
541 
542  break;
543  case CenJet: {
544  jetGroup = true;
545  }
546 
547  break;
548  case ForJet: {
549  jetGroup = true;
550  }
551 
552  break;
553  case TauJet: {
554  jetGroup = true;
555  }
556 
557  break;
558  case ETM: {
559  esumGroup = true;
560 
561  }
562 
563  break;
564  case ETT: {
565  esumGroup = true;
566 
567  }
568 
569  break;
570  case HTT: {
571  esumGroup = true;
572 
573  }
574 
575  break;
576  case HTM: {
577  esumGroup = true;
578 
579  }
580 
581  break;
582  case JetCounts: {
583  // do nothing - not available
584  }
585 
586  break;
587  case HfBitCounts: {
588  bkgdGroup = true;
589  }
590 
591  break;
592  case HfRingEtSums: {
593  bkgdGroup = true;
594  }
595 
596  break;
597  case GtExternal: {
598  bkgdGroup = true;
599  }
600 
601  break;
602  case TechTrig:
603  case Castor:
604  case BPTX:
605  default: {
606  // should not arrive here
607 
608  edm::LogVerbatim("L1GtTriggerMenuTester") << "\n Unknown object of type " << *itObj << std::endl;
609  } break;
610  }
611  }
612 
613  int sumGroup = jetGroup + egammaGroup + esumGroup + muonGroup + crossGroup + bkgdGroup;
614 
615  if (sumGroup > 1) {
616  crossAlgoTrig[algName] = &(itAlgo->second);
617  } else {
618  if (jetGroup) {
619  jetAlgoTrig[algName] = &(itAlgo->second);
620 
621  } else if (egammaGroup) {
622  egammaAlgoTrig[algName] = &(itAlgo->second);
623 
624  } else if (esumGroup && (listObjects.size() > 1)) {
625  crossAlgoTrig[algName] = &(itAlgo->second);
626 
627  } else if (esumGroup) {
628  esumAlgoTrig[algName] = &(itAlgo->second);
629 
630  } else if (muonGroup) {
631  muonAlgoTrig[algName] = &(itAlgo->second);
632 
633  } else if (bkgdGroup) {
634  bkgdAlgoTrig[algName] = &(itAlgo->second);
635 
636  } else {
637  // do nothing
638  }
639  }
640 
641  edm::LogVerbatim("L1GtTriggerMenuTester")
642  << algName << " sum: " << sumGroup << " size: " << listObjects.size() << std::endl;
643  }
644 
645  freeAlgoTrigNumber = m_numberAlgorithmTriggers - algoTrigNumber;
646 
647  jetAlgoTrigNumber = jetAlgoTrig.size();
648  egammaAlgoTrigNumber = egammaAlgoTrig.size();
649  esumAlgoTrigNumber = esumAlgoTrig.size();
650  muonAlgoTrigNumber = muonAlgoTrig.size();
651  crossAlgoTrigNumber = crossAlgoTrig.size();
652  bkgdAlgoTrigNumber = bkgdAlgoTrig.size();
653 
654  // technical triggers
655  std::map<int, const L1GtAlgorithm*> techBitToAlgo;
656 
657  int techTrigNumber = 0;
658  int freeTechTrigNumber = 0;
659 
660  for (CItAlgo itAlgo = m_technicalTriggerMap->begin(); itAlgo != m_technicalTriggerMap->end(); itAlgo++) {
661  int bitNumber = (itAlgo->second).algoBitNumber();
662  techBitToAlgo[bitNumber] = &(itAlgo->second);
663 
664  techTrigNumber++;
665  }
666 
667  freeTechTrigNumber = m_numberTechnicalTriggers - techTrigNumber;
668 
669  // name of the attached HTML file
670  if (!m_overwriteHtmlFile) {
672 
673  // replace "/" with "_"
674  std::replace(menuName.begin(), menuName.end(), '/', '_');
675  m_htmlFile = "%ATTACHURL%/" + menuName + ".html";
676  } else {
677  m_htmlFile = "%ATTACHURL%/" + m_htmlFile;
678  }
679 
680  // header for printing algorithms
681 
682  edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
683  << "\n ********** L1 Trigger Menu - printing in wiki format ********** \n\n"
684  << "\n---+++ L1 menu identification\n"
685  << "\n|L1 Trigger Menu Interface: |!" << m_l1GtMenu->gtTriggerMenuInterface() << " |"
686  << "\n|L1 Trigger Menu Name: |!" << m_l1GtMenu->gtTriggerMenuName() << " |"
687  << "\n|L1 Trigger Menu Implementation: |!" << m_l1GtMenu->gtTriggerMenuImplementation() << " |"
688  << "\n|Associated L1 scale DB key: |!" << m_l1GtMenu->gtScaleDbKey() << " |"
689  << "\n\n"
690  << std::flush << std::endl;
691 
692  // Overview page
693  edm::LogVerbatim("L1GtTriggerMenuTesterWiki") << "\n---+++ Summary\n" << std::endl;
694  edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
695  << " * Number of algorithm triggers: " << algoTrigNumber << " defined, 128 possible." << std::endl;
696  edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
697  << " * Number of technical triggers: " << techTrigNumber << " defined, 64 possible.<BR><BR>" << std::endl;
698 
699  edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
700  << " * Number of free bits for algorithm triggers: " << freeAlgoTrigNumber << std::endl;
701  edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
702  << " * Number of free bits for technical triggers: " << freeTechTrigNumber << "<BR>" << std::endl;
703 
704  edm::LogVerbatim("L1GtTriggerMenuTesterWiki") << "\nNumber of algorithm triggers per trigger group\n" << std::endl;
705  edm::LogVerbatim("L1GtTriggerMenuTesterWiki") << " | *Trigger group* | *Number of bits used*|" << std::endl;
706  edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
707  << " | Jet algorithm triggers: | " << jetAlgoTrigNumber << "|" << std::endl;
708  edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
709  << " | EGamma algorithm triggers: | " << egammaAlgoTrigNumber << "|" << std::endl;
710  edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
711  << " | Energy sum algorithm triggers: | " << esumAlgoTrigNumber << "|" << std::endl;
712  edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
713  << " | Muon algorithm triggers: | " << muonAlgoTrigNumber << "|" << std::endl;
714  edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
715  << " | Cross algorithm triggers: | " << crossAlgoTrigNumber << "|" << std::endl;
716  edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
717  << " | Background algorithm triggers: | " << bkgdAlgoTrigNumber << "|" << std::endl;
718 
719  // force a page break
720  edm::LogVerbatim("L1GtTriggerMenuTesterWiki") << "<p style=\"page-break-before: always\">&nbsp;</p>";
721 
722  // compact print - without HLT path
723  bool compactPrint = true;
724 
725  edm::LogVerbatim("L1GtTriggerMenuTesterWiki") << "\n---+++ List of algorithm triggers sorted by trigger groups\n"
726  << std::endl;
727 
728  // Jet algorithm triggers
729  printTriggerGroup("Jet algorithm triggers", jetAlgoTrig, compactPrint, m_printPfsRates);
730 
731  // EGamma algorithm triggers
732  printTriggerGroup("EGamma algorithm triggers", egammaAlgoTrig, compactPrint, m_printPfsRates);
733 
734  // Energy sum algorithm triggers
735  printTriggerGroup("Energy sum algorithm triggers", esumAlgoTrig, compactPrint, m_printPfsRates);
736 
737  // Muon algorithm triggers
738  printTriggerGroup("Muon algorithm triggers", muonAlgoTrig, compactPrint, m_printPfsRates);
739 
740  // Cross algorithm triggers
741  printTriggerGroup("Cross algorithm triggers", crossAlgoTrig, compactPrint, m_printPfsRates);
742 
743  // Background algorithm triggers
744  printTriggerGroup("Background algorithm triggers", bkgdAlgoTrig, compactPrint, m_printPfsRates);
745 
746  // force a page break
747  edm::LogVerbatim("L1GtTriggerMenuTesterWiki") << "<p style=\"page-break-before: always\">&nbsp;</p>";
748 
749  edm::LogVerbatim("L1GtTriggerMenuTesterWiki") << "\n---+++ List of algorithm triggers sorted by bits\n" << std::endl;
750 
751  edm::LogVerbatim("L1GtTriggerMenuTesterWiki") << "| *Algorithm* | *Alias* | *Bit number* |" << std::endl;
752 
753  for (CItBit itBit = algoBitToAlgo.begin(); itBit != algoBitToAlgo.end(); itBit++) {
754  int bitNumber = itBit->first;
755  std::string aName = (itBit->second)->algoName();
756  std::string aAlias = (itBit->second)->algoAlias();
757 
758  edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
759  << "|" << std::left << "[[" << (m_htmlFile + "#" + aName) << "][ " << aName << "]] "
760  << " |" << aAlias << " | " << bitNumber << "| |" << std::endl;
761  }
762 
763  // force a page break
764  edm::LogVerbatim("L1GtTriggerMenuTesterWiki") << "<p style=\"page-break-before: always\">&nbsp;</p>";
765  edm::LogVerbatim("L1GtTriggerMenuTesterWiki") << "\n---+++ List of technical triggers\n" << std::endl;
766 
767  edm::LogVerbatim("L1GtTriggerMenuTesterWiki") << "| *Technical trigger* | *Bit number* |" << std::endl;
768 
769  for (CItBit itBit = techBitToAlgo.begin(); itBit != techBitToAlgo.end(); itBit++) {
770  int bitNumber = itBit->first;
771  std::string aName = (itBit->second)->algoName();
772  std::string aAlias = (itBit->second)->algoAlias();
773 
774  edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
775  << "|!" << std::left << aName << " | " << std::right << bitNumber << " |" << std::endl;
776  }
777 
778  // force a page break
779  edm::LogVerbatim("L1GtTriggerMenuTesterWiki") << "<p style=\"page-break-before: always\">&nbsp;</p>";
780 
781  // compact print false: with HLT path association, if the parameter m_useHltMenu is true
782  // otherwise, we have no association computed
783 
784  if (m_useHltMenu) {
785  compactPrint = false;
786  } else {
787  return;
788  }
789 
790  edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
791  << "\n---+++ List of algorithm triggers sorted by trigger groups, including !HLT path association \n"
792  << std::endl;
793 
794  edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
795  << "\n The following !HLT menu was used to associate the !HLT path to the L1 algorithm triggers:\n "
796  << std::endl;
797  edm::LogVerbatim("L1GtTriggerMenuTesterWiki") << m_hltTableName << std::endl;
798 
799  // Jet algorithm triggers
800  printTriggerGroup("Jet algorithm triggers", jetAlgoTrig, compactPrint, m_printPfsRates);
801 
802  // EGamma algorithm triggers
803  printTriggerGroup("EGamma algorithm triggers", egammaAlgoTrig, compactPrint, m_printPfsRates);
804 
805  // Energy sum algorithm triggers
806  printTriggerGroup("Energy sum algorithm triggers", esumAlgoTrig, compactPrint, m_printPfsRates);
807 
808  // Muon algorithm triggers
809  printTriggerGroup("Muon algorithm triggers", muonAlgoTrig, compactPrint, m_printPfsRates);
810 
811  // Cross algorithm triggers
812  printTriggerGroup("Cross algorithm triggers", crossAlgoTrig, compactPrint, m_printPfsRates);
813 
814  // Background algorithm triggers
815  printTriggerGroup("Background algorithm triggers", bkgdAlgoTrig, compactPrint, m_printPfsRates);
816 }
L1GtTriggerMenuTester::endRun
void endRun(const edm::Run &, const edm::EventSetup &) override
end run
Definition: L1GtTriggerMenuTester.cc:141
L1GtTriggerMenuTester::m_indexPfSet
int m_indexPfSet
index of prescale factor set to be printed
Definition: L1GtTriggerMenuTester.h:118
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
L1GtTriggerMenu.h
L1GtTriggerMenuTester::printTriggerGroup
void printTriggerGroup(const std::string &trigGroupName, const std::map< std::string, const L1GtAlgorithm * > &trigGroup, const bool compactPrint, const bool printPfsRates)
printing template for a trigger group
Definition: L1GtTriggerMenuTester.cc:307
L1GtTriggerMenuTester::m_triggerMaskAlgoTrig
const std::vector< unsigned int > * m_triggerMaskAlgoTrig
Definition: L1GtTriggerMenuTester.h:147
L1GtTriggerMenu::gtTriggerMenuName
const std::string & gtTriggerMenuName() const
Definition: L1GtTriggerMenu.h:91
HTM
Definition: L1GtObject.h:38
L1GtTriggerMenuTester::m_hltProcessName
std::string m_hltProcessName
process name of HLT process for which to get HLT configuration
Definition: L1GtTriggerMenuTester.h:108
electrons_cff.bool
bool
Definition: electrons_cff.py:366
L1GtTriggerMenuTester::m_l1GtMenu
const L1GtTriggerMenu * m_l1GtMenu
Definition: L1GtTriggerMenuTester.h:154
CItCond
ConditionMap::const_iterator CItCond
iterators through map containing the conditions
Definition: L1GtTriggerMenuFwd.h:34
mps_fire.i
i
Definition: mps_fire.py:428
GtExternal
Definition: L1GtObject.h:45
MessageLogger.h
L1GtTriggerMenuTester.h
L1GtTriggerMaskAlgoTrigRcd.h
L1GtTriggerMask.h
L1GtTriggerMenuTester::beginJob
void beginJob() override
begin job
Definition: L1GtTriggerMenuTester.cc:78
ESHandle.h
ETM
Definition: L1GtObject.h:35
L1GtStableParameters::gtNumberTechnicalTriggers
unsigned int gtNumberTechnicalTriggers() const
get / set the number of technical triggers
Definition: L1GtStableParameters.h:53
Castor
Definition: L1GtObject.h:43
L1GtTriggerMenuTester::m_l1GtTmAlgo
const L1GtTriggerMask * m_l1GtTmAlgo
trigger masks & veto masks
Definition: L1GtTriggerMenuTester.h:141
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
L1GtTriggerMenuTester::~L1GtTriggerMenuTester
~L1GtTriggerMenuTester() override
Definition: L1GtTriggerMenuTester.cc:73
L1GtTriggerMenuTester::m_l1GtPfAlgo
const L1GtPrescaleFactors * m_l1GtPfAlgo
prescale factors
Definition: L1GtTriggerMenuTester.h:133
edm::Run
Definition: Run.h:45
L1GtTriggerMenuTester::m_l1GtTmVetoTech
const L1GtTriggerMask * m_l1GtTmVetoTech
Definition: L1GtTriggerMenuTester.h:145
L1GtTriggerMenuTester::endJob
void endJob() override
end job
Definition: L1GtTriggerMenuTester.cc:144
HLTSiStripMonitoring_cff.hltPaths
hltPaths
Definition: HLTSiStripMonitoring_cff.py:252
L1GtTriggerMenuRcd.h
L1GtTriggerMenuTester::m_prescaleFactorsAlgoTrig
const std::vector< std::vector< int > > * m_prescaleFactorsAlgoTrig
Definition: L1GtTriggerMenuTester.h:137
L1GtPrescaleFactors::gtPrescaleFactors
const std::vector< std::vector< int > > & gtPrescaleFactors() const
get the prescale factors by reference
Definition: L1GtPrescaleFactors.h:45
L1GtLogicParser::OperationType
OperationType
Definition: L1GtLogicParser.h:39
L1GtTriggerMenuTester::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
analyze
Definition: L1GtTriggerMenuTester.cc:131
L1GtTriggerMenuTester::m_technicalTriggerMap
const AlgorithmMap * m_technicalTriggerMap
Definition: L1GtTriggerMenuTester.h:158
L1GtTriggerMenu::gtTriggerMenuImplementation
const std::string & gtTriggerMenuImplementation() const
Definition: L1GtTriggerMenu.h:96
L1GtTriggerMaskTechTrigRcd.h
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
L1GtStableParametersRcd.h
L1GtTriggerMaskVetoTechTrigRcd
Definition: L1GtTriggerMaskVetoTechTrigRcd.h:39
L1GtTriggerMenuTester::m_algorithmAliasMap
const AlgorithmMap * m_algorithmAliasMap
Definition: L1GtTriggerMenuTester.h:157
NoIsoEG
Definition: L1GtObject.h:30
L1GtTriggerMenuTester::m_techTriggerSeedNotInL1Menu
std::vector< std::string > m_techTriggerSeedNotInL1Menu
Definition: L1GtTriggerMenuTester.h:175
EDAnalyzer.h
L1GtTriggerMenuTester::printWiki
void printWiki()
printing in Wiki format
IsoEG
Definition: L1GtObject.h:31
L1GtPrescaleFactorsTechTrigRcd
Definition: L1GtPrescaleFactorsTechTrigRcd.h:38
L1GtTriggerMenu::gtScaleDbKey
const std::string & gtScaleDbKey() const
menu associated scale key
Definition: L1GtTriggerMenu.h:101
edm::EventSetup::get
T get() const
Definition: EventSetup.h:87
MillePedeAlignmentAlgorithm_cfi.algoName
algoName
Definition: MillePedeAlignmentAlgorithm_cfi.py:10
CItAlgo
AlgorithmMap::const_iterator CItAlgo
iterators through map containing the algorithms
Definition: L1GtTriggerMenuFwd.h:38
L1GtTriggerMenuTester::CItAlgoP
std::map< std::string, const L1GtAlgorithm * >::const_iterator CItAlgoP
constant iterator
Definition: L1GtTriggerMenuTester.h:92
L1GtTriggerMenuTester::m_triggerMaskVetoAlgoTrig
const std::vector< unsigned int > * m_triggerMaskVetoAlgoTrig
Definition: L1GtTriggerMenuTester.h:150
HLTConfigProvider::hltL1GTSeeds
const std::vector< std::vector< std::pair< bool, std::string > > > & hltL1GTSeeds() const
Definition: HLTConfigProvider.h:123
L1GtTriggerMenuTester::m_overwriteHtmlFile
bool m_overwriteHtmlFile
input parameters
Definition: L1GtTriggerMenuTester.h:99
L1GtTriggerMenu::gtTriggerMenuInterface
const std::string & gtTriggerMenuInterface() const
get / set the trigger menu names
Definition: L1GtTriggerMenu.h:86
HTT
Definition: L1GtObject.h:37
HfBitCounts
Definition: L1GtObject.h:40
L1GtTriggerMaskTechTrigRcd
Definition: L1GtTriggerMaskTechTrigRcd.h:39
ConditionMap
std::map< std::string, L1GtCondition * > ConditionMap
map containing the conditions
Definition: L1GtTriggerMenuFwd.h:28
L1GtTriggerMenuRcd
Definition: L1GtTriggerMenuRcd.h:32
HfRingEtSums
Definition: L1GtObject.h:41
L1GtTriggerMenuTester::m_htmlFile
std::string m_htmlFile
name of HTML file attached to the wiki page
Definition: L1GtTriggerMenuTester.h:102
L1GtTriggerMaskAlgoTrigRcd
Definition: L1GtTriggerMaskAlgoTrigRcd.h:39
edm::ESHandle
Definition: DTSurvey.h:22
CenJet
Definition: L1GtObject.h:32
CondExternal
Definition: L1GtDefinitions.h:37
L1GtTriggerMenuTester::endLuminosityBlock
void endLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) override
end luminosity block
Definition: L1GtTriggerMenuTester.cc:136
L1GtTriggerMenu::print
void print(std::ostream &, int &) const
Definition: L1GtTriggerMenu.cc:454
L1GtTriggerMenuTester::retrieveL1EventSetup
void retrieveL1EventSetup(const edm::EventSetup &)
retrieve all the relevant L1 trigger event setup records
Definition: L1GtTriggerMenuTester.cc:146
TechTrig
Definition: L1GtObject.h:42
L1GtTriggerMaskVetoTechTrigRcd.h
HLTConfigProvider::size
unsigned int size() const
number of trigger paths in trigger table
Definition: HLTConfigProvider.h:63
L1GtTriggerMenuTester::m_l1GtStablePar
const L1GtStableParameters * m_l1GtStablePar
event setup cached stuff
Definition: L1GtTriggerMenuTester.h:124
TauJet
Definition: L1GtObject.h:34
electrons_cff.objType
objType
Definition: electrons_cff.py:519
MessageDrop.h
edm::ParameterSet
Definition: ParameterSet.h:47
L1GtTriggerMenuTester::m_hltConfig
HLTConfigProvider m_hltConfig
The instance of the HLTConfigProvider as a data member.
Definition: L1GtTriggerMenuTester.h:162
Event.h
L1GtTriggerMenuTester::beginLuminosityBlock
void beginLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) override
begin luminosity block
Definition: L1GtTriggerMenuTester.cc:127
L1GtTriggerMask::gtTriggerMask
const std::vector< unsigned int > & gtTriggerMask() const
get the trigger mask
Definition: L1GtTriggerMask.h:47
L1GtTriggerMenuTester::m_l1GtTmVetoAlgo
const L1GtTriggerMask * m_l1GtTmVetoAlgo
Definition: L1GtTriggerMenuTester.h:144
L1GtTriggerMenuTester::m_hltPathsForL1AlgorithmTrigger
std::vector< std::vector< std::string > > m_hltPathsForL1AlgorithmTrigger
vector of HLT paths seeded by a L1 algorithm trigger - vector index corresponds to the bit number
Definition: L1GtTriggerMenuTester.h:168
createfilelist.int
int
Definition: createfilelist.py:10
iEvent
int iEvent
Definition: GenABIO.cc:224
L1GtLogicParser::OP_OPERAND
Definition: L1GtLogicParser.h:45
L1GtPrescaleFactorsAlgoTrigRcd.h
HLTConfigProvider::tableName
const std::string & tableName() const
HLT ConfDB table name.
Definition: HLTConfigProvider.h:60
ETT
Definition: L1GtObject.h:36
L1GtLogicParser::expressionSeedsOperandList
std::vector< L1GtLogicParser::OperandToken > expressionSeedsOperandList()
Definition: L1GtLogicParser.cc:1042
L1GtTriggerMenu::gtAlgorithmAliasMap
const AlgorithmMap & gtAlgorithmAliasMap() const
get / set the algorithm map (by alias)
Definition: L1GtTriggerMenu.h:192
L1GtTriggerMenuTester::beginRun
void beginRun(const edm::Run &, const edm::EventSetup &) override
begin run
Definition: L1GtTriggerMenuTester.cc:81
L1GtStableParameters::gtNumberPhysTriggers
unsigned int gtNumberPhysTriggers() const
get / set the number of physics trigger algorithms
Definition: L1GtStableParameters.h:43
edm::EventSetup
Definition: EventSetup.h:58
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
get
#define get
L1GtStableParametersRcd
Definition: L1GtStableParametersRcd.h:39
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
L1GtTriggerMaskVetoAlgoTrigRcd
Definition: L1GtTriggerMaskVetoAlgoTrigRcd.h:39
L1GtTriggerMenu::gtConditionMap
const std::vector< ConditionMap > & gtConditionMap() const
get / set / build the condition maps
Definition: L1GtTriggerMenu.h:80
L1GtTriggerMenuTester::m_numberAlgorithmTriggers
unsigned int m_numberAlgorithmTriggers
number of algorithm triggers
Definition: L1GtTriggerMenuTester.h:127
Mu
Definition: L1GtObject.h:29
L1GtTriggerMenuTester::L1GtTriggerMenuTester
L1GtTriggerMenuTester(const edm::ParameterSet &)
Definition: L1GtTriggerMenuTester.cc:59
std
Definition: JetResolutionObject.h:76
L1GtTriggerMenuTester::m_noThrowIncompatibleMenu
bool m_noThrowIncompatibleMenu
Definition: L1GtTriggerMenuTester.h:112
HLTConfigProvider::init
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d'tor
Definition: HLTConfigProvider.cc:36
L1GtLogicParser
Definition: L1GtLogicParser.h:31
L1GtTriggerMenuTester::m_triggerMaskVetoTechTrig
const std::vector< unsigned int > * m_triggerMaskVetoTechTrig
Definition: L1GtTriggerMenuTester.h:151
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
L1GtLogicParser.h
Exception
Definition: hltDiff.cc:245
L1GtTriggerMenuTester::m_l1GtPfTech
const L1GtPrescaleFactors * m_l1GtPfTech
Definition: L1GtTriggerMenuTester.h:135
L1GtTriggerMenuTester::m_prescaleFactorsTechTrig
const std::vector< std::vector< int > > * m_prescaleFactorsTechTrig
Definition: L1GtTriggerMenuTester.h:138
EventSetup.h
ForJet
Definition: L1GtObject.h:33
JetCounts
Definition: L1GtObject.h:39
L1GtTriggerMenuTester::m_numberTechnicalTriggers
unsigned int m_numberTechnicalTriggers
number of technical triggers
Definition: L1GtTriggerMenuTester.h:130
HLTConfigProvider::triggerName
const std::string & triggerName(unsigned int triggerIndex) const
Definition: HLTConfigProvider.h:70
BPTX
Definition: L1GtObject.h:44
L1TBPTX_cfi.bitNumber
bitNumber
Definition: L1TBPTX_cfi.py:26
L1GtTriggerMenuTester::m_printPfsRates
bool m_printPfsRates
print prescale factors and rates
Definition: L1GtTriggerMenuTester.h:115
L1GtTriggerMenuTester::m_useHltMenu
bool m_useHltMenu
use a HLT menu for L1 seed - HLT path association
Definition: L1GtTriggerMenuTester.h:105
ParameterSet.h
L1GtPrescaleFactorsAlgoTrigRcd
Definition: L1GtPrescaleFactorsAlgoTrigRcd.h:38
L1GtTriggerMenuTester::m_triggerMaskTechTrig
const std::vector< unsigned int > * m_triggerMaskTechTrig
Definition: L1GtTriggerMenuTester.h:148
L1GtTriggerMenuTester::m_l1GtTmTech
const L1GtTriggerMask * m_l1GtTmTech
Definition: L1GtTriggerMenuTester.h:142
L1GtTriggerMaskVetoAlgoTrigRcd.h
L1GtTriggerMenuTester::m_hltPathsForL1TechnicalTrigger
std::vector< std::vector< std::string > > m_hltPathsForL1TechnicalTrigger
vector of HLT paths seeded by a L1 technical trigger - vector index corresponds to the bit number
Definition: L1GtTriggerMenuTester.h:171
edm::Event
Definition: Event.h:73
L1GtTriggerMenuTester::associateL1SeedsHltPath
void associateL1SeedsHltPath(const edm::Run &, const edm::EventSetup &)
L1 seed - HLT path association.
Definition: L1GtTriggerMenuTester.cc:215
L1GtTriggerMenu::gtTechnicalTriggerMap
const AlgorithmMap & gtTechnicalTriggerMap() const
get / set the technical trigger map
Definition: L1GtTriggerMenu.h:197
L1GtTriggerMenuTester::m_algorithmMap
const AlgorithmMap * m_algorithmMap
Definition: L1GtTriggerMenuTester.h:156
L1GtStableParameters.h
L1GtTriggerMenuTester::m_algoTriggerSeedNotInL1Menu
std::vector< std::string > m_algoTriggerSeedNotInL1Menu
vector of algorithm or technical triggers not in the L1 menu
Definition: L1GtTriggerMenuTester.h:174
L1GtTriggerMenuTester::m_hltTableName
std::string m_hltTableName
HLT menu was used to associate the HLT path to the L1 algorithm triggers.
Definition: L1GtTriggerMenuTester.h:165
L1GtPrescaleFactors.h
L1GtTriggerMenu::gtAlgorithmMap
const AlgorithmMap & gtAlgorithmMap() const
get / set the algorithm map (by name)
Definition: L1GtTriggerMenu.h:187
python.rootplot.root2matplotlib.replace
def replace(string, replacements)
Definition: root2matplotlib.py:444
L1GtPrescaleFactorsTechTrigRcd.h