55 m_l1GtDataDaqInputTag(paramSet.getParameter<
edm::
InputTag>(
"L1GtDataDaqInputTag")),
57 m_l1GtDataEvmInputTag(paramSet.getParameter<
edm::
InputTag>(
"L1GtDataEvmInputTag")),
59 m_l1GtEmulDaqInputTag(paramSet.getParameter<
edm::
InputTag>(
"L1GtEmulDaqInputTag")),
61 m_l1GtEmulEvmInputTag(paramSet.getParameter<
edm::
InputTag>(
"L1GtEmulEvmInputTag")),
63 m_l1GctDataInputTag(paramSet.getParameter<
edm::
InputTag>(
"L1GctDataInputTag")),
65 m_dirName(paramSet.getUntrackedParameter(
"DirName",
std::
string(
"L1TEMU/GTexpert"))),
67 m_excludeCondCategTypeObject(
70 m_excludeAlgoTrigByName(paramSet.getParameter<
std::
vector<
std::
string> >(
"ExcludeAlgoTrigByName")),
72 m_excludeAlgoTrigByBit(paramSet.getParameter<
std::
vector<
int> >(
"ExcludeAlgoTrigByBit")),
75 m_nrDataEventError(0),
76 m_nrEmulEventError(0),
78 m_l1GtMenuCacheID(0ULL),
79 m_l1GtPfAlgoCacheID(0ULL),
80 m_l1GtPfTechCacheID(0ULL),
81 m_l1GtTmAlgoCacheID(0ULL),
82 m_l1GtTmTechCacheID(0ULL),
87 m_dataOnlyMask(
false),
88 m_emulOnlyMask(
false),
95 if (!(itExclud->getParameter<
std::string>(
"ExcludedCondCategory")).empty()) {
103 if (!(itExclud->getParameter<
std::string>(
"ExcludedCondType")).empty()) {
111 if (!(itExclud->getParameter<
std::string>(
"ExcludedL1GtObject")).empty()) {
169 const char* histName;
171 hName = recString +
"gtfeDataEmul";
172 histName = hName.c_str();
190 int hIndex = (iIndex + 16) % 16;
192 std::stringstream
ss;
194 ss << std::uppercase << std::hex << hIndex;
204 hName = recString +
"FdlDataEmul_" +
str;
205 histName = hName.c_str();
207 std::string hTitle =
"FDL data vs emul mismatch for BxInEvent = " +
str;
229 hName = recString +
"Data_AlgoDecision_" +
str;
230 histName = hName.c_str();
232 hTitle =
"Data: algorithm decision word for BxInEvent = " +
str;
236 ibooker.
book1D(histName,
histTitle, numberAlgoTriggers, 0., numberAlgoTriggers);
239 hName = recString +
"Emul_AlgoDecision_" +
str;
240 histName = hName.c_str();
242 hTitle =
"Emul: algorithm decision word for BxInEvent = " +
str;
246 ibooker.
book1D(histName,
histTitle, numberAlgoTriggers, 0., numberAlgoTriggers);
250 hName = recString +
"Data_AlgoDecision_Prescaled_" +
str;
251 histName = hName.c_str();
253 hTitle =
"Data: prescaled algorithms: algorithm decision for BxInEvent = " +
str;
257 ibooker.
book1D(histName,
histTitle, numberAlgoTriggers, 0., numberAlgoTriggers);
260 hName = recString +
"Emul_AlgoDecision_Prescaled_" +
str;
261 histName = hName.c_str();
263 hTitle =
"Emul: prescaled algorithms: algorithm decision for BxInEvent = " +
str;
267 ibooker.
book1D(histName,
histTitle, numberAlgoTriggers, 0., numberAlgoTriggers);
271 hName = recString +
"Data_AlgoDecision_Unprescaled_" +
str;
272 histName = hName.c_str();
274 hTitle =
"Data: unprescaled algorithms: algorithm decision for BxInEvent = " +
str;
278 ibooker.
book1D(histName,
histTitle, numberAlgoTriggers, 0., numberAlgoTriggers);
281 hName = recString +
"Emul_AlgoDecision_Unprescaled_" +
str;
282 histName = hName.c_str();
284 hTitle =
"Emul: unprescaled algorithms: algorithm decision for BxInEvent = " +
str;
288 ibooker.
book1D(histName,
histTitle, numberAlgoTriggers, 0., numberAlgoTriggers);
292 hName = recString +
"Data_AlgoDecisionAfterMask_" +
str;
293 histName = hName.c_str();
295 hTitle =
"Data, physics partition: algorithm decision word after mask for BxInEvent = " +
str;
299 ibooker.
book1D(histName,
histTitle, numberAlgoTriggers, 0., numberAlgoTriggers);
302 hName = recString +
"Emul_AlgoDecisionAfterMask_" +
str;
303 histName = hName.c_str();
305 hTitle =
"Emul, physics partition: algorithm decision word after mask for BxInEvent = " +
str;
309 ibooker.
book1D(histName,
histTitle, numberAlgoTriggers, 0., numberAlgoTriggers);
312 hName = recString +
"DataEmul_AlgoDecision_" +
str;
313 histName = hName.c_str();
315 hTitle =
"Data vs emul: non-matching algorithm decision word for BxInEvent = " +
str;
319 ibooker.
book1D(histName,
histTitle, numberAlgoTriggers, 0., numberAlgoTriggers);
322 hName = recString +
"DataEmul_AlgoDecision_Prescaled_" +
str;
323 histName = hName.c_str();
325 hTitle =
"Data vs emul: prescaled algorithms with non-matching decision for BxInEvent = " +
str;
329 ibooker.
book1D(histName,
histTitle, numberAlgoTriggers, 0., numberAlgoTriggers);
332 hName = recString +
"DataEmul_AlgoDecision_Unprescaled_" +
str;
333 histName = hName.c_str();
335 hTitle =
"Data vs emul: unprescaled algorithms with non-matching decision for BxInEvent = " +
str;
339 ibooker.
book1D(histName,
histTitle, numberAlgoTriggers, 0., numberAlgoTriggers);
342 hName = recString +
"DataEmul_AlgoDecision_Unprescaled_Allowed_" +
str;
343 histName = hName.c_str();
345 hTitle =
"Data vs emul: unprescaled algorithms not excluded with non-matching decision for BxInEvent = " +
str;
349 ibooker.
book1D(histName,
histTitle, numberAlgoTriggers, 0., numberAlgoTriggers);
352 hName = recString +
"Data_AlgoDecision_NoMatch_" +
str;
353 histName = hName.c_str();
355 hTitle =
"Data: algorithm decision for non-matching cases for BxInEvent = " +
str;
359 ibooker.
book1D(histName,
histTitle, numberAlgoTriggers, 0., numberAlgoTriggers);
362 hName = recString +
"Emul_AlgoDecision_NoMatch_" +
str;
363 histName = hName.c_str();
365 hTitle =
"Emul: algorithm decision for non-matching cases for BxInEvent = " +
str;
369 ibooker.
book1D(histName,
histTitle, numberAlgoTriggers, 0., numberAlgoTriggers);
372 hName = recString +
"Data_AlgoDecision_Prescaled_NoMatch_" +
str;
373 histName = hName.c_str();
375 hTitle =
"Data: prescaled algorithms: non-matching algorithm decision for BxInEvent = " +
str;
379 ibooker.
book1D(histName,
histTitle, numberAlgoTriggers, 0., numberAlgoTriggers);
382 hName = recString +
"Emul_AlgoDecision_Prescaled_NoMatch_" +
str;
383 histName = hName.c_str();
385 hTitle =
"Emul: prescaled algorithms: non-matching algorithm decision for BxInEvent = " +
str;
389 ibooker.
book1D(histName,
histTitle, numberAlgoTriggers, 0., numberAlgoTriggers);
392 hName = recString +
"Data_AlgoDecision_Unprescaled_NoMatch_" +
str;
393 histName = hName.c_str();
395 hTitle =
"Data: unprescaled algorithms: non-matching algorithm decision for BxInEvent = " +
str;
399 ibooker.
book1D(histName,
histTitle, numberAlgoTriggers, 0., numberAlgoTriggers);
402 hName = recString +
"Emul_AlgoDecision_Unprescaled_NoMatch_" +
str;
403 histName = hName.c_str();
405 hTitle =
"Emul: unprescaled algorithms: non-matching algorithm decision for BxInEvent = " +
str;
409 ibooker.
book1D(histName,
histTitle, numberAlgoTriggers, 0., numberAlgoTriggers);
412 hName = recString +
"Data_AlgoDecisionMask_NoMatch_" +
str;
413 histName = hName.c_str();
415 hTitle =
"Data: algorithm decision for non-matching cases after mask for BxInEvent = " +
str;
419 ibooker.
book1D(histName,
histTitle, numberAlgoTriggers, 0., numberAlgoTriggers);
422 hName = recString +
"Emul_AlgoDecisionMask_NoMatch_" +
str;
423 histName = hName.c_str();
425 hTitle =
"Emul: algorithm decision for non-matching cases after mask for BxInEvent = " +
str;
429 ibooker.
book1D(histName,
histTitle, numberAlgoTriggers, 0., numberAlgoTriggers);
432 hName = recString +
"Data_AlgoDecisionMask_Prescaled_NoMatch_" +
str;
433 histName = hName.c_str();
435 hTitle =
"Data: prescaled algorithms: non-matching algorithm decision after mask for BxInEvent = " +
str;
439 ibooker.
book1D(histName,
histTitle, numberAlgoTriggers, 0., numberAlgoTriggers);
442 hName = recString +
"Emul_AlgoDecision_PrescaledMask_NoMatch_" +
str;
443 histName = hName.c_str();
445 hTitle =
"Emul: prescaled algorithms: non-matching algorithm decision after mask for BxInEvent = " +
str;
449 ibooker.
book1D(histName,
histTitle, numberAlgoTriggers, 0., numberAlgoTriggers);
452 hName = recString +
"Data_AlgoDecision_UnprescaledMask_NoMatch_" +
str;
453 histName = hName.c_str();
455 hTitle =
"Data: unprescaled algorithms: non-matching algorithm decision after mask for BxInEvent = " +
str;
459 ibooker.
book1D(histName,
histTitle, numberAlgoTriggers, 0., numberAlgoTriggers);
462 hName = recString +
"Emul_AlgoDecision_UnprescaledMask_NoMatch_" +
str;
463 histName = hName.c_str();
465 hTitle =
"Emul: unprescaled algorithms: non-matching algorithm decision after mask for BxInEvent = " +
str;
469 ibooker.
book1D(histName,
histTitle, numberAlgoTriggers, 0., numberAlgoTriggers);
472 hName = recString +
"DataEmul_AlgoDecisionAfterMask_" +
str;
473 histName = hName.c_str();
476 "Data vs emul, physics partition: non-matching algorithm decision word after mask for BxInEvent = " +
str;
480 ibooker.
book1D(histName,
histTitle, numberAlgoTriggers, 0., numberAlgoTriggers);
484 hName = recString +
"Data_TechDecision_" +
str;
485 histName = hName.c_str();
487 hTitle =
"Data technical trigger decision word for BxInEvent = " +
str;
491 ibooker.
book1D(histName,
histTitle, numberTechTriggers, 0., numberTechTriggers);
494 hName = recString +
"Emul_TechDecision_" +
str;
495 histName = hName.c_str();
497 hTitle =
"Emul: technical trigger decision word for BxInEvent = " +
str;
501 ibooker.
book1D(histName,
histTitle, numberTechTriggers, 0., numberTechTriggers);
504 hName = recString +
"Data_TechDecisionAfterMask_" +
str;
505 histName = hName.c_str();
507 hTitle =
"Data technical trigger decision word after mask for BxInEvent = " +
str;
511 ibooker.
book1D(histName,
histTitle, numberTechTriggers, 0., numberTechTriggers);
514 hName = recString +
"Emul_TechDecisionAfterMask_" +
str;
515 histName = hName.c_str();
517 hTitle =
"Emul: technical trigger decision word after mask for BxInEvent = " +
str;
521 ibooker.
book1D(histName,
histTitle, numberTechTriggers, 0., numberTechTriggers);
524 hName = recString +
"DataEmul_TechDecision_" +
str;
525 histName = hName.c_str();
527 hTitle =
"Data vs emul: non-matching technical trigger decision word for BxInEvent = " +
str;
531 ibooker.
book1D(histName,
histTitle, numberTechTriggers, 0., numberTechTriggers);
533 hName = recString +
"DataEmul_TechDecisionAfterMask_" +
str;
534 histName = hName.c_str();
536 hTitle =
"Data vs emul: non-matching technical trigger decision word after mask for BxInEvent = " +
str;
540 ibooker.
book1D(histName,
histTitle, numberTechTriggers, 0., numberTechTriggers);
550 hName = recString +
"FdlDataEmul_Err";
551 histName = hName.c_str();
554 ibooker.
book1D(histName,
"FDL data vs emul mismatch for non-matching BxInEvent in FDL payload", 13, 0., 13.);
569 hName = recString +
"FdlDataAlgoDecision_Err";
570 histName = hName.c_str();
573 "Data: algorithm trigger decision word, non-matching BxInEvent",
579 hName = recString +
"Emul_AlgoDecision_Err";
580 histName = hName.c_str();
583 "Emul: algorithm trigger decision word, non-matching BxInEvent",
588 hName = recString +
"DataEmul_AlgoDecision_Err";
589 histName = hName.c_str();
593 "Data vs emul: algorithm trigger decision word, non-matching BxInEvent",
599 hName = recString +
"Data_TechDecision_Err";
600 histName = hName.c_str();
603 "Data: technical trigger decision word, non-matching BxInEvent",
608 hName = recString +
"Emul_TechDecision_Err";
609 histName = hName.c_str();
612 "Emul: technical trigger decision word, non-matching BxInEvent",
617 hName = recString +
"DataEmul_TechDecision_Err";
618 histName = hName.c_str();
622 "Data vs emul: technical trigger decision word, non-matching BxInEvent",
632 "Algorithms excluded from data versus emulator agreement flag",
639 m_gtErrorFlag = ibooker.
book1D(
"GTErrorFlag",
"L1 GT error flag for data versus emulator comparison", 5, 0., 5);
674 for (
CItAlgo itAlgo = algorithmMap.begin(); itAlgo != algorithmMap.end(); itAlgo++) {
675 const int algBitNumber = (itAlgo->second).algoBitNumber();
677 std::stringstream
ss;
679 ss << std::uppercase << algBitNumber;
682 const std::string& aName = algBitString +
" " + itAlgo->first;
683 const char* algName = aName.c_str();
686 for (
int iBxInEvent = 0; iBxInEvent <
TotalBxInEvent; ++iBxInEvent) {
689 int hIndex = (iIndex + 16) % 16;
691 std::stringstream
ss;
693 ss << std::uppercase << std::hex << hIndex;
743 if (algBitNumber == *itAlgo) {
811 if (gtfeBlockData == gtfeBlockEmul) {
812 m_myCoutStream <<
"\n" << recString <<
" Data and emulated GTFE blocks: identical.\n";
815 m_myCoutStream <<
"\n" << recString <<
" Data and emulated GTFE blocks: different.\n";
830 const uint16_t boardIdData = gtfeBlockData.
boardId();
831 const uint16_t boardIdEmul = gtfeBlockEmul.
boardId();
833 if (boardIdData == boardIdEmul) {
834 m_myCoutStream <<
"\n" << recString <<
" Data and emulated GTFE boardId identical.";
835 m_myCoutStream <<
"\n boardId() = " << std::hex <<
"0x" << std::setw(4) << std::setfill(
'0') << boardIdData
840 m_myCoutStream <<
"\n" << recString <<
" Data and emulated GTFE boardId different.";
841 m_myCoutStream <<
"\n Data: boardId() = " << std::hex <<
"0x" << std::setw(4) << std::setfill(
'0') << boardIdData
843 m_myCoutStream <<
"\n Emul: boardId() = " << std::hex <<
"0x" << std::setw(4) << std::setfill(
'0') << boardIdEmul
850 const uint16_t recordLength1Data = gtfeBlockData.
recordLength1();
851 const uint16_t recordLength1Emul = gtfeBlockEmul.
recordLength1();
853 if (recordLength1Data == recordLength1Emul) {
854 m_myCoutStream <<
"\n" << recString <<
" Data and emulated GTFE recordLength for alternative 1 identical.";
859 m_myCoutStream <<
"\n" << recString <<
" Data and emulated GTFE recordLength for alternative 1 different.";
860 m_myCoutStream <<
"\n Data: recordLength1() = " << recordLength1Data;
861 m_myCoutStream <<
"\n Emul: recordLength1() = " << recordLength1Emul;
867 const uint16_t recordLengthData = gtfeBlockData.
recordLength();
868 const uint16_t recordLengthEmul = gtfeBlockEmul.
recordLength();
870 if (recordLengthData == recordLengthEmul) {
871 m_myCoutStream <<
"\n" << recString <<
" Data and emulated GTFE recordLength for alternative 0 identical.";
876 m_myCoutStream <<
"\n" << recString <<
" Data and emulated GTFE recordLength for alternative 1 different.";
877 m_myCoutStream <<
"\n Data: recordLength() = " << recordLengthData;
878 m_myCoutStream <<
"\n Emul: recordLength() = " << recordLengthEmul;
884 const uint16_t bxNrData = gtfeBlockData.
bxNr();
885 const uint16_t bxNrEmul = gtfeBlockEmul.
bxNr();
887 if (bxNrData == bxNrEmul) {
888 m_myCoutStream <<
"\n" << recString <<
" Data and emulated GTFE bxNr identical.";
893 m_myCoutStream <<
"\n" << recString <<
" Data and emulated GTFE bxNr different.";
901 const uint32_t setupVersionData = gtfeBlockData.
setupVersion();
902 const uint32_t setupVersionEmul = gtfeBlockEmul.
setupVersion();
904 if (setupVersionData == setupVersionEmul) {
905 m_myCoutStream <<
"\n" << recString <<
" Data and emulated GTFE setupVersion identical.";
910 m_myCoutStream <<
"\n" << recString <<
" Data and emulated GTFE setupVersion different.";
911 m_myCoutStream <<
"\n Data: setupVersion() = " << setupVersionData;
912 m_myCoutStream <<
"\n Emul: setupVersion() = " << setupVersionEmul;
918 const uint16_t activeBoardsData = gtfeBlockData.
activeBoards();
919 const uint16_t activeBoardsEmul = gtfeBlockEmul.
activeBoards();
921 if (activeBoardsData == activeBoardsEmul) {
922 m_myCoutStream <<
"\n" << recString <<
" Data and emulated GTFE activeBoards identical.";
923 m_myCoutStream <<
"\n activeBoards() = " << std::hex <<
"0x" << std::setw(4) << std::setfill(
'0')
924 << activeBoardsData << std::setfill(
' ') <<
std::dec;
928 m_myCoutStream <<
"\n" << recString <<
" Data and emulated GTFE activeBoards different.";
929 m_myCoutStream <<
"\n Data: activeBoards() = " << std::hex <<
"0x" << std::setw(4) << std::setfill(
'0')
930 << activeBoardsData << std::setfill(
' ') <<
std::dec;
931 m_myCoutStream <<
"\n Emul: activeBoards() = " << std::hex <<
"0x" << std::setw(4) << std::setfill(
'0')
932 << activeBoardsEmul << std::setfill(
' ') <<
std::dec;
940 const uint16_t altNrBxBoardData = gtfeBlockData.
altNrBxBoard();
941 const uint16_t altNrBxBoardEmul = gtfeBlockEmul.
altNrBxBoard();
943 if (altNrBxBoardData == altNrBxBoardEmul) {
944 m_myCoutStream <<
"\n" << recString <<
" Data and emulated GTFE altNrBxBoard identical.";
949 m_myCoutStream <<
"\n" << recString <<
" Data and emulated GTFE altNrBxBoard different.";
950 m_myCoutStream <<
"\n Data: altNrBxBoard() = " << altNrBxBoardData;
951 m_myCoutStream <<
"\n Emul: altNrBxBoard() = " << altNrBxBoardEmul;
957 const uint32_t totalTriggerNrData = gtfeBlockData.
totalTriggerNr();
958 const uint32_t totalTriggerNrEmul = gtfeBlockEmul.
totalTriggerNr();
960 if (totalTriggerNrData == totalTriggerNrEmul) {
961 m_myCoutStream <<
"\n" << recString <<
" Data and emulated GTFE totalTriggerNr identical.";
966 m_myCoutStream <<
"\n" << recString <<
" Data and emulated GTFE totalTriggerNr different.";
967 m_myCoutStream <<
"\n Data: totalTriggerNr() = " << totalTriggerNrData;
968 m_myCoutStream <<
"\n Emul: totalTriggerNr() = " << totalTriggerNrEmul;
985 int PhysicsPartition = 0;
990 if (fdlBlockData == fdlBlockEmul) {
991 m_myCoutStream <<
"\n" << recString <<
" Data and emulated FDL blocks: identical.\n";
995 m_myCoutStream <<
"\n" << recString <<
" Data and emulated FDL blocks: different.\n";
1011 const int bxInEventData = fdlBlockData.
bxInEvent();
1012 const int bxInEventEmul = fdlBlockEmul.
bxInEvent();
1014 bool matchBxInEvent =
false;
1016 if (bxInEventData == bxInEventEmul) {
1017 m_myCoutStream <<
"\n" << recString <<
" Data and emulated FDL bxInEvent identical.";
1020 matchBxInEvent =
true;
1023 m_myCoutStream <<
"\n" << recString <<
" Data and emulated FDL bxInEvent different.";
1034 <<
"\n Data and emulated FDL bxInEvent different \n";
1043 bool validBxInEvent =
false;
1045 LogDebug(
"L1GtHwValidation") <<
"\n Convert bxInEvent = " << bxInEventData <<
" to histIndex = " << histIndex
1048 validBxInEvent =
true;
1054 const uint16_t boardIdData = fdlBlockData.
boardId();
1055 const uint16_t boardIdEmul = fdlBlockEmul.
boardId();
1057 if (boardIdData == boardIdEmul) {
1058 m_myCoutStream <<
"\n" << recString <<
" Data and emulated FDL boardId identical.";
1059 m_myCoutStream <<
"\n boardId() = " << std::hex <<
"0x" << std::setw(4) << std::setfill(
'0') << boardIdData
1064 m_myCoutStream <<
"\n" << recString <<
" Data and emulated FDL boardId different.";
1065 m_myCoutStream <<
"\n Data: boardId() = " << std::hex <<
"0x" << std::setw(4) << std::setfill(
'0') << boardIdData
1067 m_myCoutStream <<
"\n Emul: boardId() = " << std::hex <<
"0x" << std::setw(4) << std::setfill(
'0') << boardIdEmul
1071 if (matchBxInEvent && validBxInEvent) {
1083 const uint16_t bxNrData = fdlBlockData.
bxNr();
1084 const uint16_t bxNrEmul = fdlBlockEmul.
bxNr();
1086 if (bxNrData == bxNrEmul) {
1087 m_myCoutStream <<
"\n" << recString <<
" Data and emulated FDL bxNr identical.";
1092 m_myCoutStream <<
"\n" << recString <<
" Data and emulated FDL bxNr different.";
1097 if (matchBxInEvent && validBxInEvent) {
1109 const uint32_t eventNrData = fdlBlockData.
eventNr();
1110 const uint32_t eventNrEmul = fdlBlockEmul.
eventNr();
1112 if (eventNrData == eventNrEmul) {
1113 m_myCoutStream <<
"\n" << recString <<
" Data and emulated FDL eventNr identical.";
1118 m_myCoutStream <<
"\n" << recString <<
" Data and emulated FDL eventNr different.";
1123 if (matchBxInEvent && validBxInEvent) {
1138 int nTechBits = gtTechnicalTriggerWordData.size();
1143 unsigned int bitValue = 0;
1145 if (matchBxInEvent && validBxInEvent) {
1146 for (
int iBit = 0; iBit < nTechBits; ++iBit) {
1149 if (gtTechnicalTriggerWordData[iBit]) {
1152 bitValue = (triggerMask) ? 0 : 1;
1153 gtTechnicalTriggerWordDataMask[iBit] = bitValue;
1159 if (gtTechnicalTriggerWordEmul.at(iBit)) {
1162 bitValue = (triggerMask) ? 0 : 1;
1163 gtTechnicalTriggerWordEmulMask[iBit] = bitValue;
1170 for (
int iBit = 0; iBit < nTechBits; ++iBit) {
1171 if (gtTechnicalTriggerWordData[iBit]) {
1175 if (gtTechnicalTriggerWordEmul.at(iBit)) {
1181 if (gtTechnicalTriggerWordData == gtTechnicalTriggerWordEmul) {
1182 m_myCoutStream <<
"\n" << recString <<
" Data and emulated FDL gtTechnicalTriggerWord identical.\n";
1187 m_myCoutStream <<
"\n" << recString <<
" Data and emulated FDL gtTechnicalTriggerWord different.";
1194 if (matchBxInEvent && validBxInEvent) {
1200 if (matchBxInEvent && validBxInEvent) {
1201 for (
int iBit = 0; iBit < nTechBits; ++iBit) {
1202 if (gtTechnicalTriggerWordData[iBit] != gtTechnicalTriggerWordEmul.at(iBit)) {
1207 for (
int iBit = 0; iBit < nTechBits; ++iBit) {
1208 if (gtTechnicalTriggerWordData[iBit] != gtTechnicalTriggerWordEmul.at(iBit)) {
1219 if (gtTechnicalTriggerWordDataMask == gtTechnicalTriggerWordEmulMask) {
1220 m_myCoutStream <<
"\n" << recString <<
" Data and emulated FDL gtTechnicalTriggerWord after mask identical.\n";
1224 m_myCoutStream <<
"\n" << recString <<
" Data and emulated FDL gtTechnicalTriggerWord after mask different.";
1229 if (matchBxInEvent && validBxInEvent) {
1235 if (matchBxInEvent && validBxInEvent) {
1236 for (
int iBit = 0; iBit < nTechBits; ++iBit) {
1237 if (gtTechnicalTriggerWordData[iBit] != gtTechnicalTriggerWordEmul.at(iBit)) {
1252 int nAlgoBits = gtDecisionWordData.size();
1262 size_t pfSetsSize = (*m_prescaleFactorsAlgoTrig).size();
1265 LogDebug(
"L1GtHwValidation") <<
"\nError: index of prescale factor set retrieved from the data \n"
1266 <<
"less than zero."
1267 <<
"\n Value of index retrieved from data = " << iPfSet << std::endl;
1273 }
else if (iPfSet >= (static_cast<int>(pfSetsSize))) {
1274 LogDebug(
"L1GtHwValidation") <<
"\nError: index of prescale factor set retrieved from the data \n"
1275 <<
"greater than the size of the vector of prescale factor sets."
1276 <<
"\n Value of index retrieved from data = " << iPfSet
1277 <<
"\n Vector size = " << pfSetsSize << std::endl;
1284 const std::vector<int>& prescaleFactorsAlgoTrig = (*m_prescaleFactorsAlgoTrig).at(iPfSet);
1286 if (matchBxInEvent && validBxInEvent) {
1287 for (
int iBit = 0; iBit < nAlgoBits; ++iBit) {
1293 <<
" trigger mask = " << triggerMask << std::endl;
1295 if (gtDecisionWordData[iBit]) {
1304 bitValue = (triggerMask) ? 0 : 1;
1305 gtDecisionWordDataMask[iBit] = bitValue;
1311 if (gtDecisionWordEmul.at(iBit)) {
1314 bitValue = (triggerMask) ? 0 : 1;
1315 gtDecisionWordEmulMask[iBit] = bitValue;
1322 for (
int iBit = 0; iBit < nAlgoBits; ++iBit) {
1323 if (gtDecisionWordData[iBit]) {
1328 for (
int iBit = 0; iBit < nAlgoBits; ++iBit) {
1329 if (gtDecisionWordEmul.at(iBit)) {
1338 <<
"\n matchBxInEvent && validBxInEvent false \n";
1342 if (gtDecisionWordData == gtDecisionWordEmul) {
1343 m_myCoutStream <<
"\n" << recString <<
" Data and emulated FDL gtDecisionWord identical.";
1348 m_myCoutStream <<
"\n" << recString <<
" Data and emulated FDL gtDecisionWord different.";
1355 if (matchBxInEvent && validBxInEvent) {
1361 if (matchBxInEvent && validBxInEvent) {
1362 for (
int iBit = 0; iBit < nAlgoBits; ++iBit) {
1365 if (gtDecisionWordData[iBit] != gtDecisionWordEmul.at(iBit)) {
1369 if (
excludedAlgo(iBit) && (bxInEventData == 0) && (iRec == 0)) {
1385 if (gtDecisionWordData[iBit]) {
1393 if ((!
excludedAlgo(iBit)) && (bxInEventData == 0) && (iRec == 0)) {
1398 <<
"result before mask for algorithm with bit number " << iBit
1399 <<
"\n Data: true, emulator: false \n";
1414 if ((!
excludedAlgo(iBit)) && (bxInEventData == 0) && (iRec == 0)) {
1419 <<
"result before mask for algorithm with bit number " << iBit
1420 <<
"\n Data: false, emulator: true \n";
1430 for (
int iBit = 0; iBit < nAlgoBits; ++iBit) {
1431 if (gtDecisionWordData[iBit] != gtDecisionWordEmul.at(iBit)) {
1440 <<
"\n matchBxInEvent && validBxInEvent false \n";
1445 if (gtDecisionWordDataMask == gtDecisionWordEmulMask) {
1446 m_myCoutStream <<
"\n" << recString <<
" Data and emulated FDL gtDecisionWord after mask identical.";
1450 m_myCoutStream <<
"\n" << recString <<
" Data and emulated FDL gtDecisionWord after mask different.";
1455 if (matchBxInEvent && validBxInEvent) {
1461 if (matchBxInEvent && validBxInEvent) {
1462 for (
int iBit = 0; iBit < nAlgoBits; ++iBit) {
1463 if (gtDecisionWordDataMask[iBit] != gtDecisionWordEmulMask.at(iBit)) {
1468 if (gtDecisionWordDataMask[iBit]) {
1476 if ((!
excludedAlgo(iBit)) && (bxInEventData == 0) && (iRec == 0)) {
1481 <<
"result after mask for algorithm with bit number " << iBit
1482 <<
" different in data versus emulator "
1483 <<
"\n Data: true, emulator: false \n";
1498 if ((!
excludedAlgo(iBit)) && (bxInEventData == 0) && (iRec == 0)) {
1503 <<
"result after mask for algorithm with bit number " << iBit
1504 <<
" different in data versus emulator "
1505 <<
"\n Data: false, emulator: true \n";
1521 if (gtDecisionWordExtendedData == gtDecisionWordExtendedEmul) {
1522 m_myCoutStream <<
"\n" << recString <<
" Data and emulated FDL gtDecisionWordExtended identical.\n";
1527 m_myCoutStream <<
"\n" << recString <<
" Data and emulated FDL gtDecisionWordExtended different.\n";
1534 if (matchBxInEvent && validBxInEvent) {
1542 const uint16_t noAlgoData = fdlBlockData.
noAlgo();
1543 const uint16_t noAlgoEmul = fdlBlockEmul.
noAlgo();
1545 if (noAlgoData == noAlgoEmul) {
1546 m_myCoutStream <<
"\n" << recString <<
" Data and emulated FDL noAlgo identical.";
1551 m_myCoutStream <<
"\n" << recString <<
" Data and emulated FDL noAlgo different.";
1556 if (matchBxInEvent && validBxInEvent) {
1564 const uint16_t finalORData = fdlBlockData.
finalOR();
1565 const uint16_t finalOREmul = fdlBlockEmul.
finalOR();
1567 if (finalORData == finalOREmul) {
1568 m_myCoutStream <<
"\n" << recString <<
" Data and emulated FDL finalOR identical.";
1569 m_myCoutStream <<
"\n finalOR() = " << std::hex <<
"0x" << std::setw(2) << std::setfill(
'0') << finalORData
1574 m_myCoutStream <<
"\n" << recString <<
" Data and emulated FDL finalOR different.";
1575 m_myCoutStream <<
"\n Data: finalOR() = " << std::hex <<
"0x" << std::setw(2) << std::setfill(
'0') << finalORData
1577 m_myCoutStream <<
"\n Emul: finalOR() = " << std::hex <<
"0x" << std::setw(2) << std::setfill(
'0') << finalOREmul
1581 if (matchBxInEvent && validBxInEvent) {
1589 const int finalORPhysData = finalORData & (1 << PhysicsPartition);
1590 const int finalORPhysEmul = finalOREmul & (1 << PhysicsPartition);
1592 if (finalORPhysData == finalORPhysEmul) {
1593 m_myCoutStream <<
"\n" << recString <<
" Data and emulated FDL finalOR for the physics partition identical.";
1598 m_myCoutStream <<
"\n" << recString <<
" Data and emulated FDL finalOR for the physics partition different.";
1603 if (matchBxInEvent && validBxInEvent) {
1611 const uint16_t localBxNrData = fdlBlockData.
localBxNr();
1612 const uint16_t localBxNrEmul = fdlBlockEmul.
localBxNr();
1614 if (localBxNrData == localBxNrEmul) {
1615 m_myCoutStream <<
"\n" << recString <<
" Data and emulated FDL localBxNr identical.";
1620 m_myCoutStream <<
"\n" << recString <<
" Data and emulated FDL localBxNr different.";
1625 if (matchBxInEvent && validBxInEvent) {
1642 if (psbBlockData == psbBlockEmul) {
1643 m_myCoutStream <<
"\nData and emulated PSB blocks: identical.\n";
1647 m_myCoutStream <<
"\nData and emulated PSB blocks: different.\n";
1662 const uint16_t boardIdData = psbBlockData.
boardId();
1663 const uint16_t boardIdEmul = psbBlockEmul.
boardId();
1665 if (boardIdData == boardIdEmul) {
1667 m_myCoutStream <<
"\n boardId() = " << std::hex <<
"0x" << std::setw(4) << std::setfill(
'0') << boardIdData
1673 m_myCoutStream <<
"\n Data: boardId() = " << std::hex <<
"0x" << std::setw(4) << std::setfill(
'0') << boardIdData
1675 m_myCoutStream <<
"\n Emul: boardId() = " << std::hex <<
"0x" << std::setw(4) << std::setfill(
'0') << boardIdEmul
1681 const int bxInEventData = psbBlockData.
bxInEvent();
1682 const int bxInEventEmul = psbBlockEmul.
bxInEvent();
1684 if (bxInEventData == bxInEventEmul) {
1685 m_myCoutStream <<
"\nData and emulated PSB bxInEvent identical.";
1690 m_myCoutStream <<
"\nData and emulated PSB bxInEvent different.";
1697 const uint16_t bxNrData = psbBlockData.
bxNr();
1698 const uint16_t bxNrEmul = psbBlockEmul.
bxNr();
1700 if (bxNrData == bxNrEmul) {
1713 const uint32_t eventNrData = psbBlockData.
eventNr();
1714 const uint32_t eventNrEmul = psbBlockEmul.
eventNr();
1716 if (eventNrData == eventNrEmul) {
1732 for (
int iA = 0; iA < psbBlockData.
NumberAData; ++iA) {
1733 valData = psbBlockData.
aData(iA);
1734 valEmul = psbBlockEmul.
aData(iA);
1736 if (valData == valEmul) {
1737 m_myCoutStream <<
"\nData and emulated PSB aData(" << iA <<
") identical.";
1738 m_myCoutStream <<
"\n aData(iA) = " << std::hex <<
"0x" << std::setw(4) << std::setfill(
'0') << valData
1743 m_myCoutStream <<
"\nData and emulated PSB aData(" << iA <<
") different.";
1744 m_myCoutStream <<
"\n Data: aData(iA) = " << std::hex <<
"0x" << std::setw(4) << std::setfill(
'0') << valData
1746 m_myCoutStream <<
"\n Emul: aData(iA) = " << std::hex <<
"0x" << std::setw(4) << std::setfill(
'0') << valEmul
1753 for (
int iB = 0; iB < psbBlockData.
NumberBData; ++iB) {
1754 valData = psbBlockData.
bData(iB);
1755 valEmul = psbBlockEmul.
bData(iB);
1757 if (valData == valEmul) {
1758 m_myCoutStream <<
"\nData and emulated PSB bData(" << iB <<
") identical.";
1759 m_myCoutStream <<
"\n bData(iA) = " << std::hex <<
"0x" << std::setw(4) << std::setfill(
'0') << valData
1764 m_myCoutStream <<
"\nData and emulated PSB bData(" << iB <<
") different.";
1765 m_myCoutStream <<
"\n Data: bData(iA) = " << std::hex <<
"0x" << std::setw(4) << std::setfill(
'0') << valData
1767 m_myCoutStream <<
"\n Emul: bData(iA) = " << std::hex <<
"0x" << std::setw(4) << std::setfill(
'0') << valEmul
1774 const uint16_t localBxNrData = psbBlockData.
localBxNr();
1775 const uint16_t localBxNrEmul = psbBlockEmul.
localBxNr();
1777 if (localBxNrData == localBxNrEmul) {
1778 m_myCoutStream <<
"\nData and emulated PSB localBxNr identical.";
1783 m_myCoutStream <<
"\nData and emulated PSB localBxNr different.";
1818 bool validData =
false;
1820 if (!gtReadoutRecordData.
isValid()) {
1830 bool validEmul =
false;
1832 if (!gtReadoutRecordEmul.
isValid()) {
1838 if ((!validData) || (!validEmul)) {
1839 edm::LogWarning(
"L1GtHwValidation") <<
"\n No valid product found: DAQ L1GlobalTriggerReadoutRecord"
1840 <<
"\n Data validity [1 = true; 0 = false]: " << validData
1841 <<
"\n Emulator validity: [1 = true; 0 = false]: " << validEmul
1842 <<
"\n DAQ histograms will not be filled.\n"
1855 const std::vector<L1GtFdlWord>& gtFdlVectorData = gtReadoutRecordData->
gtFdlVector();
1856 const std::vector<L1GtFdlWord>& gtFdlVectorEmul = gtReadoutRecordEmul->
gtFdlVector();
1858 int gtFdlVectorDataSize = gtFdlVectorData.size();
1859 int gtFdlVectorEmulSize = gtFdlVectorEmul.size();
1861 if (gtFdlVectorDataSize == gtFdlVectorEmulSize) {
1862 m_myCoutStream <<
"\nData and emulated FDL vector size: identical.\n";
1865 for (
int iFdl = 0; iFdl < gtFdlVectorDataSize; ++iFdl) {
1866 const L1GtFdlWord& fdlBlockData = gtFdlVectorData[iFdl];
1867 const L1GtFdlWord& fdlBlockEmul = gtFdlVectorEmul[iFdl];
1872 m_myCoutStream <<
"\nData and emulated FDL vector size: different.\n";
1873 m_myCoutStream <<
" Data: size = " << gtFdlVectorDataSize << std::endl;
1874 m_myCoutStream <<
" Emul: size = " << gtFdlVectorEmulSize << std::endl;
1883 const std::vector<L1GtPsbWord>& gtPsbVectorData = gtReadoutRecordData->
gtPsbVector();
1884 const std::vector<L1GtPsbWord>& gtPsbVectorEmul = gtReadoutRecordEmul->
gtPsbVector();
1886 int gtPsbVectorDataSize = gtPsbVectorData.size();
1887 int gtPsbVectorEmulSize = gtPsbVectorEmul.size();
1889 if (gtPsbVectorDataSize == gtPsbVectorEmulSize) {
1890 m_myCoutStream <<
"\nData and emulated PSB vector size: identical.\n";
1893 m_myCoutStream <<
"\nData and emulated PSB vector size: different.\n";
1894 m_myCoutStream <<
" Data: size = " << gtPsbVectorDataSize << std::endl;
1895 m_myCoutStream <<
" Emul: size = " << gtPsbVectorEmulSize << std::endl;
1901 for (
int iPsb = 0; iPsb < gtPsbVectorDataSize; ++iPsb) {
1902 const L1GtPsbWord& psbBlockData = gtPsbVectorData[iPsb];
1903 const uint16_t boardIdData = psbBlockData.
boardId();
1904 const int bxInEventData = psbBlockData.
bxInEvent();
1909 bool foundPSB =
false;
1911 for (
int iPsbF = 0; iPsbF < gtPsbVectorEmulSize; ++iPsbF) {
1912 const L1GtPsbWord& psbBlockEmul = gtPsbVectorEmul[iPsbF];
1913 const uint16_t boardIdEmul = psbBlockEmul.
boardId();
1914 const int bxInEventEmul = psbBlockEmul.
bxInEvent();
1916 if ((boardIdEmul == boardIdData) && (bxInEventData == bxInEventEmul)) {
1925 m_myCoutStream <<
"\nNo emulated PSB with boardId() = " << std::hex <<
"0x" << std::setw(4) << std::setfill(
'0')
1926 << boardIdData << std::setfill(
' ') <<
std::dec <<
" and BxInEvent = " << bxInEventData
1960 bool validData =
false;
1962 if (!gtReadoutRecordData.
isValid()) {
1972 bool validEmul =
false;
1974 if (!gtReadoutRecordEmul.
isValid()) {
1980 if ((!validData) || (!validEmul)) {
1981 edm::LogWarning(
"L1GtHwValidation") <<
"\n No valid product found: EVM L1GlobalTriggerEvmReadoutRecord"
1982 <<
"\n Data validity [1 = true; 0 = false]: " << validData
1983 <<
"\n Emulator validity: [1 = true; 0 = false]: " << validEmul
1984 <<
"\n EVM histograms will not be filled.\n"
1997 const std::vector<L1GtFdlWord>& gtFdlVectorData = gtReadoutRecordData->
gtFdlVector();
1998 const std::vector<L1GtFdlWord>& gtFdlVectorEmul = gtReadoutRecordEmul->
gtFdlVector();
2000 int gtFdlVectorDataSize = gtFdlVectorData.size();
2001 int gtFdlVectorEmulSize = gtFdlVectorEmul.size();
2003 if (gtFdlVectorDataSize == gtFdlVectorEmulSize) {
2004 m_myCoutStream <<
"\nData and emulated FDL vector size: identical.\n";
2007 for (
int iFdl = 0; iFdl < gtFdlVectorDataSize; ++iFdl) {
2008 const L1GtFdlWord& fdlBlockData = gtFdlVectorData[iFdl];
2009 const L1GtFdlWord& fdlBlockEmul = gtFdlVectorEmul[iFdl];
2014 m_myCoutStream <<
"\nData and emulated FDL vector size: different.\n";
2015 m_myCoutStream <<
" Data: size = " << gtFdlVectorDataSize << std::endl;
2016 m_myCoutStream <<
" Emul: size = " << gtFdlVectorEmulSize << std::endl;
2055 bool matchValue =
false;
2057 if (excludedCategory ==
CondNull) {
2060 if (conditionCategory == excludedCategory) {
2069 bool matchValue =
false;
2084 bool matchValue =
false;
2086 if (excludedObject ==
ObjNull) {
2090 for (std::vector<L1GtObject>::const_iterator itCondObj = condObjects.begin(); itCondObj != condObjects.end();
2092 if ((*itCondObj) == excludedObject) {
2104 for (
CItAlgo itAlgo = algorithmMap.begin(); itAlgo != algorithmMap.end(); itAlgo++) {
2106 const int algBitNumber = (itAlgo->second).algoBitNumber();
2107 const int chipNr = (itAlgo->second).algoChipNumber();
2111 const std::vector<L1GtLogicParser::TokenRPN>& aRpnVector = (itAlgo->second).algoRpnVector();
2112 size_t aRpnVectorSize = aRpnVector.size();
2114 bool algWithExcludedCondition =
false;
2115 bool algWithConditionNotInMap =
false;
2118 for (
size_t opI = 0; opI < aRpnVectorSize; ++opI) {
2119 const std::string& cndName = (aRpnVector[opI]).operand;
2121 if (!cndName.empty()) {
2122 bool foundCond =
false;
2124 CItCond itCond = conditionMap.find(cndName);
2125 if (itCond != conditionMap.end()) {
2128 const std::vector<L1GtObject>&
objType = (itCond->second)->objectType();
2142 LogTrace(
"L1GtHwValidation") <<
"\n "
2143 <<
"Algorithm: " << algName <<
" Condition: " << cndName <<
"\n "
2148 <<
"Object excluded: "
2151 if (matchCondCategoryValue && matchCondTypeValue && matchCondL1GtObjectValue) {
2152 algWithExcludedCondition =
true;
2162 algWithConditionNotInMap =
true;
2164 LogTrace(
"L1GtHwValidation") <<
"\n Error: condition " << cndName <<
" not found in condition map!"
2165 <<
"\n Add algorithm " << algName <<
" (bit number " << algBitNumber <<
") "
2166 <<
"\n to list of algorithms excluded from comparison"
2167 <<
"\n data versus emulator." << std::endl;
2172 if (algWithConditionNotInMap) {
2177 LogTrace(
"L1GtHwValidation") <<
"\n Error: one or more conditions from algorithm " << algName <<
" (bit number "
2178 << algBitNumber <<
") "
2179 <<
" not found in condition map!"
2180 <<
"\n Add it to list of algorithms excluded from comparison"
2181 <<
"\n data versus emulator." << std::endl;
2184 if (algWithExcludedCondition) {
2187 LogTrace(
"L1GtHwValidation") <<
"\n Algorithm " << algName <<
" (bit number " << algBitNumber
2188 <<
") contains an excluded condition."
2189 <<
"\n Add it to list of algorithms excluded from comparison"
2190 <<
"\n data versus emulator." << std::endl;
2197 if ((*itExcl) == algName) {
2200 LogTrace(
"L1GtHwValidation") <<
"\n Algorithm " << algName <<
" (bit number " << algBitNumber
2201 <<
")\n added to list of algorithms excluded from comparison"
2202 <<
" \n data versus emulator by ExcludeAlgoTrigByName." << std::endl;
2210 if ((*itExcl) == algBitNumber) {
2213 LogTrace(
"L1GtHwValidation") <<
"\n Algorithm " << algName <<
" (bit number " << algBitNumber
2214 <<
")\n added to list of algorithms excluded from comparison"
2215 <<
" \n data versus emulator by ExcludeAlgoTrigByBit." << std::endl;
2224 if (iBit == *itAlgo) {