55 parSet.getParameter<edm::
ParameterSet> (
"L1ExtraInputTags"),consumesCollector()),
57 m_printOutput(parSet.getUntrackedParameter<int>(
"PrintOutput", 3)),
59 m_analyzeDecisionReadoutRecordEnable(parSet.getParameter<bool> (
"analyzeDecisionReadoutRecordEnable")),
61 m_analyzeL1GtUtilsMenuLiteEnable(parSet.getParameter<bool> (
"analyzeL1GtUtilsMenuLiteEnable")),
62 m_analyzeL1GtUtilsEventSetupEnable(parSet.getParameter<bool> (
"analyzeL1GtUtilsEventSetupEnable")),
63 m_analyzeL1GtUtilsEnable(parSet.getParameter<bool> (
"analyzeL1GtUtilsEnable")),
64 m_analyzeTriggerEnable(parSet.getParameter<bool> (
"analyzeTriggerEnable")),
66 m_analyzeObjectMapEnable(parSet.getParameter<bool> (
"analyzeObjectMapEnable")),
68 m_analyzeL1GtTriggerMenuLiteEnable(parSet.getParameter<bool> (
"analyzeL1GtTriggerMenuLiteEnable")),
70 m_analyzeConditionsInRunBlockEnable(parSet.getParameter<bool> (
"analyzeConditionsInRunBlockEnable")),
71 m_analyzeConditionsInLumiBlockEnable(parSet.getParameter<bool> (
"analyzeConditionsInLumiBlockEnable")),
72 m_analyzeConditionsInEventBlockEnable(parSet.getParameter<bool> (
"analyzeConditionsInEventBlockEnable")),
76 m_l1GtDaqReadoutRecordInputTag(parSet.getParameter<edm::InputTag>(
77 "L1GtDaqReadoutRecordInputTag")),
80 m_l1GtRecordInputTag(parSet.getParameter<edm::InputTag>(
81 "L1GtRecordInputTag")),
84 m_l1GtObjectMapTag(parSet.getParameter<edm::InputTag>(
88 m_l1GtObjectMapsInputTag(parSet.getParameter<edm::InputTag>(
89 "L1GtObjectMapsInputTag")),
92 m_l1GmtInputTag(parSet.getParameter<edm::InputTag>(
96 m_l1GtTmLInputTag(parSet.getParameter<edm::InputTag> (
100 m_condInEdmInputTag(parSet.getParameter<edm::InputTag> (
101 "CondInEdmInputTag")),
104 m_nameAlgTechTrig(parSet.getParameter<std::
string> (
"AlgorithmName")),
105 m_condName(parSet.getParameter<std::
string> (
"ConditionName")),
106 m_bitNumber(parSet.getParameter<unsigned int> (
"BitNumber")),
108 m_l1GtUtilsConfiguration(parSet.getParameter<unsigned int> (
"L1GtUtilsConfiguration")),
109 m_l1GtTmLInputTagProv(parSet.getParameter<bool> (
"L1GtTmLInputTagProv")),
110 m_l1GtRecordsInputTagProv(parSet.getParameter<bool> (
"L1GtRecordsInputTagProv")),
111 m_l1GtUtilsConfigureBeginRun(parSet.getParameter<bool> (
"L1GtUtilsConfigureBeginRun")),
112 m_l1GtUtilsLogicalExpression(parSet.getParameter<std::
string>(
"L1GtUtilsLogicalExpression")),
113 m_logicalExpressionL1ResultsProv(m_l1GtUtilsLogicalExpression, m_l1GtUtils),
114 m_logicalExpressionL1Results(m_l1GtUtilsLogicalExpression, m_l1GtUtils, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag)
120 <<
"\n Input parameters for L1 GT test analyzer"
121 <<
"\n L1 GT DAQ product: "
123 <<
"\n L1GlobalTriggerRecord product: "
125 <<
"\n L1 GT object map collection: "
127 <<
"\n Muon collection from GMT: "
129 <<
"\n L1 trigger menu lite product: "
132 <<
"\n Condition, if an algorithm trigger is requested: " <<
m_condName
133 <<
"\n Bit number for an algorithm or technical trigger: " <<
m_bitNumber
135 <<
"\n Retrieve input tag from provenance for L1GtTriggerMenuLite in the L1GtUtils: "
137 <<
"\n Retrieve input tag from provenance for L1GlobalTriggerReadoutRecord "
138 <<
"\n and / or L1GlobalTriggerRecord in the L1GtUtils: "
140 <<
"\n Configure L1GtUtils in beginRun(...): "
142 <<
" \n" << std::endl;
179 useL1EventSetup =
false;
180 useL1GtTriggerMenuLite =
true;
185 useL1EventSetup =
true;
186 useL1GtTriggerMenuLite =
true;
191 useL1EventSetup =
true;
192 useL1GtTriggerMenuLite =
false;
205 useL1GtTriggerMenuLite);
264 <<
"\n**** L1GtAnalyzer::analyzeDecisionReadoutRecord ****\n"
269 std::ostringstream myCoutStream;
275 if (!gtReadoutRecord.
isValid()) {
277 LogDebug(
"L1GtAnalyzer") <<
"\nL1GlobalTriggerReadoutRecord with \n "
279 <<
"\nrequested in configuration, but not found in the event."
280 <<
"\nExit the method.\n" << std::endl;
286 bool gtDecision = gtReadoutRecord->decision();
287 DecisionWord gtDecisionWord = gtReadoutRecord->decisionWord();
291 <<
"\n GlobalTrigger decision: " << gtDecision << std::endl;
294 gtReadoutRecord->printGtDecision(myCoutStream);
297 gtReadoutRecord->printTechnicalTrigger(myCoutStream);
310 std::ostringstream myCoutStream;
323 myCoutStream <<
"\nL1 configuration code: \n"
325 <<
"\n 0 - Retrieve L1 trigger configuration from L1GtTriggerMenuLite only"
326 <<
"\n 10000 L1GtTriggerMenuLite product is valid"
327 <<
"\n 99999 L1GtTriggerMenuLite product not valid. Error."
329 <<
"\n 100000 - Fall through: try first L1GtTriggerMenuLite; if not valid,try event setup."
330 <<
"\n 110000 L1GtTriggerMenuLite product is valid"
331 <<
"\n 120000 L1GtTriggerMenuLite product not valid, event setup valid."
332 <<
"\n 199999 L1GtTriggerMenuLite product not valid, event setup not valid. Error."
334 <<
"\n 200000 - Retrieve L1 trigger configuration from event setup only."
335 <<
"\n 210000 Event setup valid."
336 <<
"\n 299999 Event setup not valid. Error."
338 <<
"\n 300000 - No L1 trigger configuration requested to be retrieved. Error"
339 <<
"\n Must call before using L1GtUtils methods: "
340 <<
"\n getL1GtRunCache(const edm::Event& iEvent, const edm::EventSetup& evSetup,"
341 <<
"\n const bool useL1EventSetup, const bool useL1GtTriggerMenuLite)"
347 myCoutStream <<
"\nL1 configuration code:" << l1ConfCode
348 <<
"\nValid L1 trigger configuration." << std::endl;
350 myCoutStream <<
"\nL1 trigger menu name and implementation:" <<
"\n"
355 myCoutStream <<
"\nL1 configuration code:" << l1ConfCode
356 <<
"\nNo valid L1 trigger configuration available."
357 <<
"\nSee text above for error code interpretation"
358 <<
"\nNo return here, in order to test each method, protected against configuration error."
365 <<
"\n******** Results found with input tags retrieved from provenance ******** \n"
392 myCoutStream <<
"\n\nMethods:"
393 <<
"\n decisionBeforeMask(iEvent, m_nameAlgTechTrig, iErrorCode)"
394 <<
"\n decisionAfterMask(iEvent, m_nameAlgTechTrig, iErrorCode)"
395 <<
"\n decision(iEvent, m_nameAlgTechTrig, iErrorCode)"
396 <<
"\n prescaleFactor(iEvent, m_nameAlgTechTrig, iErrorCode)"
397 <<
"\n triggerMask(iEvent, m_nameAlgTechTrig, iErrorCode)"
398 <<
"\n triggerMask(m_nameAlgTechTrig,iErrorCode)"
399 <<
"\n\n" << std::endl;
402 if (iErrorCode == 0) {
403 myCoutStream <<
"\nDecision before trigger mask for "
407 <<
": " << decisionAfterMaskAlgTechTrig << std::endl;
408 myCoutStream <<
"Decision (after trigger mask) for "
413 <<
": " << prescaleFactorAlgTechTrig
417 <<
": " << triggerMaskAlgTechTrig
420 }
else if (iErrorCode == 1) {
422 <<
" does not exist in the L1 menu "
426 myCoutStream <<
"\nError: "
427 <<
"\n An error was encountered when retrieving decision, mask and prescale factor for "
430 << iErrorCode << std::endl;
440 if (iErrorCode == 0) {
442 <<
"(faster method): " << triggerMaskAlgTechTrig
445 }
else if (iErrorCode == 1) {
447 <<
" does not exist in the L1 menu "
451 myCoutStream <<
"\nError: "
452 <<
"\n An error was encountered when fast retrieving trigger mask for "
455 << iErrorCode << std::endl;
466 myCoutStream <<
"\nMethods:"
467 <<
"\n prescaleFactorSetIndex(iEvent, trigCategory, iErrorCode)"
468 <<
"\n prescaleFactorSet(iEvent, trigCategory,iErrorCode)\n"
473 iEvent, trigCategory, iErrorCode);
475 if (iErrorCode == 0) {
477 <<
"\nAlgorithm triggers: index for prescale factor set = "
478 << pfSetIndexAlgorithmTrigger <<
"\nfor run " << iEvent.
run()
486 <<
"\nError encountered when retrieving the prescale factor set index"
487 <<
"\n for algorithm triggers, for run " << iEvent.
run()
490 <<
"\n Error code: " << iErrorCode <<
"\n" << std::endl;
494 const std::vector<int>& pfSetAlgorithmTrigger =
497 if (iErrorCode == 0) {
498 myCoutStream <<
"\nAlgorithm triggers: prescale factor set index = "
499 << pfSetIndexAlgorithmTrigger <<
"\nfor run " << iEvent.
run()
505 for (std::vector<int>::const_iterator cItBit =
506 pfSetAlgorithmTrigger.begin(); cItBit
507 != pfSetAlgorithmTrigger.end(); ++cItBit) {
510 myCoutStream <<
"Bit number " << std::right << std::setw(4) << iBit
511 <<
": prescale factor = " << (*cItBit) << std::endl;
517 <<
"\nError encountered when retrieving the prescale factor set "
518 <<
"\n for algorithm triggers, for run " << iEvent.
run()
521 <<
"\n Error code: " << iErrorCode <<
"\n" << std::endl;
526 myCoutStream <<
"\nMethod:"
527 <<
"\n triggerMaskSet(trigCategory, iErrorCode)"
531 const std::vector<unsigned int>& tmSetAlgorithmTrigger =
534 if (iErrorCode == 0) {
535 myCoutStream <<
"\nAlgorithm triggers: trigger mask set for run "
536 << iEvent.
run() <<
", luminosity block "
541 for (std::vector<unsigned int>::const_iterator cItBit =
542 tmSetAlgorithmTrigger.begin(); cItBit
543 != tmSetAlgorithmTrigger.end(); ++cItBit) {
546 myCoutStream <<
"Bit number " << std::right << std::setw(4) << iBit
547 <<
": trigger mask = " << (*cItBit) << std::endl;
553 <<
"\nError encountered when retrieving the trigger mask set "
554 <<
"\n for algorithm triggers, for run " << iEvent.
run()
557 <<
"\n Error code: " << iErrorCode <<
"\n" << std::endl;
568 myCoutStream <<
"\nMethods:"
569 <<
"\n prescaleFactorSetIndex(iEvent, trigCategory, iErrorCode)"
570 <<
"\n prescaleFactorSet(iEvent, trigCategory,iErrorCode)\n"
575 iEvent, trigCategory, iErrorCode);
577 if (iErrorCode == 0) {
579 <<
"\nTechnical triggers: index for prescale factor set = "
580 << pfSetIndexTechnicalTrigger <<
"\nfor run " << iEvent.
run()
583 <<
"\nMethod: prescaleFactorSetIndex(iEvent, trigCategory, iErrorCode)\n"
588 <<
"\nError encountered when retrieving the prescale factor set index"
589 <<
"\n for technical triggers, for run " << iEvent.
run()
592 <<
"\n Error code: " << iErrorCode <<
"\n" << std::endl;
596 const std::vector<int>& pfSetTechnicalTrigger =
599 if (iErrorCode == 0) {
600 myCoutStream <<
"\nTechnical triggers: prescale factor set index = "
601 << pfSetIndexTechnicalTrigger <<
"\nfor run " << iEvent.
run()
604 <<
"\nMethod: prescaleFactorSet(iEvent, trigCategory,iErrorCode)\n"
608 for (std::vector<int>::const_iterator cItBit =
609 pfSetTechnicalTrigger.begin(); cItBit
610 != pfSetTechnicalTrigger.end(); ++cItBit) {
613 myCoutStream <<
"Bit number " << std::right << std::setw(4) << iBit
614 <<
": prescale factor = " << (*cItBit) << std::endl;
620 <<
"\nError encountered when retrieving the prescale factor set "
621 <<
"\n for technical triggers, for run " << iEvent.
run()
624 <<
"\n Error code: " << iErrorCode <<
"\n" << std::endl;
629 myCoutStream <<
"\nMethod:"
630 <<
"\n triggerMaskSet(trigCategory, iErrorCode)"
634 const std::vector<unsigned int>& tmSetTechnicalTrigger =
637 if (iErrorCode == 0) {
638 myCoutStream <<
"\nTechnical triggers: trigger mask set for run "
639 << iEvent.
run() <<
", luminosity block "
644 for (std::vector<unsigned int>::const_iterator cItBit =
645 tmSetTechnicalTrigger.begin(); cItBit
646 != tmSetTechnicalTrigger.end(); ++cItBit) {
649 myCoutStream <<
"Bit number " << std::right << std::setw(4) << iBit
650 <<
": trigger mask = " << (*cItBit) << std::endl;
656 <<
"\nError encountered when retrieving the trigger mask set "
657 <<
"\n for technical triggers, for run " << iEvent.
run()
660 <<
"\n Error code: " << iErrorCode <<
"\n" << std::endl;
667 const std::vector<std::pair<std::string, int> >& errorCodesProv =
670 const std::vector<L1GtLogicParser::OperandToken>& expL1TriggersProv =
673 const std::vector<std::pair<std::string, bool> >& decisionsBeforeMaskProv =
675 const std::vector<std::pair<std::string, bool> >& decisionsAfterMaskProv =
677 const std::vector<std::pair<std::string, int> >& prescaleFactorsProv =
679 const std::vector<std::pair<std::string, int> >& triggerMasksProv =
682 myCoutStream << std::endl;
683 myCoutStream <<
"\nLogical expression\n "
686 for (
size_t iTrig = 0; iTrig < errorCodesProv.size(); ++iTrig) {
687 if ((errorCodesProv[iTrig]).second != 0) {
689 <<
"\nError encountered when retrieving L1 results for trigger "
690 << (errorCodesProv[iTrig]).
first <<
" (bit number "
691 << (expL1TriggersProv[iTrig]).tokenNumber <<
")\n for run "
692 << iEvent.
run() <<
", luminosity block "
695 << (errorCodesProv[iTrig]).
second <<
"\n" << std::endl;
699 myCoutStream <<
"\n" << (errorCodesProv[iTrig]).
first
700 <<
" - bit number " << (expL1TriggersProv[iTrig]).tokenNumber
703 myCoutStream <<
" decision before mask = "
704 << (decisionsBeforeMaskProv[iTrig]).
second << std::endl;
706 myCoutStream <<
" decision after mask = "
707 << (decisionsAfterMaskProv[iTrig]).
second << std::endl;
709 myCoutStream <<
" prescale factor = "
710 << (prescaleFactorsProv[iTrig]).
second << std::endl;
712 myCoutStream <<
" trigger mask = "
713 << (triggerMasksProv[iTrig]).
second << std::endl;
715 myCoutStream <<
" error code = "
716 << (errorCodesProv[iTrig]).
second << std::endl;
728 <<
"\n******** Results found with input tags provided in the configuration file ******** \n"
730 <<
"\n L1GlobalTriggerReadoutRecord: "
759 myCoutStream <<
"\n\nMethods:"
760 <<
"\n decisionBeforeMask(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, m_nameAlgTechTrig, iErrorCode)"
761 <<
"\n decisionAfterMask(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, m_nameAlgTechTrig, iErrorCode)"
762 <<
"\n decision(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, m_nameAlgTechTrig, iErrorCode)"
763 <<
"\n prescaleFactor(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, m_nameAlgTechTrig, iErrorCode)"
764 <<
"\n triggerMask(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, m_nameAlgTechTrig, iErrorCode)"
769 if (iErrorCode == 0) {
770 myCoutStream <<
"\nDecision before trigger mask for "
774 <<
": " << decisionAfterMaskAlgTechTrigITag << std::endl;
775 myCoutStream <<
"Decision (after trigger mask) for "
780 <<
": " << prescaleFactorAlgTechTrigITag
784 <<
": " << triggerMaskAlgTechTrigITag
787 }
else if (iErrorCode == 1) {
789 <<
" does not exist in the L1 menu "
793 myCoutStream <<
"\nError: "
794 <<
"\n An error was encountered when retrieving decision, mask and prescale factor for "
797 << iErrorCode << std::endl;
809 myCoutStream <<
"\nMethods:"
810 <<
"\n prescaleFactorSetIndex(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, trigCategory, iErrorCode)"
811 <<
"\n prescaleFactorSet(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, trigCategory,iErrorCode)\n"
817 trigCategory, iErrorCode);
819 if (iErrorCode == 0) {
821 <<
"\nAlgorithm triggers: index for prescale factor set = "
822 << pfSetIndexAlgorithmTriggerITag <<
"\nfor run " << iEvent.
run()
830 <<
"\nError encountered when retrieving the prescale factor set index"
831 <<
"\n for algorithm triggers, for run " << iEvent.
run()
834 <<
"\n Error code: " << iErrorCode <<
"\n" << std::endl;
838 const std::vector<int>& pfSetAlgorithmTriggerITag =
842 if (iErrorCode == 0) {
843 myCoutStream <<
"\nAlgorithm triggers: prescale factor set index = "
844 << pfSetIndexAlgorithmTriggerITag <<
"\nfor run " << iEvent.
run()
850 for (std::vector<int>::const_iterator cItBit =
851 pfSetAlgorithmTriggerITag.begin(); cItBit
852 != pfSetAlgorithmTriggerITag.end(); ++cItBit) {
855 myCoutStream <<
"Bit number " << std::right << std::setw(4) << iBit
856 <<
": prescale factor = " << (*cItBit) << std::endl;
862 <<
"\nError encountered when retrieving the prescale factor set "
863 <<
"\n for algorithm triggers, for run " << iEvent.
run()
866 <<
"\n Error code: " << iErrorCode <<
"\n" << std::endl;
879 myCoutStream <<
"\nMethods:"
880 <<
"\n prescaleFactorSetIndex(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, trigCategory, iErrorCode)"
881 <<
"\n prescaleFactorSet(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, trigCategory,iErrorCode)\n"
887 trigCategory, iErrorCode);
889 if (iErrorCode == 0) {
891 <<
"\nTechnical triggers: index for prescale factor set = "
892 << pfSetIndexTechnicalTriggerITag <<
"\nfor run " << iEvent.
run()
899 <<
"\nError encountered when retrieving the prescale factor set index"
900 <<
"\n for technical triggers, for run " << iEvent.
run()
903 <<
"\n Error code: " << iErrorCode <<
"\n" << std::endl;
907 const std::vector<int>& pfSetTechnicalTriggerITag =
911 if (iErrorCode == 0) {
912 myCoutStream <<
"\nTechnical triggers: prescale factor set index = "
913 << pfSetIndexTechnicalTriggerITag <<
"\nfor run " << iEvent.
run()
919 for (std::vector<int>::const_iterator cItBit =
920 pfSetTechnicalTriggerITag.begin(); cItBit
921 != pfSetTechnicalTriggerITag.end(); ++cItBit) {
924 myCoutStream <<
"Bit number " << std::right << std::setw(4) << iBit
925 <<
": prescale factor = " << (*cItBit) << std::endl;
931 <<
"\nError encountered when retrieving the prescale factor set "
932 <<
"\n for technical triggers, for run " << iEvent.
run()
935 <<
"\n Error code: " << iErrorCode <<
"\n" << std::endl;
942 const std::vector<std::pair<std::string, int> >& errorCodes =
945 const std::vector<L1GtLogicParser::OperandToken>& expL1Triggers =
949 const std::vector<std::pair<std::string, bool> >& decisionsBeforeMask =
951 const std::vector<std::pair<std::string, bool> >& decisionsAfterMask =
953 const std::vector<std::pair<std::string, int> >& prescaleFactors =
955 const std::vector<std::pair<std::string, int> >& triggerMasks =
958 myCoutStream << std::endl;
959 myCoutStream <<
"\nLogical expression\n "
962 for (
size_t iTrig = 0; iTrig < errorCodes.size(); ++iTrig) {
963 if ((errorCodes[iTrig]).second != 0) {
965 <<
"\nError encountered when retrieving L1 results for trigger "
966 << (errorCodes[iTrig]).
first <<
" (bit number "
967 << (expL1Triggers[iTrig]).tokenNumber <<
")\n for run "
968 << iEvent.
run() <<
", luminosity block "
971 << (errorCodes[iTrig]).
second <<
"\n" << std::endl;
975 myCoutStream <<
"\n" << (errorCodes[iTrig]).
first
976 <<
" - bit number " << (expL1Triggers[iTrig]).tokenNumber
979 myCoutStream <<
" decision before mask = "
980 << (decisionsBeforeMask[iTrig]).
second << std::endl;
982 myCoutStream <<
" decision after mask = "
983 << (decisionsAfterMask[iTrig]).
second << std::endl;
985 myCoutStream <<
" prescale factor = "
986 << (prescaleFactors[iTrig]).
second << std::endl;
988 myCoutStream <<
" trigger mask = "
989 << (triggerMasks[iTrig]).
second << std::endl;
991 myCoutStream <<
" error code = "
992 << (errorCodes[iTrig]).
second << std::endl;
1005 <<
"\n**** L1GtAnalyzer::analyzeL1GtUtilsMenuLite ****\n"
1020 useL1GtTriggerMenuLite);
1037 <<
"\n**** L1GtAnalyzer::analyzeL1GtUtilsEventSetup ****\n"
1049 useL1GtTriggerMenuLite);
1059 <<
"\n**** L1GtAnalyzer::analyzeL1GtUtils: fall-through case ****\n"
1074 useL1GtTriggerMenuLite);
1091 LogDebug(
"L1GtAnalyzer") <<
"\n**** L1GtAnalyzer::analyzeTrigger ****\n"
1096 std::ostringstream myCoutStream;
1099 myCoutStream <<
"\n\nFull analysis of an algorithm or technical trigger"
1100 <<
"\nMethod: L1GtAnalyzer::analyzeTrigger" <<
"\nTrigger: "
1105 const unsigned int eventNumber = iEvent.
id().
event();
1107 myCoutStream <<
"Run: " << runNumber <<
" LS: " << lsNumber <<
" Event: "
1108 << eventNumber <<
"\n\n" << std::endl;
1121 useL1EventSetup =
false;
1122 useL1GtTriggerMenuLite =
true;
1127 useL1EventSetup =
true;
1128 useL1GtTriggerMenuLite =
true;
1133 useL1EventSetup =
true;
1134 useL1GtTriggerMenuLite =
false;
1148 useL1GtTriggerMenuLite);
1160 int iErrorCode = -1;
1161 int l1ConfCode = -1;
1167 LogDebug(
"L1GtAnalyzer") <<
"\nL1 configuration code:" << l1ConfCode
1168 <<
"\nValid L1 trigger configuration.\n" << std::endl;
1170 LogTrace(
"L1GtAnalyzer") <<
"\nL1 trigger menu name and implementation:"
1176 myCoutStream <<
"\nL1 configuration code:" << l1ConfCode
1177 <<
"\nNo valid L1 trigger configuration available."
1178 <<
"\nCheck L1GtUtils wiki page for error code interpretation\n"
1188 bool decisionBeforeMaskAlgTechTrig =
false;
1189 bool decisionAfterMaskAlgTechTrig =
false;
1190 bool decisionAlgTechTrig =
false;
1191 int prescaleFactorAlgTechTrig = -1;
1192 int triggerMaskAlgTechTrig = -1;
1233 switch (iErrorCode) {
1240 <<
" does not exist in the L1 menu "
1246 myCoutStream <<
"\nError: "
1247 <<
"\n An error was encountered when retrieving decision, mask and prescale factor for "
1251 <<
"\n Check L1GtUtils wiki page for error code interpretation"
1263 myCoutStream <<
"\nL1Extra collections from all BxInEvent" << std::endl;
1267 myCoutStream <<
"\nL1Extra collections from BxInEvent = 0 (BX for L1A)" << std::endl;
1273 int iErrorRecord = 0;
1275 bool validRecord =
false;
1276 bool gtObjectMapRecordValid =
false;
1288 LogDebug(
"L1GtAnalyzer") <<
"\nL1GlobalTriggerObjectMaps with \n "
1296 if (gtObjectMapRecord.
isValid()) {
1298 gtObjectMapRecordValid =
true;
1303 iErrorRecord = iErrorRecord + 100;
1304 LogDebug(
"L1GtAnalyzer") <<
"\nL1GlobalTriggerObjectMapRecord with \n "
1311 if (validRecord && gtObjectMapRecordValid) {
1355 <<
"\n Trigger mask: " << triggerMaskAlgTechTrig
1356 <<
"\n Prescale factor: " << prescaleFactorAlgTechTrig
1357 <<
"\n Decision before mask: " << decisionBeforeMaskAlgTechTrig
1358 <<
"\n Decision after mask: " << decisionAfterMaskAlgTechTrig
1359 <<
"\n Decision (after mask): " << decisionAlgTechTrig <<
"\n"
1371 <<
"\n**** L1GtAnalyzer::analyzeObjectMap object map product ****\n"
1376 std::ostringstream myCoutStream;
1383 if (!gtObjectMapRecord.
isValid()) {
1385 <<
"\nWarning: L1GlobalTriggerObjectMapRecord with input tag "
1387 <<
"\nrequested in configuration, but not found in the event."
1388 <<
"\nExit the method.\n" << std::endl;
1394 const std::vector<L1GlobalTriggerObjectMap>& objMapVec =
1395 gtObjectMapRecord->gtObjectMap();
1398 for (std::vector<L1GlobalTriggerObjectMap>::const_iterator it =
1399 objMapVec.begin(); it != objMapVec.end(); ++it) {
1401 (*it).print(myCoutStream);
1410 myCoutStream <<
"\n Number of combinations passing ("
1412 << comb->size() << std::endl;
1420 const bool result = gtObjectMapRecord->getConditionResult(
1423 myCoutStream <<
"\n Result for condition " <<
m_condName
1436 <<
"\n**** L1GtAnalyzer::analyzeL1GtTriggerMenuLite ****\n"
1441 std::ostringstream myCoutStream;
1451 if (!triggerMenuLite.
isValid()) {
1453 LogDebug(
"L1GtAnalyzer") <<
"\nL1GtTriggerMenuLite with \n "
1455 <<
"\nrequested in configuration, but not found in the event."
1456 <<
"\nExit the method.\n" << std::endl;
1462 myCoutStream << (*triggerMenuLite);
1467 triggerMenuLite->gtTriggerMenuInterface();
1468 const std::string& triggerMenuName = triggerMenuLite->gtTriggerMenuName();
1470 triggerMenuLite->gtTriggerMenuImplementation();
1471 const std::string& scaleDbKey = triggerMenuLite->gtScaleDbKey();
1475 triggerMenuLite->gtAlgorithmAliasMap();
1477 triggerMenuLite->gtTechnicalTriggerMap();
1479 const std::vector<unsigned int>& triggerMaskAlgoTrig =
1480 triggerMenuLite->gtTriggerMaskAlgoTrig();
1481 const std::vector<unsigned int>& triggerMaskTechTrig =
1482 triggerMenuLite->gtTriggerMaskTechTrig();
1484 const std::vector<std::vector<int> >& prescaleFactorsAlgoTrig =
1485 triggerMenuLite->gtPrescaleFactorsAlgoTrig();
1486 const std::vector<std::vector<int> >& prescaleFactorsTechTrig =
1487 triggerMenuLite->gtPrescaleFactorsTechTrig();
1491 size_t nrDefinedAlgo = algorithmMap.size();
1492 size_t nrDefinedTech = technicalTriggerMap.size();
1496 myCoutStream <<
"\n ********** L1 Trigger Menu - printing ********** \n"
1497 <<
"\nL1 Trigger Menu Interface: " << triggerMenuInterface
1498 <<
"\nL1 Trigger Menu Name: " << triggerMenuName
1499 <<
"\nL1 Trigger Menu Implementation: " << triggerMenuImplementation
1500 <<
"\nAssociated Scale DB Key: " << scaleDbKey <<
"\n\n"
1501 <<
"\nL1 Physics Algorithms: " << nrDefinedAlgo <<
" algorithms defined." <<
"\n\n"
1503 << std::right << std::setw(35) <<
"Algorithm Name" <<
" "
1504 << std::right << std::setw(35) <<
"Algorithm Alias" <<
" "
1505 << std::right << std::setw(12) <<
"Trigger Mask";
1506 for (
unsigned iSet = 0; iSet < prescaleFactorsAlgoTrig.size(); iSet++) {
1507 myCoutStream << std::right << std::setw(10) <<
"PF Set "
1508 << std::right << std::setw(2) << iSet;
1511 myCoutStream << std::endl;
1515 != algorithmMap.end(); itTrig++) {
1517 const unsigned int bitNumber = itTrig->first;
1522 if (itAlias != algorithmAliasMap.end()) {
1523 aAlias = itAlias->second;
1526 myCoutStream << std::setw(6) << bitNumber <<
" "
1527 << std::right << std::setw(35) << aName <<
" "
1528 << std::right << std::setw(35) << aAlias <<
" "
1529 << std::right << std::setw(12) << triggerMaskAlgoTrig[bitNumber];
1530 for (
unsigned iSet = 0; iSet < prescaleFactorsAlgoTrig.size(); iSet++) {
1531 myCoutStream << std::right << std::setw(12) << prescaleFactorsAlgoTrig[iSet][bitNumber];
1534 myCoutStream << std::endl;
1537 myCoutStream <<
"\nL1 Technical Triggers: " << nrDefinedTech
1538 <<
" technical triggers defined." <<
"\n\n" << std::endl;
1539 if (nrDefinedTech) {
1541 << std::right << std::setw(6) <<
"Bit Number "
1542 << std::right << std::setw(45) <<
" Technical trigger name " <<
" "
1543 << std::right << std::setw(12) <<
"Trigger Mask";
1544 for (
unsigned iSet = 0; iSet < prescaleFactorsTechTrig.size(); iSet++) {
1545 myCoutStream << std::right << std::setw(10) <<
"PF Set "
1546 << std::right << std::setw(2) << iSet;
1549 myCoutStream << std::endl;
1553 != technicalTriggerMap.end(); itTrig++) {
1555 unsigned int bitNumber = itTrig->first;
1558 myCoutStream << std::setw(6) << bitNumber <<
" "
1559 << std::right << std::setw(45) << aName
1560 << std::right << std::setw(12) << triggerMaskTechTrig[bitNumber];
1561 for (
unsigned iSet = 0; iSet < prescaleFactorsTechTrig.size(); iSet++) {
1562 myCoutStream << std::right << std::setw(12) << prescaleFactorsTechTrig[iSet][bitNumber];
1565 myCoutStream << std::endl;
1572 const std::string* algorithmAlias = triggerMenuLite->gtAlgorithmAlias(
1576 <<
"\nError code retrieving alias for algorithm with bit number "
1579 myCoutStream <<
"\nAlias for algorithm with bit number " <<
m_bitNumber
1580 <<
": " << (*algorithmAlias) << std::endl;
1584 const std::string* algorithmName = triggerMenuLite->gtAlgorithmName(
1588 <<
"\nError code retrieving name for algorithm with bit number "
1591 myCoutStream <<
"\nName for algorithm with bit number " <<
m_bitNumber
1592 <<
": " << (*algorithmName) << std::endl;
1596 const std::string* techTrigName = triggerMenuLite->gtTechTrigName(
1600 <<
"\nError code retrieving name for technical trigger with bit number "
1603 myCoutStream <<
"\nName for technical trigger with bit number "
1604 <<
m_bitNumber <<
": " << (*techTrigName) << std::endl;
1608 const unsigned int bitNumber = triggerMenuLite->gtBitNumber(
1612 <<
"\nError code retrieving bit number for algorithm/technical trigger "
1615 myCoutStream <<
"\nBit number for algorithm/technical trigger "
1634 <<
"\n**** L1GtAnalyzer::analyzeConditionsInRunBlock ****\n"
1639 std::ostringstream myCoutStream;
1645 if (!condInRunBlock.
isValid()) {
1647 LogDebug(
"L1GtAnalyzer") <<
"\nConditionsInRunBlock with \n "
1649 <<
"\nrequested in configuration, but not found in the event."
1650 <<
"\nExit the method.\n" << std::endl;
1655 const boost::uint16_t beamModeVal = condInRunBlock->beamMode;
1656 const boost::uint16_t beamMomentumVal = condInRunBlock->beamMomentum;
1657 const boost::uint32_t lhcFillNumberVal = condInRunBlock->lhcFillNumber;
1660 myCoutStream <<
"\nLHC quantities in run " << iRun.
run()
1661 <<
"\n Beam Mode = " << beamModeVal
1662 <<
"\n Beam Momentum = " << beamMomentumVal <<
" GeV"
1663 <<
"\n LHC Fill Number = " << lhcFillNumberVal
1674 <<
"\n**** L1GtAnalyzer::analyzeConditionsInLumiBlock ****\n"
1679 std::ostringstream myCoutStream;
1685 if (!condInLumiBlock.
isValid()) {
1687 LogDebug(
"L1GtAnalyzer") <<
"\nConditionsInLumiBlock with \n "
1689 <<
"\nrequested in configuration, but not found in the event."
1690 <<
"\nExit the method.\n" << std::endl;
1695 const boost::uint32_t totalIntensityBeam1Val =
1696 condInLumiBlock->totalIntensityBeam1;
1697 const boost::uint32_t totalIntensityBeam2Val =
1698 condInLumiBlock->totalIntensityBeam2;
1700 myCoutStream <<
"\nLHC quantities in luminosity section "
1703 <<
"\n Total Intensity Beam 1 (Integer × 10E10 charges) = "
1704 << totalIntensityBeam1Val
1705 <<
"\n Total Intensity Beam 2 (Integer × 10E10 charges) = "
1706 << totalIntensityBeam2Val << std::endl;
1716 std::ostringstream myCoutStream;
1722 if (!condInEventBlock.
isValid()) {
1724 LogDebug(
"L1GtAnalyzer") <<
"\nConditionsInEventBlock with \n "
1726 <<
"\nrequested in configuration, but not found in the event."
1727 <<
"\nExit the method.\n" << std::endl;
1732 const boost::uint16_t bstMasterStatusVal =
1733 condInEventBlock->bstMasterStatus;
1734 const boost::uint32_t turnCountNumberVal =
1735 condInEventBlock->turnCountNumber;
1737 myCoutStream <<
"\nLHC quantities in event " << iEvent.
id().
event()
1739 <<
" from run " << iEvent.
run() <<
"\n BST Master Status = "
1740 << bstMasterStatusVal <<
"\n Turn count number = "
1741 << turnCountNumberVal << std::endl;
1759 LogTrace(
"L1GtAnalyzer") << myCout.str() << std::endl;
1779 std::cout <<
"\n\n L1GtAnalyzer: Error - no print output = "
1781 <<
" defined! \n Check available values in the cfi file."
1782 <<
"\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