58 parSet.getParameter<edm::
ParameterSet> (
"L1ExtraInputTags")),
60 m_printOutput(parSet.getUntrackedParameter<int>(
"PrintOutput", 3)),
62 m_analyzeDecisionReadoutRecordEnable(parSet.getParameter<bool> (
"analyzeDecisionReadoutRecordEnable")),
64 m_analyzeL1GtUtilsMenuLiteEnable(parSet.getParameter<bool> (
"analyzeL1GtUtilsMenuLiteEnable")),
65 m_analyzeL1GtUtilsEventSetupEnable(parSet.getParameter<bool> (
"analyzeL1GtUtilsEventSetupEnable")),
66 m_analyzeL1GtUtilsEnable(parSet.getParameter<bool> (
"analyzeL1GtUtilsEnable")),
67 m_analyzeTriggerEnable(parSet.getParameter<bool> (
"analyzeTriggerEnable")),
69 m_analyzeObjectMapEnable(parSet.getParameter<bool> (
"analyzeObjectMapEnable")),
71 m_analyzeL1GtTriggerMenuLiteEnable(parSet.getParameter<bool> (
"analyzeL1GtTriggerMenuLiteEnable")),
73 m_analyzeConditionsInRunBlockEnable(parSet.getParameter<bool> (
"analyzeConditionsInRunBlockEnable")),
74 m_analyzeConditionsInLumiBlockEnable(parSet.getParameter<bool> (
"analyzeConditionsInLumiBlockEnable")),
75 m_analyzeConditionsInEventBlockEnable(parSet.getParameter<bool> (
"analyzeConditionsInEventBlockEnable")),
79 m_l1GtDaqReadoutRecordInputTag(parSet.getParameter<edm::InputTag>(
80 "L1GtDaqReadoutRecordInputTag")),
83 m_l1GtRecordInputTag(parSet.getParameter<edm::InputTag>(
84 "L1GtRecordInputTag")),
87 m_l1GtObjectMapTag(parSet.getParameter<edm::InputTag>(
91 m_l1GtObjectMapsInputTag(parSet.getParameter<edm::InputTag>(
92 "L1GtObjectMapsInputTag")),
95 m_l1GmtInputTag(parSet.getParameter<edm::InputTag>(
99 m_l1GtTmLInputTag(parSet.getParameter<edm::InputTag> (
103 m_condInEdmInputTag(parSet.getParameter<edm::InputTag> (
104 "CondInEdmInputTag")),
107 m_nameAlgTechTrig(parSet.getParameter<std::
string> (
"AlgorithmName")),
108 m_condName(parSet.getParameter<std::
string> (
"ConditionName")),
109 m_bitNumber(parSet.getParameter<unsigned int> (
"BitNumber")),
111 m_l1GtUtilsConfiguration(parSet.getParameter<unsigned int> (
"L1GtUtilsConfiguration")),
112 m_l1GtTmLInputTagProv(parSet.getParameter<bool> (
"L1GtTmLInputTagProv")),
113 m_l1GtRecordsInputTagProv(parSet.getParameter<bool> (
"L1GtRecordsInputTagProv")),
114 m_l1GtUtilsConfigureBeginRun(parSet.getParameter<bool> (
"L1GtUtilsConfigureBeginRun")),
115 m_l1GtUtilsLogicalExpression(parSet.getParameter<std::
string>(
"L1GtUtilsLogicalExpression")),
116 m_logicalExpressionL1ResultsProv(m_l1GtUtilsLogicalExpression, m_l1GtUtils),
117 m_logicalExpressionL1Results(m_l1GtUtilsLogicalExpression, m_l1GtUtils, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag)
123 <<
"\n Input parameters for L1 GT test analyzer"
124 <<
"\n L1 GT DAQ product: "
126 <<
"\n L1GlobalTriggerRecord product: "
128 <<
"\n L1 GT object map collection: "
130 <<
"\n Muon collection from GMT: "
132 <<
"\n L1 trigger menu lite product: "
135 <<
"\n Condition, if an algorithm trigger is requested: " <<
m_condName
136 <<
"\n Bit number for an algorithm or technical trigger: " <<
m_bitNumber
138 <<
"\n Retrieve input tag from provenance for L1GtTriggerMenuLite in the L1GtUtils: "
140 <<
"\n Retrieve input tag from provenance for L1GlobalTriggerReadoutRecord "
141 <<
"\n and / or L1GlobalTriggerRecord in the L1GtUtils: "
143 <<
"\n Configure L1GtUtils in beginRun(...): "
145 <<
" \n" << std::endl;
182 useL1EventSetup =
false;
183 useL1GtTriggerMenuLite =
true;
188 useL1EventSetup =
true;
189 useL1GtTriggerMenuLite =
true;
194 useL1EventSetup =
true;
195 useL1GtTriggerMenuLite =
false;
208 useL1GtTriggerMenuLite);
267 <<
"\n**** L1GtAnalyzer::analyzeDecisionReadoutRecord ****\n"
272 std::ostringstream myCoutStream;
278 if (!gtReadoutRecord.
isValid()) {
280 LogDebug(
"L1GtAnalyzer") <<
"\nL1GlobalTriggerReadoutRecord with \n "
282 <<
"\nrequested in configuration, but not found in the event."
283 <<
"\nExit the method.\n" << std::endl;
289 bool gtDecision = gtReadoutRecord->decision();
290 DecisionWord gtDecisionWord = gtReadoutRecord->decisionWord();
294 <<
"\n GlobalTrigger decision: " << gtDecision << std::endl;
297 gtReadoutRecord->printGtDecision(myCoutStream);
300 gtReadoutRecord->printTechnicalTrigger(myCoutStream);
313 std::ostringstream myCoutStream;
326 myCoutStream <<
"\nL1 configuration code: \n"
328 <<
"\n 0 - Retrieve L1 trigger configuration from L1GtTriggerMenuLite only"
329 <<
"\n 10000 L1GtTriggerMenuLite product is valid"
330 <<
"\n 99999 L1GtTriggerMenuLite product not valid. Error."
332 <<
"\n 100000 - Fall through: try first L1GtTriggerMenuLite; if not valid,try event setup."
333 <<
"\n 110000 L1GtTriggerMenuLite product is valid"
334 <<
"\n 120000 L1GtTriggerMenuLite product not valid, event setup valid."
335 <<
"\n 199999 L1GtTriggerMenuLite product not valid, event setup not valid. Error."
337 <<
"\n 200000 - Retrieve L1 trigger configuration from event setup only."
338 <<
"\n 210000 Event setup valid."
339 <<
"\n 299999 Event setup not valid. Error."
341 <<
"\n 300000 - No L1 trigger configuration requested to be retrieved. Error"
342 <<
"\n Must call before using L1GtUtils methods: "
343 <<
"\n getL1GtRunCache(const edm::Event& iEvent, const edm::EventSetup& evSetup,"
344 <<
"\n const bool useL1EventSetup, const bool useL1GtTriggerMenuLite)"
350 myCoutStream <<
"\nL1 configuration code:" << l1ConfCode
351 <<
"\nValid L1 trigger configuration." << std::endl;
353 myCoutStream <<
"\nL1 trigger menu name and implementation:" <<
"\n"
358 myCoutStream <<
"\nL1 configuration code:" << l1ConfCode
359 <<
"\nNo valid L1 trigger configuration available."
360 <<
"\nSee text above for error code interpretation"
361 <<
"\nNo return here, in order to test each method, protected against configuration error."
368 <<
"\n******** Results found with input tags retrieved from provenance ******** \n"
395 myCoutStream <<
"\n\nMethods:"
396 <<
"\n decisionBeforeMask(iEvent, m_nameAlgTechTrig, iErrorCode)"
397 <<
"\n decisionAfterMask(iEvent, m_nameAlgTechTrig, iErrorCode)"
398 <<
"\n decision(iEvent, m_nameAlgTechTrig, iErrorCode)"
399 <<
"\n prescaleFactor(iEvent, m_nameAlgTechTrig, iErrorCode)"
400 <<
"\n triggerMask(iEvent, m_nameAlgTechTrig, iErrorCode)"
401 <<
"\n triggerMask(m_nameAlgTechTrig,iErrorCode)"
402 <<
"\n\n" << std::endl;
405 if (iErrorCode == 0) {
406 myCoutStream <<
"\nDecision before trigger mask for "
410 <<
": " << decisionAfterMaskAlgTechTrig << std::endl;
411 myCoutStream <<
"Decision (after trigger mask) for "
416 <<
": " << prescaleFactorAlgTechTrig
420 <<
": " << triggerMaskAlgTechTrig
423 }
else if (iErrorCode == 1) {
425 <<
" does not exist in the L1 menu "
429 myCoutStream <<
"\nError: "
430 <<
"\n An error was encountered when retrieving decision, mask and prescale factor for "
433 << iErrorCode << std::endl;
443 if (iErrorCode == 0) {
445 <<
"(faster method): " << triggerMaskAlgTechTrig
448 }
else if (iErrorCode == 1) {
450 <<
" does not exist in the L1 menu "
454 myCoutStream <<
"\nError: "
455 <<
"\n An error was encountered when fast retrieving trigger mask for "
458 << iErrorCode << std::endl;
469 myCoutStream <<
"\nMethods:"
470 <<
"\n prescaleFactorSetIndex(iEvent, trigCategory, iErrorCode)"
471 <<
"\n prescaleFactorSet(iEvent, trigCategory,iErrorCode)\n"
476 iEvent, trigCategory, iErrorCode);
478 if (iErrorCode == 0) {
480 <<
"\nAlgorithm triggers: index for prescale factor set = "
481 << pfSetIndexAlgorithmTrigger <<
"\nfor run " << iEvent.
run()
489 <<
"\nError encountered when retrieving the prescale factor set index"
490 <<
"\n for algorithm triggers, for run " << iEvent.
run()
493 <<
"\n Error code: " << iErrorCode <<
"\n" << std::endl;
497 const std::vector<int>& pfSetAlgorithmTrigger =
500 if (iErrorCode == 0) {
501 myCoutStream <<
"\nAlgorithm triggers: prescale factor set index = "
502 << pfSetIndexAlgorithmTrigger <<
"\nfor run " << iEvent.
run()
508 for (std::vector<int>::const_iterator cItBit =
509 pfSetAlgorithmTrigger.begin(); cItBit
510 != pfSetAlgorithmTrigger.end(); ++cItBit) {
513 myCoutStream <<
"Bit number " << std::right << std::setw(4) << iBit
514 <<
": prescale factor = " << (*cItBit) << std::endl;
520 <<
"\nError encountered when retrieving the prescale factor set "
521 <<
"\n for algorithm triggers, for run " << iEvent.
run()
524 <<
"\n Error code: " << iErrorCode <<
"\n" << std::endl;
529 myCoutStream <<
"\nMethod:"
530 <<
"\n triggerMaskSet(trigCategory, iErrorCode)"
534 const std::vector<unsigned int>& tmSetAlgorithmTrigger =
537 if (iErrorCode == 0) {
538 myCoutStream <<
"\nAlgorithm triggers: trigger mask set for run "
539 << iEvent.
run() <<
", luminosity block "
544 for (std::vector<unsigned int>::const_iterator cItBit =
545 tmSetAlgorithmTrigger.begin(); cItBit
546 != tmSetAlgorithmTrigger.end(); ++cItBit) {
549 myCoutStream <<
"Bit number " << std::right << std::setw(4) << iBit
550 <<
": trigger mask = " << (*cItBit) << std::endl;
556 <<
"\nError encountered when retrieving the trigger mask set "
557 <<
"\n for algorithm triggers, for run " << iEvent.
run()
560 <<
"\n Error code: " << iErrorCode <<
"\n" << std::endl;
571 myCoutStream <<
"\nMethods:"
572 <<
"\n prescaleFactorSetIndex(iEvent, trigCategory, iErrorCode)"
573 <<
"\n prescaleFactorSet(iEvent, trigCategory,iErrorCode)\n"
578 iEvent, trigCategory, iErrorCode);
580 if (iErrorCode == 0) {
582 <<
"\nTechnical triggers: index for prescale factor set = "
583 << pfSetIndexTechnicalTrigger <<
"\nfor run " << iEvent.
run()
586 <<
"\nMethod: prescaleFactorSetIndex(iEvent, trigCategory, iErrorCode)\n"
591 <<
"\nError encountered when retrieving the prescale factor set index"
592 <<
"\n for technical triggers, for run " << iEvent.
run()
595 <<
"\n Error code: " << iErrorCode <<
"\n" << std::endl;
599 const std::vector<int>& pfSetTechnicalTrigger =
602 if (iErrorCode == 0) {
603 myCoutStream <<
"\nTechnical triggers: prescale factor set index = "
604 << pfSetIndexTechnicalTrigger <<
"\nfor run " << iEvent.
run()
607 <<
"\nMethod: prescaleFactorSet(iEvent, trigCategory,iErrorCode)\n"
611 for (std::vector<int>::const_iterator cItBit =
612 pfSetTechnicalTrigger.begin(); cItBit
613 != pfSetTechnicalTrigger.end(); ++cItBit) {
616 myCoutStream <<
"Bit number " << std::right << std::setw(4) << iBit
617 <<
": prescale factor = " << (*cItBit) << std::endl;
623 <<
"\nError encountered when retrieving the prescale factor set "
624 <<
"\n for technical triggers, for run " << iEvent.
run()
627 <<
"\n Error code: " << iErrorCode <<
"\n" << std::endl;
632 myCoutStream <<
"\nMethod:"
633 <<
"\n triggerMaskSet(trigCategory, iErrorCode)"
637 const std::vector<unsigned int>& tmSetTechnicalTrigger =
640 if (iErrorCode == 0) {
641 myCoutStream <<
"\nTechnical triggers: trigger mask set for run "
642 << iEvent.
run() <<
", luminosity block "
647 for (std::vector<unsigned int>::const_iterator cItBit =
648 tmSetTechnicalTrigger.begin(); cItBit
649 != tmSetTechnicalTrigger.end(); ++cItBit) {
652 myCoutStream <<
"Bit number " << std::right << std::setw(4) << iBit
653 <<
": trigger mask = " << (*cItBit) << std::endl;
659 <<
"\nError encountered when retrieving the trigger mask set "
660 <<
"\n for technical triggers, for run " << iEvent.
run()
663 <<
"\n Error code: " << iErrorCode <<
"\n" << std::endl;
670 const std::vector<std::pair<std::string, int> >& errorCodesProv =
673 const std::vector<L1GtLogicParser::OperandToken>& expL1TriggersProv =
676 const std::vector<std::pair<std::string, bool> >& decisionsBeforeMaskProv =
678 const std::vector<std::pair<std::string, bool> >& decisionsAfterMaskProv =
680 const std::vector<std::pair<std::string, int> >& prescaleFactorsProv =
682 const std::vector<std::pair<std::string, int> >& triggerMasksProv =
685 myCoutStream << std::endl;
686 myCoutStream <<
"\nLogical expression\n "
689 for (
size_t iTrig = 0; iTrig < errorCodesProv.size(); ++iTrig) {
690 if ((errorCodesProv[iTrig]).second != 0) {
692 <<
"\nError encountered when retrieving L1 results for trigger "
693 << (errorCodesProv[iTrig]).
first <<
" (bit number "
694 << (expL1TriggersProv[iTrig]).tokenNumber <<
")\n for run "
695 << iEvent.
run() <<
", luminosity block "
698 << (errorCodesProv[iTrig]).
second <<
"\n" << std::endl;
702 myCoutStream <<
"\n" << (errorCodesProv[iTrig]).
first
703 <<
" - bit number " << (expL1TriggersProv[iTrig]).tokenNumber
706 myCoutStream <<
" decision before mask = "
707 << (decisionsBeforeMaskProv[iTrig]).
second << std::endl;
709 myCoutStream <<
" decision after mask = "
710 << (decisionsAfterMaskProv[iTrig]).
second << std::endl;
712 myCoutStream <<
" prescale factor = "
713 << (prescaleFactorsProv[iTrig]).
second << std::endl;
715 myCoutStream <<
" trigger mask = "
716 << (triggerMasksProv[iTrig]).
second << std::endl;
718 myCoutStream <<
" error code = "
719 << (errorCodesProv[iTrig]).
second << std::endl;
731 <<
"\n******** Results found with input tags provided in the configuration file ******** \n"
733 <<
"\n L1GlobalTriggerReadoutRecord: "
762 myCoutStream <<
"\n\nMethods:"
763 <<
"\n decisionBeforeMask(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, m_nameAlgTechTrig, iErrorCode)"
764 <<
"\n decisionAfterMask(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, m_nameAlgTechTrig, iErrorCode)"
765 <<
"\n decision(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, m_nameAlgTechTrig, iErrorCode)"
766 <<
"\n prescaleFactor(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, m_nameAlgTechTrig, iErrorCode)"
767 <<
"\n triggerMask(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, m_nameAlgTechTrig, iErrorCode)"
772 if (iErrorCode == 0) {
773 myCoutStream <<
"\nDecision before trigger mask for "
777 <<
": " << decisionAfterMaskAlgTechTrigITag << std::endl;
778 myCoutStream <<
"Decision (after trigger mask) for "
783 <<
": " << prescaleFactorAlgTechTrigITag
787 <<
": " << triggerMaskAlgTechTrigITag
790 }
else if (iErrorCode == 1) {
792 <<
" does not exist in the L1 menu "
796 myCoutStream <<
"\nError: "
797 <<
"\n An error was encountered when retrieving decision, mask and prescale factor for "
800 << iErrorCode << std::endl;
812 myCoutStream <<
"\nMethods:"
813 <<
"\n prescaleFactorSetIndex(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, trigCategory, iErrorCode)"
814 <<
"\n prescaleFactorSet(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, trigCategory,iErrorCode)\n"
820 trigCategory, iErrorCode);
822 if (iErrorCode == 0) {
824 <<
"\nAlgorithm triggers: index for prescale factor set = "
825 << pfSetIndexAlgorithmTriggerITag <<
"\nfor run " << iEvent.
run()
833 <<
"\nError encountered when retrieving the prescale factor set index"
834 <<
"\n for algorithm triggers, for run " << iEvent.
run()
837 <<
"\n Error code: " << iErrorCode <<
"\n" << std::endl;
841 const std::vector<int>& pfSetAlgorithmTriggerITag =
845 if (iErrorCode == 0) {
846 myCoutStream <<
"\nAlgorithm triggers: prescale factor set index = "
847 << pfSetIndexAlgorithmTriggerITag <<
"\nfor run " << iEvent.
run()
853 for (std::vector<int>::const_iterator cItBit =
854 pfSetAlgorithmTriggerITag.begin(); cItBit
855 != pfSetAlgorithmTriggerITag.end(); ++cItBit) {
858 myCoutStream <<
"Bit number " << std::right << std::setw(4) << iBit
859 <<
": prescale factor = " << (*cItBit) << std::endl;
865 <<
"\nError encountered when retrieving the prescale factor set "
866 <<
"\n for algorithm triggers, for run " << iEvent.
run()
869 <<
"\n Error code: " << iErrorCode <<
"\n" << std::endl;
882 myCoutStream <<
"\nMethods:"
883 <<
"\n prescaleFactorSetIndex(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, trigCategory, iErrorCode)"
884 <<
"\n prescaleFactorSet(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, trigCategory,iErrorCode)\n"
890 trigCategory, iErrorCode);
892 if (iErrorCode == 0) {
894 <<
"\nTechnical triggers: index for prescale factor set = "
895 << pfSetIndexTechnicalTriggerITag <<
"\nfor run " << iEvent.
run()
902 <<
"\nError encountered when retrieving the prescale factor set index"
903 <<
"\n for technical triggers, for run " << iEvent.
run()
906 <<
"\n Error code: " << iErrorCode <<
"\n" << std::endl;
910 const std::vector<int>& pfSetTechnicalTriggerITag =
914 if (iErrorCode == 0) {
915 myCoutStream <<
"\nTechnical triggers: prescale factor set index = "
916 << pfSetIndexTechnicalTriggerITag <<
"\nfor run " << iEvent.
run()
922 for (std::vector<int>::const_iterator cItBit =
923 pfSetTechnicalTriggerITag.begin(); cItBit
924 != pfSetTechnicalTriggerITag.end(); ++cItBit) {
927 myCoutStream <<
"Bit number " << std::right << std::setw(4) << iBit
928 <<
": prescale factor = " << (*cItBit) << std::endl;
934 <<
"\nError encountered when retrieving the prescale factor set "
935 <<
"\n for technical triggers, for run " << iEvent.
run()
938 <<
"\n Error code: " << iErrorCode <<
"\n" << std::endl;
945 const std::vector<std::pair<std::string, int> >& errorCodes =
948 const std::vector<L1GtLogicParser::OperandToken>& expL1Triggers =
952 const std::vector<std::pair<std::string, bool> >& decisionsBeforeMask =
954 const std::vector<std::pair<std::string, bool> >& decisionsAfterMask =
956 const std::vector<std::pair<std::string, int> >& prescaleFactors =
958 const std::vector<std::pair<std::string, int> >& triggerMasks =
961 myCoutStream << std::endl;
962 myCoutStream <<
"\nLogical expression\n "
965 for (
size_t iTrig = 0; iTrig < errorCodes.size(); ++iTrig) {
966 if ((errorCodes[iTrig]).second != 0) {
968 <<
"\nError encountered when retrieving L1 results for trigger "
969 << (errorCodes[iTrig]).
first <<
" (bit number "
970 << (expL1Triggers[iTrig]).tokenNumber <<
")\n for run "
971 << iEvent.
run() <<
", luminosity block "
974 << (errorCodes[iTrig]).
second <<
"\n" << std::endl;
978 myCoutStream <<
"\n" << (errorCodes[iTrig]).
first
979 <<
" - bit number " << (expL1Triggers[iTrig]).tokenNumber
982 myCoutStream <<
" decision before mask = "
983 << (decisionsBeforeMask[iTrig]).
second << std::endl;
985 myCoutStream <<
" decision after mask = "
986 << (decisionsAfterMask[iTrig]).
second << std::endl;
988 myCoutStream <<
" prescale factor = "
989 << (prescaleFactors[iTrig]).
second << std::endl;
991 myCoutStream <<
" trigger mask = "
992 << (triggerMasks[iTrig]).
second << std::endl;
994 myCoutStream <<
" error code = "
995 << (errorCodes[iTrig]).
second << std::endl;
1008 <<
"\n**** L1GtAnalyzer::analyzeL1GtUtilsMenuLite ****\n"
1023 useL1GtTriggerMenuLite);
1040 <<
"\n**** L1GtAnalyzer::analyzeL1GtUtilsEventSetup ****\n"
1052 useL1GtTriggerMenuLite);
1062 <<
"\n**** L1GtAnalyzer::analyzeL1GtUtils: fall-through case ****\n"
1077 useL1GtTriggerMenuLite);
1094 LogDebug(
"L1GtAnalyzer") <<
"\n**** L1GtAnalyzer::analyzeTrigger ****\n"
1099 std::ostringstream myCoutStream;
1102 myCoutStream <<
"\n\nFull analysis of an algorithm or technical trigger"
1103 <<
"\nMethod: L1GtAnalyzer::analyzeTrigger" <<
"\nTrigger: "
1108 const unsigned int eventNumber = iEvent.
id().
event();
1110 myCoutStream <<
"Run: " << runNumber <<
" LS: " << lsNumber <<
" Event: "
1111 << eventNumber <<
"\n\n" << std::endl;
1124 useL1EventSetup =
false;
1125 useL1GtTriggerMenuLite =
true;
1130 useL1EventSetup =
true;
1131 useL1GtTriggerMenuLite =
true;
1136 useL1EventSetup =
true;
1137 useL1GtTriggerMenuLite =
false;
1151 useL1GtTriggerMenuLite);
1163 int iErrorCode = -1;
1164 int l1ConfCode = -1;
1170 LogDebug(
"L1GtAnalyzer") <<
"\nL1 configuration code:" << l1ConfCode
1171 <<
"\nValid L1 trigger configuration.\n" << std::endl;
1173 LogTrace(
"L1GtAnalyzer") <<
"\nL1 trigger menu name and implementation:"
1179 myCoutStream <<
"\nL1 configuration code:" << l1ConfCode
1180 <<
"\nNo valid L1 trigger configuration available."
1181 <<
"\nCheck L1GtUtils wiki page for error code interpretation\n"
1191 bool decisionBeforeMaskAlgTechTrig =
false;
1192 bool decisionAfterMaskAlgTechTrig =
false;
1193 bool decisionAlgTechTrig =
false;
1194 int prescaleFactorAlgTechTrig = -1;
1195 int triggerMaskAlgTechTrig = -1;
1236 switch (iErrorCode) {
1243 <<
" does not exist in the L1 menu "
1249 myCoutStream <<
"\nError: "
1250 <<
"\n An error was encountered when retrieving decision, mask and prescale factor for "
1254 <<
"\n Check L1GtUtils wiki page for error code interpretation"
1266 myCoutStream <<
"\nL1Extra collections from all BxInEvent" << std::endl;
1270 myCoutStream <<
"\nL1Extra collections from BxInEvent = 0 (BX for L1A)" << std::endl;
1276 int iErrorRecord = 0;
1278 bool validRecord =
false;
1279 bool gtObjectMapRecordValid =
false;
1291 LogDebug(
"L1GtAnalyzer") <<
"\nL1GlobalTriggerObjectMaps with \n "
1299 if (gtObjectMapRecord.
isValid()) {
1301 gtObjectMapRecordValid =
true;
1306 iErrorRecord = iErrorRecord + 100;
1307 LogDebug(
"L1GtAnalyzer") <<
"\nL1GlobalTriggerObjectMapRecord with \n "
1314 if (validRecord && gtObjectMapRecordValid) {
1358 <<
"\n Trigger mask: " << triggerMaskAlgTechTrig
1359 <<
"\n Prescale factor: " << prescaleFactorAlgTechTrig
1360 <<
"\n Decision before mask: " << decisionBeforeMaskAlgTechTrig
1361 <<
"\n Decision after mask: " << decisionAfterMaskAlgTechTrig
1362 <<
"\n Decision (after mask): " << decisionAlgTechTrig <<
"\n"
1374 <<
"\n**** L1GtAnalyzer::analyzeObjectMap object map product ****\n"
1379 std::ostringstream myCoutStream;
1386 if (!gtObjectMapRecord.
isValid()) {
1388 <<
"\nWarning: L1GlobalTriggerObjectMapRecord with input tag "
1390 <<
"\nrequested in configuration, but not found in the event."
1391 <<
"\nExit the method.\n" << std::endl;
1397 const std::vector<L1GlobalTriggerObjectMap>& objMapVec =
1398 gtObjectMapRecord->gtObjectMap();
1401 for (std::vector<L1GlobalTriggerObjectMap>::const_iterator it =
1402 objMapVec.begin(); it != objMapVec.end(); ++it) {
1404 (*it).print(myCoutStream);
1413 myCoutStream <<
"\n Number of combinations passing ("
1415 << comb->size() << std::endl;
1423 const bool result = gtObjectMapRecord->getConditionResult(
1426 myCoutStream <<
"\n Result for condition " <<
m_condName
1439 <<
"\n**** L1GtAnalyzer::analyzeL1GtTriggerMenuLite ****\n"
1444 std::ostringstream myCoutStream;
1454 if (!triggerMenuLite.
isValid()) {
1456 LogDebug(
"L1GtAnalyzer") <<
"\nL1GtTriggerMenuLite with \n "
1458 <<
"\nrequested in configuration, but not found in the event."
1459 <<
"\nExit the method.\n" << std::endl;
1465 myCoutStream << (*triggerMenuLite);
1470 triggerMenuLite->gtTriggerMenuInterface();
1471 const std::string& triggerMenuName = triggerMenuLite->gtTriggerMenuName();
1473 triggerMenuLite->gtTriggerMenuImplementation();
1474 const std::string& scaleDbKey = triggerMenuLite->gtScaleDbKey();
1478 triggerMenuLite->gtAlgorithmAliasMap();
1480 triggerMenuLite->gtTechnicalTriggerMap();
1482 const std::vector<unsigned int>& triggerMaskAlgoTrig =
1483 triggerMenuLite->gtTriggerMaskAlgoTrig();
1484 const std::vector<unsigned int>& triggerMaskTechTrig =
1485 triggerMenuLite->gtTriggerMaskTechTrig();
1487 const std::vector<std::vector<int> >& prescaleFactorsAlgoTrig =
1488 triggerMenuLite->gtPrescaleFactorsAlgoTrig();
1489 const std::vector<std::vector<int> >& prescaleFactorsTechTrig =
1490 triggerMenuLite->gtPrescaleFactorsTechTrig();
1494 size_t nrDefinedAlgo = algorithmMap.size();
1495 size_t nrDefinedTech = technicalTriggerMap.size();
1499 myCoutStream <<
"\n ********** L1 Trigger Menu - printing ********** \n"
1500 <<
"\nL1 Trigger Menu Interface: " << triggerMenuInterface
1501 <<
"\nL1 Trigger Menu Name: " << triggerMenuName
1502 <<
"\nL1 Trigger Menu Implementation: " << triggerMenuImplementation
1503 <<
"\nAssociated Scale DB Key: " << scaleDbKey <<
"\n\n"
1504 <<
"\nL1 Physics Algorithms: " << nrDefinedAlgo <<
" algorithms defined." <<
"\n\n"
1506 << std::right << std::setw(35) <<
"Algorithm Name" <<
" "
1507 << std::right << std::setw(35) <<
"Algorithm Alias" <<
" "
1508 << std::right << std::setw(12) <<
"Trigger Mask";
1509 for (
unsigned iSet = 0; iSet < prescaleFactorsAlgoTrig.size(); iSet++) {
1510 myCoutStream << std::right << std::setw(10) <<
"PF Set "
1511 << std::right << std::setw(2) << iSet;
1514 myCoutStream << std::endl;
1518 != algorithmMap.end(); itTrig++) {
1520 const unsigned int bitNumber = itTrig->first;
1525 if (itAlias != algorithmAliasMap.end()) {
1526 aAlias = itAlias->second;
1529 myCoutStream << std::setw(6) << bitNumber <<
" "
1530 << std::right << std::setw(35) << aName <<
" "
1531 << std::right << std::setw(35) << aAlias <<
" "
1532 << std::right << std::setw(12) << triggerMaskAlgoTrig[bitNumber];
1533 for (
unsigned iSet = 0; iSet < prescaleFactorsAlgoTrig.size(); iSet++) {
1534 myCoutStream << std::right << std::setw(12) << prescaleFactorsAlgoTrig[iSet][bitNumber];
1537 myCoutStream << std::endl;
1540 myCoutStream <<
"\nL1 Technical Triggers: " << nrDefinedTech
1541 <<
" technical triggers defined." <<
"\n\n" << std::endl;
1542 if (nrDefinedTech) {
1544 << std::right << std::setw(6) <<
"Bit Number "
1545 << std::right << std::setw(45) <<
" Technical trigger name " <<
" "
1546 << std::right << std::setw(12) <<
"Trigger Mask";
1547 for (
unsigned iSet = 0; iSet < prescaleFactorsTechTrig.size(); iSet++) {
1548 myCoutStream << std::right << std::setw(10) <<
"PF Set "
1549 << std::right << std::setw(2) << iSet;
1552 myCoutStream << std::endl;
1556 != technicalTriggerMap.end(); itTrig++) {
1558 unsigned int bitNumber = itTrig->first;
1561 myCoutStream << std::setw(6) << bitNumber <<
" "
1562 << std::right << std::setw(45) << aName
1563 << std::right << std::setw(12) << triggerMaskTechTrig[bitNumber];
1564 for (
unsigned iSet = 0; iSet < prescaleFactorsTechTrig.size(); iSet++) {
1565 myCoutStream << std::right << std::setw(12) << prescaleFactorsTechTrig[iSet][bitNumber];
1568 myCoutStream << std::endl;
1575 const std::string* algorithmAlias = triggerMenuLite->gtAlgorithmAlias(
1579 <<
"\nError code retrieving alias for algorithm with bit number "
1582 myCoutStream <<
"\nAlias for algorithm with bit number " <<
m_bitNumber
1583 <<
": " << (*algorithmAlias) << std::endl;
1587 const std::string* algorithmName = triggerMenuLite->gtAlgorithmName(
1591 <<
"\nError code retrieving name for algorithm with bit number "
1594 myCoutStream <<
"\nName for algorithm with bit number " <<
m_bitNumber
1595 <<
": " << (*algorithmName) << std::endl;
1599 const std::string* techTrigName = triggerMenuLite->gtTechTrigName(
1603 <<
"\nError code retrieving name for technical trigger with bit number "
1606 myCoutStream <<
"\nName for technical trigger with bit number "
1607 <<
m_bitNumber <<
": " << (*techTrigName) << std::endl;
1611 const unsigned int bitNumber = triggerMenuLite->gtBitNumber(
1615 <<
"\nError code retrieving bit number for algorithm/technical trigger "
1618 myCoutStream <<
"\nBit number for algorithm/technical trigger "
1637 <<
"\n**** L1GtAnalyzer::analyzeConditionsInRunBlock ****\n"
1642 std::ostringstream myCoutStream;
1648 if (!condInRunBlock.
isValid()) {
1650 LogDebug(
"L1GtAnalyzer") <<
"\nConditionsInRunBlock with \n "
1652 <<
"\nrequested in configuration, but not found in the event."
1653 <<
"\nExit the method.\n" << std::endl;
1658 const boost::uint16_t beamModeVal = condInRunBlock->beamMode;
1659 const boost::uint16_t beamMomentumVal = condInRunBlock->beamMomentum;
1660 const boost::uint32_t lhcFillNumberVal = condInRunBlock->lhcFillNumber;
1663 myCoutStream <<
"\nLHC quantities in run " << iRun.
run()
1664 <<
"\n Beam Mode = " << beamModeVal
1665 <<
"\n Beam Momentum = " << beamMomentumVal <<
" GeV"
1666 <<
"\n LHC Fill Number = " << lhcFillNumberVal
1677 <<
"\n**** L1GtAnalyzer::analyzeConditionsInLumiBlock ****\n"
1682 std::ostringstream myCoutStream;
1688 if (!condInLumiBlock.
isValid()) {
1690 LogDebug(
"L1GtAnalyzer") <<
"\nConditionsInLumiBlock with \n "
1692 <<
"\nrequested in configuration, but not found in the event."
1693 <<
"\nExit the method.\n" << std::endl;
1698 const boost::uint32_t totalIntensityBeam1Val =
1699 condInLumiBlock->totalIntensityBeam1;
1700 const boost::uint32_t totalIntensityBeam2Val =
1701 condInLumiBlock->totalIntensityBeam2;
1703 myCoutStream <<
"\nLHC quantities in luminosity section "
1706 <<
"\n Total Intensity Beam 1 (Integer × 10E10 charges) = "
1707 << totalIntensityBeam1Val
1708 <<
"\n Total Intensity Beam 2 (Integer × 10E10 charges) = "
1709 << totalIntensityBeam2Val << std::endl;
1719 std::ostringstream myCoutStream;
1725 if (!condInEventBlock.
isValid()) {
1727 LogDebug(
"L1GtAnalyzer") <<
"\nConditionsInEventBlock with \n "
1729 <<
"\nrequested in configuration, but not found in the event."
1730 <<
"\nExit the method.\n" << std::endl;
1735 const boost::uint16_t bstMasterStatusVal =
1736 condInEventBlock->bstMasterStatus;
1737 const boost::uint32_t turnCountNumberVal =
1738 condInEventBlock->turnCountNumber;
1740 myCoutStream <<
"\nLHC quantities in event " << iEvent.
id().
event()
1742 <<
" from run " << iEvent.
run() <<
"\n BST Master Status = "
1743 << bstMasterStatusVal <<
"\n Turn count number = "
1744 << turnCountNumberVal << std::endl;
1762 LogTrace(
"L1GtAnalyzer") << myCout.str() << std::endl;
1782 std::cout <<
"\n\n L1GtAnalyzer: Error - no print output = "
1784 <<
" defined! \n Check available values in the cfi file."
1785 <<
"\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