CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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(
65  parSet.getParameter<bool> ("NoThrowIncompatibleMenu")),
66  m_printPfsRates(parSet.getParameter<bool> ("PrintPfsRates")),
67  m_indexPfSet(parSet.getParameter<int> ("IndexPfSet")),
68  m_numberAlgorithmTriggers(0), m_numberTechnicalTriggers(0) {
69 
70  // empty
71 
72 }
73 
74 // destructor
76  // empty
77 }
78 
79 // begin job
81 
82 }
83 
84 // begin run
86  const edm::EventSetup& evSetup) {
87 
88  // retrieve L1 trigger configuration
89  retrieveL1EventSetup(evSetup);
90 
91  // print with various level of verbosity
92 
93  // define an output stream to print into
94  // it can then be directed to whatever log level is desired
95  std::ostringstream myCout;
96 
97  int printVerbosity = 0;
98  m_l1GtMenu->print(myCout, printVerbosity);
99  myCout << std::flush << std::endl;
100 
101  printVerbosity = 1;
102  m_l1GtMenu->print(myCout, printVerbosity);
103  myCout << std::flush << std::endl;
104 
105  printVerbosity = 2;
106  m_l1GtMenu->print(myCout, printVerbosity);
107  myCout << std::flush << std::endl;
108 
109  // redirect myCout to edm::LogVerbatim TODO - parameter to choose the log
110  edm::LogVerbatim("L1GtTriggerMenuTester") << myCout.str() << std::endl;
111 
112  // prepare L1 - HLT
113  if (m_useHltMenu) {
114  associateL1SeedsHltPath(iRun, evSetup);
115 
117  edm::LogVerbatim("L1GtTriggerMenuTester")
118  << "\n List of algorithm triggers used as L1 seeds but not in L1 menu"
119  << std::endl;
120 
121  for (std::vector<std::string>::const_iterator strIter =
122  m_algoTriggerSeedNotInL1Menu.begin(); strIter
123  != m_algoTriggerSeedNotInL1Menu.end(); ++strIter) {
124 
125  edm::LogVerbatim("L1GtTriggerMenuTester") << " "
126  << (*strIter) << std::endl;
127  }
128 
129  }
130  }
131 
132  // print in wiki format
133  printWiki();
134 
135 }
136 
137 // begin luminosity block
139  const edm::EventSetup& evSetup) {
140 
141 }
142 
143 // loop over events
145  const edm::EventSetup& evSetup) {
146 
147  // empty
148 
149 }
150 
151 // end luminosity block
153  const edm::EventSetup& evSetup) {
154 
155 }
156 
157 // end run
159 
160 }
161 
162 // end job
164 
165 }
166 
168 
169  // get / update the stable parameters from the EventSetup
170 
172  evSetup.get<L1GtStableParametersRcd> ().get(l1GtStablePar);
173  m_l1GtStablePar = l1GtStablePar.product();
174 
175  // number of algorithm triggers
177 
178  // number of technical triggers
180 
181 // int maxNumberTrigger = std::max(m_numberAlgorithmTriggers,
182 // m_numberTechnicalTriggers);
183 
184 // m_triggerMaskSet.reserve(maxNumberTrigger);
185 // m_prescaleFactorSet.reserve(maxNumberTrigger);
186 
187  // get / update the prescale factors from the EventSetup
188 
189 
191  evSetup.get<L1GtPrescaleFactorsAlgoTrigRcd> ().get(l1GtPfAlgo);
192  m_l1GtPfAlgo = l1GtPfAlgo.product();
193 
195 
197  evSetup.get<L1GtPrescaleFactorsTechTrigRcd> ().get(l1GtPfTech);
198  m_l1GtPfTech = l1GtPfTech.product();
199 
201 
202  // get / update the trigger mask from the EventSetup
203 
205  evSetup.get<L1GtTriggerMaskAlgoTrigRcd> ().get(l1GtTmAlgo);
206  m_l1GtTmAlgo = l1GtTmAlgo.product();
207 
209 
211  evSetup.get<L1GtTriggerMaskTechTrigRcd> ().get(l1GtTmTech);
212  m_l1GtTmTech = l1GtTmTech.product();
213 
215 
216  edm::ESHandle<L1GtTriggerMask> l1GtTmVetoAlgo;
217  evSetup.get<L1GtTriggerMaskVetoAlgoTrigRcd> ().get(l1GtTmVetoAlgo);
218  m_l1GtTmVetoAlgo = l1GtTmVetoAlgo.product();
219 
221 
222  edm::ESHandle<L1GtTriggerMask> l1GtTmVetoTech;
223  evSetup.get<L1GtTriggerMaskVetoTechTrigRcd> ().get(l1GtTmVetoTech);
224  m_l1GtTmVetoTech = l1GtTmVetoTech.product();
225 
227 
228  // get / update the trigger menu from the EventSetup
229 
231  evSetup.get<L1GtTriggerMenuRcd> ().get(l1GtMenu);
232  m_l1GtMenu = l1GtMenu.product();
233  (const_cast<L1GtTriggerMenu*> (m_l1GtMenu))->buildGtConditionMap();
234 
237 
239 
240 }
241 
243  const edm::EventSetup& evSetup) {
244 
245  bool hltChanged = true;
246 
247  if (m_hltConfig.init(iRun, evSetup, m_hltProcessName, hltChanged)) {
248 
249  // if init returns TRUE, initialization has succeeded!
250  if (hltChanged) {
251 
252  // HLT configuration has actually changed wrt the previous run
254 
255  edm::LogVerbatim("L1GtTriggerMenuTester")
256  << "\nHLT ConfDB menu name: \n " << m_hltTableName
257  << std::endl;
258 
259  // loop over trigger paths, get the HLTLevel1GTSeed logical expression, and add the path to
260  // each L1 trigger
261 
264 
267 
268  for (unsigned int iHlt = 0; iHlt < m_hltConfig.size(); ++iHlt) {
269 
270  const std::string& hltPathName = m_hltConfig.triggerName(iHlt);
271 
272  const std::vector<std::pair<bool, std::string> >& hltL1Seed =
273  m_hltConfig.hltL1GTSeeds(hltPathName);
274 
275  unsigned int numberHltL1GTSeeds = hltL1Seed.size();
276 
277  edm::LogVerbatim("L1GtTriggerMenuTester") << "\nPath: "
278  << hltPathName << " : <== " << numberHltL1GTSeeds
279  << " HLTLevel1GTSeed module(s)" << std::endl;
280 
281  for (unsigned int iSeedModule = 0; iSeedModule
282  < numberHltL1GTSeeds; ++iSeedModule) {
283 
284  // one needs a non-const logical expression... TODO check why
285  std::string m_l1SeedsLogicalExpression =
286  (hltL1Seed[iSeedModule]).second;
287 
288  edm::LogVerbatim("L1GtTriggerMenuTester") << " '"
289  << m_l1SeedsLogicalExpression << "'";
290 
291  // parse logical expression
292 
293  if (m_l1SeedsLogicalExpression != "L1GlobalDecision") {
294 
295  // check also the logical expression - add/remove spaces if needed
296  L1GtLogicParser m_l1AlgoLogicParser = L1GtLogicParser(
297  m_l1SeedsLogicalExpression);
298 
299  // list of required algorithms for seeding
300  std::vector<L1GtLogicParser::OperandToken>
301  m_l1AlgoSeeds =
302  m_l1AlgoLogicParser.expressionSeedsOperandList();
303  size_t l1AlgoSeedsSize = m_l1AlgoSeeds.size();
304 
305  edm::LogVerbatim("L1GtTriggerMenuTester")
306  << " : <== " << l1AlgoSeedsSize
307  << " L1 seeds" << std::endl;
308 
309  // for each algorithm trigger, check if it is in the L1 menu, get the bit number
310  // and add path to the vector of strings for that bit number
311 
312  for (size_t i = 0; i < l1AlgoSeedsSize; ++i) {
313 
314  const std::string& trigNameOrAlias =
315  (m_l1AlgoSeeds[i]).tokenName;
316 
317  CItAlgo itAlgo = m_algorithmAliasMap->find(
318  trigNameOrAlias);
319  if (itAlgo != m_algorithmAliasMap->end()) {
320 
321  int bitNr = (itAlgo->second).algoBitNumber();
322 
323  (m_hltPathsForL1AlgorithmTrigger.at(bitNr)).push_back(
324  hltPathName);
325 
326  edm::LogVerbatim("L1GtTriggerMenuTester")
327  << " " << trigNameOrAlias
328  << " bit " << bitNr << std::endl;
329 
330  } else {
331 
333  edm::LogVerbatim("L1GtTriggerMenuTester")
334  << " " << trigNameOrAlias
335  << " trigger not in L1 menu "
337  << std::endl;
338 
340  trigNameOrAlias);
341 
342  } else {
343  throw cms::Exception("FailModule")
344  << "\nAlgorithm "
345  << trigNameOrAlias
346  << ", requested as seed by a HLT path, not found in the L1 trigger menu\n "
348  << "\nIncompatible L1 and HLT menus.\n"
349  << std::endl;
350 
351  }
352  }
353  }
354 
355  }
356  }
357 
358  }
359  }
360  } else {
361  // if init returns FALSE, initialization has NOT succeeded, which indicates a problem
362  // with the file and/or code and needs to be investigated!
363  edm::LogError("MyAnalyzer")
364  << " HLT config extraction failure with process name "
365  << m_hltProcessName;
366  }
367 
368 }
369 
370 // printing template for a trigger group
372  const std::map<std::string, const L1GtAlgorithm*>& trigGroup,
373  const bool compactPrint, const bool printPfsRates) {
374 
375  // FIXME get values - either read from a specific L1 menu file, or from
376  std::string lumiVal1 = "5.0E33";
377  std::string lumiVal2 = "7.0E33";
378  std::string trigComment;
379 
380  int trigPfVal1 = 0;
381  int trigPfVal2 = 0;
382 
383  int trigRateVal1 = 0;
384  int trigRateVal2 = 0;
385 
386  // cumulative list of L1 triggers not used as seed by HLT
387  std::vector < std::string > algoTriggerNotSeed;
388  algoTriggerNotSeed.reserve(m_numberAlgorithmTriggers);
389 
390  std::vector < std::string > techTriggerNotSeed;
391  techTriggerNotSeed.reserve(m_numberTechnicalTriggers);
392 
393  // force a page break before each group
394  edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
395  << "<p style=\"page-break-before: always\">&nbsp;</p>";
396 
397  edm::LogVerbatim("L1GtTriggerMenuTesterWiki") << "\n---++++ "
398  << trigGroupName << "\n" << std::endl;
399 
400  if (compactPrint) {
401  edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
402  << "| *Trigger Name* | *Trigger Alias* | *Bit* | *Comments* |"
403  << std::endl;
404 
405  } else {
406 
407  if (printPfsRates) {
408  edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
409  << "| *Trigger Name* | *Trigger Alias* | *Bit* | *Luminosity* |||| *Seed for !HLT path(s)* | *Comments* |"
410  << std::endl;
411 
412  edm::LogVerbatim("L1GtTriggerMenuTesterWiki") << "|^|^|^| *"
413  << lumiVal1 << "* || *" << lumiVal2
414  << "* || ** | ** |" << std::endl;
415 
416  edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
417  << "|^|^|^| *PF* | *Rate* | *PF* | *Rate* | ** | ** |"
418  << std::endl;
419 
420  } else {
421 
422  edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
423  << "| *Trigger Name* | *Trigger Alias* | *Bit* | *Seed for !HLT path(s)* |"
424  << std::endl;
425  }
426 
427  }
428 
429  for (CItAlgoP itAlgo = trigGroup.begin(); itAlgo != trigGroup.end(); itAlgo++) {
430 
431  const std::string& aName = (itAlgo->second)->algoName();
432  const std::string& aAlias = (itAlgo->second)->algoAlias();
433  const int& bitNumber = (itAlgo->second)->algoBitNumber();
434 
435 
436  // concatenate in a string, to simplify the next print instruction
437  std::string seedsHlt;
438  if (m_useHltMenu) {
439  const std::vector<std::string> & hltPaths =
440  m_hltPathsForL1AlgorithmTrigger.at(bitNumber);
441 
442  if (hltPaths.size() < 1) {
443  algoTriggerNotSeed.push_back(aAlias);
444  seedsHlt
445  = "<font color = \"red\">Not used as seed by any !HLT path</font>";
446  } else {
447 
448  for (std::vector<std::string>::const_iterator strIter =
449  hltPaths.begin(); strIter != hltPaths.end(); ++strIter) {
450 
451  seedsHlt = seedsHlt + (*strIter) + "<BR>";
452  }
453  }
454 
455  }
456 
457  if (compactPrint) {
458  edm::LogVerbatim("L1GtTriggerMenuTesterWiki") << "|" << std::left
459  << "[[" << (m_htmlFile + "#" + aName) << "][ " << aName
460  << "]] " << " |" << aAlias << " | " << bitNumber << "| |"
461  << std::endl;
462 
463  } else {
464 
465  if (printPfsRates) {
466  edm::LogVerbatim("L1GtTriggerMenuTesterWiki") << "|"
467  << std::left << "[[" << (m_htmlFile + "#" + aName)
468  << "][ " << aName << "]] " << " |" << aAlias
469  << " | " << bitNumber << "| "
470  << ((trigPfVal1 != 0) ? trigPfVal1 : 0) << " | "
471  << ((trigRateVal1 != 0) ? trigRateVal1 : 0) << " | "
472  << ((trigPfVal2 != 0) ? trigPfVal2 : 0) << " | "
473  << ((trigRateVal2 != 0) ? trigRateVal2 : 0) << " | "
474  << seedsHlt << " | " << trigComment << " |"
475  << std::endl;
476 
477  } else {
478 
479  edm::LogVerbatim("L1GtTriggerMenuTesterWiki") << "|"
480  << std::left << "[[" << (m_htmlFile + "#" + aName)
481  << "][ " << aName << "]] " << " |" << aAlias
482  << " | " << bitNumber << "|" << seedsHlt << " | "
483  << std::endl;
484  }
485 
486  }
487 
488  }
489 
490  edm::LogVerbatim("L1GtTriggerMenuTesterWiki") << "\n" << trigGroupName
491  << ": " << (trigGroup.size()) << " bits defined." << std::endl;
492 
493  if (m_useHltMenu && (!compactPrint)) {
494  edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
495  << "\n Algorithm triggers from " << trigGroupName
496  << " not used as seeds by !HLT:" << std::endl;
497 
498  if (algoTriggerNotSeed.size() != 0) {
499  for (std::vector<std::string>::const_iterator strIter =
500  algoTriggerNotSeed.begin(); strIter
501  != algoTriggerNotSeed.end(); ++strIter) {
502 
503  edm::LogVerbatim("L1GtTriggerMenuTesterWiki") << " * "
504  << (*strIter) << std::endl;
505  }
506 
507  } else {
508  edm::LogVerbatim("L1GtTriggerMenuTesterWiki") << " * none"
509  << std::endl;
510  }
511  }
512 
513 }
514 
517 
518  //
519  // print menu, prescale factors and trigger mask in wiki format
520  //
521 
522  // L1 GT prescale factors for algorithm triggers
523 
524  std::vector<int> prescaleFactorsAlgoTrig = m_prescaleFactorsAlgoTrig->at(
525  m_indexPfSet);
526 
527  // L1 GT prescale factors for technical triggers
528 
529  std::vector<int> prescaleFactorsTechTrig = m_prescaleFactorsTechTrig->at(
530  m_indexPfSet);
531 
532  // use another map <int, L1GtAlgorithm> to get the menu sorted after bit number
533  // both algorithm and bit numbers are unique
534  typedef std::map<int, const L1GtAlgorithm*>::const_iterator CItBit;
535 
536  // algorithm triggers
537 
538  std::map<int, const L1GtAlgorithm*> algoBitToAlgo;
539 
540  std::map<std::string, const L1GtAlgorithm*> jetAlgoTrig;
541  std::map<std::string, const L1GtAlgorithm*> egammaAlgoTrig;
542  std::map<std::string, const L1GtAlgorithm*> esumAlgoTrig;
543  std::map<std::string, const L1GtAlgorithm*> muonAlgoTrig;
544  std::map<std::string, const L1GtAlgorithm*> crossAlgoTrig;
545  std::map<std::string, const L1GtAlgorithm*> bkgdAlgoTrig;
546 
547  int algoTrigNumber = 0;
548  int freeAlgoTrigNumber = 0;
549 
550  int jetAlgoTrigNumber = 0;
551  int egammaAlgoTrigNumber = 0;
552  int esumAlgoTrigNumber = 0;
553  int muonAlgoTrigNumber = 0;
554  int crossAlgoTrigNumber = 0;
555  int bkgdAlgoTrigNumber = 0;
556 
557  for (CItAlgo itAlgo = m_algorithmMap->begin(); itAlgo
558  != m_algorithmMap->end(); itAlgo++) {
559 
560  const int bitNumber = (itAlgo->second).algoBitNumber();
561  const std::string& algName = (itAlgo->second).algoName();
562 
563  algoBitToAlgo[bitNumber] = &(itAlgo->second);
564 
565  algoTrigNumber++;
566 
567  // per category
568 
569  const ConditionMap& conditionMap = (m_l1GtMenu->gtConditionMap()).at(
570  (itAlgo->second).algoChipNumber());
571 
572  const std::vector<L1GtLogicParser::TokenRPN>& rpnVector =
573  (itAlgo->second).algoRpnVector();
574  const L1GtLogicParser::OperationType condOperand =
576 
577  std::list<L1GtObject> listObjects;
578 
579  for (size_t i = 0; i < rpnVector.size(); ++i) {
580 
581  if ((rpnVector[i]).operation == condOperand) {
582 
583  const std::string& cndName = (rpnVector[i]).operand;
584 
585  // search the condition in the condition list
586 
587  bool foundCond = false;
588 
589  CItCond itCond = conditionMap.find(cndName);
590  if (itCond != conditionMap.end()) {
591  foundCond = true;
592 
593  // loop through object types and add them to the list
594 
595  const std::vector<L1GtObject>& objType =
596  (itCond->second)->objectType();
597 
598  for (std::vector<L1GtObject>::const_iterator itObject =
599  objType.begin(); itObject != objType.end(); itObject++) {
600  listObjects.push_back(*itObject);
601 
602  edm::LogVerbatim("L1GtTriggerMenuTester")
603  << (*itObject) << std::endl;
604  }
605 
606  // FIXME for XML parser, add GtExternal to objType correctly
607  if ((itCond->second)->condCategory() == CondExternal) {
608  listObjects.push_back(GtExternal);
609  }
610 
611  }
612 
613  if (!foundCond) {
614 
615  // it should never be happen, all conditions are in the maps
616  throw cms::Exception("FailModule") << "\nCondition "
617  << cndName << " not found in the condition map"
618  << " for chip number "
619  << ((itAlgo->second).algoChipNumber()) << std::endl;
620  }
621 
622  }
623 
624  }
625 
626  // eliminate duplicates
627  listObjects.sort();
628  listObjects.unique();
629 
630  // add the algorithm to the corresponding group
631 
632  bool jetGroup = false;
633  bool egammaGroup = false;
634  bool esumGroup = false;
635  bool muonGroup = false;
636  bool crossGroup = false;
637  bool bkgdGroup = false;
638 
639  for (std::list<L1GtObject>::const_iterator itObj = listObjects.begin(); itObj
640  != listObjects.end(); ++itObj) {
641 
642  switch (*itObj) {
643  case Mu: {
644  muonGroup = true;
645  }
646 
647  break;
648  case NoIsoEG: {
649  egammaGroup = true;
650  }
651 
652  break;
653  case IsoEG: {
654  egammaGroup = true;
655  }
656 
657  break;
658  case CenJet: {
659  jetGroup = true;
660  }
661 
662  break;
663  case ForJet: {
664  jetGroup = true;
665  }
666 
667  break;
668  case TauJet: {
669  jetGroup = true;
670  }
671 
672  break;
673  case ETM: {
674  esumGroup = true;
675 
676  }
677 
678  break;
679  case ETT: {
680  esumGroup = true;
681 
682  }
683 
684  break;
685  case HTT: {
686  esumGroup = true;
687 
688  }
689 
690  break;
691  case HTM: {
692  esumGroup = true;
693 
694  }
695 
696  break;
697  case JetCounts: {
698  // do nothing - not available
699  }
700 
701  break;
702  case HfBitCounts: {
703  bkgdGroup = true;
704  }
705 
706  break;
707  case HfRingEtSums: {
708  bkgdGroup = true;
709  }
710 
711  break;
712  case GtExternal: {
713  bkgdGroup = true;
714  }
715 
716  break;
717  case TechTrig:
718  case Castor:
719  case BPTX:
720  default: {
721  // should not arrive here
722 
723  edm::LogVerbatim("L1GtTriggerMenuTester")
724  << "\n Unknown object of type " << *itObj
725  << std::endl;
726  }
727  break;
728  }
729 
730  }
731 
732  int sumGroup = jetGroup + egammaGroup + esumGroup + muonGroup
733  + crossGroup + bkgdGroup;
734 
735  if (sumGroup > 1) {
736  crossAlgoTrig[algName] = &(itAlgo->second);
737  } else {
738 
739  if (jetGroup) {
740  jetAlgoTrig[algName] = &(itAlgo->second);
741 
742  } else if (egammaGroup) {
743  egammaAlgoTrig[algName] = &(itAlgo->second);
744 
745  } else if (esumGroup && (listObjects.size() > 1)) {
746  crossAlgoTrig[algName] = &(itAlgo->second);
747 
748  } else if (esumGroup) {
749  esumAlgoTrig[algName] = &(itAlgo->second);
750 
751  } else if (muonGroup) {
752  muonAlgoTrig[algName] = &(itAlgo->second);
753 
754  } else if (bkgdGroup) {
755  bkgdAlgoTrig[algName] = &(itAlgo->second);
756 
757  } else {
758  // do nothing
759  }
760 
761  }
762 
763  edm::LogVerbatim("L1GtTriggerMenuTester") << algName << " sum: "
764  << sumGroup << " size: " << listObjects.size() << std::endl;
765 
766  }
767 
768  freeAlgoTrigNumber = m_numberAlgorithmTriggers - algoTrigNumber;
769 
770  jetAlgoTrigNumber = jetAlgoTrig.size();
771  egammaAlgoTrigNumber = egammaAlgoTrig.size();
772  esumAlgoTrigNumber = esumAlgoTrig.size();
773  muonAlgoTrigNumber = muonAlgoTrig.size();
774  crossAlgoTrigNumber = crossAlgoTrig.size();
775  bkgdAlgoTrigNumber = bkgdAlgoTrig.size();
776 
777  // technical triggers
778  std::map<int, const L1GtAlgorithm*> techBitToAlgo;
779 
780  int techTrigNumber = 0;
781  int freeTechTrigNumber = 0;
782 
783  for (CItAlgo itAlgo = m_technicalTriggerMap->begin(); itAlgo
784  != m_technicalTriggerMap->end(); itAlgo++) {
785 
786  int bitNumber = (itAlgo->second).algoBitNumber();
787  techBitToAlgo[bitNumber] = &(itAlgo->second);
788 
789  techTrigNumber++;
790  }
791 
792  freeTechTrigNumber = m_numberTechnicalTriggers - techTrigNumber;
793 
794  // name of the attached HTML file
795  if (!m_overwriteHtmlFile) {
797 
798  // replace "/" with "_"
799  std::replace(menuName.begin(), menuName.end(), '/', '_');
800  m_htmlFile = "%ATTACHURL%/" + menuName + ".html";
801  } else {
802  m_htmlFile = "%ATTACHURL%/" + m_htmlFile;
803  }
804 
805  // header for printing algorithms
806 
807  edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
808  << "\n ********** L1 Trigger Menu - printing in wiki format ********** \n\n"
809  << "\n---+++ L1 menu identification\n"
810  << "\n|L1 Trigger Menu Interface: |!"
811  << m_l1GtMenu->gtTriggerMenuInterface() << " |"
812  << "\n|L1 Trigger Menu Name: |!" << m_l1GtMenu->gtTriggerMenuName()
813  << " |" << "\n|L1 Trigger Menu Implementation: |!"
815  << "\n|Associated L1 scale DB key: |!"
816  << m_l1GtMenu->gtScaleDbKey() << " |" << "\n\n" << std::flush
817  << std::endl;
818 
819  // Overview page
820  edm::LogVerbatim("L1GtTriggerMenuTesterWiki") << "\n---+++ Summary\n"
821  << std::endl;
822  edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
823  << " * Number of algorithm triggers: " << algoTrigNumber
824  << " defined, 128 possible." << std::endl;
825  edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
826  << " * Number of technical triggers: " << techTrigNumber
827  << " defined, 64 possible.<BR><BR>" << std::endl;
828 
829  edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
830  << " * Number of free bits for algorithm triggers: "
831  << freeAlgoTrigNumber << std::endl;
832  edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
833  << " * Number of free bits for technical triggers: "
834  << freeTechTrigNumber << "<BR>" << std::endl;
835 
836  edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
837  << "\nNumber of algorithm triggers per trigger group\n"
838  << std::endl;
839  edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
840  << " | *Trigger group* | *Number of bits used*|" << std::endl;
841  edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
842  << " | Jet algorithm triggers: | " << jetAlgoTrigNumber << "|"
843  << std::endl;
844  edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
845  << " | EGamma algorithm triggers: | " << egammaAlgoTrigNumber
846  << "|" << std::endl;
847  edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
848  << " | Energy sum algorithm triggers: | " << esumAlgoTrigNumber
849  << "|" << std::endl;
850  edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
851  << " | Muon algorithm triggers: | " << muonAlgoTrigNumber
852  << "|" << std::endl;
853  edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
854  << " | Cross algorithm triggers: | " << crossAlgoTrigNumber
855  << "|" << std::endl;
856  edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
857  << " | Background algorithm triggers: | " << bkgdAlgoTrigNumber
858  << "|" << std::endl;
859 
860  // force a page break
861  edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
862  << "<p style=\"page-break-before: always\">&nbsp;</p>";
863 
864  // compact print - without HLT path
865  bool compactPrint = true;
866 
867  edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
868  << "\n---+++ List of algorithm triggers sorted by trigger groups\n"
869  << std::endl;
870 
871  // Jet algorithm triggers
872  printTriggerGroup("Jet algorithm triggers", jetAlgoTrig, compactPrint,
874 
875  // EGamma algorithm triggers
876  printTriggerGroup("EGamma algorithm triggers", egammaAlgoTrig,
877  compactPrint, m_printPfsRates);
878 
879  // Energy sum algorithm triggers
880  printTriggerGroup("Energy sum algorithm triggers", esumAlgoTrig,
881  compactPrint, m_printPfsRates);
882 
883  // Muon algorithm triggers
884  printTriggerGroup("Muon algorithm triggers", muonAlgoTrig, compactPrint,
886 
887  // Cross algorithm triggers
888  printTriggerGroup("Cross algorithm triggers", crossAlgoTrig, compactPrint,
890 
891  // Background algorithm triggers
892  printTriggerGroup("Background algorithm triggers", bkgdAlgoTrig,
893  compactPrint, m_printPfsRates);
894 
895  // force a page break
896  edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
897  << "<p style=\"page-break-before: always\">&nbsp;</p>";
898 
899  edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
900  << "\n---+++ List of algorithm triggers sorted by bits\n"
901  << std::endl;
902 
903  edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
904  << "| *Algorithm* | *Alias* | *Bit number* |" << std::endl;
905 
906  for (CItBit itBit = algoBitToAlgo.begin(); itBit != algoBitToAlgo.end(); itBit++) {
907 
908  int bitNumber = itBit->first;
909  std::string aName = (itBit->second)->algoName();
910  std::string aAlias = (itBit->second)->algoAlias();
911 
912  edm::LogVerbatim("L1GtTriggerMenuTesterWiki") << "|" << std::left
913  << "[[" << (m_htmlFile + "#" + aName) << "][ " << aName
914  << "]] " << " |" << aAlias << " | " << bitNumber << "| |"
915  << std::endl;
916 
917  }
918 
919  // force a page break
920  edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
921  << "<p style=\"page-break-before: always\">&nbsp;</p>";
922  edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
923  << "\n---+++ List of technical triggers\n" << std::endl;
924 
925  edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
926  << "| *Technical trigger* | *Bit number* |" << std::endl;
927 
928  for (CItBit itBit = techBitToAlgo.begin(); itBit != techBitToAlgo.end(); itBit++) {
929 
930  int bitNumber = itBit->first;
931  std::string aName = (itBit->second)->algoName();
932  std::string aAlias = (itBit->second)->algoAlias();
933 
934  edm::LogVerbatim("L1GtTriggerMenuTesterWiki") << "|!" << std::left
935  << aName << " | " << std::right << bitNumber << " |"
936  << std::endl;
937  }
938 
939  // force a page break
940  edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
941  << "<p style=\"page-break-before: always\">&nbsp;</p>";
942 
943  // compact print false: with HLT path association, if the parameter m_useHltMenu is true
944  // otherwise, we have no association computed
945 
946  if (m_useHltMenu) {
947  compactPrint = false;
948  } else {
949  return;
950  }
951 
952  edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
953  << "\n---+++ List of algorithm triggers sorted by trigger groups, including !HLT path association \n"
954  << std::endl;
955 
956  edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
957  << "\n The following !HLT menu was used to associate the !HLT path to the L1 algorithm triggers:\n "
958  << std::endl;
959  edm::LogVerbatim("L1GtTriggerMenuTesterWiki") << m_hltTableName
960  << std::endl;
961 
962  // Jet algorithm triggers
963  printTriggerGroup("Jet algorithm triggers", jetAlgoTrig, compactPrint,
965 
966  // EGamma algorithm triggers
967  printTriggerGroup("EGamma algorithm triggers", egammaAlgoTrig,
968  compactPrint, m_printPfsRates);
969 
970  // Energy sum algorithm triggers
971  printTriggerGroup("Energy sum algorithm triggers", esumAlgoTrig,
972  compactPrint, m_printPfsRates);
973 
974  // Muon algorithm triggers
975  printTriggerGroup("Muon algorithm triggers", muonAlgoTrig, compactPrint,
977 
978  // Cross algorithm triggers
979  printTriggerGroup("Cross algorithm triggers", crossAlgoTrig, compactPrint,
981 
982  // Background algorithm triggers
983  printTriggerGroup("Background algorithm triggers", bkgdAlgoTrig,
984  compactPrint, m_printPfsRates);
985 
986 }
unsigned int size() const
number of trigger paths in trigger table
std::vector< L1GtLogicParser::OperandToken > expressionSeedsOperandList()
const std::string & gtTriggerMenuName() const
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
int i
Definition: DBlmapReader.cc:9
bool m_overwriteHtmlFile
input parameters
void beginLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &)
begin luminosity block
const std::vector< std::vector< int > > * m_prescaleFactorsTechTrig
Definition: L1GtObject.h:39
const std::string & triggerName(unsigned int triggerIndex) const
L1GtTriggerMenuTester(const edm::ParameterSet &)
void endLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &)
end luminosity block
std::map< std::string, L1GtCondition * > ConditionMap
map containing the conditions
const L1GtStableParameters * m_l1GtStablePar
event setup cached stuff
Definition: L1GtObject.h:36
const std::vector< unsigned int > * m_triggerMaskVetoAlgoTrig
ConditionMap::const_iterator CItCond
iterators through map containing the conditions
void associateL1SeedsHltPath(const edm::Run &, const edm::EventSetup &)
L1 seed - HLT path association.
const std::vector< std::vector< std::pair< bool, std::string > > > & hltL1GTSeeds() const
bool m_printPfsRates
print prescale factors and rates
std::string m_hltTableName
HLT menu was used to associate the HLT path to the L1 algorithm triggers.
const AlgorithmMap * m_algorithmAliasMap
const std::string & gtTriggerMenuImplementation() const
HLTConfigProvider m_hltConfig
The instance of the HLTConfigProvider as a data member.
const L1GtTriggerMenu * m_l1GtMenu
const std::string & tableName() const
HLT ConfDB table name.
const AlgorithmMap * m_algorithmMap
const L1GtTriggerMask * m_l1GtTmVetoAlgo
const std::vector< ConditionMap > & gtConditionMap() const
get / set / build the condition maps
const L1GtPrescaleFactors * m_l1GtPfTech
const std::vector< unsigned int > * m_triggerMaskAlgoTrig
void printWiki()
printing in Wiki format
AlgorithmMap::const_iterator CItAlgo
iterators through map containing the algorithms
void endRun(const edm::Run &, const edm::EventSetup &)
end run
Definition: L1GtObject.h:38
U second(std::pair< T, U > const &p)
unsigned int gtNumberTechnicalTriggers() const
get / set the number of technical triggers
void beginRun(const edm::Run &, const edm::EventSetup &)
begin run
unsigned int gtNumberPhysTriggers() const
get / set the number of physics trigger algorithms
int iEvent
Definition: GenABIO.cc:243
std::vector< std::string > m_techTriggerSeedNotInL1Menu
const std::vector< unsigned int > & gtTriggerMask() const
get the trigger mask
void print(std::ostream &, int &) const
const std::string & gtScaleDbKey() const
menu associated scale key
int m_indexPfSet
index of prescale factor set to be printed
const std::vector< unsigned int > * m_triggerMaskVetoTechTrig
bool m_useHltMenu
use a HLT menu for L1 seed - HLT path association
std::map< std::string, const L1GtAlgorithm * >::const_iterator CItAlgoP
constant iterator
const L1GtTriggerMask * m_l1GtTmAlgo
trigger masks &amp; veto masks
const std::string & gtTriggerMenuInterface() const
get / set the trigger menu names
void analyze(const edm::Event &, const edm::EventSetup &)
analyze
const std::vector< std::vector< int > > & gtPrescaleFactors() const
get the prescale factors by reference
Definition: L1GtObject.h:30
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
const std::vector< std::vector< int > > * m_prescaleFactorsAlgoTrig
const L1GtPrescaleFactors * m_l1GtPfAlgo
prescale factors
unsigned int m_numberAlgorithmTriggers
number of algorithm triggers
Definition: L1GtObject.h:37
const AlgorithmMap & gtAlgorithmMap() const
get / set the algorithm map (by name)
const AlgorithmMap * m_technicalTriggerMap
const L1GtTriggerMask * m_l1GtTmTech
std::vector< std::string > m_algoTriggerSeedNotInL1Menu
vector of algorithm or technical triggers not in the L1 menu
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 ...
const L1GtTriggerMask * m_l1GtTmVetoTech
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 ...
const AlgorithmMap & gtTechnicalTriggerMap() const
get / set the technical trigger map
const AlgorithmMap & gtAlgorithmAliasMap() const
get / set the algorithm map (by alias)
void retrieveL1EventSetup(const edm::EventSetup &)
retrieve all the relevant L1 trigger event setup records
std::string m_htmlFile
name of HTML file attached to the wiki page
std::string m_hltProcessName
process name of HLT process for which to get HLT configuration
unsigned int m_numberTechnicalTriggers
number of technical triggers
Definition: Run.h:41
list at
Definition: asciidump.py:428
const std::vector< unsigned int > * m_triggerMaskTechTrig