56 parSet.getParameter<edm::
ParameterSet> (
"L1ExtraInputTags"),consumesCollector()),
58 m_printOutput(parSet.getUntrackedParameter<int>(
"PrintOutput", 3)),
60 m_analyzeDecisionReadoutRecordEnable(parSet.getParameter<bool> (
"analyzeDecisionReadoutRecordEnable")),
62 m_analyzeL1GtUtilsMenuLiteEnable(parSet.getParameter<bool> (
"analyzeL1GtUtilsMenuLiteEnable")),
63 m_analyzeL1GtUtilsEventSetupEnable(parSet.getParameter<bool> (
"analyzeL1GtUtilsEventSetupEnable")),
64 m_analyzeL1GtUtilsEnable(parSet.getParameter<bool> (
"analyzeL1GtUtilsEnable")),
65 m_analyzeTriggerEnable(parSet.getParameter<bool> (
"analyzeTriggerEnable")),
67 m_analyzeObjectMapEnable(parSet.getParameter<bool> (
"analyzeObjectMapEnable")),
69 m_analyzeL1GtTriggerMenuLiteEnable(parSet.getParameter<bool> (
"analyzeL1GtTriggerMenuLiteEnable")),
71 m_analyzeConditionsInRunBlockEnable(parSet.getParameter<bool> (
"analyzeConditionsInRunBlockEnable")),
72 m_analyzeConditionsInLumiBlockEnable(parSet.getParameter<bool> (
"analyzeConditionsInLumiBlockEnable")),
73 m_analyzeConditionsInEventBlockEnable(parSet.getParameter<bool> (
"analyzeConditionsInEventBlockEnable")),
77 m_l1GtDaqReadoutRecordInputTag(parSet.getParameter<edm::InputTag>(
78 "L1GtDaqReadoutRecordInputTag")),
81 m_l1GtRecordInputTag(parSet.getParameter<edm::InputTag>(
82 "L1GtRecordInputTag")),
85 m_l1GtObjectMapTag(parSet.getParameter<edm::InputTag>(
89 m_l1GtObjectMapsInputTag(parSet.getParameter<edm::InputTag>(
90 "L1GtObjectMapsInputTag")),
93 m_l1GmtInputTag(parSet.getParameter<edm::InputTag>(
97 m_l1GtTmLInputTag(parSet.getParameter<edm::InputTag> (
101 m_condInEdmInputTag(parSet.getParameter<edm::InputTag> (
102 "CondInEdmInputTag")),
105 m_nameAlgTechTrig(parSet.getParameter<std::
string> (
"AlgorithmName")),
106 m_condName(parSet.getParameter<std::
string> (
"ConditionName")),
107 m_bitNumber(parSet.getParameter<unsigned int> (
"BitNumber")),
109 m_l1GtUtilsConfiguration(parSet.getParameter<unsigned int> (
"L1GtUtilsConfiguration")),
110 m_l1GtTmLInputTagProv(parSet.getParameter<bool> (
"L1GtTmLInputTagProv")),
111 m_l1GtRecordsInputTagProv(parSet.getParameter<bool> (
"L1GtRecordsInputTagProv")),
112 m_l1GtUtilsConfigureBeginRun(parSet.getParameter<bool> (
"L1GtUtilsConfigureBeginRun")),
113 m_l1GtUtilsLogicalExpression(parSet.getParameter<std::
string>(
"L1GtUtilsLogicalExpression")),
114 m_logicalExpressionL1ResultsProv(m_l1GtUtilsLogicalExpression, m_l1GtUtils),
115 m_logicalExpressionL1Results(m_l1GtUtilsLogicalExpression, m_l1GtUtils, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag)
121 <<
"\n Input parameters for L1 GT test analyzer"
122 <<
"\n L1 GT DAQ product: "
124 <<
"\n L1GlobalTriggerRecord product: "
126 <<
"\n L1 GT object map collection: "
128 <<
"\n Muon collection from GMT: "
130 <<
"\n L1 trigger menu lite product: "
133 <<
"\n Condition, if an algorithm trigger is requested: " <<
m_condName
134 <<
"\n Bit number for an algorithm or technical trigger: " <<
m_bitNumber
136 <<
"\n Retrieve input tag from provenance for L1GtTriggerMenuLite in the L1GtUtils: "
138 <<
"\n Retrieve input tag from provenance for L1GlobalTriggerReadoutRecord "
139 <<
"\n and / or L1GlobalTriggerRecord in the L1GtUtils: "
141 <<
"\n Configure L1GtUtils in beginRun(...): "
143 <<
" \n" << std::endl;
180 useL1EventSetup =
false;
181 useL1GtTriggerMenuLite =
true;
186 useL1EventSetup =
true;
187 useL1GtTriggerMenuLite =
true;
192 useL1EventSetup =
true;
193 useL1GtTriggerMenuLite =
false;
206 useL1GtTriggerMenuLite);
265 <<
"\n**** L1GtAnalyzer::analyzeDecisionReadoutRecord ****\n"
270 std::ostringstream myCoutStream;
276 if (!gtReadoutRecord.
isValid()) {
278 LogDebug(
"L1GtAnalyzer") <<
"\nL1GlobalTriggerReadoutRecord with \n "
280 <<
"\nrequested in configuration, but not found in the event."
281 <<
"\nExit the method.\n" << std::endl;
287 bool gtDecision = gtReadoutRecord->decision();
288 DecisionWord gtDecisionWord = gtReadoutRecord->decisionWord();
292 <<
"\n GlobalTrigger decision: " << gtDecision << std::endl;
295 gtReadoutRecord->printGtDecision(myCoutStream);
298 gtReadoutRecord->printTechnicalTrigger(myCoutStream);
311 std::ostringstream myCoutStream;
324 myCoutStream <<
"\nL1 configuration code: \n"
326 <<
"\n 0 - Retrieve L1 trigger configuration from L1GtTriggerMenuLite only"
327 <<
"\n 10000 L1GtTriggerMenuLite product is valid"
328 <<
"\n 99999 L1GtTriggerMenuLite product not valid. Error."
330 <<
"\n 100000 - Fall through: try first L1GtTriggerMenuLite; if not valid,try event setup."
331 <<
"\n 110000 L1GtTriggerMenuLite product is valid"
332 <<
"\n 120000 L1GtTriggerMenuLite product not valid, event setup valid."
333 <<
"\n 199999 L1GtTriggerMenuLite product not valid, event setup not valid. Error."
335 <<
"\n 200000 - Retrieve L1 trigger configuration from event setup only."
336 <<
"\n 210000 Event setup valid."
337 <<
"\n 299999 Event setup not valid. Error."
339 <<
"\n 300000 - No L1 trigger configuration requested to be retrieved. Error"
340 <<
"\n Must call before using L1GtUtils methods: "
341 <<
"\n getL1GtRunCache(const edm::Event& iEvent, const edm::EventSetup& evSetup,"
342 <<
"\n const bool useL1EventSetup, const bool useL1GtTriggerMenuLite)"
348 myCoutStream <<
"\nL1 configuration code:" << l1ConfCode
349 <<
"\nValid L1 trigger configuration." << std::endl;
351 myCoutStream <<
"\nL1 trigger menu name and implementation:" <<
"\n"
356 myCoutStream <<
"\nL1 configuration code:" << l1ConfCode
357 <<
"\nNo valid L1 trigger configuration available."
358 <<
"\nSee text above for error code interpretation"
359 <<
"\nNo return here, in order to test each method, protected against configuration error."
366 <<
"\n******** Results found with input tags retrieved from provenance ******** \n"
393 myCoutStream <<
"\n\nMethods:"
394 <<
"\n decisionBeforeMask(iEvent, m_nameAlgTechTrig, iErrorCode)"
395 <<
"\n decisionAfterMask(iEvent, m_nameAlgTechTrig, iErrorCode)"
396 <<
"\n decision(iEvent, m_nameAlgTechTrig, iErrorCode)"
397 <<
"\n prescaleFactor(iEvent, m_nameAlgTechTrig, iErrorCode)"
398 <<
"\n triggerMask(iEvent, m_nameAlgTechTrig, iErrorCode)"
399 <<
"\n triggerMask(m_nameAlgTechTrig,iErrorCode)"
400 <<
"\n\n" << std::endl;
403 if (iErrorCode == 0) {
404 myCoutStream <<
"\nDecision before trigger mask for "
408 <<
": " << decisionAfterMaskAlgTechTrig << std::endl;
409 myCoutStream <<
"Decision (after trigger mask) for "
414 <<
": " << prescaleFactorAlgTechTrig
418 <<
": " << triggerMaskAlgTechTrig
421 }
else if (iErrorCode == 1) {
423 <<
" does not exist in the L1 menu "
427 myCoutStream <<
"\nError: "
428 <<
"\n An error was encountered when retrieving decision, mask and prescale factor for "
431 << iErrorCode << std::endl;
441 if (iErrorCode == 0) {
443 <<
"(faster method): " << triggerMaskAlgTechTrig
446 }
else if (iErrorCode == 1) {
448 <<
" does not exist in the L1 menu "
452 myCoutStream <<
"\nError: "
453 <<
"\n An error was encountered when fast retrieving trigger mask for "
456 << iErrorCode << std::endl;
467 myCoutStream <<
"\nMethods:"
468 <<
"\n prescaleFactorSetIndex(iEvent, trigCategory, iErrorCode)"
469 <<
"\n prescaleFactorSet(iEvent, trigCategory,iErrorCode)\n"
474 iEvent, trigCategory, iErrorCode);
476 if (iErrorCode == 0) {
478 <<
"\nAlgorithm triggers: index for prescale factor set = "
479 << pfSetIndexAlgorithmTrigger <<
"\nfor run " << iEvent.
run()
487 <<
"\nError encountered when retrieving the prescale factor set index"
488 <<
"\n for algorithm triggers, for run " << iEvent.
run()
491 <<
"\n Error code: " << iErrorCode <<
"\n" << std::endl;
495 const std::vector<int>& pfSetAlgorithmTrigger =
498 if (iErrorCode == 0) {
499 myCoutStream <<
"\nAlgorithm triggers: prescale factor set index = "
500 << pfSetIndexAlgorithmTrigger <<
"\nfor run " << iEvent.
run()
506 for (std::vector<int>::const_iterator cItBit =
507 pfSetAlgorithmTrigger.begin(); cItBit
508 != pfSetAlgorithmTrigger.end(); ++cItBit) {
511 myCoutStream <<
"Bit number " << std::right << std::setw(4) << iBit
512 <<
": prescale factor = " << (*cItBit) << std::endl;
518 <<
"\nError encountered when retrieving the prescale factor set "
519 <<
"\n for algorithm triggers, for run " << iEvent.
run()
522 <<
"\n Error code: " << iErrorCode <<
"\n" << std::endl;
527 myCoutStream <<
"\nMethod:"
528 <<
"\n triggerMaskSet(trigCategory, iErrorCode)"
532 const std::vector<unsigned int>& tmSetAlgorithmTrigger =
535 if (iErrorCode == 0) {
536 myCoutStream <<
"\nAlgorithm triggers: trigger mask set for run "
537 << iEvent.
run() <<
", luminosity block "
542 for (std::vector<unsigned int>::const_iterator cItBit =
543 tmSetAlgorithmTrigger.begin(); cItBit
544 != tmSetAlgorithmTrigger.end(); ++cItBit) {
547 myCoutStream <<
"Bit number " << std::right << std::setw(4) << iBit
548 <<
": trigger mask = " << (*cItBit) << std::endl;
554 <<
"\nError encountered when retrieving the trigger mask set "
555 <<
"\n for algorithm triggers, for run " << iEvent.
run()
558 <<
"\n Error code: " << iErrorCode <<
"\n" << std::endl;
569 myCoutStream <<
"\nMethods:"
570 <<
"\n prescaleFactorSetIndex(iEvent, trigCategory, iErrorCode)"
571 <<
"\n prescaleFactorSet(iEvent, trigCategory,iErrorCode)\n"
576 iEvent, trigCategory, iErrorCode);
578 if (iErrorCode == 0) {
580 <<
"\nTechnical triggers: index for prescale factor set = "
581 << pfSetIndexTechnicalTrigger <<
"\nfor run " << iEvent.
run()
584 <<
"\nMethod: prescaleFactorSetIndex(iEvent, trigCategory, iErrorCode)\n"
589 <<
"\nError encountered when retrieving the prescale factor set index"
590 <<
"\n for technical triggers, for run " << iEvent.
run()
593 <<
"\n Error code: " << iErrorCode <<
"\n" << std::endl;
597 const std::vector<int>& pfSetTechnicalTrigger =
600 if (iErrorCode == 0) {
601 myCoutStream <<
"\nTechnical triggers: prescale factor set index = "
602 << pfSetIndexTechnicalTrigger <<
"\nfor run " << iEvent.
run()
605 <<
"\nMethod: prescaleFactorSet(iEvent, trigCategory,iErrorCode)\n"
609 for (std::vector<int>::const_iterator cItBit =
610 pfSetTechnicalTrigger.begin(); cItBit
611 != pfSetTechnicalTrigger.end(); ++cItBit) {
614 myCoutStream <<
"Bit number " << std::right << std::setw(4) << iBit
615 <<
": prescale factor = " << (*cItBit) << std::endl;
621 <<
"\nError encountered when retrieving the prescale factor set "
622 <<
"\n for technical triggers, for run " << iEvent.
run()
625 <<
"\n Error code: " << iErrorCode <<
"\n" << std::endl;
630 myCoutStream <<
"\nMethod:"
631 <<
"\n triggerMaskSet(trigCategory, iErrorCode)"
635 const std::vector<unsigned int>& tmSetTechnicalTrigger =
638 if (iErrorCode == 0) {
639 myCoutStream <<
"\nTechnical triggers: trigger mask set for run "
640 << iEvent.
run() <<
", luminosity block "
645 for (std::vector<unsigned int>::const_iterator cItBit =
646 tmSetTechnicalTrigger.begin(); cItBit
647 != tmSetTechnicalTrigger.end(); ++cItBit) {
650 myCoutStream <<
"Bit number " << std::right << std::setw(4) << iBit
651 <<
": trigger mask = " << (*cItBit) << std::endl;
657 <<
"\nError encountered when retrieving the trigger mask set "
658 <<
"\n for technical triggers, for run " << iEvent.
run()
661 <<
"\n Error code: " << iErrorCode <<
"\n" << std::endl;
668 const std::vector<std::pair<std::string, int> >& errorCodesProv =
671 const std::vector<L1GtLogicParser::OperandToken>& expL1TriggersProv =
674 const std::vector<std::pair<std::string, bool> >& decisionsBeforeMaskProv =
676 const std::vector<std::pair<std::string, bool> >& decisionsAfterMaskProv =
678 const std::vector<std::pair<std::string, int> >& prescaleFactorsProv =
680 const std::vector<std::pair<std::string, int> >& triggerMasksProv =
683 myCoutStream << std::endl;
684 myCoutStream <<
"\nLogical expression\n "
687 for (
size_t iTrig = 0; iTrig < errorCodesProv.size(); ++iTrig) {
688 if ((errorCodesProv[iTrig]).second != 0) {
690 <<
"\nError encountered when retrieving L1 results for trigger "
691 << (errorCodesProv[iTrig]).
first <<
" (bit number "
692 << (expL1TriggersProv[iTrig]).tokenNumber <<
")\n for run "
693 << iEvent.
run() <<
", luminosity block "
696 << (errorCodesProv[iTrig]).
second <<
"\n" << std::endl;
700 myCoutStream <<
"\n" << (errorCodesProv[iTrig]).
first
701 <<
" - bit number " << (expL1TriggersProv[iTrig]).tokenNumber
704 myCoutStream <<
" decision before mask = "
705 << (decisionsBeforeMaskProv[iTrig]).
second << std::endl;
707 myCoutStream <<
" decision after mask = "
708 << (decisionsAfterMaskProv[iTrig]).
second << std::endl;
710 myCoutStream <<
" prescale factor = "
711 << (prescaleFactorsProv[iTrig]).
second << std::endl;
713 myCoutStream <<
" trigger mask = "
714 << (triggerMasksProv[iTrig]).
second << std::endl;
716 myCoutStream <<
" error code = "
717 << (errorCodesProv[iTrig]).
second << std::endl;
729 <<
"\n******** Results found with input tags provided in the configuration file ******** \n"
731 <<
"\n L1GlobalTriggerReadoutRecord: "
760 myCoutStream <<
"\n\nMethods:"
761 <<
"\n decisionBeforeMask(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, m_nameAlgTechTrig, iErrorCode)"
762 <<
"\n decisionAfterMask(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, m_nameAlgTechTrig, iErrorCode)"
763 <<
"\n decision(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, m_nameAlgTechTrig, iErrorCode)"
764 <<
"\n prescaleFactor(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, m_nameAlgTechTrig, iErrorCode)"
765 <<
"\n triggerMask(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, m_nameAlgTechTrig, iErrorCode)"
770 if (iErrorCode == 0) {
771 myCoutStream <<
"\nDecision before trigger mask for "
775 <<
": " << decisionAfterMaskAlgTechTrigITag << std::endl;
776 myCoutStream <<
"Decision (after trigger mask) for "
781 <<
": " << prescaleFactorAlgTechTrigITag
785 <<
": " << triggerMaskAlgTechTrigITag
788 }
else if (iErrorCode == 1) {
790 <<
" does not exist in the L1 menu "
794 myCoutStream <<
"\nError: "
795 <<
"\n An error was encountered when retrieving decision, mask and prescale factor for "
798 << iErrorCode << std::endl;
810 myCoutStream <<
"\nMethods:"
811 <<
"\n prescaleFactorSetIndex(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, trigCategory, iErrorCode)"
812 <<
"\n prescaleFactorSet(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, trigCategory,iErrorCode)\n"
818 trigCategory, iErrorCode);
820 if (iErrorCode == 0) {
822 <<
"\nAlgorithm triggers: index for prescale factor set = "
823 << pfSetIndexAlgorithmTriggerITag <<
"\nfor run " << iEvent.
run()
831 <<
"\nError encountered when retrieving the prescale factor set index"
832 <<
"\n for algorithm triggers, for run " << iEvent.
run()
835 <<
"\n Error code: " << iErrorCode <<
"\n" << std::endl;
839 const std::vector<int>& pfSetAlgorithmTriggerITag =
843 if (iErrorCode == 0) {
844 myCoutStream <<
"\nAlgorithm triggers: prescale factor set index = "
845 << pfSetIndexAlgorithmTriggerITag <<
"\nfor run " << iEvent.
run()
851 for (std::vector<int>::const_iterator cItBit =
852 pfSetAlgorithmTriggerITag.begin(); cItBit
853 != pfSetAlgorithmTriggerITag.end(); ++cItBit) {
856 myCoutStream <<
"Bit number " << std::right << std::setw(4) << iBit
857 <<
": prescale factor = " << (*cItBit) << std::endl;
863 <<
"\nError encountered when retrieving the prescale factor set "
864 <<
"\n for algorithm triggers, for run " << iEvent.
run()
867 <<
"\n Error code: " << iErrorCode <<
"\n" << std::endl;
880 myCoutStream <<
"\nMethods:"
881 <<
"\n prescaleFactorSetIndex(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, trigCategory, iErrorCode)"
882 <<
"\n prescaleFactorSet(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, trigCategory,iErrorCode)\n"
888 trigCategory, iErrorCode);
890 if (iErrorCode == 0) {
892 <<
"\nTechnical triggers: index for prescale factor set = "
893 << pfSetIndexTechnicalTriggerITag <<
"\nfor run " << iEvent.
run()
900 <<
"\nError encountered when retrieving the prescale factor set index"
901 <<
"\n for technical triggers, for run " << iEvent.
run()
904 <<
"\n Error code: " << iErrorCode <<
"\n" << std::endl;
908 const std::vector<int>& pfSetTechnicalTriggerITag =
912 if (iErrorCode == 0) {
913 myCoutStream <<
"\nTechnical triggers: prescale factor set index = "
914 << pfSetIndexTechnicalTriggerITag <<
"\nfor run " << iEvent.
run()
920 for (std::vector<int>::const_iterator cItBit =
921 pfSetTechnicalTriggerITag.begin(); cItBit
922 != pfSetTechnicalTriggerITag.end(); ++cItBit) {
925 myCoutStream <<
"Bit number " << std::right << std::setw(4) << iBit
926 <<
": prescale factor = " << (*cItBit) << std::endl;
932 <<
"\nError encountered when retrieving the prescale factor set "
933 <<
"\n for technical triggers, for run " << iEvent.
run()
936 <<
"\n Error code: " << iErrorCode <<
"\n" << std::endl;
943 const std::vector<std::pair<std::string, int> >& errorCodes =
946 const std::vector<L1GtLogicParser::OperandToken>& expL1Triggers =
950 const std::vector<std::pair<std::string, bool> >& decisionsBeforeMask =
952 const std::vector<std::pair<std::string, bool> >& decisionsAfterMask =
954 const std::vector<std::pair<std::string, int> >& prescaleFactors =
956 const std::vector<std::pair<std::string, int> >& triggerMasks =
959 myCoutStream << std::endl;
960 myCoutStream <<
"\nLogical expression\n "
963 for (
size_t iTrig = 0; iTrig < errorCodes.size(); ++iTrig) {
964 if ((errorCodes[iTrig]).second != 0) {
966 <<
"\nError encountered when retrieving L1 results for trigger "
967 << (errorCodes[iTrig]).
first <<
" (bit number "
968 << (expL1Triggers[iTrig]).tokenNumber <<
")\n for run "
969 << iEvent.
run() <<
", luminosity block "
972 << (errorCodes[iTrig]).
second <<
"\n" << std::endl;
976 myCoutStream <<
"\n" << (errorCodes[iTrig]).
first
977 <<
" - bit number " << (expL1Triggers[iTrig]).tokenNumber
980 myCoutStream <<
" decision before mask = "
981 << (decisionsBeforeMask[iTrig]).
second << std::endl;
983 myCoutStream <<
" decision after mask = "
984 << (decisionsAfterMask[iTrig]).
second << std::endl;
986 myCoutStream <<
" prescale factor = "
987 << (prescaleFactors[iTrig]).
second << std::endl;
989 myCoutStream <<
" trigger mask = "
990 << (triggerMasks[iTrig]).
second << std::endl;
992 myCoutStream <<
" error code = "
993 << (errorCodes[iTrig]).
second << std::endl;
1006 <<
"\n**** L1GtAnalyzer::analyzeL1GtUtilsMenuLite ****\n"
1021 useL1GtTriggerMenuLite);
1038 <<
"\n**** L1GtAnalyzer::analyzeL1GtUtilsEventSetup ****\n"
1050 useL1GtTriggerMenuLite);
1060 <<
"\n**** L1GtAnalyzer::analyzeL1GtUtils: fall-through case ****\n"
1075 useL1GtTriggerMenuLite);
1092 LogDebug(
"L1GtAnalyzer") <<
"\n**** L1GtAnalyzer::analyzeTrigger ****\n"
1097 std::ostringstream myCoutStream;
1100 myCoutStream <<
"\n\nFull analysis of an algorithm or technical trigger"
1101 <<
"\nMethod: L1GtAnalyzer::analyzeTrigger" <<
"\nTrigger: "
1106 const unsigned int eventNumber = iEvent.
id().
event();
1108 myCoutStream <<
"Run: " << runNumber <<
" LS: " << lsNumber <<
" Event: "
1109 << eventNumber <<
"\n\n" << std::endl;
1122 useL1EventSetup =
false;
1123 useL1GtTriggerMenuLite =
true;
1128 useL1EventSetup =
true;
1129 useL1GtTriggerMenuLite =
true;
1134 useL1EventSetup =
true;
1135 useL1GtTriggerMenuLite =
false;
1149 useL1GtTriggerMenuLite);
1161 int iErrorCode = -1;
1162 int l1ConfCode = -1;
1168 LogDebug(
"L1GtAnalyzer") <<
"\nL1 configuration code:" << l1ConfCode
1169 <<
"\nValid L1 trigger configuration.\n" << std::endl;
1171 LogTrace(
"L1GtAnalyzer") <<
"\nL1 trigger menu name and implementation:"
1177 myCoutStream <<
"\nL1 configuration code:" << l1ConfCode
1178 <<
"\nNo valid L1 trigger configuration available."
1179 <<
"\nCheck L1GtUtils wiki page for error code interpretation\n"
1189 bool decisionBeforeMaskAlgTechTrig =
false;
1190 bool decisionAfterMaskAlgTechTrig =
false;
1191 bool decisionAlgTechTrig =
false;
1192 int prescaleFactorAlgTechTrig = -1;
1193 int triggerMaskAlgTechTrig = -1;
1234 switch (iErrorCode) {
1241 <<
" does not exist in the L1 menu "
1247 myCoutStream <<
"\nError: "
1248 <<
"\n An error was encountered when retrieving decision, mask and prescale factor for "
1252 <<
"\n Check L1GtUtils wiki page for error code interpretation"
1264 myCoutStream <<
"\nL1Extra collections from all BxInEvent" << std::endl;
1268 myCoutStream <<
"\nL1Extra collections from BxInEvent = 0 (BX for L1A)" << std::endl;
1274 int iErrorRecord = 0;
1276 bool validRecord =
false;
1277 bool gtObjectMapRecordValid =
false;
1289 LogDebug(
"L1GtAnalyzer") <<
"\nL1GlobalTriggerObjectMaps with \n "
1297 if (gtObjectMapRecord.
isValid()) {
1299 gtObjectMapRecordValid =
true;
1304 iErrorRecord = iErrorRecord + 100;
1305 LogDebug(
"L1GtAnalyzer") <<
"\nL1GlobalTriggerObjectMapRecord with \n "
1312 if (validRecord && gtObjectMapRecordValid) {
1356 <<
"\n Trigger mask: " << triggerMaskAlgTechTrig
1357 <<
"\n Prescale factor: " << prescaleFactorAlgTechTrig
1358 <<
"\n Decision before mask: " << decisionBeforeMaskAlgTechTrig
1359 <<
"\n Decision after mask: " << decisionAfterMaskAlgTechTrig
1360 <<
"\n Decision (after mask): " << decisionAlgTechTrig <<
"\n"
1372 <<
"\n**** L1GtAnalyzer::analyzeObjectMap object map product ****\n"
1377 std::ostringstream myCoutStream;
1384 if (!gtObjectMapRecord.
isValid()) {
1386 <<
"\nWarning: L1GlobalTriggerObjectMapRecord with input tag "
1388 <<
"\nrequested in configuration, but not found in the event."
1389 <<
"\nExit the method.\n" << std::endl;
1395 const std::vector<L1GlobalTriggerObjectMap>& objMapVec =
1396 gtObjectMapRecord->gtObjectMap();
1399 for (std::vector<L1GlobalTriggerObjectMap>::const_iterator it =
1400 objMapVec.begin(); it != objMapVec.end(); ++it) {
1402 (*it).print(myCoutStream);
1411 myCoutStream <<
"\n Number of combinations passing ("
1413 << comb->size() << std::endl;
1421 const bool result = gtObjectMapRecord->getConditionResult(
1424 myCoutStream <<
"\n Result for condition " <<
m_condName
1437 <<
"\n**** L1GtAnalyzer::analyzeL1GtTriggerMenuLite ****\n"
1442 std::ostringstream myCoutStream;
1452 if (!triggerMenuLite.
isValid()) {
1454 LogDebug(
"L1GtAnalyzer") <<
"\nL1GtTriggerMenuLite with \n "
1456 <<
"\nrequested in configuration, but not found in the event."
1457 <<
"\nExit the method.\n" << std::endl;
1463 myCoutStream << (*triggerMenuLite);
1468 triggerMenuLite->gtTriggerMenuInterface();
1469 const std::string& triggerMenuName = triggerMenuLite->gtTriggerMenuName();
1471 triggerMenuLite->gtTriggerMenuImplementation();
1472 const std::string& scaleDbKey = triggerMenuLite->gtScaleDbKey();
1476 triggerMenuLite->gtAlgorithmAliasMap();
1478 triggerMenuLite->gtTechnicalTriggerMap();
1480 const std::vector<unsigned int>& triggerMaskAlgoTrig =
1481 triggerMenuLite->gtTriggerMaskAlgoTrig();
1482 const std::vector<unsigned int>& triggerMaskTechTrig =
1483 triggerMenuLite->gtTriggerMaskTechTrig();
1485 const std::vector<std::vector<int> >& prescaleFactorsAlgoTrig =
1486 triggerMenuLite->gtPrescaleFactorsAlgoTrig();
1487 const std::vector<std::vector<int> >& prescaleFactorsTechTrig =
1488 triggerMenuLite->gtPrescaleFactorsTechTrig();
1492 size_t nrDefinedAlgo = algorithmMap.size();
1493 size_t nrDefinedTech = technicalTriggerMap.size();
1497 myCoutStream <<
"\n ********** L1 Trigger Menu - printing ********** \n"
1498 <<
"\nL1 Trigger Menu Interface: " << triggerMenuInterface
1499 <<
"\nL1 Trigger Menu Name: " << triggerMenuName
1500 <<
"\nL1 Trigger Menu Implementation: " << triggerMenuImplementation
1501 <<
"\nAssociated Scale DB Key: " << scaleDbKey <<
"\n\n"
1502 <<
"\nL1 Physics Algorithms: " << nrDefinedAlgo <<
" algorithms defined." <<
"\n\n"
1504 << std::right << std::setw(35) <<
"Algorithm Name" <<
" "
1505 << std::right << std::setw(35) <<
"Algorithm Alias" <<
" "
1506 << std::right << std::setw(12) <<
"Trigger Mask";
1507 for (
unsigned iSet = 0; iSet < prescaleFactorsAlgoTrig.size(); iSet++) {
1508 myCoutStream << std::right << std::setw(10) <<
"PF Set "
1509 << std::right << std::setw(2) << iSet;
1512 myCoutStream << std::endl;
1516 != algorithmMap.end(); itTrig++) {
1518 const unsigned int bitNumber = itTrig->first;
1523 if (itAlias != algorithmAliasMap.end()) {
1524 aAlias = itAlias->second;
1527 myCoutStream << std::setw(6) << bitNumber <<
" "
1528 << std::right << std::setw(35) << aName <<
" "
1529 << std::right << std::setw(35) << aAlias <<
" "
1530 << std::right << std::setw(12) << triggerMaskAlgoTrig[bitNumber];
1531 for (
unsigned iSet = 0; iSet < prescaleFactorsAlgoTrig.size(); iSet++) {
1532 myCoutStream << std::right << std::setw(12) << prescaleFactorsAlgoTrig[iSet][bitNumber];
1535 myCoutStream << std::endl;
1538 myCoutStream <<
"\nL1 Technical Triggers: " << nrDefinedTech
1539 <<
" technical triggers defined." <<
"\n\n" << std::endl;
1540 if (nrDefinedTech) {
1542 << std::right << std::setw(6) <<
"Bit Number "
1543 << std::right << std::setw(45) <<
" Technical trigger name " <<
" "
1544 << std::right << std::setw(12) <<
"Trigger Mask";
1545 for (
unsigned iSet = 0; iSet < prescaleFactorsTechTrig.size(); iSet++) {
1546 myCoutStream << std::right << std::setw(10) <<
"PF Set "
1547 << std::right << std::setw(2) << iSet;
1550 myCoutStream << std::endl;
1554 != technicalTriggerMap.end(); itTrig++) {
1556 unsigned int bitNumber = itTrig->first;
1559 myCoutStream << std::setw(6) << bitNumber <<
" "
1560 << std::right << std::setw(45) << aName
1561 << std::right << std::setw(12) << triggerMaskTechTrig[bitNumber];
1562 for (
unsigned iSet = 0; iSet < prescaleFactorsTechTrig.size(); iSet++) {
1563 myCoutStream << std::right << std::setw(12) << prescaleFactorsTechTrig[iSet][bitNumber];
1566 myCoutStream << std::endl;
1573 const std::string* algorithmAlias = triggerMenuLite->gtAlgorithmAlias(
1577 <<
"\nError code retrieving alias for algorithm with bit number "
1580 myCoutStream <<
"\nAlias for algorithm with bit number " <<
m_bitNumber
1581 <<
": " << (*algorithmAlias) << std::endl;
1585 const std::string* algorithmName = triggerMenuLite->gtAlgorithmName(
1589 <<
"\nError code retrieving name for algorithm with bit number "
1592 myCoutStream <<
"\nName for algorithm with bit number " <<
m_bitNumber
1593 <<
": " << (*algorithmName) << std::endl;
1597 const std::string* techTrigName = triggerMenuLite->gtTechTrigName(
1601 <<
"\nError code retrieving name for technical trigger with bit number "
1604 myCoutStream <<
"\nName for technical trigger with bit number "
1605 <<
m_bitNumber <<
": " << (*techTrigName) << std::endl;
1609 const unsigned int bitNumber = triggerMenuLite->gtBitNumber(
1613 <<
"\nError code retrieving bit number for algorithm/technical trigger "
1616 myCoutStream <<
"\nBit number for algorithm/technical trigger "
1635 <<
"\n**** L1GtAnalyzer::analyzeConditionsInRunBlock ****\n"
1640 std::ostringstream myCoutStream;
1646 if (!condInRunBlock.
isValid()) {
1648 LogDebug(
"L1GtAnalyzer") <<
"\nConditionsInRunBlock with \n "
1650 <<
"\nrequested in configuration, but not found in the event."
1651 <<
"\nExit the method.\n" << std::endl;
1656 const boost::uint16_t beamModeVal = condInRunBlock->beamMode;
1657 const boost::uint16_t beamMomentumVal = condInRunBlock->beamMomentum;
1658 const boost::uint32_t lhcFillNumberVal = condInRunBlock->lhcFillNumber;
1661 myCoutStream <<
"\nLHC quantities in run " << iRun.
run()
1662 <<
"\n Beam Mode = " << beamModeVal
1663 <<
"\n Beam Momentum = " << beamMomentumVal <<
" GeV"
1664 <<
"\n LHC Fill Number = " << lhcFillNumberVal
1675 <<
"\n**** L1GtAnalyzer::analyzeConditionsInLumiBlock ****\n"
1680 std::ostringstream myCoutStream;
1686 if (!condInLumiBlock.
isValid()) {
1688 LogDebug(
"L1GtAnalyzer") <<
"\nConditionsInLumiBlock with \n "
1690 <<
"\nrequested in configuration, but not found in the event."
1691 <<
"\nExit the method.\n" << std::endl;
1696 const boost::uint32_t totalIntensityBeam1Val =
1697 condInLumiBlock->totalIntensityBeam1;
1698 const boost::uint32_t totalIntensityBeam2Val =
1699 condInLumiBlock->totalIntensityBeam2;
1701 myCoutStream <<
"\nLHC quantities in luminosity section "
1704 <<
"\n Total Intensity Beam 1 (Integer × 10E10 charges) = "
1705 << totalIntensityBeam1Val
1706 <<
"\n Total Intensity Beam 2 (Integer × 10E10 charges) = "
1707 << totalIntensityBeam2Val << std::endl;
1717 std::ostringstream myCoutStream;
1723 if (!condInEventBlock.
isValid()) {
1725 LogDebug(
"L1GtAnalyzer") <<
"\nConditionsInEventBlock with \n "
1727 <<
"\nrequested in configuration, but not found in the event."
1728 <<
"\nExit the method.\n" << std::endl;
1733 const boost::uint16_t bstMasterStatusVal =
1734 condInEventBlock->bstMasterStatus;
1735 const boost::uint32_t turnCountNumberVal =
1736 condInEventBlock->turnCountNumber;
1738 myCoutStream <<
"\nLHC quantities in event " << iEvent.
id().
event()
1740 <<
" from run " << iEvent.
run() <<
"\n BST Master Status = "
1741 << bstMasterStatusVal <<
"\n Turn count number = "
1742 << turnCountNumberVal << std::endl;
1760 LogTrace(
"L1GtAnalyzer") << myCout.str() << std::endl;
1780 std::cout <<
"\n\n L1GtAnalyzer: Error - no print output = "
1782 <<
" defined! \n Check available values in the cfi file."
1783 <<
"\n" << std::endl;
virtual void analyzeObjectMap(const edm::Event &, const edm::EventSetup &)
analyze: object map product
EventNumber_t event() const
bool getByLabel(std::string const &label, Handle< PROD > &result) const
const bool decisionAfterMask(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return decision after trigger mask for a given algorithm or technical trigger
edm::InputTag m_l1GmtInputTag
input tag for muon collection from GMT
static const bool useL1GtTriggerMenuLite(false)
const int logicalExpressionRunUpdate(const edm::Run &, const edm::EventSetup &, const std::string &)
virtual void analyzeDecisionReadoutRecord(const edm::Event &, const edm::EventSetup &)
edm::InputTag m_condInEdmInputTag
input tag for ConditionInEdm products
edm::InputTag m_l1GtRecordInputTag
input tags for GT lite product
virtual void endJob()
end of job
const bool availableL1Configuration(int &errorCode, int &l1ConfCode) const
bool m_analyzeObjectMapEnable
virtual void analyze(const edm::Event &, const edm::EventSetup &)
analyze each event: event loop over various code snippets
bool m_analyzeConditionsInRunBlockEnable
edm::LuminosityBlockNumber_t luminosityBlock() const
const std::vector< std::pair< std::string, int > > & prescaleFactors()
std::string m_l1GtUtilsLogicalExpression
Run const & getRun() const
const std::vector< unsigned int > & triggerMaskSet(const TriggerCategory &trigCategory, int &errorCode)
bool m_analyzeDecisionReadoutRecordEnable
enable / disable various analysis methods
const std::vector< std::pair< std::string, int > > & triggerMasks()
const std::string & l1TriggerMenu() const
return the L1 trigger menu name
virtual void endLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &)
end section
bool getByLabel(std::string const &label, Handle< PROD > &result) const
const bool decisionBeforeMask(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return decision before trigger mask for a given algorithm or technical trigger
void analyzeConditionsInEventBlock(const edm::Event &, const edm::EventSetup &)
to be used in analyze/produce/filter
LuminosityBlockNumber_t luminosityBlock() const
U second(std::pair< T, U > const &p)
void analyzeConditionsInRunBlock(const edm::Run &, const edm::EventSetup &)
const std::vector< std::pair< std::string, bool > > & decisionsAfterMask()
bool m_analyzeConditionsInEventBlockEnable
void analyzeL1GtUtils(const edm::Event &, const edm::EventSetup &)
std::string m_nameAlgTechTrig
an algorithm trigger (name or alias) or a technical trigger name
void printOutput(std::ostringstream &)
print the output stream to the required output, given by m_printOutput
const std::vector< std::pair< std::string, bool > > & decisionsBeforeMask()
virtual void endRun(const edm::Run &, const edm::EventSetup &)
std::string m_condName
a condition in the algorithm trigger to test the object maps
const bool decision(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
void analyzeL1GtTriggerMenuLite(const edm::Event &, const edm::EventSetup &)
analyze: usage of L1GtTriggerMenuLite
const std::string & l1TriggerMenuImplementation() const
return the L1 trigger menu implementation
edm::InputTag m_l1GtObjectMapTag
input tags for GT object map collection L1GlobalTriggerObjectMapRecord
L1RetrieveL1Extra m_retrieveL1Extra
std::vector< bool > DecisionWord
typedefs
bool m_analyzeTriggerEnable
const std::vector< int > & prescaleFactorSet(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const TriggerCategory &trigCategory, int &errorCode)
bool m_analyzeL1GtUtilsEventSetupEnable
const std::vector< L1GtLogicParser::OperandToken > & expL1Triggers()
list of triggers in the logical expression, trigger decisions, prescale factors and masks...
unsigned int m_bitNumber
a bit number to retrieve the name and the alias
static const bool useL1EventSetup(true)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
int m_printOutput
print output
void analyzeConditionsInLumiBlock(const edm::LuminosityBlock &, const edm::EventSetup &)
to be used in beginLuminosityBlock
void getL1GtRunCache(const edm::Run &, const edm::EventSetup &, const bool, const bool, const edm::InputTag &)
get all the run-constant quantities for L1 trigger and cache them
unsigned int m_l1GtUtilsConfiguration
L1 configuration code for L1GtUtils.
bool m_analyzeConditionsInLumiBlockEnable
edm::InputTag m_l1GtDaqReadoutRecordInputTag
input tags for GT DAQ product
L1GtUtils::LogicalExpressionL1Results m_logicalExpressionL1ResultsProv
bool m_l1GtUtilsConfigureBeginRun
if true, configure (partially) L1GtUtils in beginRun using getL1GtRunCache
L1GtAnalyzer(const edm::ParameterSet &)
edm::InputTag m_l1GtObjectMapsInputTag
input tags for GT object map collection L1GlobalTriggerObjectMaps
const int prescaleFactorSetIndex(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const TriggerCategory &trigCategory, int &errorCode) const
const int triggerMask(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return trigger mask for a given algorithm or technical trigger
bool m_l1GtTmLInputTagProv
bool m_analyzeL1GtUtilsMenuLiteEnable
bool m_analyzeL1GtUtilsEnable
bool m_l1GtRecordsInputTagProv
void analyzeL1GtUtilsEventSetup(const edm::Event &, const edm::EventSetup &)
const int prescaleFactor(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return prescale factor for a given algorithm or technical trigger
std::vector< SingleCombInCond > CombinationsInCond
all the object combinations evaluated to true in the condition
void analyzeTrigger(const edm::Event &, const edm::EventSetup &)
full analysis of an algorithm or technical trigger
virtual void beginLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &)
bool isValid()
return true if the logical expression is syntactically correct
void analyzeL1GtUtilsMenuLite(const edm::Event &, const edm::EventSetup &)
for tests, use only one of the following methods
L1GtUtils::LogicalExpressionL1Results m_logicalExpressionL1Results
virtual void beginRun(const edm::Run &, const edm::EventSetup &)
edm::InputTag m_l1GtTmLInputTag
input tag for L1GtTriggerMenuLite
const std::vector< std::pair< std::string, int > > & errorCodes(const edm::Event &)
void analyzeL1GtUtilsCore(const edm::Event &, const edm::EventSetup &)
analyze: usage of L1GtUtils