46 parSet.getParameter<edm::
ParameterSet> (
"L1ExtraInputTags"),consumesCollector()),
48 m_printOutput(parSet.getUntrackedParameter<int>(
"PrintOutput", 3)),
50 m_analyzeDecisionReadoutRecordEnable(parSet.getParameter<bool> (
"analyzeDecisionReadoutRecordEnable")),
52 m_analyzeL1GtUtilsMenuLiteEnable(parSet.getParameter<bool> (
"analyzeL1GtUtilsMenuLiteEnable")),
53 m_analyzeL1GtUtilsEventSetupEnable(parSet.getParameter<bool> (
"analyzeL1GtUtilsEventSetupEnable")),
54 m_analyzeL1GtUtilsEnable(parSet.getParameter<bool> (
"analyzeL1GtUtilsEnable")),
55 m_analyzeTriggerEnable(parSet.getParameter<bool> (
"analyzeTriggerEnable")),
57 m_analyzeObjectMapEnable(parSet.getParameter<bool> (
"analyzeObjectMapEnable")),
59 m_analyzeL1GtTriggerMenuLiteEnable(parSet.getParameter<bool> (
"analyzeL1GtTriggerMenuLiteEnable")),
61 m_analyzeConditionsInRunBlockEnable(parSet.getParameter<bool> (
"analyzeConditionsInRunBlockEnable")),
62 m_analyzeConditionsInLumiBlockEnable(parSet.getParameter<bool> (
"analyzeConditionsInLumiBlockEnable")),
63 m_analyzeConditionsInEventBlockEnable(parSet.getParameter<bool> (
"analyzeConditionsInEventBlockEnable")),
67 m_l1GtDaqReadoutRecordInputTag(parSet.getParameter<edm::
InputTag>(
68 "L1GtDaqReadoutRecordInputTag")),
71 m_l1GtRecordInputTag(parSet.getParameter<edm::
InputTag>(
72 "L1GtRecordInputTag")),
75 m_l1GtObjectMapTag(parSet.getParameter<edm::
InputTag>(
79 m_l1GtObjectMapsInputTag(parSet.getParameter<edm::
InputTag>(
80 "L1GtObjectMapsInputTag")),
83 m_l1GmtInputTag(parSet.getParameter<edm::
InputTag>(
87 m_l1GtTmLInputTag(parSet.getParameter<edm::
InputTag> (
91 m_condInEdmInputTag(parSet.getParameter<edm::
InputTag> (
92 "CondInEdmInputTag")),
95 m_nameAlgTechTrig(parSet.getParameter<std::
string> (
"AlgorithmName")),
96 m_condName(parSet.getParameter<std::
string> (
"ConditionName")),
97 m_bitNumber(parSet.getParameter<unsigned int> (
"BitNumber")),
99 m_l1GtUtilsConfiguration(parSet.getParameter<unsigned int> (
"L1GtUtilsConfiguration")),
100 m_l1GtTmLInputTagProv(parSet.getParameter<bool> (
"L1GtTmLInputTagProv")),
101 m_l1GtRecordsInputTagProv(parSet.getParameter<bool> (
"L1GtRecordsInputTagProv")),
102 m_l1GtUtilsConfigureBeginRun(parSet.getParameter<bool> (
"L1GtUtilsConfigureBeginRun")),
103 m_l1GtUtilsLogicalExpression(parSet.getParameter<std::
string>(
"L1GtUtilsLogicalExpression")),
104 m_l1GtUtilsProv(parSet,
106 m_l1GtUtilsConfiguration == 0 || m_l1GtUtilsConfiguration == 100000,
110 m_l1GtTmLInputTagProv ? edm::
InputTag() : m_l1GtTmLInputTag),
113 m_l1GtUtilsConfiguration == 0 || m_l1GtUtilsConfiguration == 100000,
115 m_l1GtRecordInputTag,
116 m_l1GtDaqReadoutRecordInputTag,
117 m_l1GtTmLInputTagProv ? edm::
InputTag() : m_l1GtTmLInputTag),
118 m_logicalExpressionL1ResultsProv(m_l1GtUtilsLogicalExpression, m_l1GtUtilsProv),
119 m_logicalExpressionL1Results(m_l1GtUtilsLogicalExpression, m_l1GtUtils)
130 <<
"\n Input parameters for L1 GT test analyzer"
131 <<
"\n L1 GT DAQ product: "
133 <<
"\n L1GlobalTriggerRecord product: "
135 <<
"\n L1 GT object map collection: "
137 <<
"\n Muon collection from GMT: "
139 <<
"\n L1 trigger menu lite product: "
142 <<
"\n Condition, if an algorithm trigger is requested: " <<
m_condName
143 <<
"\n Bit number for an algorithm or technical trigger: " <<
m_bitNumber
145 <<
"\n Retrieve input tag from provenance for L1GtTriggerMenuLite in the L1GtUtils: "
147 <<
"\n Retrieve input tag from provenance for L1GlobalTriggerReadoutRecord "
148 <<
"\n and / or L1GlobalTriggerRecord in the L1GtUtils: "
150 <<
"\n Configure L1GtUtils in beginRun(...): "
152 <<
" \n" << std::endl;
189 useL1EventSetup =
false;
190 useL1GtTriggerMenuLite =
true;
195 useL1EventSetup =
true;
196 useL1GtTriggerMenuLite =
true;
201 useL1EventSetup =
true;
202 useL1GtTriggerMenuLite =
false;
213 useL1GtTriggerMenuLite);
216 useL1GtTriggerMenuLite);
268 <<
"\n**** L1GtAnalyzer::analyzeDecisionReadoutRecord ****\n"
273 std::ostringstream myCoutStream;
279 if (!gtReadoutRecord.
isValid()) {
281 LogDebug(
"L1GtAnalyzer") <<
"\nL1GlobalTriggerReadoutRecord with \n "
283 <<
"\nrequested in configuration, but not found in the event."
284 <<
"\nExit the method.\n" << std::endl;
290 bool gtDecision = gtReadoutRecord->decision();
291 DecisionWord gtDecisionWord = gtReadoutRecord->decisionWord();
295 <<
"\n GlobalTrigger decision: " << gtDecision << std::endl;
298 gtReadoutRecord->printGtDecision(myCoutStream);
301 gtReadoutRecord->printTechnicalTrigger(myCoutStream);
314 std::ostringstream myCoutStream;
327 myCoutStream <<
"\nL1 configuration code: \n"
329 <<
"\n 0 - Retrieve L1 trigger configuration from L1GtTriggerMenuLite only"
330 <<
"\n 10000 L1GtTriggerMenuLite product is valid"
331 <<
"\n 99999 L1GtTriggerMenuLite product not valid. Error."
333 <<
"\n 100000 - Fall through: try first L1GtTriggerMenuLite; if not valid,try event setup."
334 <<
"\n 110000 L1GtTriggerMenuLite product is valid"
335 <<
"\n 120000 L1GtTriggerMenuLite product not valid, event setup valid."
336 <<
"\n 199999 L1GtTriggerMenuLite product not valid, event setup not valid. Error."
338 <<
"\n 200000 - Retrieve L1 trigger configuration from event setup only."
339 <<
"\n 210000 Event setup valid."
340 <<
"\n 299999 Event setup not valid. Error."
342 <<
"\n 300000 - No L1 trigger configuration requested to be retrieved. Error"
343 <<
"\n Must call before using L1GtUtils methods: "
344 <<
"\n getL1GtRunCache(const edm::Event& iEvent, const edm::EventSetup& evSetup,"
345 <<
"\n const bool useL1EventSetup, const bool useL1GtTriggerMenuLite)"
351 myCoutStream <<
"\nL1 configuration code:" << l1ConfCode
352 <<
"\nValid L1 trigger configuration." << std::endl;
354 myCoutStream <<
"\nL1 trigger menu name and implementation:" <<
"\n"
359 myCoutStream <<
"\nL1 configuration code:" << l1ConfCode
360 <<
"\nNo valid L1 trigger configuration available."
361 <<
"\nSee text above for error code interpretation"
362 <<
"\nNo return here, in order to test each method, protected against configuration error."
369 <<
"\n******** Results found with input tags retrieved from provenance ******** \n"
396 myCoutStream <<
"\n\nMethods:"
397 <<
"\n decisionBeforeMask(iEvent, m_nameAlgTechTrig, iErrorCode)"
398 <<
"\n decisionAfterMask(iEvent, m_nameAlgTechTrig, iErrorCode)"
399 <<
"\n decision(iEvent, m_nameAlgTechTrig, iErrorCode)"
400 <<
"\n prescaleFactor(iEvent, m_nameAlgTechTrig, iErrorCode)"
401 <<
"\n triggerMask(iEvent, m_nameAlgTechTrig, iErrorCode)"
402 <<
"\n triggerMask(m_nameAlgTechTrig,iErrorCode)"
403 <<
"\n\n" << std::endl;
406 if (iErrorCode == 0) {
407 myCoutStream <<
"\nDecision before trigger mask for "
411 <<
": " << decisionAfterMaskAlgTechTrig << std::endl;
412 myCoutStream <<
"Decision (after trigger mask) for "
417 <<
": " << prescaleFactorAlgTechTrig
421 <<
": " << triggerMaskAlgTechTrig
424 }
else if (iErrorCode == 1) {
426 <<
" does not exist in the L1 menu "
430 myCoutStream <<
"\nError: "
431 <<
"\n An error was encountered when retrieving decision, mask and prescale factor for "
434 << iErrorCode << std::endl;
444 if (iErrorCode == 0) {
446 <<
"(faster method): " << triggerMaskAlgTechTrig
449 }
else if (iErrorCode == 1) {
451 <<
" does not exist in the L1 menu "
455 myCoutStream <<
"\nError: "
456 <<
"\n An error was encountered when fast retrieving trigger mask for "
459 << iErrorCode << std::endl;
470 myCoutStream <<
"\nMethods:"
471 <<
"\n prescaleFactorSetIndex(iEvent, trigCategory, iErrorCode)"
472 <<
"\n prescaleFactorSet(iEvent, trigCategory,iErrorCode)\n"
477 iEvent, trigCategory, iErrorCode);
479 if (iErrorCode == 0) {
481 <<
"\nAlgorithm triggers: index for prescale factor set = "
482 << pfSetIndexAlgorithmTrigger <<
"\nfor run " << iEvent.
run()
490 <<
"\nError encountered when retrieving the prescale factor set index"
491 <<
"\n for algorithm triggers, for run " << iEvent.
run()
494 <<
"\n Error code: " << iErrorCode <<
"\n" << std::endl;
498 const std::vector<int>& pfSetAlgorithmTrigger =
501 if (iErrorCode == 0) {
502 myCoutStream <<
"\nAlgorithm triggers: prescale factor set index = "
503 << pfSetIndexAlgorithmTrigger <<
"\nfor run " << iEvent.
run()
509 for (std::vector<int>::const_iterator cItBit =
510 pfSetAlgorithmTrigger.begin(); cItBit
511 != pfSetAlgorithmTrigger.end(); ++cItBit) {
514 myCoutStream <<
"Bit number " << std::right << std::setw(4) << iBit
515 <<
": prescale factor = " << (*cItBit) << std::endl;
521 <<
"\nError encountered when retrieving the prescale factor set "
522 <<
"\n for algorithm triggers, for run " << iEvent.
run()
525 <<
"\n Error code: " << iErrorCode <<
"\n" << std::endl;
530 myCoutStream <<
"\nMethod:"
531 <<
"\n triggerMaskSet(trigCategory, iErrorCode)"
535 const std::vector<unsigned int>& tmSetAlgorithmTrigger =
538 if (iErrorCode == 0) {
539 myCoutStream <<
"\nAlgorithm triggers: trigger mask set for run "
540 << iEvent.
run() <<
", luminosity block "
545 for (std::vector<unsigned int>::const_iterator cItBit =
546 tmSetAlgorithmTrigger.begin(); cItBit
547 != tmSetAlgorithmTrigger.end(); ++cItBit) {
550 myCoutStream <<
"Bit number " << std::right << std::setw(4) << iBit
551 <<
": trigger mask = " << (*cItBit) << std::endl;
557 <<
"\nError encountered when retrieving the trigger mask set "
558 <<
"\n for algorithm triggers, for run " << iEvent.
run()
561 <<
"\n Error code: " << iErrorCode <<
"\n" << std::endl;
572 myCoutStream <<
"\nMethods:"
573 <<
"\n prescaleFactorSetIndex(iEvent, trigCategory, iErrorCode)"
574 <<
"\n prescaleFactorSet(iEvent, trigCategory,iErrorCode)\n"
579 iEvent, trigCategory, iErrorCode);
581 if (iErrorCode == 0) {
583 <<
"\nTechnical triggers: index for prescale factor set = "
584 << pfSetIndexTechnicalTrigger <<
"\nfor run " << iEvent.
run()
587 <<
"\nMethod: prescaleFactorSetIndex(iEvent, trigCategory, iErrorCode)\n"
592 <<
"\nError encountered when retrieving the prescale factor set index"
593 <<
"\n for technical triggers, for run " << iEvent.
run()
596 <<
"\n Error code: " << iErrorCode <<
"\n" << std::endl;
600 const std::vector<int>& pfSetTechnicalTrigger =
603 if (iErrorCode == 0) {
604 myCoutStream <<
"\nTechnical triggers: prescale factor set index = "
605 << pfSetIndexTechnicalTrigger <<
"\nfor run " << iEvent.
run()
608 <<
"\nMethod: prescaleFactorSet(iEvent, trigCategory,iErrorCode)\n"
612 for (std::vector<int>::const_iterator cItBit =
613 pfSetTechnicalTrigger.begin(); cItBit
614 != pfSetTechnicalTrigger.end(); ++cItBit) {
617 myCoutStream <<
"Bit number " << std::right << std::setw(4) << iBit
618 <<
": prescale factor = " << (*cItBit) << std::endl;
624 <<
"\nError encountered when retrieving the prescale factor set "
625 <<
"\n for technical triggers, for run " << iEvent.
run()
628 <<
"\n Error code: " << iErrorCode <<
"\n" << std::endl;
633 myCoutStream <<
"\nMethod:"
634 <<
"\n triggerMaskSet(trigCategory, iErrorCode)"
638 const std::vector<unsigned int>& tmSetTechnicalTrigger =
641 if (iErrorCode == 0) {
642 myCoutStream <<
"\nTechnical triggers: trigger mask set for run "
643 << iEvent.
run() <<
", luminosity block "
648 for (std::vector<unsigned int>::const_iterator cItBit =
649 tmSetTechnicalTrigger.begin(); cItBit
650 != tmSetTechnicalTrigger.end(); ++cItBit) {
653 myCoutStream <<
"Bit number " << std::right << std::setw(4) << iBit
654 <<
": trigger mask = " << (*cItBit) << std::endl;
660 <<
"\nError encountered when retrieving the trigger mask set "
661 <<
"\n for technical triggers, for run " << iEvent.
run()
664 <<
"\n Error code: " << iErrorCode <<
"\n" << std::endl;
671 const std::vector<std::pair<std::string, int> >& errorCodesProv =
674 const std::vector<L1GtLogicParser::OperandToken>& expL1TriggersProv =
677 const std::vector<std::pair<std::string, bool> >& decisionsBeforeMaskProv =
679 const std::vector<std::pair<std::string, bool> >& decisionsAfterMaskProv =
681 const std::vector<std::pair<std::string, int> >& prescaleFactorsProv =
683 const std::vector<std::pair<std::string, int> >& triggerMasksProv =
686 myCoutStream << std::endl;
687 myCoutStream <<
"\nLogical expression\n "
690 for (
size_t iTrig = 0; iTrig < errorCodesProv.size(); ++iTrig) {
691 if ((errorCodesProv[iTrig]).second != 0) {
693 <<
"\nError encountered when retrieving L1 results for trigger "
694 << (errorCodesProv[iTrig]).
first <<
" (bit number "
695 << (expL1TriggersProv[iTrig]).tokenNumber <<
")\n for run "
696 << iEvent.
run() <<
", luminosity block "
699 << (errorCodesProv[iTrig]).
second <<
"\n" << std::endl;
703 myCoutStream <<
"\n" << (errorCodesProv[iTrig]).
first
704 <<
" - bit number " << (expL1TriggersProv[iTrig]).tokenNumber
707 myCoutStream <<
" decision before mask = "
708 << (decisionsBeforeMaskProv[iTrig]).
second << std::endl;
710 myCoutStream <<
" decision after mask = "
711 << (decisionsAfterMaskProv[iTrig]).
second << std::endl;
713 myCoutStream <<
" prescale factor = "
714 << (prescaleFactorsProv[iTrig]).
second << std::endl;
716 myCoutStream <<
" trigger mask = "
717 << (triggerMasksProv[iTrig]).
second << std::endl;
719 myCoutStream <<
" error code = "
720 << (errorCodesProv[iTrig]).
second << std::endl;
732 <<
"\n******** Results found with input tags provided in the configuration file ******** \n"
734 <<
"\n L1GlobalTriggerReadoutRecord: "
758 myCoutStream <<
"\n\nMethods:"
759 <<
"\n decisionBeforeMask(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, m_nameAlgTechTrig, iErrorCode)"
760 <<
"\n decisionAfterMask(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, m_nameAlgTechTrig, iErrorCode)"
761 <<
"\n decision(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, m_nameAlgTechTrig, iErrorCode)"
762 <<
"\n prescaleFactor(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, m_nameAlgTechTrig, iErrorCode)"
763 <<
"\n triggerMask(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, m_nameAlgTechTrig, iErrorCode)"
768 if (iErrorCode == 0) {
769 myCoutStream <<
"\nDecision before trigger mask for "
773 <<
": " << decisionAfterMaskAlgTechTrigITag << std::endl;
774 myCoutStream <<
"Decision (after trigger mask) for "
779 <<
": " << prescaleFactorAlgTechTrigITag
783 <<
": " << triggerMaskAlgTechTrigITag
786 }
else if (iErrorCode == 1) {
788 <<
" does not exist in the L1 menu "
792 myCoutStream <<
"\nError: "
793 <<
"\n An error was encountered when retrieving decision, mask and prescale factor for "
796 << iErrorCode << std::endl;
808 myCoutStream <<
"\nMethods:"
809 <<
"\n prescaleFactorSetIndex(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, trigCategory, iErrorCode)"
810 <<
"\n prescaleFactorSet(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, trigCategory,iErrorCode)\n"
815 iEvent, trigCategory, iErrorCode);
817 if (iErrorCode == 0) {
819 <<
"\nAlgorithm triggers: index for prescale factor set = "
820 << pfSetIndexAlgorithmTriggerITag <<
"\nfor run " << iEvent.
run()
828 <<
"\nError encountered when retrieving the prescale factor set index"
829 <<
"\n for algorithm triggers, for run " << iEvent.
run()
832 <<
"\n Error code: " << iErrorCode <<
"\n" << std::endl;
836 const std::vector<int>& pfSetAlgorithmTriggerITag =
839 if (iErrorCode == 0) {
840 myCoutStream <<
"\nAlgorithm triggers: prescale factor set index = "
841 << pfSetIndexAlgorithmTriggerITag <<
"\nfor run " << iEvent.
run()
847 for (std::vector<int>::const_iterator cItBit =
848 pfSetAlgorithmTriggerITag.begin(); cItBit
849 != pfSetAlgorithmTriggerITag.end(); ++cItBit) {
852 myCoutStream <<
"Bit number " << std::right << std::setw(4) << iBit
853 <<
": prescale factor = " << (*cItBit) << std::endl;
859 <<
"\nError encountered when retrieving the prescale factor set "
860 <<
"\n for algorithm triggers, for run " << iEvent.
run()
863 <<
"\n Error code: " << iErrorCode <<
"\n" << std::endl;
876 myCoutStream <<
"\nMethods:"
877 <<
"\n prescaleFactorSetIndex(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, trigCategory, iErrorCode)"
878 <<
"\n prescaleFactorSet(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, trigCategory,iErrorCode)\n"
883 iEvent, trigCategory, iErrorCode);
885 if (iErrorCode == 0) {
887 <<
"\nTechnical triggers: index for prescale factor set = "
888 << pfSetIndexTechnicalTriggerITag <<
"\nfor run " << iEvent.
run()
895 <<
"\nError encountered when retrieving the prescale factor set index"
896 <<
"\n for technical triggers, for run " << iEvent.
run()
899 <<
"\n Error code: " << iErrorCode <<
"\n" << std::endl;
903 const std::vector<int>& pfSetTechnicalTriggerITag =
906 if (iErrorCode == 0) {
907 myCoutStream <<
"\nTechnical triggers: prescale factor set index = "
908 << pfSetIndexTechnicalTriggerITag <<
"\nfor run " << iEvent.
run()
914 for (std::vector<int>::const_iterator cItBit =
915 pfSetTechnicalTriggerITag.begin(); cItBit
916 != pfSetTechnicalTriggerITag.end(); ++cItBit) {
919 myCoutStream <<
"Bit number " << std::right << std::setw(4) << iBit
920 <<
": prescale factor = " << (*cItBit) << std::endl;
926 <<
"\nError encountered when retrieving the prescale factor set "
927 <<
"\n for technical triggers, for run " << iEvent.
run()
930 <<
"\n Error code: " << iErrorCode <<
"\n" << std::endl;
937 const std::vector<std::pair<std::string, int> >& errorCodes =
940 const std::vector<L1GtLogicParser::OperandToken>& expL1Triggers =
944 const std::vector<std::pair<std::string, bool> >& decisionsBeforeMask =
946 const std::vector<std::pair<std::string, bool> >& decisionsAfterMask =
948 const std::vector<std::pair<std::string, int> >& prescaleFactors =
950 const std::vector<std::pair<std::string, int> >& triggerMasks =
953 myCoutStream << std::endl;
954 myCoutStream <<
"\nLogical expression\n "
957 for (
size_t iTrig = 0; iTrig < errorCodes.size(); ++iTrig) {
958 if ((errorCodes[iTrig]).second != 0) {
960 <<
"\nError encountered when retrieving L1 results for trigger "
961 << (errorCodes[iTrig]).
first <<
" (bit number "
962 << (expL1Triggers[iTrig]).tokenNumber <<
")\n for run "
963 << iEvent.
run() <<
", luminosity block "
966 << (errorCodes[iTrig]).
second <<
"\n" << std::endl;
970 myCoutStream <<
"\n" << (errorCodes[iTrig]).
first
971 <<
" - bit number " << (expL1Triggers[iTrig]).tokenNumber
974 myCoutStream <<
" decision before mask = "
975 << (decisionsBeforeMask[iTrig]).
second << std::endl;
977 myCoutStream <<
" decision after mask = "
978 << (decisionsAfterMask[iTrig]).
second << std::endl;
980 myCoutStream <<
" prescale factor = "
981 << (prescaleFactors[iTrig]).
second << std::endl;
983 myCoutStream <<
" trigger mask = "
984 << (triggerMasks[iTrig]).
second << std::endl;
986 myCoutStream <<
" error code = "
987 << (errorCodes[iTrig]).
second << std::endl;
1000 <<
"\n**** L1GtAnalyzer::analyzeL1GtUtilsMenuLite ****\n"
1012 useL1GtTriggerMenuLite);
1015 useL1GtTriggerMenuLite);
1024 <<
"\n**** L1GtAnalyzer::analyzeL1GtUtilsEventSetup ****\n"
1036 useL1GtTriggerMenuLite);
1039 useL1GtTriggerMenuLite);
1049 <<
"\n**** L1GtAnalyzer::analyzeL1GtUtils: fall-through case ****\n"
1061 useL1GtTriggerMenuLite);
1064 useL1GtTriggerMenuLite);
1072 LogDebug(
"L1GtAnalyzer") <<
"\n**** L1GtAnalyzer::analyzeTrigger ****\n"
1077 std::ostringstream myCoutStream;
1080 myCoutStream <<
"\n\nFull analysis of an algorithm or technical trigger"
1081 <<
"\nMethod: L1GtAnalyzer::analyzeTrigger" <<
"\nTrigger: "
1086 const unsigned int eventNumber = iEvent.
id().
event();
1088 myCoutStream <<
"Run: " << runNumber <<
" LS: " << lsNumber <<
" Event: "
1089 << eventNumber <<
"\n\n" << std::endl;
1102 useL1EventSetup =
false;
1103 useL1GtTriggerMenuLite =
true;
1108 useL1EventSetup =
true;
1109 useL1GtTriggerMenuLite =
true;
1114 useL1EventSetup =
true;
1115 useL1GtTriggerMenuLite =
false;
1126 useL1GtTriggerMenuLite);
1129 useL1GtTriggerMenuLite);
1133 int iErrorCode = -1;
1134 int l1ConfCode = -1;
1140 LogDebug(
"L1GtAnalyzer") <<
"\nL1 configuration code:" << l1ConfCode
1141 <<
"\nValid L1 trigger configuration.\n" << std::endl;
1143 LogTrace(
"L1GtAnalyzer") <<
"\nL1 trigger menu name and implementation:"
1149 myCoutStream <<
"\nL1 configuration code:" << l1ConfCode
1150 <<
"\nNo valid L1 trigger configuration available."
1151 <<
"\nCheck L1GtUtils wiki page for error code interpretation\n"
1161 bool decisionBeforeMaskAlgTechTrig =
false;
1162 bool decisionAfterMaskAlgTechTrig =
false;
1163 bool decisionAlgTechTrig =
false;
1164 int prescaleFactorAlgTechTrig = -1;
1165 int triggerMaskAlgTechTrig = -1;
1200 switch (iErrorCode) {
1207 <<
" does not exist in the L1 menu "
1213 myCoutStream <<
"\nError: "
1214 <<
"\n An error was encountered when retrieving decision, mask and prescale factor for "
1218 <<
"\n Check L1GtUtils wiki page for error code interpretation"
1230 myCoutStream <<
"\nL1Extra collections from all BxInEvent" << std::endl;
1234 myCoutStream <<
"\nL1Extra collections from BxInEvent = 0 (BX for L1A)" << std::endl;
1240 int iErrorRecord = 0;
1242 bool validRecord =
false;
1243 bool gtObjectMapRecordValid =
false;
1255 LogDebug(
"L1GtAnalyzer") <<
"\nL1GlobalTriggerObjectMaps with \n "
1263 if (gtObjectMapRecord.
isValid()) {
1265 gtObjectMapRecordValid =
true;
1270 iErrorRecord = iErrorRecord + 100;
1271 LogDebug(
"L1GtAnalyzer") <<
"\nL1GlobalTriggerObjectMapRecord with \n "
1278 if (validRecord && gtObjectMapRecordValid) {
1322 <<
"\n Trigger mask: " << triggerMaskAlgTechTrig
1323 <<
"\n Prescale factor: " << prescaleFactorAlgTechTrig
1324 <<
"\n Decision before mask: " << decisionBeforeMaskAlgTechTrig
1325 <<
"\n Decision after mask: " << decisionAfterMaskAlgTechTrig
1326 <<
"\n Decision (after mask): " << decisionAlgTechTrig <<
"\n"
1338 <<
"\n**** L1GtAnalyzer::analyzeObjectMap object map product ****\n"
1343 std::ostringstream myCoutStream;
1350 if (!gtObjectMapRecord.
isValid()) {
1352 <<
"\nWarning: L1GlobalTriggerObjectMapRecord with input tag "
1354 <<
"\nrequested in configuration, but not found in the event."
1355 <<
"\nExit the method.\n" << std::endl;
1361 const std::vector<L1GlobalTriggerObjectMap>& objMapVec =
1362 gtObjectMapRecord->gtObjectMap();
1365 for (std::vector<L1GlobalTriggerObjectMap>::const_iterator it =
1366 objMapVec.begin(); it != objMapVec.end(); ++it) {
1368 (*it).print(myCoutStream);
1377 myCoutStream <<
"\n Number of combinations passing ("
1379 << comb->size() << std::endl;
1387 const bool result = gtObjectMapRecord->getConditionResult(
1390 myCoutStream <<
"\n Result for condition " <<
m_condName
1403 <<
"\n**** L1GtAnalyzer::analyzeL1GtTriggerMenuLite ****\n"
1408 std::ostringstream myCoutStream;
1418 if (!triggerMenuLite.
isValid()) {
1420 LogDebug(
"L1GtAnalyzer") <<
"\nL1GtTriggerMenuLite with \n "
1422 <<
"\nrequested in configuration, but not found in the event."
1423 <<
"\nExit the method.\n" << std::endl;
1429 myCoutStream << (*triggerMenuLite);
1434 triggerMenuLite->gtTriggerMenuInterface();
1435 const std::string& triggerMenuName = triggerMenuLite->gtTriggerMenuName();
1437 triggerMenuLite->gtTriggerMenuImplementation();
1438 const std::string& scaleDbKey = triggerMenuLite->gtScaleDbKey();
1442 triggerMenuLite->gtAlgorithmAliasMap();
1444 triggerMenuLite->gtTechnicalTriggerMap();
1446 const std::vector<unsigned int>& triggerMaskAlgoTrig =
1447 triggerMenuLite->gtTriggerMaskAlgoTrig();
1448 const std::vector<unsigned int>& triggerMaskTechTrig =
1449 triggerMenuLite->gtTriggerMaskTechTrig();
1451 const std::vector<std::vector<int> >& prescaleFactorsAlgoTrig =
1452 triggerMenuLite->gtPrescaleFactorsAlgoTrig();
1453 const std::vector<std::vector<int> >& prescaleFactorsTechTrig =
1454 triggerMenuLite->gtPrescaleFactorsTechTrig();
1458 size_t nrDefinedAlgo = algorithmMap.size();
1459 size_t nrDefinedTech = technicalTriggerMap.size();
1463 myCoutStream <<
"\n ********** L1 Trigger Menu - printing ********** \n"
1464 <<
"\nL1 Trigger Menu Interface: " << triggerMenuInterface
1465 <<
"\nL1 Trigger Menu Name: " << triggerMenuName
1466 <<
"\nL1 Trigger Menu Implementation: " << triggerMenuImplementation
1467 <<
"\nAssociated Scale DB Key: " << scaleDbKey <<
"\n\n"
1468 <<
"\nL1 Physics Algorithms: " << nrDefinedAlgo <<
" algorithms defined." <<
"\n\n"
1470 << std::right << std::setw(35) <<
"Algorithm Name" <<
" "
1471 << std::right << std::setw(35) <<
"Algorithm Alias" <<
" "
1472 << std::right << std::setw(12) <<
"Trigger Mask";
1473 for (
unsigned iSet = 0; iSet < prescaleFactorsAlgoTrig.size(); iSet++) {
1474 myCoutStream << std::right << std::setw(10) <<
"PF Set "
1475 << std::right << std::setw(2) << iSet;
1478 myCoutStream << std::endl;
1482 != algorithmMap.end(); itTrig++) {
1484 const unsigned int bitNumber = itTrig->first;
1489 if (itAlias != algorithmAliasMap.end()) {
1490 aAlias = itAlias->second;
1493 myCoutStream << std::setw(6) << bitNumber <<
" "
1494 << std::right << std::setw(35) << aName <<
" "
1495 << std::right << std::setw(35) << aAlias <<
" "
1496 << std::right << std::setw(12) << triggerMaskAlgoTrig[bitNumber];
1497 for (
unsigned iSet = 0; iSet < prescaleFactorsAlgoTrig.size(); iSet++) {
1498 myCoutStream << std::right << std::setw(12) << prescaleFactorsAlgoTrig[iSet][bitNumber];
1501 myCoutStream << std::endl;
1504 myCoutStream <<
"\nL1 Technical Triggers: " << nrDefinedTech
1505 <<
" technical triggers defined." <<
"\n\n" << std::endl;
1506 if (nrDefinedTech) {
1508 << std::right << std::setw(6) <<
"Bit Number "
1509 << std::right << std::setw(45) <<
" Technical trigger name " <<
" "
1510 << std::right << std::setw(12) <<
"Trigger Mask";
1511 for (
unsigned iSet = 0; iSet < prescaleFactorsTechTrig.size(); iSet++) {
1512 myCoutStream << std::right << std::setw(10) <<
"PF Set "
1513 << std::right << std::setw(2) << iSet;
1516 myCoutStream << std::endl;
1520 != technicalTriggerMap.end(); itTrig++) {
1522 unsigned int bitNumber = itTrig->first;
1525 myCoutStream << std::setw(6) << bitNumber <<
" "
1526 << std::right << std::setw(45) << aName
1527 << std::right << std::setw(12) << triggerMaskTechTrig[bitNumber];
1528 for (
unsigned iSet = 0; iSet < prescaleFactorsTechTrig.size(); iSet++) {
1529 myCoutStream << std::right << std::setw(12) << prescaleFactorsTechTrig[iSet][bitNumber];
1532 myCoutStream << std::endl;
1539 const std::string* algorithmAlias = triggerMenuLite->gtAlgorithmAlias(
1543 <<
"\nError code retrieving alias for algorithm with bit number "
1546 myCoutStream <<
"\nAlias for algorithm with bit number " <<
m_bitNumber
1547 <<
": " << (*algorithmAlias) << std::endl;
1551 const std::string* algorithmName = triggerMenuLite->gtAlgorithmName(
1555 <<
"\nError code retrieving name for algorithm with bit number "
1558 myCoutStream <<
"\nName for algorithm with bit number " <<
m_bitNumber
1559 <<
": " << (*algorithmName) << std::endl;
1563 const std::string* techTrigName = triggerMenuLite->gtTechTrigName(
1567 <<
"\nError code retrieving name for technical trigger with bit number "
1570 myCoutStream <<
"\nName for technical trigger with bit number "
1571 <<
m_bitNumber <<
": " << (*techTrigName) << std::endl;
1575 const unsigned int bitNumber = triggerMenuLite->gtBitNumber(
1579 <<
"\nError code retrieving bit number for algorithm/technical trigger "
1582 myCoutStream <<
"\nBit number for algorithm/technical trigger "
1601 <<
"\n**** L1GtAnalyzer::analyzeConditionsInRunBlock ****\n"
1606 std::ostringstream myCoutStream;
1612 if (!condInRunBlock.
isValid()) {
1614 LogDebug(
"L1GtAnalyzer") <<
"\nConditionsInRunBlock with \n "
1616 <<
"\nrequested in configuration, but not found in the event."
1617 <<
"\nExit the method.\n" << std::endl;
1622 const boost::uint16_t beamModeVal = condInRunBlock->beamMode;
1623 const boost::uint16_t beamMomentumVal = condInRunBlock->beamMomentum;
1624 const boost::uint32_t lhcFillNumberVal = condInRunBlock->lhcFillNumber;
1627 myCoutStream <<
"\nLHC quantities in run " << iRun.
run()
1628 <<
"\n Beam Mode = " << beamModeVal
1629 <<
"\n Beam Momentum = " << beamMomentumVal <<
" GeV"
1630 <<
"\n LHC Fill Number = " << lhcFillNumberVal
1641 <<
"\n**** L1GtAnalyzer::analyzeConditionsInLumiBlock ****\n"
1646 std::ostringstream myCoutStream;
1652 if (!condInLumiBlock.
isValid()) {
1654 LogDebug(
"L1GtAnalyzer") <<
"\nConditionsInLumiBlock with \n "
1656 <<
"\nrequested in configuration, but not found in the event."
1657 <<
"\nExit the method.\n" << std::endl;
1662 const boost::uint32_t totalIntensityBeam1Val =
1663 condInLumiBlock->totalIntensityBeam1;
1664 const boost::uint32_t totalIntensityBeam2Val =
1665 condInLumiBlock->totalIntensityBeam2;
1667 myCoutStream <<
"\nLHC quantities in luminosity section "
1670 <<
"\n Total Intensity Beam 1 (Integer × 10E10 charges) = "
1671 << totalIntensityBeam1Val
1672 <<
"\n Total Intensity Beam 2 (Integer × 10E10 charges) = "
1673 << totalIntensityBeam2Val << std::endl;
1683 std::ostringstream myCoutStream;
1689 if (!condInEventBlock.
isValid()) {
1691 LogDebug(
"L1GtAnalyzer") <<
"\nConditionsInEventBlock with \n "
1693 <<
"\nrequested in configuration, but not found in the event."
1694 <<
"\nExit the method.\n" << std::endl;
1699 const boost::uint16_t bstMasterStatusVal =
1700 condInEventBlock->bstMasterStatus;
1701 const boost::uint32_t turnCountNumberVal =
1702 condInEventBlock->turnCountNumber;
1704 myCoutStream <<
"\nLHC quantities in event " << iEvent.
id().
event()
1706 <<
" from run " << iEvent.
run() <<
"\n BST Master Status = "
1707 << bstMasterStatusVal <<
"\n Turn count number = "
1708 << turnCountNumberVal << std::endl;
1726 LogTrace(
"L1GtAnalyzer") << myCout.str() << std::endl;
1746 std::cout <<
"\n\n L1GtAnalyzer: Error - no print output = "
1748 <<
" defined! \n Check available values in the cfi file."
1749 <<
"\n" << std::endl;
virtual void analyzeObjectMap(const edm::Event &, const edm::EventSetup &)
analyze: object map product
EventNumber_t event() const
edm::InputTag m_l1GmtInputTag
input tag for muon collection from GMT
edm::EDGetTokenT< edm::ConditionsInRunBlock > m_condInRunToken
const int logicalExpressionRunUpdate(const edm::Run &, const edm::EventSetup &, const std::string &)
edm::EDGetTokenT< L1GtTriggerMenuLite > m_l1GtTmLToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
virtual void analyzeDecisionReadoutRecord(const edm::Event &, const edm::EventSetup &)
edm::InputTag m_condInEdmInputTag
input tag for ConditionInEdm products
const int prescaleFactorSetIndex(const edm::Event &iEvent, const TriggerCategory &trigCategory, int &errorCode) const
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::EDGetTokenT< L1GlobalTriggerObjectMaps > m_l1GtObjectMapsToken
edm::LuminosityBlockNumber_t luminosityBlock() const
const std::vector< std::pair< std::string, int > > & prescaleFactors()
const bool decision(const edm::Event &iEvent, const std::string &nameAlgoTechTrig, int &errorCode) const
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
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
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 getByToken(EDGetToken token, Handle< PROD > &result) const
bool m_analyzeTriggerEnable
edm::EDGetTokenT< edm::ConditionsInLumiBlock > m_condInLumiToken
bool m_analyzeL1GtUtilsEventSetupEnable
edm::EDGetTokenT< edm::ConditionsInEventBlock > m_condInEventToken
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
L1GtUtils m_l1GtUtilsProv
const int triggerMask(const edm::Event &iEvent, const std::string &nameAlgoTechTrig, int &errorCode) const
return trigger mask for a given algorithm or technical trigger
int m_printOutput
print output
void analyzeConditionsInLumiBlock(const edm::LuminosityBlock &, const edm::EventSetup &)
to be used in beginLuminosityBlock
const std::vector< int > & prescaleFactorSet(const edm::Event &iEvent, const TriggerCategory &trigCategory, int &errorCode)
const bool decisionBeforeMask(const edm::Event &iEvent, const std::string &nameAlgoTechTrig, int &errorCode) const
return decision before trigger mask for a given algorithm or technical trigger
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > m_l1GtDaqReadoutRecordToken
static const bool useL1GtTriggerMenuLite(true)
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
void getL1GtRunCache(const edm::Run &, const edm::EventSetup &, const bool, const bool)
get all the run-constant quantities for L1 trigger and cache them
bool m_l1GtTmLInputTagProv
bool m_analyzeL1GtUtilsMenuLiteEnable
bool m_analyzeL1GtUtilsEnable
bool m_l1GtRecordsInputTagProv
void analyzeL1GtUtilsEventSetup(const edm::Event &, const edm::EventSetup &)
edm::EDGetTokenT< L1GlobalTriggerObjectMapRecord > m_l1GtObjectMapToken
const bool decisionAfterMask(const edm::Event &iEvent, const std::string &nameAlgoTechTrig, int &errorCode) const
return decision after trigger mask 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
static const bool useL1EventSetup(true)
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
const int prescaleFactor(const edm::Event &iEvent, const std::string &nameAlgoTechTrig, int &errorCode) const
return prescale factor for a given algorithm or technical trigger