46 m_retrieveL1Extra(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")),
66 m_l1GtDaqReadoutRecordInputTag(parSet.getParameter<edm::
InputTag>(
"L1GtDaqReadoutRecordInputTag")),
69 m_l1GtRecordInputTag(parSet.getParameter<edm::
InputTag>(
"L1GtRecordInputTag")),
72 m_l1GtObjectMapTag(parSet.getParameter<edm::
InputTag>(
"L1GtObjectMapTag")),
75 m_l1GtObjectMapsInputTag(parSet.getParameter<edm::
InputTag>(
"L1GtObjectMapsInputTag")),
78 m_l1GmtInputTag(parSet.getParameter<edm::
InputTag>(
"L1GmtInputTag")),
81 m_l1GtTmLInputTag(parSet.getParameter<edm::
InputTag>(
"L1GtTmLInputTag")),
84 m_condInEdmInputTag(parSet.getParameter<edm::
InputTag>(
"CondInEdmInputTag")),
87 m_nameAlgTechTrig(parSet.getParameter<std::
string>(
"AlgorithmName")),
88 m_condName(parSet.getParameter<std::
string>(
"ConditionName")),
89 m_bitNumber(parSet.getParameter<unsigned int>(
"BitNumber")),
91 m_l1GtUtilsConfiguration(parSet.getParameter<unsigned int>(
"L1GtUtilsConfiguration")),
92 m_l1GtTmLInputTagProv(parSet.getParameter<bool>(
"L1GtTmLInputTagProv")),
93 m_l1GtRecordsInputTagProv(parSet.getParameter<bool>(
"L1GtRecordsInputTagProv")),
94 m_l1GtUtilsConfigureBeginRun(parSet.getParameter<bool>(
"L1GtUtilsConfigureBeginRun")),
95 m_l1GtUtilsLogicalExpression(parSet.getParameter<std::
string>(
"L1GtUtilsLogicalExpression")),
96 m_l1GtUtilsProv(parSet,
98 m_l1GtUtilsConfiguration == 0 || m_l1GtUtilsConfiguration == 100000,
102 m_l1GtTmLInputTagProv ? edm::
InputTag() : m_l1GtTmLInputTag),
105 m_l1GtUtilsConfiguration == 0 || m_l1GtUtilsConfiguration == 100000,
107 m_l1GtRecordInputTag,
108 m_l1GtDaqReadoutRecordInputTag,
109 m_l1GtTmLInputTagProv ? edm::
InputTag() : m_l1GtTmLInputTag),
110 m_logicalExpressionL1ResultsProv(m_l1GtUtilsLogicalExpression, m_l1GtUtilsProv),
111 m_logicalExpressionL1Results(m_l1GtUtilsLogicalExpression, m_l1GtUtils) {
120 LogDebug(
"L1GtAnalyzer") <<
"\n Input parameters for L1 GT test analyzer"
127 <<
"\n Condition, if an algorithm trigger is requested: " <<
m_condName
128 <<
"\n Bit number for an algorithm or technical trigger: " <<
m_bitNumber
130 <<
"\n Retrieve input tag from provenance for L1GtTriggerMenuLite in the L1GtUtils: "
132 <<
"\n Retrieve input tag from provenance for L1GlobalTriggerReadoutRecord "
163 useL1EventSetup =
false;
164 useL1GtTriggerMenuLite =
true;
168 useL1EventSetup =
true;
169 useL1GtTriggerMenuLite =
true;
173 useL1EventSetup =
true;
174 useL1GtTriggerMenuLite =
false;
224 LogDebug(
"L1GtAnalyzer") <<
"\n**** L1GtAnalyzer::analyzeDecisionReadoutRecord ****\n" << std::endl;
228 std::ostringstream myCoutStream;
234 if (!gtReadoutRecord.
isValid()) {
236 <<
"\nrequested in configuration, but not found in the event."
237 <<
"\nExit the method.\n"
244 bool gtDecision = gtReadoutRecord->decision();
245 DecisionWord gtDecisionWord = gtReadoutRecord->decisionWord();
248 edm::LogVerbatim(
"L1GtAnalyzer") <<
"\n GlobalTrigger decision: " << gtDecision << std::endl;
251 gtReadoutRecord->printGtDecision(myCoutStream);
254 gtReadoutRecord->printTechnicalTrigger(myCoutStream);
262 std::ostringstream myCoutStream;
274 myCoutStream <<
"\nL1 configuration code: \n"
276 <<
"\n 0 - Retrieve L1 trigger configuration from L1GtTriggerMenuLite only"
277 <<
"\n 10000 L1GtTriggerMenuLite product is valid"
278 <<
"\n 99999 L1GtTriggerMenuLite product not valid. Error."
280 <<
"\n 100000 - Fall through: try first L1GtTriggerMenuLite; if not valid,try event setup."
281 <<
"\n 110000 L1GtTriggerMenuLite product is valid"
282 <<
"\n 120000 L1GtTriggerMenuLite product not valid, event setup valid."
283 <<
"\n 199999 L1GtTriggerMenuLite product not valid, event setup not valid. Error."
285 <<
"\n 200000 - Retrieve L1 trigger configuration from event setup only."
286 <<
"\n 210000 Event setup valid."
287 <<
"\n 299999 Event setup not valid. Error."
289 <<
"\n 300000 - No L1 trigger configuration requested to be retrieved. Error"
290 <<
"\n Must call before using L1GtUtils methods: "
291 <<
"\n getL1GtRunCache(const edm::Event& iEvent, const edm::EventSetup& evSetup,"
292 <<
"\n const bool useL1EventSetup, const bool useL1GtTriggerMenuLite)"
297 myCoutStream <<
"\nL1 configuration code:" << l1ConfCode <<
"\nValid L1 trigger configuration." << std::endl;
299 myCoutStream <<
"\nL1 trigger menu name and implementation:"
305 myCoutStream <<
"\nL1 configuration code:" << l1ConfCode <<
"\nNo valid L1 trigger configuration available."
306 <<
"\nSee text above for error code interpretation"
307 <<
"\nNo return here, in order to test each method, protected against configuration error."
311 myCoutStream <<
"\n******** Results found with input tags retrieved from provenance ******** \n" << std::endl;
332 myCoutStream <<
"\n\nMethods:"
333 <<
"\n decisionBeforeMask(iEvent, m_nameAlgTechTrig, iErrorCode)"
334 <<
"\n decisionAfterMask(iEvent, m_nameAlgTechTrig, iErrorCode)"
335 <<
"\n decision(iEvent, m_nameAlgTechTrig, iErrorCode)"
336 <<
"\n prescaleFactor(iEvent, m_nameAlgTechTrig, iErrorCode)"
337 <<
"\n triggerMask(iEvent, m_nameAlgTechTrig, iErrorCode)"
338 <<
"\n triggerMask(m_nameAlgTechTrig,iErrorCode)"
342 if (iErrorCode == 0) {
343 myCoutStream <<
"\nDecision before trigger mask for " <<
m_nameAlgTechTrig <<
": "
344 << decisionBeforeMaskAlgTechTrig << std::endl;
345 myCoutStream <<
"Decision after trigger mask for " <<
m_nameAlgTechTrig <<
": " << decisionAfterMaskAlgTechTrig
347 myCoutStream <<
"Decision (after trigger mask) for " <<
m_nameAlgTechTrig <<
": " << decisionAlgTechTrig
350 myCoutStream <<
"Prescale factor for " <<
m_nameAlgTechTrig <<
": " << prescaleFactorAlgTechTrig
353 myCoutStream <<
"Trigger mask for " <<
m_nameAlgTechTrig <<
": " << triggerMaskAlgTechTrig
356 }
else if (iErrorCode == 1) {
362 myCoutStream <<
"\nError: "
363 <<
"\n An error was encountered when retrieving decision, mask and prescale factor for "
365 <<
"\n Error code: " << iErrorCode << std::endl;
373 if (iErrorCode == 0) {
374 myCoutStream <<
"\nTrigger mask for " <<
m_nameAlgTechTrig <<
"(faster method): " << triggerMaskAlgTechTrig
377 }
else if (iErrorCode == 1) {
383 myCoutStream <<
"\nError: "
384 <<
"\n An error was encountered when fast retrieving trigger mask for " <<
m_nameAlgTechTrig
393 myCoutStream <<
"\nMethods:"
394 <<
"\n prescaleFactorSetIndex(iEvent, trigCategory, iErrorCode)"
395 <<
"\n prescaleFactorSet(iEvent, trigCategory,iErrorCode)\n"
401 if (iErrorCode == 0) {
402 myCoutStream <<
"\nAlgorithm triggers: index for prescale factor set = " << pfSetIndexAlgorithmTrigger
407 myCoutStream <<
"\nError encountered when retrieving the prescale factor set index"
408 <<
"\n for algorithm triggers, for run " << iEvent.
run() <<
", luminosity block "
410 <<
"\n Error code: " << iErrorCode <<
"\n"
417 if (iErrorCode == 0) {
418 myCoutStream <<
"\nAlgorithm triggers: prescale factor set index = " << pfSetIndexAlgorithmTrigger <<
"\nfor run "
419 << iEvent.
run() <<
", luminosity block " << iEvent.
luminosityBlock() <<
", with L1 menu \n "
423 for (std::vector<int>::const_iterator cItBit = pfSetAlgorithmTrigger.begin(); cItBit != pfSetAlgorithmTrigger.end();
426 myCoutStream <<
"Bit number " << std::right << std::setw(4) << iBit <<
": prescale factor = " << (*cItBit)
431 myCoutStream <<
"\nError encountered when retrieving the prescale factor set "
432 <<
"\n for algorithm triggers, for run " << iEvent.
run() <<
", luminosity block "
434 <<
"\n Error code: " << iErrorCode <<
"\n"
440 myCoutStream <<
"\nMethod:"
441 <<
"\n triggerMaskSet(trigCategory, iErrorCode)" << std::endl;
446 if (iErrorCode == 0) {
447 myCoutStream <<
"\nAlgorithm triggers: trigger mask set for run " << iEvent.
run() <<
", luminosity block "
452 for (std::vector<unsigned int>::const_iterator cItBit = tmSetAlgorithmTrigger.begin();
453 cItBit != tmSetAlgorithmTrigger.end();
456 myCoutStream <<
"Bit number " << std::right << std::setw(4) << iBit <<
": trigger mask = " << (*cItBit)
461 myCoutStream <<
"\nError encountered when retrieving the trigger mask set "
462 <<
"\n for algorithm triggers, for run " << iEvent.
run() <<
", luminosity block "
464 <<
"\n Error code: " << iErrorCode <<
"\n"
473 myCoutStream <<
"\nMethods:"
474 <<
"\n prescaleFactorSetIndex(iEvent, trigCategory, iErrorCode)"
475 <<
"\n prescaleFactorSet(iEvent, trigCategory,iErrorCode)\n"
481 if (iErrorCode == 0) {
482 myCoutStream <<
"\nTechnical triggers: index for prescale factor set = " << pfSetIndexTechnicalTrigger
485 <<
"\nMethod: prescaleFactorSetIndex(iEvent, trigCategory, iErrorCode)\n"
489 myCoutStream <<
"\nError encountered when retrieving the prescale factor set index"
490 <<
"\n for technical triggers, for run " << iEvent.
run() <<
", luminosity block "
492 <<
"\n Error code: " << iErrorCode <<
"\n"
499 if (iErrorCode == 0) {
500 myCoutStream <<
"\nTechnical triggers: prescale factor set index = " << pfSetIndexTechnicalTrigger <<
"\nfor run "
501 << iEvent.
run() <<
", luminosity block " << iEvent.
luminosityBlock() <<
", with L1 menu \n "
506 for (std::vector<int>::const_iterator cItBit = pfSetTechnicalTrigger.begin(); cItBit != pfSetTechnicalTrigger.end();
509 myCoutStream <<
"Bit number " << std::right << std::setw(4) << iBit <<
": prescale factor = " << (*cItBit)
514 myCoutStream <<
"\nError encountered when retrieving the prescale factor set "
515 <<
"\n for technical triggers, for run " << iEvent.
run() <<
", luminosity block "
517 <<
"\n Error code: " << iErrorCode <<
"\n"
523 myCoutStream <<
"\nMethod:"
524 <<
"\n triggerMaskSet(trigCategory, iErrorCode)" << std::endl;
529 if (iErrorCode == 0) {
530 myCoutStream <<
"\nTechnical triggers: trigger mask set for run " << iEvent.
run() <<
", luminosity block "
535 for (std::vector<unsigned int>::const_iterator cItBit = tmSetTechnicalTrigger.begin();
536 cItBit != tmSetTechnicalTrigger.end();
539 myCoutStream <<
"Bit number " << std::right << std::setw(4) << iBit <<
": trigger mask = " << (*cItBit)
544 myCoutStream <<
"\nError encountered when retrieving the trigger mask set "
545 <<
"\n for technical triggers, for run " << iEvent.
run() <<
", luminosity block "
547 <<
"\n Error code: " << iErrorCode <<
"\n"
556 const std::vector<L1GtLogicParser::OperandToken>& expL1TriggersProv =
559 const std::vector<std::pair<std::string, bool> >& decisionsBeforeMaskProv =
561 const std::vector<std::pair<std::string, bool> >& decisionsAfterMaskProv =
563 const std::vector<std::pair<std::string, int> >& prescaleFactorsProv =
567 myCoutStream << std::endl;
570 for (
size_t iTrig = 0; iTrig < errorCodesProv.size(); ++iTrig) {
571 if ((errorCodesProv[iTrig]).second != 0) {
572 myCoutStream <<
"\nError encountered when retrieving L1 results for trigger " << (errorCodesProv[iTrig]).
first
573 <<
" (bit number " << (expL1TriggersProv[iTrig]).tokenNumber <<
")\n for run " << iEvent.
run()
574 <<
", luminosity block " << iEvent.
luminosityBlock() <<
" with L1 menu \n "
580 << (errorCodesProv[iTrig]).
first <<
" - bit number " << (expL1TriggersProv[iTrig]).tokenNumber
583 myCoutStream <<
" decision before mask = " << (decisionsBeforeMaskProv[iTrig]).
second << std::endl;
585 myCoutStream <<
" decision after mask = " << (decisionsAfterMaskProv[iTrig]).
second << std::endl;
587 myCoutStream <<
" prescale factor = " << (prescaleFactorsProv[iTrig]).
second << std::endl;
589 myCoutStream <<
" trigger mask = " << (triggerMasksProv[iTrig]).
second << std::endl;
591 myCoutStream <<
" error code = " << (errorCodesProv[iTrig]).
second << std::endl;
599 myCoutStream <<
"\n******** Results found with input tags provided in the configuration file ******** \n"
620 <<
"\n decisionBeforeMask(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, m_nameAlgTechTrig, "
622 <<
"\n decisionAfterMask(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, m_nameAlgTechTrig, "
624 <<
"\n decision(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, m_nameAlgTechTrig, iErrorCode)"
625 <<
"\n prescaleFactor(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, m_nameAlgTechTrig, "
627 <<
"\n triggerMask(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, m_nameAlgTechTrig, iErrorCode)"
631 if (iErrorCode == 0) {
632 myCoutStream <<
"\nDecision before trigger mask for " <<
m_nameAlgTechTrig <<
": "
633 << decisionBeforeMaskAlgTechTrigITag << std::endl;
635 << decisionAfterMaskAlgTechTrigITag << std::endl;
636 myCoutStream <<
"Decision (after trigger mask) for " <<
m_nameAlgTechTrig <<
": " << decisionAlgTechTrigITag
639 myCoutStream <<
"Prescale factor for " <<
m_nameAlgTechTrig <<
": " << prescaleFactorAlgTechTrigITag
642 myCoutStream <<
"Trigger mask for " <<
m_nameAlgTechTrig <<
": " << triggerMaskAlgTechTrigITag
645 }
else if (iErrorCode == 1) {
651 myCoutStream <<
"\nError: "
652 <<
"\n An error was encountered when retrieving decision, mask and prescale factor for "
654 <<
"\n Error code: " << iErrorCode << std::endl;
662 myCoutStream <<
"\nMethods:"
663 <<
"\n prescaleFactorSetIndex(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, "
664 "trigCategory, iErrorCode)"
665 <<
"\n prescaleFactorSet(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, "
666 "trigCategory,iErrorCode)\n"
672 if (iErrorCode == 0) {
673 myCoutStream <<
"\nAlgorithm triggers: index for prescale factor set = " << pfSetIndexAlgorithmTriggerITag
678 myCoutStream <<
"\nError encountered when retrieving the prescale factor set index"
679 <<
"\n for algorithm triggers, for run " << iEvent.
run() <<
", luminosity block "
681 <<
"\n Error code: " << iErrorCode <<
"\n"
688 if (iErrorCode == 0) {
689 myCoutStream <<
"\nAlgorithm triggers: prescale factor set index = " << pfSetIndexAlgorithmTriggerITag
694 for (std::vector<int>::const_iterator cItBit = pfSetAlgorithmTriggerITag.begin();
695 cItBit != pfSetAlgorithmTriggerITag.end();
698 myCoutStream <<
"Bit number " << std::right << std::setw(4) << iBit <<
": prescale factor = " << (*cItBit)
703 myCoutStream <<
"\nError encountered when retrieving the prescale factor set "
704 <<
"\n for algorithm triggers, for run " << iEvent.
run() <<
", luminosity block "
706 <<
"\n Error code: " << iErrorCode <<
"\n"
715 myCoutStream <<
"\nMethods:"
716 <<
"\n prescaleFactorSetIndex(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, "
717 "trigCategory, iErrorCode)"
718 <<
"\n prescaleFactorSet(iEvent, m_l1GtRecordInputTag, m_l1GtDaqReadoutRecordInputTag, "
719 "trigCategory,iErrorCode)\n"
725 if (iErrorCode == 0) {
726 myCoutStream <<
"\nTechnical triggers: index for prescale factor set = " << pfSetIndexTechnicalTriggerITag
731 myCoutStream <<
"\nError encountered when retrieving the prescale factor set index"
732 <<
"\n for technical triggers, for run " << iEvent.
run() <<
", luminosity block "
734 <<
"\n Error code: " << iErrorCode <<
"\n"
741 if (iErrorCode == 0) {
742 myCoutStream <<
"\nTechnical triggers: prescale factor set index = " << pfSetIndexTechnicalTriggerITag
747 for (std::vector<int>::const_iterator cItBit = pfSetTechnicalTriggerITag.begin();
748 cItBit != pfSetTechnicalTriggerITag.end();
751 myCoutStream <<
"Bit number " << std::right << std::setw(4) << iBit <<
": prescale factor = " << (*cItBit)
756 myCoutStream <<
"\nError encountered when retrieving the prescale factor set "
757 <<
"\n for technical triggers, for run " << iEvent.
run() <<
", luminosity block "
759 <<
"\n Error code: " << iErrorCode <<
"\n"
770 const std::vector<std::pair<std::string, bool> >& decisionsBeforeMask =
772 const std::vector<std::pair<std::string, bool> >& decisionsAfterMask =
777 myCoutStream << std::endl;
780 for (
size_t iTrig = 0; iTrig < errorCodes.size(); ++iTrig) {
781 if ((errorCodes[iTrig]).second != 0) {
782 myCoutStream <<
"\nError encountered when retrieving L1 results for trigger " << (errorCodes[iTrig]).
first
783 <<
" (bit number " << (expL1Triggers[iTrig]).tokenNumber <<
")\n for run " << iEvent.
run()
784 <<
", luminosity block " << iEvent.
luminosityBlock() <<
" with L1 menu \n "
790 << (errorCodes[iTrig]).
first <<
" - bit number " << (expL1Triggers[iTrig]).tokenNumber << std::endl;
792 myCoutStream <<
" decision before mask = " << (decisionsBeforeMask[iTrig]).
second << std::endl;
794 myCoutStream <<
" decision after mask = " << (decisionsAfterMask[iTrig]).
second << std::endl;
796 myCoutStream <<
" prescale factor = " << (prescaleFactors[iTrig]).
second << std::endl;
798 myCoutStream <<
" trigger mask = " << (triggerMasks[iTrig]).
second << std::endl;
800 myCoutStream <<
" error code = " << (errorCodes[iTrig]).
second << std::endl;
808 LogDebug(
"L1GtAnalyzer") <<
"\n**** L1GtAnalyzer::analyzeL1GtUtilsMenuLite ****\n" << std::endl;
826 LogDebug(
"L1GtAnalyzer") <<
"\n**** L1GtAnalyzer::analyzeL1GtUtilsEventSetup ****\n" << std::endl;
844 LogDebug(
"L1GtAnalyzer") <<
"\n**** L1GtAnalyzer::analyzeL1GtUtils: fall-through case ****\n" << std::endl;
862 LogDebug(
"L1GtAnalyzer") <<
"\n**** L1GtAnalyzer::analyzeTrigger ****\n" << std::endl;
866 std::ostringstream myCoutStream;
869 myCoutStream <<
"\n\nFull analysis of an algorithm or technical trigger"
870 <<
"\nMethod: L1GtAnalyzer::analyzeTrigger"
876 const unsigned int eventNumber = iEvent.
id().
event();
878 myCoutStream <<
"Run: " << runNumber <<
" LS: " << lsNumber <<
" Event: " << eventNumber <<
"\n\n" << std::endl;
890 useL1EventSetup =
false;
891 useL1GtTriggerMenuLite =
true;
895 useL1EventSetup =
true;
896 useL1GtTriggerMenuLite =
true;
900 useL1EventSetup =
true;
901 useL1GtTriggerMenuLite =
false;
921 LogDebug(
"L1GtAnalyzer") <<
"\nL1 configuration code:" << l1ConfCode <<
"\nValid L1 trigger configuration.\n"
924 LogTrace(
"L1GtAnalyzer") <<
"\nL1 trigger menu name and implementation:"
931 myCoutStream <<
"\nL1 configuration code:" << l1ConfCode <<
"\nNo valid L1 trigger configuration available."
932 <<
"\nCheck L1GtUtils wiki page for error code interpretation\n"
942 bool decisionBeforeMaskAlgTechTrig =
false;
943 bool decisionAfterMaskAlgTechTrig =
false;
944 bool decisionAlgTechTrig =
false;
945 int prescaleFactorAlgTechTrig = -1;
946 int triggerMaskAlgTechTrig = -1;
971 switch (iErrorCode) {
982 myCoutStream <<
"\nError: "
983 <<
"\n An error was encountered when retrieving decision, mask and prescale factor for "
985 <<
"\n Error code: " << iErrorCode <<
"\n Check L1GtUtils wiki page for error code interpretation"
996 myCoutStream <<
"\nL1Extra collections from all BxInEvent" << std::endl;
1000 myCoutStream <<
"\nL1Extra collections from BxInEvent = 0 (BX for L1A)" << std::endl;
1006 int iErrorRecord = 0;
1008 bool validRecord =
false;
1009 bool gtObjectMapRecordValid =
false;
1020 <<
"\nnot found in the event." << std::endl;
1026 if (gtObjectMapRecord.
isValid()) {
1027 gtObjectMapRecordValid =
true;
1031 iErrorRecord = iErrorRecord + 100;
1033 <<
"\nnot found in the event." << std::endl;
1037 if (validRecord && gtObjectMapRecordValid) {
1079 <<
"\n Trigger mask: " << triggerMaskAlgTechTrig
1080 <<
"\n Prescale factor: " << prescaleFactorAlgTechTrig
1081 <<
"\n Decision before mask: " << decisionBeforeMaskAlgTechTrig
1082 <<
"\n Decision after mask: " << decisionAfterMaskAlgTechTrig
1083 <<
"\n Decision (after mask): " << decisionAlgTechTrig <<
"\n"
1091 LogDebug(
"L1GtAnalyzer") <<
"\n**** L1GtAnalyzer::analyzeObjectMap object map product ****\n" << std::endl;
1095 std::ostringstream myCoutStream;
1102 if (!gtObjectMapRecord.
isValid()) {
1104 <<
"\nrequested in configuration, but not found in the event."
1105 <<
"\nExit the method.\n"
1112 const std::vector<L1GlobalTriggerObjectMap>& objMapVec = gtObjectMapRecord->gtObjectMap();
1115 for (std::vector<L1GlobalTriggerObjectMap>::const_iterator it = objMapVec.begin(); it != objMapVec.end(); ++it) {
1116 (*it).print(myCoutStream);
1123 if (comb !=
nullptr) {
1125 <<
"): " << comb->size() << std::endl;
1141 LogDebug(
"L1GtAnalyzer") <<
"\n**** L1GtAnalyzer::analyzeL1GtTriggerMenuLite ****\n" << std::endl;
1145 std::ostringstream myCoutStream;
1154 if (!triggerMenuLite.
isValid()) {
1156 <<
"\nrequested in configuration, but not found in the event."
1157 <<
"\nExit the method.\n"
1164 myCoutStream << (*triggerMenuLite);
1168 const std::string& triggerMenuInterface = triggerMenuLite->gtTriggerMenuInterface();
1169 const std::string& triggerMenuName = triggerMenuLite->gtTriggerMenuName();
1170 const std::string& triggerMenuImplementation = triggerMenuLite->gtTriggerMenuImplementation();
1171 const std::string& scaleDbKey = triggerMenuLite->gtScaleDbKey();
1177 const std::vector<unsigned int>& triggerMaskAlgoTrig = triggerMenuLite->gtTriggerMaskAlgoTrig();
1178 const std::vector<unsigned int>& triggerMaskTechTrig = triggerMenuLite->gtTriggerMaskTechTrig();
1180 const std::vector<std::vector<int> >& prescaleFactorsAlgoTrig = triggerMenuLite->gtPrescaleFactorsAlgoTrig();
1181 const std::vector<std::vector<int> >& prescaleFactorsTechTrig = triggerMenuLite->gtPrescaleFactorsTechTrig();
1185 size_t nrDefinedAlgo = algorithmMap.size();
1186 size_t nrDefinedTech = technicalTriggerMap.size();
1190 myCoutStream <<
"\n ********** L1 Trigger Menu - printing ********** \n"
1191 <<
"\nL1 Trigger Menu Interface: " << triggerMenuInterface
1192 <<
"\nL1 Trigger Menu Name: " << triggerMenuName
1193 <<
"\nL1 Trigger Menu Implementation: " << triggerMenuImplementation
1194 <<
"\nAssociated Scale DB Key: " << scaleDbKey <<
"\n\n"
1195 <<
"\nL1 Physics Algorithms: " << nrDefinedAlgo <<
" algorithms defined."
1197 <<
"Bit Number " << std::right << std::setw(35) <<
"Algorithm Name"
1198 <<
" " << std::right << std::setw(35) <<
"Algorithm Alias"
1199 <<
" " << std::right << std::setw(12) <<
"Trigger Mask";
1200 for (
unsigned iSet = 0; iSet < prescaleFactorsAlgoTrig.size(); iSet++) {
1201 myCoutStream << std::right << std::setw(10) <<
"PF Set " << std::right << std::setw(2) << iSet;
1204 myCoutStream << std::endl;
1207 const unsigned int bitNumber = itTrig->first;
1212 if (itAlias != algorithmAliasMap.end()) {
1213 aAlias = itAlias->second;
1216 myCoutStream << std::setw(6) << bitNumber <<
" " << std::right << std::setw(35) << aName <<
" " << std::right
1217 << std::setw(35) << aAlias <<
" " << std::right << std::setw(12) << triggerMaskAlgoTrig[bitNumber];
1218 for (
unsigned iSet = 0; iSet < prescaleFactorsAlgoTrig.size(); iSet++) {
1219 myCoutStream << std::right << std::setw(12) << prescaleFactorsAlgoTrig[iSet][bitNumber];
1222 myCoutStream << std::endl;
1225 myCoutStream <<
"\nL1 Technical Triggers: " << nrDefinedTech <<
" technical triggers defined."
1228 if (nrDefinedTech) {
1229 myCoutStream << std::right << std::setw(6) <<
"Bit Number " << std::right << std::setw(45)
1230 <<
" Technical trigger name "
1231 <<
" " << std::right << std::setw(12) <<
"Trigger Mask";
1232 for (
unsigned iSet = 0; iSet < prescaleFactorsTechTrig.size(); iSet++) {
1233 myCoutStream << std::right << std::setw(10) <<
"PF Set " << std::right << std::setw(2) << iSet;
1236 myCoutStream << std::endl;
1241 unsigned int bitNumber = itTrig->first;
1244 myCoutStream << std::setw(6) << bitNumber <<
" " << std::right << std::setw(45) << aName << std::right
1245 << std::setw(12) << triggerMaskTechTrig[bitNumber];
1246 for (
unsigned iSet = 0; iSet < prescaleFactorsTechTrig.size(); iSet++) {
1247 myCoutStream << std::right << std::setw(12) << prescaleFactorsTechTrig[iSet][bitNumber];
1250 myCoutStream << std::endl;
1258 myCoutStream <<
"\nError code retrieving alias for algorithm with bit number " <<
m_bitNumber <<
": " << errorCode
1261 myCoutStream <<
"\nAlias for algorithm with bit number " <<
m_bitNumber <<
": " << (*algorithmAlias) << std::endl;
1267 myCoutStream <<
"\nError code retrieving name for algorithm with bit number " <<
m_bitNumber <<
": " << errorCode
1270 myCoutStream <<
"\nName for algorithm with bit number " <<
m_bitNumber <<
": " << (*algorithmName) << std::endl;
1276 myCoutStream <<
"\nError code retrieving name for technical trigger with bit number " <<
m_bitNumber <<
": "
1277 << errorCode << std::endl;
1279 myCoutStream <<
"\nName for technical trigger with bit number " <<
m_bitNumber <<
": " << (*techTrigName)
1284 const unsigned int bitNumber = triggerMenuLite->gtBitNumber(
m_nameAlgTechTrig, errorCode);
1286 myCoutStream <<
"\nError code retrieving bit number for algorithm/technical trigger " <<
m_nameAlgTechTrig <<
": "
1287 << errorCode << std::endl;
1289 myCoutStream <<
"\nBit number for algorithm/technical trigger " <<
m_nameAlgTechTrig <<
": " << bitNumber
1303 LogDebug(
"L1GtAnalyzer") <<
"\n**** L1GtAnalyzer::analyzeConditionsInRunBlock ****\n" << std::endl;
1307 std::ostringstream myCoutStream;
1313 if (!condInRunBlock.
isValid()) {
1315 <<
"\nrequested in configuration, but not found in the event."
1316 <<
"\nExit the method.\n"
1322 const uint16_t beamModeVal = condInRunBlock->beamMode;
1323 const uint16_t beamMomentumVal = condInRunBlock->beamMomentum;
1324 const uint32_t lhcFillNumberVal = condInRunBlock->lhcFillNumber;
1327 myCoutStream <<
"\nLHC quantities in run " << iRun.
run() <<
"\n Beam Mode = " << beamModeVal
1328 <<
"\n Beam Momentum = " << beamMomentumVal <<
" GeV"
1329 <<
"\n LHC Fill Number = " << lhcFillNumberVal << std::endl;
1335 LogDebug(
"L1GtAnalyzer") <<
"\n**** L1GtAnalyzer::analyzeConditionsInLumiBlock ****\n" << std::endl;
1339 std::ostringstream myCoutStream;
1345 if (!condInLumiBlock.
isValid()) {
1347 <<
"\nrequested in configuration, but not found in the event."
1348 <<
"\nExit the method.\n"
1354 const uint32_t totalIntensityBeam1Val = condInLumiBlock->totalIntensityBeam1;
1355 const uint32_t totalIntensityBeam2Val = condInLumiBlock->totalIntensityBeam2;
1357 myCoutStream <<
"\nLHC quantities in luminosity section "
1360 <<
"\n Total Intensity Beam 1 (Integer × 10E10 charges) = " << totalIntensityBeam1Val
1361 <<
"\n Total Intensity Beam 2 (Integer × 10E10 charges) = " << totalIntensityBeam2Val << std::endl;
1369 std::ostringstream myCoutStream;
1375 if (!condInEventBlock.
isValid()) {
1377 <<
"\nrequested in configuration, but not found in the event."
1378 <<
"\nExit the method.\n"
1384 const uint16_t bstMasterStatusVal = condInEventBlock->bstMasterStatus;
1385 const uint32_t turnCountNumberVal = condInEventBlock->turnCountNumber;
1387 myCoutStream <<
"\nLHC quantities in event " << iEvent.
id().
event() <<
" from luminosity section "
1389 <<
"\n BST Master Status = " << bstMasterStatusVal <<
"\n Turn count number = " << turnCountNumberVal
1404 LogTrace(
"L1GtAnalyzer") << myCout.str() << std::endl;
1422 <<
" defined! \n Check available values in the cfi file."
void beginRun(const edm::Run &, const edm::EventSetup &) override
Log< level::Info, true > LogVerbatim
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
const bool availableL1Configuration(int &errorCode, int &l1ConfCode) const
bool m_analyzeObjectMapEnable
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
void analyzeConditionsInEventBlock(const edm::Event &, const edm::EventSetup &)
to be used in analyze/produce/filter
void endRun(const edm::Run &, const edm::EventSetup &) override
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()
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)
Log< level::Info, false > LogInfo
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
void beginLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) override
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > m_l1GtDaqReadoutRecordToken
static const bool useL1GtTriggerMenuLite(true)
unsigned int m_l1GtUtilsConfiguration
L1 configuration code for L1GtUtils.
bool m_analyzeConditionsInLumiBlockEnable
void endLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) override
end section
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
void endJob() override
end of job
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
void analyze(const edm::Event &, const edm::EventSetup &) override
analyze each event: event loop over various code snippets
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
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