103 delete m_candL1MuShower;
107 delete m_candL1EtSum;
108 delete m_candL1EtSumZdc;
109 delete m_candL1External;
119 const int nrL1MuShower,
128 m_candL1Mu->setBXRange(m_bxFirst_, m_bxLast_);
129 m_candL1MuShower->setBXRange(m_bxFirst_, m_bxLast_);
130 m_candL1EG->setBXRange(m_bxFirst_, m_bxLast_);
131 m_candL1Tau->setBXRange(m_bxFirst_, m_bxLast_);
132 m_candL1Jet->setBXRange(m_bxFirst_, m_bxLast_);
133 m_candL1EtSum->setBXRange(m_bxFirst_, m_bxLast_);
134 m_candL1EtSumZdc->setBXRange(m_bxFirst_, m_bxLast_);
135 m_candL1External->setBXRange(m_bxFirst_, m_bxLast_);
139 LogDebug(
"L1TGlobal") <<
"\t Initializing Board with bxFirst = " << m_bxFirst_ <<
", bxLast = " << m_bxLast_;
150 const bool receiveEG,
152 const bool receiveTau,
154 const bool receiveJet,
156 const bool receiveEtSums,
157 const bool receiveEtSumsZdc,
158 const bool receiveCICADA) {
160 LogDebug(
"L1TGlobal") <<
"\n**** Board receiving Calo Data ";
168 iEvent.getByToken(egInputToken, egData);
172 edm::LogWarning(
"L1TGlobal") <<
"\nWarning: Input tag for the BXVector<l1t::EGamma> collection" 173 <<
"\nrequested in configuration, but not found in the event.\n";
177 for (
int i = egData->getFirstBX();
i <= egData->getLastBX(); ++
i) {
179 if (i < m_bxFirst_ || i > m_bxLast_)
184 for (std::vector<l1t::EGamma>::const_iterator eg = egData->begin(
i); eg != egData->end(
i); ++eg) {
186 (*m_candL1EG).push_back(
i, &(*eg));
188 edm::LogWarning(
"L1TGlobal") <<
" Too many EG (" << nObj <<
") for uGT Configuration maxEG =" << nrL1EG;
190 LogDebug(
"L1TGlobal") <<
"EG Pt " << eg->hwPt() <<
" Eta " << eg->hwEta() <<
" Phi " << eg->hwPhi()
191 <<
" Qual " << eg->hwQual() <<
" Iso " << eg->hwIso();
201 iEvent.getByToken(tauInputToken, tauData);
205 edm::LogWarning(
"L1TGlobal") <<
"\nWarning: Input tag for the BXVector<l1t::Tau> collection" 206 <<
"\nrequested in configuration, but not found in the event.\n";
210 for (
int i = tauData->getFirstBX();
i <= tauData->getLastBX(); ++
i) {
212 if (i < m_bxFirst_ || i > m_bxLast_)
217 for (std::vector<l1t::Tau>::const_iterator
tau = tauData->begin(
i);
tau != tauData->end(
i); ++
tau) {
218 if (nObj < nrL1Tau) {
219 (*m_candL1Tau).push_back(
i, &(*
tau));
221 LogTrace(
"L1TGlobal") <<
" Too many Tau (" << nObj <<
") for uGT Configuration maxTau =" << nrL1Tau;
224 LogDebug(
"L1TGlobal") <<
"tau Pt " <<
tau->hwPt() <<
" Eta " <<
tau->hwEta() <<
" Phi " <<
tau->hwPhi()
225 <<
" Qual " <<
tau->hwQual() <<
" Iso " <<
tau->hwIso();
239 edm::LogWarning(
"L1TGlobal") <<
"\nWarning: Input tag for the BXVector<l1t::Jet> collection" 240 <<
"\nrequested in configuration, but not found in the event.\n";
246 if (i < m_bxFirst_ || i > m_bxLast_)
252 if (nObj < nrL1Jet) {
253 (*m_candL1Jet).push_back(
i, &(*
jet));
255 edm::LogWarning(
"L1TGlobal") <<
" Too many Jets (" << nObj <<
") for uGT Configuration maxJet =" << nrL1Jet;
258 LogDebug(
"L1TGlobal") <<
"Jet Pt " <<
jet->hwPt() <<
" Eta " <<
jet->hwEta() <<
" Phi " <<
jet->hwPhi()
259 <<
" Qual " <<
jet->hwQual() <<
" Iso " <<
jet->hwIso();
268 iEvent.getByToken(sumInputToken, etSumData);
272 edm::LogWarning(
"L1TGlobal") <<
"\nWarning: Input tag for the BXVector<l1t::EtSum> collection" 273 <<
"\nrequested in configuration, but not found in the event.\n";
276 for (
int i = etSumData->getFirstBX();
i <= etSumData->getLastBX(); ++
i) {
278 if (i < m_bxFirst_ || i > m_bxLast_)
282 for (std::vector<l1t::EtSum>::const_iterator etsum = etSumData->begin(
i); etsum != etSumData->end(
i); ++etsum) {
283 (*m_candL1EtSum).push_back(
i, &(*etsum));
328 if (receiveEtSumsZdc) {
330 iEvent.getByToken(sumZdcInputToken, etSumData);
334 edm::LogWarning(
"L1TGlobal") <<
"\nWarning: Input tag for the ZDC Energy Sums collection" 335 <<
"\nrequested in configuration, but not found in the event.\n";
338 for (
int i = etSumData->getFirstBX();
i <= etSumData->getLastBX(); ++
i) {
340 if (i < m_bxFirst_ || i > m_bxLast_)
343 for (std::vector<l1t::EtSum>::const_iterator etsum = etSumData->begin(
i); etsum != etSumData->end(
i); ++etsum) {
344 (*m_candL1EtSumZdc).push_back(
i, &(*etsum));
351 iEvent.getByToken(CICADAInputToken, cicadaScoreHandle);
352 if (not cicadaScoreHandle.
isValid()) {
354 edm::LogWarning(
"L1Tglobal") <<
"\nWarning: Input tag for the CICADA score" 355 <<
"\nrequested in configuration, but not found in the event.\n" 356 <<
"\nSetting score to 0.0";
359 }
else if (cicadaScoreHandle->isEmpty(0)) {
362 <<
"\nWarning: CICADA score had a valid input tag, but an empty BX collection" 363 <<
"\nThe CICADA score will be filled with 0.0 to prevent any failure of uGT emulation";
367 setCICADAScore(cicadaScoreHandle->at(
377 const bool receiveMu,
380 LogDebug(
"L1TGlobal") <<
"\n**** GlobalBoard receiving muon data = ";
389 iEvent.getByToken(muInputToken, muonData);
393 edm::LogWarning(
"L1TGlobal") <<
"\nWarning: Input tag for the BXVector<l1t::Muon> collection" 394 <<
"\nrequested in configuration, but not found in the event.\n";
398 for (
int i = muonData->getFirstBX();
i <= muonData->getLastBX(); ++
i) {
400 if (i < m_bxFirst_ || i > m_bxLast_)
405 for (std::vector<l1t::Muon>::const_iterator
mu = muonData->begin(
i);
mu != muonData->end(
i); ++
mu) {
407 (*m_candL1Mu).push_back(
i, &(*
mu));
409 edm::LogWarning(
"L1TGlobal") <<
" Too many Muons (" << nObj <<
") for uGT Configuration maxMu =" << nrL1Mu;
412 LogDebug(
"L1TGlobal") <<
"Muon Pt " <<
mu->hwPt() <<
" EtaAtVtx " <<
mu->hwEtaAtVtx() <<
" PhiAtVtx " 413 <<
mu->hwPhiAtVtx() <<
" Qual " <<
mu->hwQual() <<
" Iso " <<
mu->hwIso();
424 const bool receiveMuShower,
425 const int nrL1MuShower) {
427 if (receiveMuShower) {
429 iEvent.getByToken(muShowerInputToken, muonData);
433 edm::LogWarning(
"L1TGlobal") <<
"\nWarning: Input tag for the BXVector<l1t::MuonShower> collection" 434 <<
"\nrequested in configuration, but not found in the event.\n";
438 for (
int i = muonData->getFirstBX();
i <= muonData->getLastBX(); ++
i) {
440 if (i < m_bxFirst_ || i > m_bxLast_)
445 for (std::vector<l1t::MuonShower>::const_iterator
mu = muonData->begin(
i);
mu != muonData->end(
i); ++
mu) {
446 if (nObj < nrL1MuShower) {
451 std::shared_ptr<l1t::MuonShower> musOneNominalInTime =
452 std::make_shared<l1t::MuonShower>(
false,
false,
false,
false,
false,
false);
453 std::shared_ptr<l1t::MuonShower> musOneTightInTime =
454 std::make_shared<l1t::MuonShower>(
false,
false,
false,
false,
false,
false);
455 std::shared_ptr<l1t::MuonShower> musTwoLooseDiffSectorsInTime =
456 std::make_shared<l1t::MuonShower>(
false,
false,
false,
false,
false,
false);
457 std::shared_ptr<l1t::MuonShower> musOutOfTime0 =
458 std::make_shared<l1t::MuonShower>(
false,
false,
false,
false,
false,
false);
459 std::shared_ptr<l1t::MuonShower> musOutOfTime1 =
460 std::make_shared<l1t::MuonShower>(
false,
false,
false,
false,
false,
false);
462 musOneNominalInTime->setOneNominalInTime(
mu->isOneNominalInTime());
463 musOneTightInTime->setOneTightInTime(
mu->isOneTightInTime());
464 musTwoLooseDiffSectorsInTime->setTwoLooseDiffSectorsInTime(
mu->isTwoLooseDiffSectorsInTime());
465 musOutOfTime0->setMusOutOfTime0(
mu->musOutOfTime0());
466 musOutOfTime1->setMusOutOfTime1(
mu->musOutOfTime1());
468 (*m_candL1MuShower).push_back(
i, musOneNominalInTime);
469 (*m_candL1MuShower).push_back(
i, musOneTightInTime);
470 (*m_candL1MuShower).push_back(
i, musTwoLooseDiffSectorsInTime);
471 (*m_candL1MuShower).push_back(
i, musOutOfTime0);
472 (*m_candL1MuShower).push_back(
i, musOutOfTime1);
476 <<
") for uGT Configuration maxMuShower =" << nrL1MuShower;
488 const bool receiveExt) {
490 LogDebug(
"L1TGlobal") <<
"\n**** GlobalBoard receiving external data = ";
499 iEvent.getByToken(extInputToken, extData);
503 edm::LogWarning(
"L1TGlobal") <<
"\nWarning: Input tag for the BXVector<GlobalExtBlk> collection" 504 <<
"\nrequested in configuration, but not found in the event.\n";
508 for (
int i = extData->getFirstBX();
i <= extData->getLastBX(); ++
i) {
510 if (i < m_bxFirst_ || i > m_bxLast_)
514 for (std::vector<GlobalExtBlk>::const_iterator
ext = extData->begin(
i);
ext != extData->end(
i); ++
ext) {
515 (*m_candL1External).push_back(
i, &(*
ext));
526 const bool produceL1GtObjectMapRecord,
527 const int iBxInEvent,
528 std::unique_ptr<GlobalObjectMapRecord>& gtObjectMapRecord,
529 const unsigned int numberPhysTriggers,
531 const int nrL1MuShower,
535 const std::vector<ConditionMap>& conditionMap = m_l1GtMenu->
gtConditionMap();
539 LogDebug(
"L1TGlobal") <<
" L1 Menu Scales -- Set Name: " << scaleSetName;
543 m_algInitialOr =
false;
544 m_algPrescaledOr =
false;
545 m_algIntermOr =
false;
546 m_algFinalOr =
false;
547 m_algFinalOrVeto =
false;
549 const std::vector<std::vector<MuonTemplate>>& corrMuon = m_l1GtMenu->
corMuonTemplate();
551 const std::vector<std::vector<CaloTemplate>>& corrCalo = m_l1GtMenu->
corCaloTemplate();
553 const std::vector<std::vector<EnergySumTemplate>>& corrEnergySum = m_l1GtMenu->
corEnergySumTemplate();
555 LogDebug(
"L1TGlobal") <<
"Size corrMuon " << corrMuon.size() <<
"\nSize corrCalo " << corrCalo.size()
556 <<
"\nSize corrSums " << corrEnergySum.size();
564 if (m_conditionResultMaps.size() != conditionMap.size()) {
565 m_conditionResultMaps.clear();
566 m_conditionResultMaps.resize(conditionMap.size());
571 for (std::vector<ConditionMap>::const_iterator itCondOnChip = conditionMap.begin();
572 itCondOnChip != conditionMap.end();
578 for (
CItCond itCond = itCondOnChip->begin(); itCond != itCondOnChip->end(); itCond++) {
580 switch ((itCond->second)->condCategory()) {
583 const int ifMuEtaNumberBits = 0;
591 cMapResults[itCond->first] = muCondition;
593 if (m_verbosity && m_isDebugEnabled) {
594 std::ostringstream myCout;
595 muCondition->
print(myCout);
597 LogTrace(
"L1TGlobal") << myCout.str();
609 cMapResults[itCond->first] = muShowerCondition;
611 if (m_verbosity && m_isDebugEnabled) {
612 std::ostringstream myCout;
613 muShowerCondition->
print(myCout);
615 edm::LogWarning(
"L1TGlobal") <<
"MuonShowerCondition " << myCout.str();
622 const int ifCaloEtaNumberBits = 0;
625 new CaloCondition(itCond->second,
this, nrL1EG, nrL1Jet, nrL1Tau, ifCaloEtaNumberBits);
631 cMapResults[itCond->first] = caloCondition;
633 if (m_verbosity && m_isDebugEnabled) {
634 std::ostringstream myCout;
635 caloCondition->
print(myCout);
637 LogTrace(
"L1TGlobal") << myCout.str();
648 cMapResults[itCond->first] = eSumCondition;
650 if (m_verbosity && m_isDebugEnabled) {
651 std::ostringstream myCout;
652 eSumCondition->
print(myCout);
654 LogTrace(
"L1TGlobal") << myCout.str();
665 cMapResults[itCond->first] = eSumZdcCondition;
667 if (m_verbosity && m_isDebugEnabled) {
668 std::ostringstream myCout;
669 eSumZdcCondition->
print(myCout);
671 LogTrace(
"L1TGlobal") << myCout.str();
683 cMapResults[itCond->first] = axol1tlCondition;
685 if (m_verbosity && m_isDebugEnabled) {
686 std::ostringstream myCout;
687 axol1tlCondition->
print(myCout);
700 cMapResults[itCond->first] = cicadaCondition;
702 if (m_verbosity && m_isDebugEnabled) {
703 std::ostringstream myCout;
704 cicadaCondition->
print(myCout);
716 cMapResults[itCond->first] = extCondition;
718 if (m_verbosity && m_isDebugEnabled) {
719 std::ostringstream myCout;
720 extCondition->
print(myCout);
722 LogTrace(
"L1TGlobal") << myCout.str();
732 const int cond0Ind = corrTemplate->
cond0Index();
733 const int cond1Ind = corrTemplate->
cond1Index();
739 int cond0NrL1Objects = 0;
740 int cond1NrL1Objects = 0;
741 LogDebug(
"L1TGlobal") <<
" cond0NrL1Objects" << cond0NrL1Objects <<
" cond1NrL1Objects " 744 switch (cond0Categ) {
746 cond0Condition = &((corrMuon[iChip])[cond0Ind]);
749 cond0Condition = &((corrCalo[iChip])[cond0Ind]);
752 cond0Condition = &((corrEnergySum[iChip])[cond0Ind]);
759 switch (cond1Categ) {
761 cond1Condition = &((corrMuon[iChip])[cond1Ind]);
764 cond1Condition = &((corrCalo[iChip])[cond1Ind]);
767 cond1Condition = &((corrEnergySum[iChip])[cond1Ind]);
780 cMapResults[itCond->first] = correlationCond;
782 if (m_verbosity && m_isDebugEnabled) {
783 std::ostringstream myCout;
784 correlationCond->
print(myCout);
786 LogTrace(
"L1TGlobal") << myCout.str();
799 const int cond0Ind = corrTemplate->
cond0Index();
800 const int cond1Ind = corrTemplate->
cond1Index();
801 const int cond2Ind = corrTemplate->
cond2Index();
808 int cond0NrL1Objects = 0;
809 int cond1NrL1Objects = 0;
810 int cond2NrL1Objects = 0;
811 LogDebug(
"L1TGlobal") <<
" cond0NrL1Objects " << cond0NrL1Objects <<
" cond1NrL1Objects " 812 << cond1NrL1Objects <<
" cond2NrL1Objects " << cond2NrL1Objects;
814 cond0Condition = &((corrMuon[iChip])[cond0Ind]);
816 LogDebug(
"L1TGlobal") <<
"No muon0 to evaluate three-body correlation condition";
819 cond1Condition = &((corrMuon[iChip])[cond1Ind]);
821 LogDebug(
"L1TGlobal") <<
"No muon1 to evaluate three-body correlation condition";
824 cond2Condition = &((corrMuon[iChip])[cond2Ind]);
826 LogDebug(
"L1TGlobal") <<
"No muon2 to evaluate three-body correlation condition";
833 correlationThreeBodyCond->
setScales(>Scales);
835 cMapResults[itCond->first] = correlationThreeBodyCond;
837 if (m_verbosity && m_isDebugEnabled) {
838 std::ostringstream myCout;
839 correlationThreeBodyCond->
print(myCout);
841 LogTrace(
"L1TGlobal") << myCout.str();
853 const int cond0Ind = corrTemplate->
cond0Index();
854 const int cond1Ind = corrTemplate->
cond1Index();
855 const int cond2Ind = corrTemplate->
cond2Index();
862 int cond0NrL1Objects = 0;
863 int cond1NrL1Objects = 0;
864 int cond2NrL1Objects = 0;
865 LogDebug(
"L1TGlobal") <<
" cond0NrL1Objects" << cond0NrL1Objects <<
" cond1NrL1Objects " << cond1NrL1Objects
866 <<
" cond2NrL1Objects " << cond2NrL1Objects;
868 switch (cond0Categ) {
870 cond0Condition = &((corrMuon[iChip])[cond0Ind]);
873 cond0Condition = &((corrCalo[iChip])[cond0Ind]);
876 cond0Condition = &((corrEnergySum[iChip])[cond0Ind]);
883 switch (cond1Categ) {
885 cond1Condition = &((corrMuon[iChip])[cond1Ind]);
888 cond1Condition = &((corrCalo[iChip])[cond1Ind]);
891 cond1Condition = &((corrEnergySum[iChip])[cond1Ind]);
898 switch (cond2Categ) {
900 cond2Condition = &((corrMuon[iChip])[cond2Ind]);
903 cond2Condition = &((corrCalo[iChip])[cond2Ind]);
906 cond2Condition = &((corrEnergySum[iChip])[cond2Ind]);
917 correlationCondWOR->
setScales(>Scales);
920 cMapResults[itCond->first] = correlationCondWOR;
922 if (m_verbosity && m_isDebugEnabled) {
923 std::ostringstream myCout;
924 correlationCondWOR->
print(myCout);
926 LogTrace(
"L1TGlobal") << myCout.str();
948 std::vector<GlobalObjectMap> objMapVec;
949 if (produceL1GtObjectMapRecord && (iBxInEvent == 0))
950 objMapVec.reserve(numberPhysTriggers);
952 for (
CItAlgo itAlgo = algorithmMap.begin(); itAlgo != algorithmMap.end(); itAlgo++) {
954 gtAlg.
evaluateAlgorithm((itAlgo->second).algoChipNumber(), m_conditionResultMaps);
956 int algBitNumber = (itAlgo->second).algoBitNumber();
959 LogDebug(
"L1TGlobal") <<
" ===> for iBxInEvent = " << iBxInEvent <<
":\t algBitName = " << itAlgo->first
960 <<
",\t algBitNumber = " << algBitNumber <<
",\t algResult = " << algResult;
964 m_uGtAlgBlk.setAlgoDecisionInitial(algBitNumber, algResult);
965 m_algInitialOr =
true;
968 if (m_verbosity && m_isDebugEnabled) {
969 std::ostringstream myCout;
970 (itAlgo->second).
print(myCout);
973 LogTrace(
"L1TGlobal") << myCout.str();
977 if (produceL1GtObjectMapRecord && (iBxInEvent == 0)) {
978 std::vector<L1TObjectTypeInCond> otypes;
983 for (
auto imap = conditionMap.begin(); imap != conditionMap.end(); imap++) {
984 auto match = imap->find(iop->tokenName);
986 if (match != imap->end()) {
990 otype = match->second->objectType();
992 for (
auto itype =
otype.begin(); itype !=
otype.end(); itype++) {
998 edm::LogWarning(
"L1TGlobal") <<
"\n Failed to find match for operand token " << iop->tokenName <<
"\n";
1000 otypes.push_back(
otype);
1015 if (m_verbosity && m_isDebugEnabled) {
1016 std::ostringstream myCout1;
1017 objMap.
print(myCout1);
1019 LogTrace(
"L1TGlobal") << myCout1.str();
1022 objMapVec.push_back(objMap);
1027 if (produceL1GtObjectMapRecord && (iBxInEvent == 0)) {
1028 gtObjectMapRecord->swapGtObjectMap(objMapVec);
1034 for (std::vector<AlgorithmEvaluation::ConditionEvaluationMap>::iterator itCondOnChip = m_conditionResultMaps.begin();
1035 itCondOnChip != m_conditionResultMaps.end();
1038 delete itCond->second;
1039 itCond->second =
nullptr;
1048 const int iBxInEvent,
1049 const int totalBxInEvent,
1050 const unsigned int numberPhysTriggers,
1051 const std::vector<double>& prescaleFactorsAlgoTrig,
1052 const std::vector<unsigned int>& triggerMaskAlgoTrig,
1053 const std::vector<int>& triggerMaskVetoAlgoTrig,
1054 const bool algorithmTriggersUnprescaled,
1055 const bool algorithmTriggersUnmasked) {
1057 LogDebug(
"L1TGlobal") <<
"\n**** GlobalBoard apply Final Decision Logic ";
1061 if (m_prescaleCounterAlgoTrig.empty()
or 1062 (m_currentLumi !=
iEvent.luminosityBlock() and m_resetPSCountersEachLumiSec)) {
1063 m_prescaleCounterAlgoTrig.clear();
1064 m_prescaleCounterAlgoTrig.reserve(totalBxInEvent);
1065 auto const& prescaleCountersAlgoTrig =
1066 m_semiRandomInitialPSCounters ? prescaleCountersWithSemirandomInitialCounter(prescaleFactorsAlgoTrig,
iEvent)
1067 : prescaleCounters(prescaleFactorsAlgoTrig);
1068 for (
int iBxInEvent = 0; iBxInEvent < totalBxInEvent; ++iBxInEvent) {
1069 m_prescaleCounterAlgoTrig.push_back(prescaleCountersAlgoTrig);
1072 m_currentLumi =
iEvent.luminosityBlock();
1077 m_uGtAlgBlk.copyInitialToInterm();
1082 if (!algorithmTriggersUnprescaled) {
1084 int const inBxInEvent = totalBxInEvent / 2 + iBxInEvent;
1086 bool temp_algPrescaledOr =
false;
1087 bool alreadyReported =
false;
1088 for (
unsigned int iBit = 0; iBit < numberPhysTriggers; ++iBit) {
1089 bool const bitValue = m_uGtAlgBlk.getAlgoDecisionInitial(iBit);
1092 if (iBit < prescaleFactorsAlgoTrig.size()) {
1093 if (prescaleFactorsAlgoTrig.at(iBit) != 1) {
1094 bool const triggered = m_prescaleCounterAlgoTrig.at(inBxInEvent).at(iBit).accept();
1096 temp_algPrescaledOr =
true;
1099 m_uGtAlgBlk.setAlgoDecisionInterm(iBit,
false);
1103 temp_algPrescaledOr =
true;
1106 else if (!alreadyReported) {
1107 alreadyReported =
true;
1108 edm::LogWarning(
"L1TGlobal") <<
"\nWarning: algoBit >= prescaleFactorsAlgoTrig.size() in bx " << iBxInEvent;
1113 m_algPrescaledOr = temp_algPrescaledOr;
1117 m_algPrescaledOr = m_algInitialOr;
1123 m_uGtAlgBlk.copyIntermToFinal();
1125 if (!algorithmTriggersUnmasked) {
1126 bool temp_algFinalOr =
false;
1127 bool alreadyReported =
false;
1128 for (
unsigned int iBit = 0; iBit < numberPhysTriggers; ++iBit) {
1129 const bool bitValue = m_uGtAlgBlk.getAlgoDecisionInterm(iBit);
1133 bool isMasked =
false;
1134 if (iBit < triggerMaskAlgoTrig.size())
1135 isMasked = (triggerMaskAlgoTrig.at(iBit) == 0);
1136 else if (!alreadyReported) {
1137 alreadyReported =
true;
1138 edm::LogWarning(
"L1TGlobal") <<
"\nWarning: algoBit >= triggerMaskAlgoTrig.size() in bx " << iBxInEvent;
1141 bool const passMask = (bitValue && !isMasked);
1144 temp_algFinalOr =
true;
1146 m_uGtAlgBlk.setAlgoDecisionFinal(iBit,
false);
1149 if (triggerMaskVetoAlgoTrig.at(iBit) == 1)
1150 m_algFinalOrVeto =
true;
1154 m_algIntermOr = temp_algFinalOr;
1157 m_algIntermOr = m_algPrescaledOr;
1164 m_algFinalOr = (m_algIntermOr & !m_algFinalOrVeto);
1169 std::unique_ptr<GlobalAlgBlkBxCollection>& uGtAlgRecord,
1174 LogDebug(
"L1TGlobal") <<
"\n**** GlobalBoard fill DAQ Records for bx= " << iBxInEvent;
1178 m_uGtAlgBlk.setbxInEventNr((iBxInEvent & 0xF));
1179 m_uGtAlgBlk.setPreScColumn(prescaleSet);
1180 m_uGtAlgBlk.setL1MenuUUID(menuUUID);
1181 m_uGtAlgBlk.setL1FirmwareUUID(firmwareUUID);
1183 m_uGtAlgBlk.setFinalORVeto(m_algFinalOrVeto);
1184 m_uGtAlgBlk.setFinalORPreVeto(m_algIntermOr);
1185 m_uGtAlgBlk.setFinalOR(m_algFinalOr);
1187 uGtAlgRecord->push_back(iBxInEvent, m_uGtAlgBlk);
1197 m_uGtAlgBlk.reset();
1199 m_gtlDecisionWord.reset();
1200 m_gtlAlgorithmOR.reset();
1205 m_candL1Mu->clear();
1206 m_candL1Mu->setBXRange(m_bxFirst_, m_bxLast_);
1211 m_candL1MuShower->clear();
1212 m_candL1MuShower->setBXRange(m_bxFirst_, m_bxLast_);
1217 m_candL1EG->clear();
1218 m_candL1Tau->clear();
1219 m_candL1Jet->clear();
1220 m_candL1EtSum->clear();
1221 m_candL1EtSumZdc->clear();
1222 m_cicadaScore = 0.0;
1224 m_candL1EG->setBXRange(m_bxFirst_, m_bxLast_);
1225 m_candL1Tau->setBXRange(m_bxFirst_, m_bxLast_);
1226 m_candL1Jet->setBXRange(m_bxFirst_, m_bxLast_);
1227 m_candL1EtSum->setBXRange(m_bxFirst_, m_bxLast_);
1228 m_candL1EtSumZdc->setBXRange(m_bxFirst_, m_bxLast_);
1232 m_candL1External->clear();
1233 m_candL1External->setBXRange(m_bxFirst_, m_bxLast_);
1238 LogTrace(
"L1TGlobal") <<
"\nl1t::L1GlobalTrigger: uGMT data received for BxInEvent = " << iBxInEvent;
1240 int nrL1Mu = m_candL1Mu->size(iBxInEvent);
1241 LogTrace(
"L1TGlobal") <<
"Number of GMT muons = " << nrL1Mu <<
"\n";
1246 std::vector<double>
const& prescaleFactorsAlgoTrig) {
1247 std::vector<PrescaleCounter>
out;
1248 out.reserve(prescaleFactorsAlgoTrig.size());
1249 for (
size_t iAlgo = 0; iAlgo < prescaleFactorsAlgoTrig.size(); ++iAlgo) {
1250 out.emplace_back(prescaleFactorsAlgoTrig[iAlgo]);
1257 std::vector<double>
const& prescaleFactorsAlgoTrig,
edm::Event const&
iEvent) {
1261 std::srand(
iEvent.id().run());
1262 std::srand(std::rand() +
iEvent.id().luminosityBlock());
1263 std::srand(std::rand() +
iEvent.id().event());
1264 int const semirandom = std::rand();
1266 std::vector<PrescaleCounter>
out;
1267 out.reserve(prescaleFactorsAlgoTrig.size());
1269 for (
size_t iAlgo = 0; iAlgo < prescaleFactorsAlgoTrig.size(); ++iAlgo) {
1270 out.emplace_back(prescaleFactorsAlgoTrig[iAlgo]);
1274 auto& prescaleCounter =
out.back();
1275 if (prescaleCounter.prescale_count > 0) {
1276 prescaleCounter.trigger_counter = semirandom % prescaleCounter.prescale_count;
1285 trigger_counter += m_singlestep;
1287 if (prescale_count == 0
or trigger_counter < prescale_count)
1290 trigger_counter -= prescale_count;
void setAlgoBitNumber(int algoBitNumberValue)
void print(std::ostream &myCout) const override
print condition
const int cond0Index() const
get / set the index of the two sub-conditions in the cor* vector from menu
void evaluateConditionStoreResult(const int bxEval)
call evaluateCondition and save last result
std::vector< l1t::GlobalObject > L1TObjectTypeInCond
void swapOperandTokenVector(std::vector< GlobalLogicParser::OperandToken > &operandTokenVectorValue)
void print(std::ostream &myCout) const override
print condition
void print(std::ostream &myCout) const override
print condition
void print(std::ostream &myCout) const override
print condition
static std::vector< PrescaleCounter > prescaleCountersWithSemirandomInitialCounter(std::vector< double > const &prescaleFactorsAlgoTrig, edm::Event const &iEvent)
void setVerbosity(const int verbosity)
const int cond1Index() const
virtual std::string getScalesName() const
void fillAlgRecord(int iBxInEvent, std::unique_ptr< GlobalAlgBlkBxCollection > &uGtAlgRecord, int prescaleSet, int menuUUID, int firmwareUUID)
Fill the Daq Records.
unsigned long long m_l1MuTriggerScalesCacheID
const l1t::GtConditionCategory cond1Category() const
void runFDL(const edm::Event &iEvent, const int iBxInEvent, const int totalBxInEvent, const unsigned int numberPhysTriggers, const std::vector< double > &prescaleFactorsAlgoTrig, const std::vector< unsigned int > &triggerMaskAlgoTrig, const std::vector< int > &triggerMaskVetoAlgoTrig, const bool algorithmTriggersUnprescaled, const bool algorithmTriggersUnmasked)
run the uGT FDL (Apply Prescales and Veto)
const int cond0Index() const
get / set the index of the two sub-conditions in the cor* vector from menu
void print(std::ostream &myCout) const
print the full object map
const l1t::GtConditionCategory cond1Category() const
void swapObjectTypeVector(std::vector< L1TObjectTypeInCond > &objectTypeVectorValue)
void swapCombinationVector(std::vector< CombinationsInCond > &combinationVectorValue)
ConditionEvaluationMap::iterator ItEvalMap
void printGmtData(const int iBxInEvent) const
print received Muon dataWord
void print(std::ostream &myCout) const
unsigned long long m_l1GtMenuCacheID
void print(std::ostream &myCout) const override
print condition
static std::vector< PrescaleCounter > prescaleCounters(std::vector< double > const &prescaleFactorsAlgoTrig)
const l1t::GtConditionCategory cond2Category() const
const int cond1Index() const
std::bitset< GlobalAlgBlk::maxPhysicsTriggers > m_gtlDecisionWord
ConditionMap::const_iterator CItCond
iterators through map containing the conditions
GtConditionCategory
condition categories
const l1t::GtConditionCategory cond0Category() const
get / set the category of the thre sub-conditions
void receiveCaloObjectData(const edm::Event &, const edm::EDGetTokenT< BXVector< l1t::EGamma >> &, const edm::EDGetTokenT< BXVector< l1t::Tau >> &, const edm::EDGetTokenT< BXVector< l1t::Jet >> &, const edm::EDGetTokenT< BXVector< l1t::EtSum >> &, const edm::EDGetTokenT< BXVector< l1t::EtSum >> &, const edm::EDGetTokenT< BXVector< float >> &, const bool receiveEG, const int nrL1EG, const bool receiveTau, const int nrL1Tau, const bool receiveJet, const int nrL1Jet, const bool receiveEtSums, const bool receiveEtSumsZdc, const bool receiveCICADA)
receive data from Global Muon Trigger
const l1t::GtConditionCategory cond0Category() const
get / set the category of the two sub-conditions
unsigned int m_boardEventCount
AlgorithmMap::const_iterator CItAlgo
iterators through map containing the algorithms
void print(std::ostream &myCout) const override
print condition
void reset()
reset the content of a GlobalAlgBlk
void print(std::ostream &myCout) const override
print condition
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
void runGTL(const edm::Event &iEvent, const edm::EventSetup &evSetup, const TriggerMenu *m_l1GtMenu, const bool produceL1GtObjectMapRecord, const int iBxInEvent, std::unique_ptr< GlobalObjectMapRecord > >ObjectMapRecord, const unsigned int numberPhysTriggers, const int nrL1Mu, const int nrL1MuShower, const int nrL1EG, const int nrL1Tau, const int nrL1Jet)
run the uGT GTL (Conditions and Algorithms)
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
unsigned long long m_l1CaloGeometryCacheID
const l1t::GtConditionCategory cond1Category() const
void setAlgoGtlResult(bool algoGtlResultValue)
const int cond2Index() const
void print(std::ostream &myCout) const override
print condition
std::vector< CombinationsInCond > & gtAlgoCombinationVector()
std::vector< std::vector< PrescaleCounter > > m_prescaleCounterAlgoTrig
void setScales(const GlobalScales *)
void evaluateAlgorithm(const int chipNumber, const std::vector< ConditionEvaluationMap > &)
evaluate an algorithm
void receiveExternalData(const edm::Event &, const edm::EDGetTokenT< BXVector< GlobalExtBlk >> &, const bool receiveExt)
bool gtAlgoResult() const
get / set the result of the algorithm
const int cond2Index() const
void setAlgoName(const std::string &algoNameValue)
const int cond1Index() const
void print(std::ostream &myCout) const override
print condition
void setScales(const GlobalScales *)
std::vector< GlobalLogicParser::OperandToken > & operandTokenVector()
void setScales(const GlobalScales *)
const int cond0Index() const
get / set the index of the three subconditions in the cor* vector from menu
void init(const int numberPhysTriggers, const int nrL1Mu, const int nrL1MuShower, const int nrL1EG, const int nrL1Tau, const int nrL1Jet, int bxFirst, int bxLast)
initialize the class (mainly reserve)
void print(std::ostream &myCout) const override
print condition
std::unordered_map< std::string, ConditionEvaluation * > ConditionEvaluationMap
copy constructor
const l1t::GtConditionCategory cond0Category() const
get / set the category of the three subconditions
Log< level::Warning, false > LogWarning
std::bitset< GlobalAlgBlk::maxPhysicsTriggers > m_gtlAlgorithmOR
std::map< std::string, GlobalAlgorithm > AlgorithmMap
map containing the algorithms
const l1t::GtConditionCategory cond2Category() const
void receiveMuonShowerObjectData(const edm::Event &, const edm::EDGetTokenT< BXVector< l1t::MuonShower >> &, const bool receiveMuShower, const int nrL1MuShower)
void receiveMuonObjectData(const edm::Event &, const edm::EDGetTokenT< BXVector< l1t::Muon >> &, const bool receiveMu, const int nrL1Mu)
void print(std::ostream &myCout) const override
print condition