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