58 m_l1GtDataDaqInputTag(paramSet.getParameter<edm::InputTag>(
59 "L1GtDataDaqInputTag")),
61 m_l1GtDataEvmInputTag(paramSet.getParameter<edm::InputTag>(
62 "L1GtDataEvmInputTag")),
64 m_l1GtEmulDaqInputTag(paramSet.getParameter<edm::InputTag>(
65 "L1GtEmulDaqInputTag")),
67 m_l1GtEmulEvmInputTag(paramSet.getParameter<edm::InputTag>(
68 "L1GtEmulEvmInputTag")),
70 m_l1GctDataInputTag(paramSet.getParameter<edm::InputTag>(
71 "L1GctDataInputTag")),
73 m_dirName(paramSet.getUntrackedParameter(
"DirName", std::string(
74 "L1Trigger/L1ExtraDQM/source"))),
76 m_nrDataEventError(0),
77 m_nrEmulEventError(0),
79 m_l1GtMenuCacheID(0ULL), m_l1GtPfAlgoCacheID(0ULL),
80 m_l1GtPfTechCacheID(0ULL), m_l1GtTmAlgoCacheID(0ULL),
81 m_l1GtTmTechCacheID(0ULL),
85 m_nrEvJob(0), m_nrEvRun(0) {
88 <<
"\nInput tag for the L1 GT DAQ hardware record: "
90 <<
"\nInput tag for the L1 GT EVM hardware record: "
92 <<
"\nInput tag for the L1 GT DAQ emulator records: "
94 <<
"\nInput tag for the L1 GT EVM emulator records: "
96 <<
"\nInput tag for the L1 GCT hardware record: "
102 <<
"\n Unable to get DQMStore service.";
150 unsigned long long l1GtMenuCacheID =
167 for (
CItAlgo itAlgo = algorithmMap.begin(); itAlgo != algorithmMap.end(); itAlgo++) {
169 std::string aName = itAlgo->first;
170 const char* algName = aName.c_str();
171 int algBitNumber = (itAlgo->second).algoBitNumber();
174 for (
int iBxInEvent = 0; iBxInEvent <
TotalBxInEvent; ++iBxInEvent) {
176 algBitNumber + 1, algName, 1);
178 algBitNumber + 1, algName, 1);
180 algBitNumber + 1, algName, 1);
182 algBitNumber + 1, algName, 1);
184 algBitNumber + 1, algName, 1);
189 algBitNumber + 1, algName, 1);
191 algBitNumber + 1, algName, 1);
193 algBitNumber + 1, algName, 1);
195 algBitNumber + 1, algName, 1);
197 algBitNumber + 1, algName, 1);
202 algBitNumber + 1, algName, 1);
204 algBitNumber + 1, algName, 1);
206 algBitNumber + 1, algName, 1);
208 algBitNumber + 1, algName, 1);
219 unsigned long long l1GtPfAlgoCacheID = evSetup.
get<
234 unsigned long long l1GtPfTechCacheID = evSetup.
get<
252 unsigned long long l1GtTmAlgoCacheID = evSetup.
get<
267 unsigned long long l1GtTmTechCacheID = evSetup.
get<
287 const L1GtfeWord& gtfeBlockEmul,
const int iRec) {
290 std::string recString;
297 if (gtfeBlockData == gtfeBlockEmul) {
299 <<
" Data and emulated GTFE blocks: identical.\n";
303 <<
" Data and emulated GTFE blocks: different.\n";
319 const boost::uint16_t boardIdData = gtfeBlockData.
boardId();
320 const boost::uint16_t boardIdEmul = gtfeBlockEmul.
boardId();
322 if (boardIdData == boardIdEmul) {
324 <<
" Data and emulated GTFE boardId identical.";
325 m_myCoutStream <<
"\n boardId() = " << std::hex <<
"0x" << std::setw(4)
326 << std::setfill(
'0') << boardIdData << std::setfill(
' ')
332 <<
" Data and emulated GTFE boardId different.";
334 << std::setw(4) << std::setfill(
'0') << boardIdData
335 << std::setfill(
' ') << std::dec;
337 << std::setw(4) << std::setfill(
'0') << boardIdEmul
338 << std::setfill(
' ') << std::dec;
345 const boost::uint16_t recordLength1Data = gtfeBlockData.
recordLength1();
346 const boost::uint16_t recordLength1Emul = gtfeBlockEmul.
recordLength1();
348 if (recordLength1Data == recordLength1Emul) {
350 <<
" Data and emulated GTFE recordLength for alternative 1 identical.";
356 <<
" Data and emulated GTFE recordLength for alternative 1 different.";
357 m_myCoutStream <<
"\n Data: recordLength1() = " << recordLength1Data;
358 m_myCoutStream <<
"\n Emul: recordLength1() = " << recordLength1Emul;
365 const boost::uint16_t recordLengthData = gtfeBlockData.
recordLength();
366 const boost::uint16_t recordLengthEmul = gtfeBlockEmul.
recordLength();
368 if (recordLengthData == recordLengthEmul) {
370 <<
" Data and emulated GTFE recordLength for alternative 0 identical.";
376 <<
" Data and emulated GTFE recordLength for alternative 1 different.";
377 m_myCoutStream <<
"\n Data: recordLength() = " << recordLengthData;
378 m_myCoutStream <<
"\n Emul: recordLength() = " << recordLengthEmul;
385 const boost::uint16_t bxNrData = gtfeBlockData.
bxNr();
386 const boost::uint16_t bxNrEmul = gtfeBlockEmul.
bxNr();
388 if (bxNrData == bxNrEmul) {
390 <<
" Data and emulated GTFE bxNr identical.";
396 <<
" Data and emulated GTFE bxNr different.";
405 const boost::uint32_t setupVersionData = gtfeBlockData.
setupVersion();
406 const boost::uint32_t setupVersionEmul = gtfeBlockEmul.
setupVersion();
408 if (setupVersionData == setupVersionEmul) {
410 <<
" Data and emulated GTFE setupVersion identical.";
416 <<
" Data and emulated GTFE setupVersion different.";
417 m_myCoutStream <<
"\n Data: setupVersion() = " << setupVersionData;
418 m_myCoutStream <<
"\n Emul: setupVersion() = " << setupVersionEmul;
425 const boost::uint16_t activeBoardsData = gtfeBlockData.
activeBoards();
426 const boost::uint16_t activeBoardsEmul = gtfeBlockEmul.
activeBoards();
428 if (activeBoardsData == activeBoardsEmul) {
430 <<
" Data and emulated GTFE activeBoards identical.";
432 << std::setw(4) << std::setfill(
'0') << activeBoardsData
433 << std::setfill(
' ') << std::dec;
438 <<
" Data and emulated GTFE activeBoards different.";
439 m_myCoutStream <<
"\n Data: activeBoards() = " << std::hex <<
"0x"
440 << std::setw(4) << std::setfill(
'0') << activeBoardsData
441 << std::setfill(
' ') << std::dec;
442 m_myCoutStream <<
"\n Emul: activeBoards() = " << std::hex <<
"0x"
443 << std::setw(4) << std::setfill(
'0') << activeBoardsEmul
444 << std::setfill(
' ') << std::dec;
453 const boost::uint16_t altNrBxBoardData = gtfeBlockData.
altNrBxBoard();
454 const boost::uint16_t altNrBxBoardEmul = gtfeBlockEmul.
altNrBxBoard();
456 if (altNrBxBoardData == altNrBxBoardEmul) {
458 <<
" Data and emulated GTFE altNrBxBoard identical.";
464 <<
" Data and emulated GTFE altNrBxBoard different.";
465 m_myCoutStream <<
"\n Data: altNrBxBoard() = " << altNrBxBoardData;
466 m_myCoutStream <<
"\n Emul: altNrBxBoard() = " << altNrBxBoardEmul;
473 const boost::uint32_t totalTriggerNrData = gtfeBlockData.
totalTriggerNr();
474 const boost::uint32_t totalTriggerNrEmul = gtfeBlockEmul.
totalTriggerNr();
476 if (totalTriggerNrData == totalTriggerNrEmul) {
478 <<
" Data and emulated GTFE totalTriggerNr identical.";
484 <<
" Data and emulated GTFE totalTriggerNr different.";
485 m_myCoutStream <<
"\n Data: totalTriggerNr() = " << totalTriggerNrData;
486 m_myCoutStream <<
"\n Emul: totalTriggerNr() = " << totalTriggerNrEmul;
504 int PhysicsPartition = 0;
507 std::string recString;
514 if (fdlBlockData == fdlBlockEmul) {
516 <<
" Data and emulated FDL blocks: identical.\n";
521 <<
" Data and emulated FDL blocks: different.\n";
538 const int bxInEventData = fdlBlockData.
bxInEvent();
539 const int bxInEventEmul = fdlBlockEmul.
bxInEvent();
541 bool matchBxInEvent =
false;
543 if (bxInEventData == bxInEventEmul) {
545 <<
" Data and emulated FDL bxInEvent identical.";
548 matchBxInEvent =
true;
552 <<
" Data and emulated FDL bxInEvent different.";
565 bool validBxInEvent =
false;
567 LogDebug(
"L1GtHwValidation") <<
"\n Convert bxInEvent = " << bxInEventData
568 <<
" to histIndex = " << histIndex << std::endl;
570 validBxInEvent =
true;
576 const boost::uint16_t boardIdData = fdlBlockData.
boardId();
577 const boost::uint16_t boardIdEmul = fdlBlockEmul.
boardId();
579 if (boardIdData == boardIdEmul) {
581 <<
" Data and emulated FDL boardId identical.";
582 m_myCoutStream <<
"\n boardId() = " << std::hex <<
"0x" << std::setw(4)
583 << std::setfill(
'0') << boardIdData << std::setfill(
' ')
589 <<
" Data and emulated FDL boardId different.";
591 << std::setw(4) << std::setfill(
'0') << boardIdData
592 << std::setfill(
' ') << std::dec;
594 << std::setw(4) << std::setfill(
'0') << boardIdEmul
595 << std::setfill(
' ') << std::dec;
598 if (matchBxInEvent && validBxInEvent) {
611 const boost::uint16_t bxNrData = fdlBlockData.
bxNr();
612 const boost::uint16_t bxNrEmul = fdlBlockEmul.
bxNr();
614 if (bxNrData == bxNrEmul) {
616 <<
" Data and emulated FDL bxNr identical.";
622 <<
" Data and emulated FDL bxNr different.";
627 if (matchBxInEvent && validBxInEvent) {
639 const boost::uint32_t eventNrData = fdlBlockData.
eventNr();
640 const boost::uint32_t eventNrEmul = fdlBlockEmul.
eventNr();
642 if (eventNrData == eventNrEmul) {
644 <<
" Data and emulated FDL eventNr identical.";
650 <<
" Data and emulated FDL eventNr different.";
655 if (matchBxInEvent && validBxInEvent) {
673 int nTechBits = gtTechnicalTriggerWordData.size();
678 unsigned int bitValue = 0;
680 if (matchBxInEvent && validBxInEvent) {
681 for (
int iBit = 0; iBit < nTechBits; ++iBit) {
684 << PhysicsPartition);
686 if (gtTechnicalTriggerWordData[iBit]) {
689 bitValue = (triggerMask) ? 0 : 1;
690 gtTechnicalTriggerWordDataMask[iBit] = bitValue;
696 if (gtTechnicalTriggerWordEmul.at(iBit)) {
699 bitValue = (triggerMask) ? 0 : 1;
700 gtTechnicalTriggerWordEmulMask[iBit] = bitValue;
707 for (
int iBit = 0; iBit < nTechBits; ++iBit) {
709 if (gtTechnicalTriggerWordData[iBit]) {
713 if (gtTechnicalTriggerWordEmul.at(iBit)) {
719 if (gtTechnicalTriggerWordData == gtTechnicalTriggerWordEmul) {
721 <<
" Data and emulated FDL gtTechnicalTriggerWord identical.\n";
727 <<
" Data and emulated FDL gtTechnicalTriggerWord different.";
734 if (matchBxInEvent && validBxInEvent) {
740 if (matchBxInEvent && validBxInEvent) {
741 for (
int iBit = 0; iBit < nTechBits; ++iBit) {
742 if (gtTechnicalTriggerWordData[iBit]
743 != gtTechnicalTriggerWordEmul.at(iBit)) {
748 for (
int iBit = 0; iBit < nTechBits; ++iBit) {
749 if (gtTechnicalTriggerWordData[iBit]
750 != gtTechnicalTriggerWordEmul.at(iBit)) {
761 if (gtTechnicalTriggerWordDataMask == gtTechnicalTriggerWordEmulMask) {
763 <<
" Data and emulated FDL gtTechnicalTriggerWord after mask identical.\n";
768 <<
" Data and emulated FDL gtTechnicalTriggerWord after mask different.";
773 if (matchBxInEvent && validBxInEvent) {
779 if (matchBxInEvent && validBxInEvent) {
780 for (
int iBit = 0; iBit < nTechBits; ++iBit) {
781 if (gtTechnicalTriggerWordData[iBit]
782 != gtTechnicalTriggerWordEmul.at(iBit)) {
797 int nAlgoBits = gtDecisionWordData.size();
804 const std::vector<int>& prescaleFactorsAlgoTrig =
805 (*m_prescaleFactorsAlgoTrig).at(iPfSet);
808 if (matchBxInEvent && validBxInEvent) {
810 for (
int iBit = 0; iBit < nAlgoBits; ++iBit) {
813 << PhysicsPartition);
817 LogTrace(
"L1GtHwValidation") <<
"Bit " << iBit
818 <<
": prescale factor = " << prescaleFactor
819 <<
" trigger mask = " << triggerMask << std::endl;
821 if (gtDecisionWordData[iBit]) {
824 if (prescaleFactor == 1) {
831 bitValue = (triggerMask) ? 0 : 1;
832 gtDecisionWordDataMask[iBit] = bitValue;
838 if (gtDecisionWordEmul.at(iBit)) {
841 bitValue = (triggerMask) ? 0 : 1;
842 gtDecisionWordEmulMask[iBit] = bitValue;
849 for (
int iBit = 0; iBit < nAlgoBits; ++iBit) {
850 if (gtDecisionWordData[iBit]) {
855 for (
int iBit = 0; iBit < nAlgoBits; ++iBit) {
856 if (gtDecisionWordEmul.at(iBit)) {
862 if (gtDecisionWordData == gtDecisionWordEmul) {
864 <<
" Data and emulated FDL gtDecisionWord identical.";
870 <<
" Data and emulated FDL gtDecisionWord different.";
877 if (matchBxInEvent && validBxInEvent) {
883 if (matchBxInEvent && validBxInEvent) {
884 for (
int iBit = 0; iBit < nAlgoBits; ++iBit) {
888 if (gtDecisionWordData[iBit] != gtDecisionWordEmul.at(iBit)) {
892 if (prescaleFactor == 1) {
900 if (gtDecisionWordData[iBit]) {
904 if (prescaleFactor == 1) {
916 if (prescaleFactor == 1) {
927 for (
int iBit = 0; iBit < nAlgoBits; ++iBit) {
928 if (gtDecisionWordData[iBit] != gtDecisionWordEmul.at(iBit)) {
936 if (gtDecisionWordDataMask == gtDecisionWordEmulMask) {
938 <<
" Data and emulated FDL gtDecisionWord after mask identical.";
943 <<
" Data and emulated FDL gtDecisionWord after mask different.";
948 if (matchBxInEvent && validBxInEvent) {
954 if (matchBxInEvent && validBxInEvent) {
955 for (
int iBit = 0; iBit < nAlgoBits; ++iBit) {
956 if (gtDecisionWordDataMask[iBit] != gtDecisionWordEmulMask.at(
971 if (gtDecisionWordExtendedData == gtDecisionWordExtendedEmul) {
973 <<
" Data and emulated FDL gtDecisionWordExtended identical.\n";
979 <<
" Data and emulated FDL gtDecisionWordExtended different.\n";
986 if (matchBxInEvent && validBxInEvent) {
995 const boost::uint16_t noAlgoData = fdlBlockData.
noAlgo();
996 const boost::uint16_t noAlgoEmul = fdlBlockEmul.
noAlgo();
998 if (noAlgoData == noAlgoEmul) {
1000 <<
" Data and emulated FDL noAlgo identical.";
1006 <<
" Data and emulated FDL noAlgo different.";
1011 if (matchBxInEvent && validBxInEvent) {
1020 const boost::uint16_t finalORData = fdlBlockData.
finalOR();
1021 const boost::uint16_t finalOREmul = fdlBlockEmul.
finalOR();
1023 if (finalORData == finalOREmul) {
1025 <<
" Data and emulated FDL finalOR identical.";
1026 m_myCoutStream <<
"\n finalOR() = " << std::hex <<
"0x" << std::setw(2)
1027 << std::setfill(
'0') << finalORData << std::setfill(
' ')
1033 <<
" Data and emulated FDL finalOR different.";
1035 << std::setw(2) << std::setfill(
'0') << finalORData
1036 << std::setfill(
' ') << std::dec;
1038 << std::setw(2) << std::setfill(
'0') << finalOREmul
1039 << std::setfill(
' ') << std::dec;
1042 if (matchBxInEvent && validBxInEvent) {
1051 const int finalORPhysData = finalORData & (1 << PhysicsPartition);
1052 const int finalORPhysEmul = finalOREmul & (1 << PhysicsPartition);
1054 if (finalORPhysData == finalORPhysEmul) {
1056 <<
" Data and emulated FDL finalOR for the physics partition identical.";
1062 <<
" Data and emulated FDL finalOR for the physics partition different.";
1067 if (matchBxInEvent && validBxInEvent) {
1076 const boost::uint16_t localBxNrData = fdlBlockData.
localBxNr();
1077 const boost::uint16_t localBxNrEmul = fdlBlockEmul.
localBxNr();
1079 if (localBxNrData == localBxNrEmul) {
1081 <<
" Data and emulated FDL localBxNr identical.";
1087 <<
" Data and emulated FDL localBxNr different.";
1092 if (matchBxInEvent && validBxInEvent) {
1111 if (psbBlockData == psbBlockEmul) {
1112 m_myCoutStream <<
"\nData and emulated PSB blocks: identical.\n";
1116 m_myCoutStream <<
"\nData and emulated PSB blocks: different.\n";
1132 const boost::uint16_t boardIdData = psbBlockData.
boardId();
1133 const boost::uint16_t boardIdEmul = psbBlockEmul.
boardId();
1135 if (boardIdData == boardIdEmul) {
1137 m_myCoutStream <<
"\n boardId() = " << std::hex <<
"0x" << std::setw(4)
1138 << std::setfill(
'0') << boardIdData << std::setfill(
' ')
1145 << std::setw(4) << std::setfill(
'0') << boardIdData
1146 << std::setfill(
' ') << std::dec;
1148 << std::setw(4) << std::setfill(
'0') << boardIdEmul
1149 << std::setfill(
' ') << std::dec;
1155 const int bxInEventData = psbBlockData.
bxInEvent();
1156 const int bxInEventEmul = psbBlockEmul.
bxInEvent();
1158 if (bxInEventData == bxInEventEmul) {
1159 m_myCoutStream <<
"\nData and emulated PSB bxInEvent identical.";
1164 m_myCoutStream <<
"\nData and emulated PSB bxInEvent different.";
1172 const boost::uint16_t bxNrData = psbBlockData.
bxNr();
1173 const boost::uint16_t bxNrEmul = psbBlockEmul.
bxNr();
1175 if (bxNrData == bxNrEmul) {
1189 const boost::uint32_t eventNrData = psbBlockData.
eventNr();
1190 const boost::uint32_t eventNrEmul = psbBlockEmul.
eventNr();
1192 if (eventNrData == eventNrEmul) {
1206 boost::uint16_t valData;
1207 boost::uint16_t valEmul;
1209 for (
int iA = 0; iA < psbBlockData.
NumberAData; ++iA) {
1210 valData = psbBlockData.
aData(iA);
1211 valEmul = psbBlockEmul.
aData(iA);
1213 if (valData == valEmul) {
1217 << std::setw(4) << std::setfill(
'0') << valData
1218 << std::setfill(
' ') << std::dec;
1225 << std::setw(4) << std::setfill(
'0') << valData
1226 << std::setfill(
' ') << std::dec;
1228 << std::setw(4) << std::setfill(
'0') << valEmul
1229 << std::setfill(
' ') << std::dec;
1237 for (
int iB = 0; iB < psbBlockData.
NumberBData; ++iB) {
1238 valData = psbBlockData.
bData(iB);
1239 valEmul = psbBlockEmul.
bData(iB);
1241 if (valData == valEmul) {
1245 << std::setw(4) << std::setfill(
'0') << valData
1246 << std::setfill(
' ') << std::dec;
1253 << std::setw(4) << std::setfill(
'0') << valData
1254 << std::setfill(
' ') << std::dec;
1256 << std::setw(4) << std::setfill(
'0') << valEmul
1257 << std::setfill(
' ') << std::dec;
1265 const boost::uint16_t localBxNrData = psbBlockData.
localBxNr();
1266 const boost::uint16_t localBxNrEmul = psbBlockEmul.
localBxNr();
1268 if (localBxNrData == localBxNrEmul) {
1269 m_myCoutStream <<
"\nData and emulated PSB localBxNr identical.";
1274 m_myCoutStream <<
"\nData and emulated PSB localBxNr different.";
1304 bool validData =
false;
1306 if (!gtReadoutRecordData.
isValid()) {
1316 bool validEmul =
false;
1318 if (!gtReadoutRecordEmul.
isValid()) {
1324 if ((!validData) || (!validEmul)) {
1326 <<
"\n No valid product found: DAQ L1GlobalTriggerReadoutRecord"
1327 <<
"\n Data validity [1 = true; 0 = false]: " << validData
1328 <<
"\n Emulator validity: [1 = true; 0 = false]: "
1329 << validEmul <<
"\n DAQ histograms will not be filled.\n"
1336 const L1GtfeWord& gtfeBlockData = gtReadoutRecordData->gtfeWord();
1337 const L1GtfeWord& gtfeBlockEmul = gtReadoutRecordEmul->gtfeWord();
1339 compareGTFE(iEvent, evSetup, gtfeBlockData, gtfeBlockEmul, iRec);
1342 const std::vector<L1GtFdlWord>& gtFdlVectorData =
1343 gtReadoutRecordData->gtFdlVector();
1344 const std::vector<L1GtFdlWord>& gtFdlVectorEmul =
1345 gtReadoutRecordEmul->gtFdlVector();
1347 int gtFdlVectorDataSize = gtFdlVectorData.size();
1348 int gtFdlVectorEmulSize = gtFdlVectorEmul.size();
1350 if (gtFdlVectorDataSize == gtFdlVectorEmulSize) {
1351 m_myCoutStream <<
"\nData and emulated FDL vector size: identical.\n";
1354 for (
int iFdl = 0; iFdl < gtFdlVectorDataSize; ++iFdl) {
1356 const L1GtFdlWord& fdlBlockData = gtFdlVectorData[iFdl];
1357 const L1GtFdlWord& fdlBlockEmul = gtFdlVectorEmul[iFdl];
1359 compareFDL(iEvent, evSetup, fdlBlockData, fdlBlockEmul, iRec);
1362 m_myCoutStream <<
"\nData and emulated FDL vector size: different.\n";
1363 m_myCoutStream <<
" Data: size = " << gtFdlVectorDataSize << std::endl;
1364 m_myCoutStream <<
" Emul: size = " << gtFdlVectorEmulSize << std::endl;
1374 const std::vector<L1GtPsbWord>& gtPsbVectorData =
1375 gtReadoutRecordData->gtPsbVector();
1376 const std::vector<L1GtPsbWord>& gtPsbVectorEmul =
1377 gtReadoutRecordEmul->gtPsbVector();
1379 int gtPsbVectorDataSize = gtPsbVectorData.size();
1380 int gtPsbVectorEmulSize = gtPsbVectorEmul.size();
1382 if (gtPsbVectorDataSize == gtPsbVectorEmulSize) {
1383 m_myCoutStream <<
"\nData and emulated PSB vector size: identical.\n";
1386 m_myCoutStream <<
"\nData and emulated PSB vector size: different.\n";
1387 m_myCoutStream <<
" Data: size = " << gtPsbVectorDataSize << std::endl;
1388 m_myCoutStream <<
" Emul: size = " << gtPsbVectorEmulSize << std::endl;
1395 for (
int iPsb = 0; iPsb < gtPsbVectorDataSize; ++iPsb) {
1397 const L1GtPsbWord& psbBlockData = gtPsbVectorData[iPsb];
1398 const boost::uint16_t boardIdData = psbBlockData.
boardId();
1399 const int bxInEventData = psbBlockData.
bxInEvent();
1404 bool foundPSB =
false;
1406 for (
int iPsbF = 0; iPsbF < gtPsbVectorEmulSize; ++iPsbF) {
1408 const L1GtPsbWord& psbBlockEmul = gtPsbVectorEmul[iPsbF];
1409 const boost::uint16_t boardIdEmul = psbBlockEmul.
boardId();
1410 const int bxInEventEmul = psbBlockEmul.
bxInEvent();
1412 if ((boardIdEmul == boardIdData)
1413 && (bxInEventData == bxInEventEmul)) {
1418 comparePSB(iEvent, evSetup, psbBlockData, psbBlockEmul);
1424 m_myCoutStream <<
"\nNo emulated PSB with boardId() = " << std::hex
1425 <<
"0x" << std::setw(4) << std::setfill(
'0') << boardIdData
1426 << std::setfill(
' ') << std::dec <<
" and BxInEvent = "
1427 << bxInEventData <<
" was found";
1451 bool validData =
false;
1453 if (!gtReadoutRecordData.
isValid()) {
1463 bool validEmul =
false;
1465 if (!gtReadoutRecordEmul.
isValid()) {
1471 if ((!validData) || (!validEmul)) {
1473 <<
"\n No valid product found: EVM L1GlobalTriggerEvmReadoutRecord"
1474 <<
"\n Data validity [1 = true; 0 = false]: " << validData
1475 <<
"\n Emulator validity: [1 = true; 0 = false]: "
1476 << validEmul <<
"\n EVM histograms will not be filled.\n"
1483 const L1GtfeWord& gtfeBlockData = gtReadoutRecordData->gtfeWord();
1484 const L1GtfeWord& gtfeBlockEmul = gtReadoutRecordEmul->gtfeWord();
1486 compareGTFE(iEvent, evSetup, gtfeBlockData, gtfeBlockEmul, iRec);
1489 const std::vector<L1GtFdlWord>& gtFdlVectorData =
1490 gtReadoutRecordData->gtFdlVector();
1491 const std::vector<L1GtFdlWord>& gtFdlVectorEmul =
1492 gtReadoutRecordEmul->gtFdlVector();
1494 int gtFdlVectorDataSize = gtFdlVectorData.size();
1495 int gtFdlVectorEmulSize = gtFdlVectorEmul.size();
1497 if (gtFdlVectorDataSize == gtFdlVectorEmulSize) {
1498 m_myCoutStream <<
"\nData and emulated FDL vector size: identical.\n";
1501 for (
int iFdl = 0; iFdl < gtFdlVectorDataSize; ++iFdl) {
1503 const L1GtFdlWord& fdlBlockData = gtFdlVectorData[iFdl];
1504 const L1GtFdlWord& fdlBlockEmul = gtFdlVectorEmul[iFdl];
1506 compareFDL(iEvent, evSetup, fdlBlockData, fdlBlockEmul, iRec);
1509 m_myCoutStream <<
"\nData and emulated FDL vector size: different.\n";
1510 m_myCoutStream <<
" Data: size = " << gtFdlVectorDataSize << std::endl;
1511 m_myCoutStream <<
" Emul: size = " << gtFdlVectorEmulSize << std::endl;
1561 const unsigned int numberTechTriggers =
1564 const unsigned int numberAlgoTriggers =
1569 std::string recString;
1577 const char* histName;
1579 hName = recString +
"gtfeDataEmul";
1580 histName = hName.c_str();
1584 "GTFE data vs emul mismatch", 8, 0., 7.);
1599 int iIndex = iHist - ((TotalBxInEvent + 1) / 2 - 1);
1600 int hIndex = (iIndex + 16) % 16;
1602 std::stringstream ss;
1604 ss << std::uppercase << std::hex << hIndex;
1607 hName = recString +
"FdlDataEmul_" + str;
1608 histName = hName.c_str();
1610 std::string hTitle =
"FDL data vs emul mismatch for BxInEvent = "
1612 const char* histTitle = hTitle.c_str();
1634 hName = recString +
"Data_AlgoDecision_" + str;
1635 histName = hName.c_str();
1637 hTitle =
"Data: algorithm decision word for BxInEvent = " + str;
1638 histTitle = hTitle.c_str();
1641 histTitle, numberAlgoTriggers, 0., numberAlgoTriggers);
1644 hName = recString +
"Emul_AlgoDecision_" + str;
1645 histName = hName.c_str();
1647 hTitle =
"Emul: algorithm decision word for BxInEvent = " + str;
1648 histTitle = hTitle.c_str();
1651 histTitle, numberAlgoTriggers, 0., numberAlgoTriggers);
1655 hName = recString +
"Data_AlgoDecision_Prescaled_" + str;
1656 histName = hName.c_str();
1659 =
"Data: prescaled algorithms: algorithm decision for BxInEvent = "
1661 histTitle = hTitle.c_str();
1664 histName, histTitle, numberAlgoTriggers, 0.,
1665 numberAlgoTriggers);
1668 hName = recString +
"Emul_AlgoDecision_Prescaled_" + str;
1669 histName = hName.c_str();
1672 =
"Emul: prescaled algorithms: algorithm decision for BxInEvent = "
1674 histTitle = hTitle.c_str();
1677 histName, histTitle, numberAlgoTriggers, 0.,
1678 numberAlgoTriggers);
1682 hName = recString +
"Data_AlgoDecision_Unprescaled_" + str;
1683 histName = hName.c_str();
1686 =
"Data: unprescaled algorithms: algorithm decision for BxInEvent = "
1688 histTitle = hTitle.c_str();
1691 histName, histTitle, numberAlgoTriggers, 0.,
1692 numberAlgoTriggers);
1695 hName = recString +
"Emul_AlgoDecision_Unprescaled_" + str;
1696 histName = hName.c_str();
1699 =
"Emul: unprescaled algorithms: algorithm decision for BxInEvent = "
1701 histTitle = hTitle.c_str();
1704 histName, histTitle, numberAlgoTriggers, 0.,
1705 numberAlgoTriggers);
1709 hName = recString +
"Data_AlgoDecisionAfterMask_" + str;
1710 histName = hName.c_str();
1713 =
"Data, physics partition: algorithm decision word after mask for BxInEvent = "
1715 histTitle = hTitle.c_str();
1718 histTitle, numberAlgoTriggers, 0., numberAlgoTriggers);
1721 hName = recString +
"Emul_AlgoDecisionAfterMask_" + str;
1722 histName = hName.c_str();
1725 =
"Emul, physics partition: algorithm decision word after mask for BxInEvent = "
1727 histTitle = hTitle.c_str();
1730 histTitle, numberAlgoTriggers, 0., numberAlgoTriggers);
1733 hName = recString +
"DataEmul_AlgoDecision_" + str;
1734 histName = hName.c_str();
1737 =
"Data vs emul: non-matching algorithm decision word for BxInEvent = "
1739 histTitle = hTitle.c_str();
1742 histTitle, numberAlgoTriggers, 0., numberAlgoTriggers);
1745 hName = recString +
"DataEmul_AlgoDecision_Prescaled_" + str;
1746 histName = hName.c_str();
1749 =
"Data vs emul: prescaled algorithms with non-matching decision for BxInEvent = "
1751 histTitle = hTitle.c_str();
1754 histName, histTitle, numberAlgoTriggers, 0.,
1755 numberAlgoTriggers);
1758 hName = recString +
"DataEmul_AlgoDecision_Unprescaled_" + str;
1759 histName = hName.c_str();
1762 =
"Data vs emul: unprescaled algorithms with non-matching decision for BxInEvent = "
1764 histTitle = hTitle.c_str();
1767 histName, histTitle, numberAlgoTriggers, 0.,
1768 numberAlgoTriggers);
1771 hName = recString +
"Data_AlgoDecision_NoMatch_" + str;
1772 histName = hName.c_str();
1775 =
"Data: algorithm decision for non-matching cases for BxInEvent = "
1777 histTitle = hTitle.c_str();
1780 histName, histTitle, numberAlgoTriggers, 0.,
1781 numberAlgoTriggers);
1784 hName = recString +
"Emul_AlgoDecision_NoMatch_" + str;
1785 histName = hName.c_str();
1788 =
"Emul: algorithm decision for non-matching cases for BxInEvent = "
1790 histTitle = hTitle.c_str();
1793 histName, histTitle, numberAlgoTriggers, 0.,
1794 numberAlgoTriggers);
1797 hName = recString +
"Data_AlgoDecision_Prescaled_NoMatch_" + str;
1798 histName = hName.c_str();
1801 =
"Data: prescaled algorithms: non-matching algorithm decision for BxInEvent = "
1803 histTitle = hTitle.c_str();
1806 =
m_dbe->
book1D(histName, histTitle, numberAlgoTriggers,
1807 0., numberAlgoTriggers);
1810 hName = recString +
"Emul_AlgoDecision_Prescaled_NoMatch_" + str;
1811 histName = hName.c_str();
1814 =
"Emul: prescaled algorithms: non-matching algorithm decision for BxInEvent = "
1816 histTitle = hTitle.c_str();
1819 =
m_dbe->
book1D(histName, histTitle, numberAlgoTriggers,
1820 0., numberAlgoTriggers);
1824 hName = recString +
"Data_AlgoDecision_Unprescaled_NoMatch_" + str;
1825 histName = hName.c_str();
1828 =
"Data: unprescaled algorithms: non-matching algorithm decision for BxInEvent = "
1830 histTitle = hTitle.c_str();
1833 =
m_dbe->
book1D(histName, histTitle, numberAlgoTriggers,
1834 0., numberAlgoTriggers);
1837 hName = recString +
"Emul_AlgoDecision_Unprescaled_NoMatch_" + str;
1838 histName = hName.c_str();
1841 =
"Emul: unprescaled algorithms: non-matching algorithm decision for BxInEvent = "
1843 histTitle = hTitle.c_str();
1846 =
m_dbe->
book1D(histName, histTitle, numberAlgoTriggers,
1847 0., numberAlgoTriggers);
1851 hName = recString +
"DataEmul_AlgoDecisionAfterMask_" + str;
1852 histName = hName.c_str();
1855 =
"Data vs emul, physics partition: non-matching algorithm decision word after mask for BxInEvent = "
1857 histTitle = hTitle.c_str();
1860 histName, histTitle, numberAlgoTriggers, 0.,
1861 numberAlgoTriggers);
1865 hName = recString +
"Data_TechDecision_" + str;
1866 histName = hName.c_str();
1868 hTitle =
"Data technical trigger decision word for BxInEvent = "
1870 histTitle = hTitle.c_str();
1873 histTitle, numberTechTriggers, 0., numberTechTriggers);
1876 hName = recString +
"Emul_TechDecision_" + str;
1877 histName = hName.c_str();
1879 hTitle =
"Emul: technical trigger decision word for BxInEvent = "
1881 histTitle = hTitle.c_str();
1884 histTitle, numberTechTriggers, 0., numberTechTriggers);
1887 hName = recString +
"Data_TechDecisionAfterMask_" + str;
1888 histName = hName.c_str();
1891 =
"Data technical trigger decision word after mask for BxInEvent = "
1893 histTitle = hTitle.c_str();
1896 histTitle, numberTechTriggers, 0., numberTechTriggers);
1899 hName = recString +
"Emul_TechDecisionAfterMask_" + str;
1900 histName = hName.c_str();
1903 =
"Emul: technical trigger decision word after mask for BxInEvent = "
1905 histTitle = hTitle.c_str();
1908 histTitle, numberTechTriggers, 0., numberTechTriggers);
1911 hName = recString +
"DataEmul_TechDecision_" + str;
1912 histName = hName.c_str();
1915 =
"Data vs emul: non-matching technical trigger decision word for BxInEvent = "
1917 histTitle = hTitle.c_str();
1920 histTitle, numberTechTriggers, 0., numberTechTriggers);
1922 hName = recString +
"DataEmul_TechDecisionAfterMask_" + str;
1923 histName = hName.c_str();
1926 =
"Data vs emul: non-matching technical trigger decision word after mask for BxInEvent = "
1928 histTitle = hTitle.c_str();
1931 histName, histTitle, numberTechTriggers, 0.,
1932 numberTechTriggers);
1936 hName = recString +
"FdlDataEmul_Err";
1937 histName = hName.c_str();
1942 "FDL data vs emul mismatch for non-matching BxInEvent in FDL payload",
1958 hName = recString +
"FdlDataAlgoDecision_Err";
1959 histName = hName.c_str();
1964 "Data: algorithm trigger decision word, non-matching BxInEvent",
1965 numberAlgoTriggers, 0., numberAlgoTriggers);
1968 hName = recString +
"Emul_AlgoDecision_Err";
1969 histName = hName.c_str();
1974 "Emul: algorithm trigger decision word, non-matching BxInEvent",
1975 numberAlgoTriggers, 0., numberAlgoTriggers);
1977 hName = recString +
"DataEmul_AlgoDecision_Err";
1978 histName = hName.c_str();
1983 "Data vs emul: algorithm trigger decision word, non-matching BxInEvent",
1984 numberAlgoTriggers, 0., numberAlgoTriggers);
1987 hName = recString +
"Data_TechDecision_Err";
1988 histName = hName.c_str();
1993 "Data: technical trigger decision word, non-matching BxInEvent",
1994 numberTechTriggers, 0., numberTechTriggers);
1996 hName = recString +
"Emul_TechDecision_Err";
1997 histName = hName.c_str();
2002 "Emul: technical trigger decision word, non-matching BxInEvent",
2003 numberTechTriggers, 0., numberTechTriggers);
2005 hName = recString +
"DataEmul_TechDecision_Err";
2006 histName = hName.c_str();
2011 "Data vs emul: technical trigger decision word, non-matching BxInEvent",
2012 numberTechTriggers, 0., numberTechTriggers);
2020 LogDebug(
"L1GtHwValidation") <<
"\n\n endRun: " << run.
id()
2021 <<
"\n Number of events analyzed in this run: " <<
m_nrEvRun
2022 <<
"\n Total number of events analyzed in this job: " <<
m_nrEvJob
2023 <<
"\n" << std::endl;
2031 <<
"\n\nTotal number of events analyzed in this job: " <<
m_nrEvJob
2032 <<
"\n" << std::endl;
MonitorElement * m_fdlDataEmulAlgoDecision[TotalBxInEvent][NumberOfGtRecords]
const boost::uint16_t noAlgo() const
get/set NoAlgo
T getUntrackedParameter(std::string const &, T const &) const
const TechnicalTriggerWord & gtTechnicalTriggerWord() const
get/set technical trigger bits
const boost::uint16_t gtPrescaleFactorIndexAlgo() const
MonitorElement * m_fdlEmulAlgoDecisionUnprescaled_NoMatch[TotalBxInEvent][NumberOfGtRecords]
const boost::uint16_t bxNr() const
get/set bunch cross number of the actual bx
const L1GtTriggerMask * m_l1GtTmTech
const boost::uint16_t localBxNr() const
get/set local bunch cross number of the actual bx
MonitorElement * m_fdlDataAlgoDecision_Err[NumberOfGtRecords]
virtual void compareGTFE(const edm::Event &, const edm::EventSetup &, const L1GtfeWord &, const L1GtfeWord &, const int)
compare the GTFE board
virtual void analyze(const edm::Event &, const edm::EventSetup &)
const boost::uint32_t eventNr() const
get/set event number since last L1 reset generated in FDL
virtual void comparePSB(const edm::Event &, const edm::EventSetup &, const L1GtPsbWord &, const L1GtPsbWord &)
compare the PSB board
const boost::uint16_t boardId() const
get/set board ID
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
virtual void print(std::ostream &myCout) const
pretty print the content of a L1GtfeWord
void rmdir(const std::string &fullpath)
const std::vector< std::vector< int > > * m_prescaleFactorsAlgoTrig
#define DEFINE_FWK_MODULE(type)
const boost::uint16_t recordLength() const
get/set record length for alternative 0
static const unsigned int NumberTechnicalTriggers
MonitorElement * m_fdlEmulTechDecision[TotalBxInEvent][NumberOfGtRecords]
const boost::uint16_t bxNr() const
get/set bunch cross number as counted in the GTFE board
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * m_fdlDataEmulAlgoDecisionPrescaled[TotalBxInEvent][NumberOfGtRecords]
const boost::uint32_t totalTriggerNr() const
get/set total number of L1A sent since start of run
void bookHistograms()
book all histograms for the module
edm::InputTag m_l1GtEmulEvmInputTag
input tag for the L1 GT emulator EVM record
MonitorElement * m_fdlEmulAlgoDecisionMask[TotalBxInEvent][NumberOfGtRecords]
const boost::uint32_t setupVersion() const
get/set setup version
MonitorElement * m_fdlDataAlgoDecisionUnprescaled[TotalBxInEvent][NumberOfGtRecords]
unsigned long long m_l1GtMenuCacheID
const L1GtPrescaleFactors * m_l1GtPfTech
virtual void compareFDL(const edm::Event &, const edm::EventSetup &, const L1GtFdlWord &, const L1GtFdlWord &, const int)
compare the FDL board
virtual void compareTCS(const edm::Event &, const edm::EventSetup &, const L1TcsWord &, const L1TcsWord &)
compare the TCS board
DQMStore * m_dbe
internal members
unsigned long long m_l1GtTmAlgoCacheID
MonitorElement * m_fdlEmulTechDecisionMask[TotalBxInEvent][NumberOfGtRecords]
MonitorElement * m_fdlDataAlgoDecisionPrescaled[TotalBxInEvent][NumberOfGtRecords]
void printGtDecisionWord(std::ostream &myCout) const
MonitorElement * m_gtfeDataEmul[NumberOfGtRecords]
histograms
MonitorElement * m_fdlDataAlgoDecisionUnprescaled_NoMatch[TotalBxInEvent][NumberOfGtRecords]
std::vector< bool > DecisionWordExtended
void beginRun(const edm::Run &run, const edm::EventSetup &c)
std::vector< unsigned int > m_triggerMaskTechTrig
virtual ~L1GtHwValidation()
MonitorElement * m_fdlDataEmulAlgoDecisionMask[TotalBxInEvent][NumberOfGtRecords]
MonitorElement * m_fdlDataAlgoDecisionPrescaled_NoMatch[TotalBxInEvent][NumberOfGtRecords]
const std::vector< unsigned int > & gtTriggerMask() const
get the trigger mask
std::vector< bool > DecisionWord
typedefs
const boost::uint16_t localBxNr() const
get/set local bunch cross number of the actual bx
const L1GtTriggerMask * m_l1GtTmAlgo
trigger masks
edm::InputTag m_l1GtEmulDaqInputTag
input tag for the L1 GT emulator DAQ record
MonitorElement * m_fdlDataEmulTechDecision[TotalBxInEvent][NumberOfGtRecords]
const int bxInEvent() const
get/set bunch cross in the GT event record
void printGtDecisionWordExtended(std::ostream &myCout) const
void endRun(const edm::Run &run, const edm::EventSetup &c)
virtual void compareEvmRecord(const edm::Event &, const edm::EventSetup &)
L1 GT EVM record comparison.
MonitorElement * m_fdlDataTechDecision_Err[NumberOfGtRecords]
const boost::uint16_t boardId() const
get/set board ID
MonitorElement * m_fdlDataAlgoDecision[TotalBxInEvent][NumberOfGtRecords]
std::vector< bool > TechnicalTriggerWord
technical trigger bits (64 bits)
L1GtHwValidation(const edm::ParameterSet &)
static const unsigned int NumberPhysTriggers
const boost::uint32_t eventNr() const
get/set event number since last L1 reset generated in PSB
void setVerbose(unsigned level)
static const int TotalBxInEvent
MonitorElement * m_fdlEmulAlgoDecisionUnprescaled[TotalBxInEvent][NumberOfGtRecords]
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
const L1GtTriggerMenu * m_l1GtMenu
trigger menu
MonitorElement * m_fdlEmulAlgoDecision_Err[NumberOfGtRecords]
const boost::uint16_t aData(int iA) const
get/set A_DATA_CH_IA
const boost::uint16_t recordLength1() const
get/set record length for alternative 1
void print(std::ostream &myCout) const
pretty print the content of a L1GtFdlWord
void print(std::ostream &myCout) const
pretty print
bool dirExists(const std::string &path) const
true if directory exists
unsigned long long m_l1GtPfAlgoCacheID
MonitorElement * m_fdlDataTechDecisionMask[TotalBxInEvent][NumberOfGtRecords]
edm::InputTag m_l1GtDataDaqInputTag
input tag for the L1 GT hardware DAQ record
MonitorElement * m_fdlDataAlgoDecision_NoMatch[TotalBxInEvent][NumberOfGtRecords]
MonitorElement * m_fdlDataEmul[TotalBxInEvent][NumberOfGtRecords]
FDL (0 for DAQ, 1 for EVM record)
MonitorElement * m_fdlDataEmul_Err[NumberOfGtRecords]
const std::vector< std::vector< int > > & gtPrescaleFactors() const
get the prescale factors by reference
std::ostringstream m_myCoutStream
static const int NumberBData
int m_nrDataEventError
counters
const boost::uint16_t bData(int iB) const
get/set B_DATA_CH_IB
T const * product() const
const int bxInEvent() const
get/set bunch cross in the GT event record
const DecisionWord & gtDecisionWord() const
get/set/print algorithms bits (decision word)
unsigned long long m_l1GtTmTechCacheID
virtual void compareGt_Gct(const edm::Event &, const edm::EventSetup &)
const boost::uint16_t bxNr() const
get/set BxNr - bunch cross number of the actual bx
MonitorElement * m_fdlEmulTechDecision_Err[NumberOfGtRecords]
static const int NumberAData
const boost::uint16_t boardId() const
get/set board ID
edm::InputTag m_l1GctDataInputTag
input tag for the L1 GCT hardware record
void printGtTechnicalTriggerWord(std::ostream &myCout) const
MonitorElement * m_fdlDataEmulAlgoDecision_Err[NumberOfGtRecords]
const boost::uint16_t finalOR() const
get/set "Final OR" bits
const boost::uint16_t activeBoards() const
get/set boards contributing to EVM respectively DAQ record
static const int NumberOfGtRecords
MonitorElement * m_fdlDataTechDecision[TotalBxInEvent][NumberOfGtRecords]
MonitorElement * m_fdlEmulAlgoDecision[TotalBxInEvent][NumberOfGtRecords]
const std::vector< std::vector< int > > * m_prescaleFactorsTechTrig
MonitorElement * m_fdlEmulAlgoDecision_NoMatch[TotalBxInEvent][NumberOfGtRecords]
const DecisionWordExtended & gtDecisionWordExtended() const
get/set extended algorithms bits (extended decision word)
MonitorElement * m_fdlDataEmulTechDecisionMask[TotalBxInEvent][NumberOfGtRecords]
MonitorElement * m_fdlDataAlgoDecisionMask[TotalBxInEvent][NumberOfGtRecords]
virtual void compareDaqRecord(const edm::Event &, const edm::EventSetup &)
L1 GT DAQ record comparison.
std::vector< unsigned int > m_triggerMaskAlgoTrig
const boost::uint16_t altNrBxBoard() const
get/set alternative for number of BX per board
MonitorElement * m_fdlDataEmulTechDecision_Err[NumberOfGtRecords]
MonitorElement * m_fdlEmulAlgoDecisionPrescaled_NoMatch[TotalBxInEvent][NumberOfGtRecords]
void setCurrentFolder(const std::string &fullpath)
const L1GtPrescaleFactors * m_l1GtPfAlgo
prescale factors
edm::InputTag m_l1GtDataEvmInputTag
input tag for the L1 GT hardware EVM record
unsigned long long m_l1GtPfTechCacheID
MonitorElement * m_fdlEmulAlgoDecisionPrescaled[TotalBxInEvent][NumberOfGtRecords]
std::string m_dirName
directory name for L1Extra plots
MonitorElement * m_fdlDataEmulAlgoDecisionUnprescaled[TotalBxInEvent][NumberOfGtRecords]