104 delete m_candL1MuShower;
108 delete m_candL1EtSum;
109 delete m_candL1EtSumZdc;
110 delete m_candL1External;
120 const int nrL1MuShower,
129 m_candL1Mu->setBXRange(m_bxFirst_, m_bxLast_);
130 m_candL1MuShower->setBXRange(m_bxFirst_, m_bxLast_);
131 m_candL1EG->setBXRange(m_bxFirst_, m_bxLast_);
132 m_candL1Tau->setBXRange(m_bxFirst_, m_bxLast_);
133 m_candL1Jet->setBXRange(m_bxFirst_, m_bxLast_);
134 m_candL1EtSum->setBXRange(m_bxFirst_, m_bxLast_);
135 m_candL1EtSumZdc->setBXRange(m_bxFirst_, m_bxLast_);
136 m_candL1External->setBXRange(m_bxFirst_, m_bxLast_);
140 LogDebug(
"L1TGlobal") <<
"\t Initializing Board with bxFirst = " << m_bxFirst_ <<
", bxLast = " << m_bxLast_;
151 const bool receiveEG,
153 const bool receiveTau,
155 const bool receiveJet,
157 const bool receiveEtSums,
158 const bool receiveEtSumsZdc,
159 const bool receiveCICADA) {
161 LogDebug(
"L1TGlobal") <<
"\n**** Board receiving Calo Data ";
169 iEvent.getByToken(egInputToken, egData);
173 edm::LogWarning(
"L1TGlobal") <<
"\nWarning: Input tag for the BXVector<l1t::EGamma> collection" 174 <<
"\nrequested in configuration, but not found in the event.\n";
178 for (
int i = egData->getFirstBX();
i <= egData->getLastBX(); ++
i) {
180 if (i < m_bxFirst_ || i > m_bxLast_)
185 for (std::vector<l1t::EGamma>::const_iterator eg = egData->begin(
i); eg != egData->end(
i); ++eg) {
187 (*m_candL1EG).push_back(
i, &(*eg));
189 edm::LogWarning(
"L1TGlobal") <<
" Too many EG (" << nObj <<
") for uGT Configuration maxEG =" << nrL1EG;
191 LogDebug(
"L1TGlobal") <<
"EG Pt " << eg->hwPt() <<
" Eta " << eg->hwEta() <<
" Phi " << eg->hwPhi()
192 <<
" Qual " << eg->hwQual() <<
" Iso " << eg->hwIso();
202 iEvent.getByToken(tauInputToken, tauData);
206 edm::LogWarning(
"L1TGlobal") <<
"\nWarning: Input tag for the BXVector<l1t::Tau> collection" 207 <<
"\nrequested in configuration, but not found in the event.\n";
211 for (
int i = tauData->getFirstBX();
i <= tauData->getLastBX(); ++
i) {
213 if (i < m_bxFirst_ || i > m_bxLast_)
218 for (std::vector<l1t::Tau>::const_iterator
tau = tauData->begin(
i);
tau != tauData->end(
i); ++
tau) {
219 if (nObj < nrL1Tau) {
220 (*m_candL1Tau).push_back(
i, &(*
tau));
222 LogTrace(
"L1TGlobal") <<
" Too many Tau (" << nObj <<
") for uGT Configuration maxTau =" << nrL1Tau;
225 LogDebug(
"L1TGlobal") <<
"tau Pt " <<
tau->hwPt() <<
" Eta " <<
tau->hwEta() <<
" Phi " <<
tau->hwPhi()
226 <<
" Qual " <<
tau->hwQual() <<
" Iso " <<
tau->hwIso();
240 edm::LogWarning(
"L1TGlobal") <<
"\nWarning: Input tag for the BXVector<l1t::Jet> collection" 241 <<
"\nrequested in configuration, but not found in the event.\n";
247 if (i < m_bxFirst_ || i > m_bxLast_)
253 if (nObj < nrL1Jet) {
254 (*m_candL1Jet).push_back(
i, &(*
jet));
256 edm::LogWarning(
"L1TGlobal") <<
" Too many Jets (" << nObj <<
") for uGT Configuration maxJet =" << nrL1Jet;
259 LogDebug(
"L1TGlobal") <<
"Jet Pt " <<
jet->hwPt() <<
" Eta " <<
jet->hwEta() <<
" Phi " <<
jet->hwPhi()
260 <<
" Qual " <<
jet->hwQual() <<
" Iso " <<
jet->hwIso();
269 iEvent.getByToken(sumInputToken, etSumData);
273 edm::LogWarning(
"L1TGlobal") <<
"\nWarning: Input tag for the BXVector<l1t::EtSum> collection" 274 <<
"\nrequested in configuration, but not found in the event.\n";
277 for (
int i = etSumData->getFirstBX();
i <= etSumData->getLastBX(); ++
i) {
279 if (i < m_bxFirst_ || i > m_bxLast_)
283 for (std::vector<l1t::EtSum>::const_iterator etsum = etSumData->begin(
i); etsum != etSumData->end(
i); ++etsum) {
284 (*m_candL1EtSum).push_back(
i, &(*etsum));
329 if (receiveEtSumsZdc) {
331 iEvent.getByToken(sumZdcInputToken, etSumData);
335 edm::LogWarning(
"L1TGlobal") <<
"\nWarning: Input tag for the ZDC Energy Sums collection" 336 <<
"\nrequested in configuration, but not found in the event.\n";
339 for (
int i = etSumData->getFirstBX();
i <= etSumData->getLastBX(); ++
i) {
341 if (i < m_bxFirst_ || i > m_bxLast_)
344 for (std::vector<l1t::EtSum>::const_iterator etsum = etSumData->begin(
i); etsum != etSumData->end(
i); ++etsum) {
345 (*m_candL1EtSumZdc).push_back(
i, &(*etsum));
352 iEvent.getByToken(CICADAInputToken, cicadaScoreHandle);
353 if (not cicadaScoreHandle.
isValid()) {
355 edm::LogWarning(
"L1Tglobal") <<
"\nWarning: Input tag for the CICADA score" 356 <<
"\nrequested in configuration, but not found in the event.\n" 357 <<
"\nSetting score to 0.0";
360 }
else if (cicadaScoreHandle->isEmpty(0)) {
363 <<
"\nWarning: CICADA score had a valid input tag, but an empty BX collection" 364 <<
"\nThe CICADA score will be filled with 0.0 to prevent any failure of uGT emulation";
368 setCICADAScore(cicadaScoreHandle->at(
378 const bool receiveMu,
380 const std::vector<l1t::Muon>* muonVec_bxm2,
381 const std::vector<l1t::Muon>* muonVec_bxm1) {
383 LogDebug(
"L1TGlobal") <<
"\n**** GlobalBoard receiving muon data = ";
392 iEvent.getByToken(muInputToken, muonData);
396 edm::LogWarning(
"L1TGlobal") <<
"\nWarning: Input tag for the BXVector<l1t::Muon> collection" 397 <<
"\nrequested in configuration, but not found in the event.\n";
401 for (
int i = muonData->getFirstBX();
i <= muonData->getLastBX(); ++
i) {
403 if (i < m_bxFirst_ || i > m_bxLast_)
409 for (std::vector<l1t::Muon>::const_iterator
mu = muonVec_bxm2->begin();
mu != muonVec_bxm2->end(); ++
mu) {
411 (*m_candL1Mu).push_back(
i, &(*
mu));
414 <<
" Too many Muons (" << nObj <<
") for uGT Configuration maxMu =" << nrL1Mu;
417 LogDebug(
"L1TGlobal") <<
"Muon Pt " <<
mu->hwPt() <<
" EtaAtVtx " <<
mu->hwEtaAtVtx() <<
" PhiAtVtx " 418 <<
mu->hwPhiAtVtx() <<
" Qual " <<
mu->hwQual() <<
" Iso " <<
mu->hwIso();
421 }
else if (
i == -1) {
422 for (std::vector<l1t::Muon>::const_iterator
mu = muonVec_bxm1->begin();
mu != muonVec_bxm1->end(); ++
mu) {
424 (*m_candL1Mu).push_back(
i, &(*
mu));
427 <<
" Too many Muons (" << nObj <<
") for uGT Configuration maxMu =" << nrL1Mu;
430 LogDebug(
"L1TGlobal") <<
"Muon Pt " <<
mu->hwPt() <<
" EtaAtVtx " <<
mu->hwEtaAtVtx() <<
" PhiAtVtx " 431 <<
mu->hwPhiAtVtx() <<
" Qual " <<
mu->hwQual() <<
" Iso " <<
mu->hwIso();
435 for (std::vector<l1t::Muon>::const_iterator
mu = muonData->begin(
i);
mu != muonData->end(
i); ++
mu) {
437 (*m_candL1Mu).push_back(
i, &(*
mu));
440 <<
" Too many Muons (" << nObj <<
") for uGT Configuration maxMu =" << nrL1Mu;
443 LogDebug(
"L1TGlobal") <<
"Muon Pt " <<
mu->hwPt() <<
" EtaAtVtx " <<
mu->hwEtaAtVtx() <<
" PhiAtVtx " 444 <<
mu->hwPhiAtVtx() <<
" Qual " <<
mu->hwQual() <<
" Iso " <<
mu->hwIso();
456 const bool receiveMuShower,
457 const int nrL1MuShower) {
459 if (receiveMuShower) {
461 iEvent.getByToken(muShowerInputToken, muonData);
465 edm::LogWarning(
"L1TGlobal") <<
"\nWarning: Input tag for the BXVector<l1t::MuonShower> collection" 466 <<
"\nrequested in configuration, but not found in the event.\n";
470 for (
int i = muonData->getFirstBX();
i <= muonData->getLastBX(); ++
i) {
472 if (i < m_bxFirst_ || i > m_bxLast_)
477 for (std::vector<l1t::MuonShower>::const_iterator
mu = muonData->begin(
i);
mu != muonData->end(
i); ++
mu) {
478 if (nObj < nrL1MuShower) {
483 std::shared_ptr<l1t::MuonShower> musOneNominalInTime =
484 std::make_shared<l1t::MuonShower>(
false,
false,
false,
false,
false,
false);
485 std::shared_ptr<l1t::MuonShower> musOneTightInTime =
486 std::make_shared<l1t::MuonShower>(
false,
false,
false,
false,
false,
false);
487 std::shared_ptr<l1t::MuonShower> musTwoLooseDiffSectorsInTime =
488 std::make_shared<l1t::MuonShower>(
false,
false,
false,
false,
false,
false);
489 std::shared_ptr<l1t::MuonShower> musOutOfTime0 =
490 std::make_shared<l1t::MuonShower>(
false,
false,
false,
false,
false,
false);
491 std::shared_ptr<l1t::MuonShower> musOutOfTime1 =
492 std::make_shared<l1t::MuonShower>(
false,
false,
false,
false,
false,
false);
494 musOneNominalInTime->setOneNominalInTime(
mu->isOneNominalInTime());
495 musOneTightInTime->setOneTightInTime(
mu->isOneTightInTime());
496 musTwoLooseDiffSectorsInTime->setTwoLooseDiffSectorsInTime(
mu->isTwoLooseDiffSectorsInTime());
497 musOutOfTime0->setMusOutOfTime0(
mu->musOutOfTime0());
498 musOutOfTime1->setMusOutOfTime1(
mu->musOutOfTime1());
500 (*m_candL1MuShower).push_back(
i, musOneNominalInTime);
501 (*m_candL1MuShower).push_back(
i, musOneTightInTime);
502 (*m_candL1MuShower).push_back(
i, musTwoLooseDiffSectorsInTime);
503 (*m_candL1MuShower).push_back(
i, musOutOfTime0);
504 (*m_candL1MuShower).push_back(
i, musOutOfTime1);
508 <<
") for uGT Configuration maxMuShower =" << nrL1MuShower;
520 const bool receiveExt) {
522 LogDebug(
"L1TGlobal") <<
"\n**** GlobalBoard receiving external data = ";
531 iEvent.getByToken(extInputToken, extData);
535 edm::LogWarning(
"L1TGlobal") <<
"\nWarning: Input tag for the BXVector<GlobalExtBlk> collection" 536 <<
"\nrequested in configuration, but not found in the event.\n";
540 for (
int i = extData->getFirstBX();
i <= extData->getLastBX(); ++
i) {
542 if (i < m_bxFirst_ || i > m_bxLast_)
546 for (std::vector<GlobalExtBlk>::const_iterator
ext = extData->begin(
i);
ext != extData->end(
i); ++
ext) {
547 (*m_candL1External).push_back(
i, &(*
ext));
556 m_uGtAXOScore.reset();
557 m_uGtAXOScore.setbxInEventNr((iBxInEvent & 0xF));
560 float scorevalue = 0.0;
561 if (iBxInEvent == 0) {
562 scorevalue = m_storedAXOScore;
566 m_uGtAXOScore.setAXOScore(scorevalue);
567 AxoScoreRecord->push_back(iBxInEvent, m_uGtAXOScore);
574 const bool produceL1GtObjectMapRecord,
575 const int iBxInEvent,
576 std::unique_ptr<GlobalObjectMapRecord>& gtObjectMapRecord,
577 const unsigned int numberPhysTriggers,
579 const int nrL1MuShower,
583 const std::vector<ConditionMap>& conditionMap = m_l1GtMenu->
gtConditionMap();
587 LogDebug(
"L1TGlobal") <<
" L1 Menu Scales -- Set Name: " << scaleSetName;
591 m_algInitialOr =
false;
592 m_algPrescaledOr =
false;
593 m_algIntermOr =
false;
594 m_algFinalOr =
false;
595 m_algFinalOrVeto =
false;
597 const std::vector<std::vector<MuonTemplate>>& corrMuon = m_l1GtMenu->
corMuonTemplate();
599 const std::vector<std::vector<CaloTemplate>>& corrCalo = m_l1GtMenu->
corCaloTemplate();
601 const std::vector<std::vector<EnergySumTemplate>>& corrEnergySum = m_l1GtMenu->
corEnergySumTemplate();
603 LogDebug(
"L1TGlobal") <<
"Size corrMuon " << corrMuon.size() <<
"\nSize corrCalo " << corrCalo.size()
604 <<
"\nSize corrSums " << corrEnergySum.size();
612 if (m_conditionResultMaps.size() != conditionMap.size()) {
613 m_conditionResultMaps.clear();
614 m_conditionResultMaps.resize(conditionMap.size());
619 for (std::vector<ConditionMap>::const_iterator itCondOnChip = conditionMap.begin();
620 itCondOnChip != conditionMap.end();
626 for (
CItCond itCond = itCondOnChip->begin(); itCond != itCondOnChip->end(); itCond++) {
628 switch ((itCond->second)->condCategory()) {
631 const int ifMuEtaNumberBits = 0;
639 cMapResults[itCond->first] = muCondition;
641 if (m_verbosity && m_isDebugEnabled) {
642 std::ostringstream myCout;
643 muCondition->
print(myCout);
645 LogTrace(
"L1TGlobal") << myCout.str();
657 cMapResults[itCond->first] = muShowerCondition;
659 if (m_verbosity && m_isDebugEnabled) {
660 std::ostringstream myCout;
661 muShowerCondition->
print(myCout);
663 edm::LogWarning(
"L1TGlobal") <<
"MuonShowerCondition " << myCout.str();
670 const int ifCaloEtaNumberBits = 0;
673 new CaloCondition(itCond->second,
this, nrL1EG, nrL1Jet, nrL1Tau, ifCaloEtaNumberBits);
679 cMapResults[itCond->first] = caloCondition;
681 if (m_verbosity && m_isDebugEnabled) {
682 std::ostringstream myCout;
683 caloCondition->
print(myCout);
685 LogTrace(
"L1TGlobal") << myCout.str();
696 cMapResults[itCond->first] = eSumCondition;
698 if (m_verbosity && m_isDebugEnabled) {
699 std::ostringstream myCout;
700 eSumCondition->
print(myCout);
702 LogTrace(
"L1TGlobal") << myCout.str();
713 cMapResults[itCond->first] = eSumZdcCondition;
715 if (m_verbosity && m_isDebugEnabled) {
716 std::ostringstream myCout;
717 eSumZdcCondition->
print(myCout);
719 LogTrace(
"L1TGlobal") << myCout.str();
731 cMapResults[itCond->first] = axol1tlCondition;
735 if (m_saveAXOScore && m_storedAXOScore < 0.0) {
736 m_storedAXOScore = axol1tlCondition->
getScore();
739 if (m_verbosity && m_isDebugEnabled) {
740 std::ostringstream myCout;
741 axol1tlCondition->
print(myCout);
754 cMapResults[itCond->first] = cicadaCondition;
756 if (m_verbosity && m_isDebugEnabled) {
757 std::ostringstream myCout;
758 cicadaCondition->
print(myCout);
770 cMapResults[itCond->first] = extCondition;
772 if (m_verbosity && m_isDebugEnabled) {
773 std::ostringstream myCout;
774 extCondition->
print(myCout);
776 LogTrace(
"L1TGlobal") << myCout.str();
786 const int cond0Ind = corrTemplate->
cond0Index();
787 const int cond1Ind = corrTemplate->
cond1Index();
793 int cond0NrL1Objects = 0;
794 int cond1NrL1Objects = 0;
795 LogDebug(
"L1TGlobal") <<
" cond0NrL1Objects" << cond0NrL1Objects <<
" cond1NrL1Objects " 798 switch (cond0Categ) {
800 cond0Condition = &((corrMuon[iChip])[cond0Ind]);
803 cond0Condition = &((corrCalo[iChip])[cond0Ind]);
806 cond0Condition = &((corrEnergySum[iChip])[cond0Ind]);
813 switch (cond1Categ) {
815 cond1Condition = &((corrMuon[iChip])[cond1Ind]);
818 cond1Condition = &((corrCalo[iChip])[cond1Ind]);
821 cond1Condition = &((corrEnergySum[iChip])[cond1Ind]);
834 cMapResults[itCond->first] = correlationCond;
836 if (m_verbosity && m_isDebugEnabled) {
837 std::ostringstream myCout;
838 correlationCond->
print(myCout);
840 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 " 866 << cond1NrL1Objects <<
" cond2NrL1Objects " << cond2NrL1Objects;
868 cond0Condition = &((corrMuon[iChip])[cond0Ind]);
870 LogDebug(
"L1TGlobal") <<
"No muon0 to evaluate three-body correlation condition";
873 cond1Condition = &((corrMuon[iChip])[cond1Ind]);
875 LogDebug(
"L1TGlobal") <<
"No muon1 to evaluate three-body correlation condition";
878 cond2Condition = &((corrMuon[iChip])[cond2Ind]);
880 LogDebug(
"L1TGlobal") <<
"No muon2 to evaluate three-body correlation condition";
887 correlationThreeBodyCond->
setScales(>Scales);
889 cMapResults[itCond->first] = correlationThreeBodyCond;
891 if (m_verbosity && m_isDebugEnabled) {
892 std::ostringstream myCout;
893 correlationThreeBodyCond->
print(myCout);
895 LogTrace(
"L1TGlobal") << myCout.str();
907 const int cond0Ind = corrTemplate->
cond0Index();
908 const int cond1Ind = corrTemplate->
cond1Index();
909 const int cond2Ind = corrTemplate->
cond2Index();
916 int cond0NrL1Objects = 0;
917 int cond1NrL1Objects = 0;
918 int cond2NrL1Objects = 0;
919 LogDebug(
"L1TGlobal") <<
" cond0NrL1Objects" << cond0NrL1Objects <<
" cond1NrL1Objects " << cond1NrL1Objects
920 <<
" cond2NrL1Objects " << cond2NrL1Objects;
922 switch (cond0Categ) {
924 cond0Condition = &((corrMuon[iChip])[cond0Ind]);
927 cond0Condition = &((corrCalo[iChip])[cond0Ind]);
930 cond0Condition = &((corrEnergySum[iChip])[cond0Ind]);
937 switch (cond1Categ) {
939 cond1Condition = &((corrMuon[iChip])[cond1Ind]);
942 cond1Condition = &((corrCalo[iChip])[cond1Ind]);
945 cond1Condition = &((corrEnergySum[iChip])[cond1Ind]);
952 switch (cond2Categ) {
954 cond2Condition = &((corrMuon[iChip])[cond2Ind]);
957 cond2Condition = &((corrCalo[iChip])[cond2Ind]);
960 cond2Condition = &((corrEnergySum[iChip])[cond2Ind]);
971 correlationCondWOR->
setScales(>Scales);
974 cMapResults[itCond->first] = correlationCondWOR;
976 if (m_verbosity && m_isDebugEnabled) {
977 std::ostringstream myCout;
978 correlationCondWOR->
print(myCout);
980 LogTrace(
"L1TGlobal") << myCout.str();
1002 std::vector<GlobalObjectMap> objMapVec;
1003 if (produceL1GtObjectMapRecord && (iBxInEvent == 0))
1004 objMapVec.reserve(numberPhysTriggers);
1006 for (
CItAlgo itAlgo = algorithmMap.begin(); itAlgo != algorithmMap.end(); itAlgo++) {
1008 gtAlg.
evaluateAlgorithm((itAlgo->second).algoChipNumber(), m_conditionResultMaps);
1010 int algBitNumber = (itAlgo->second).algoBitNumber();
1013 LogDebug(
"L1TGlobal") <<
" ===> for iBxInEvent = " << iBxInEvent <<
":\t algBitName = " << itAlgo->first
1014 <<
",\t algBitNumber = " << algBitNumber <<
",\t algResult = " << algResult;
1018 m_uGtAlgBlk.setAlgoDecisionInitial(algBitNumber, algResult);
1019 m_algInitialOr =
true;
1022 if (m_verbosity && m_isDebugEnabled) {
1023 std::ostringstream myCout;
1024 (itAlgo->second).
print(myCout);
1025 gtAlg.
print(myCout);
1027 LogTrace(
"L1TGlobal") << myCout.str();
1031 if (produceL1GtObjectMapRecord && (iBxInEvent == 0)) {
1032 std::vector<L1TObjectTypeInCond> otypes;
1037 for (
auto imap = conditionMap.begin(); imap != conditionMap.end(); imap++) {
1038 auto match = imap->find(iop->tokenName);
1040 if (match != imap->end()) {
1044 otype = match->second->objectType();
1046 for (
auto itype =
otype.begin(); itype !=
otype.end(); itype++) {
1052 edm::LogWarning(
"L1TGlobal") <<
"\n Failed to find match for operand token " << iop->tokenName <<
"\n";
1054 otypes.push_back(
otype);
1069 if (m_verbosity && m_isDebugEnabled) {
1070 std::ostringstream myCout1;
1071 objMap.
print(myCout1);
1073 LogTrace(
"L1TGlobal") << myCout1.str();
1076 objMapVec.push_back(objMap);
1081 if (produceL1GtObjectMapRecord && (iBxInEvent == 0)) {
1082 gtObjectMapRecord->swapGtObjectMap(objMapVec);
1088 for (std::vector<AlgorithmEvaluation::ConditionEvaluationMap>::iterator itCondOnChip = m_conditionResultMaps.begin();
1089 itCondOnChip != m_conditionResultMaps.end();
1092 delete itCond->second;
1093 itCond->second =
nullptr;
1102 const int iBxInEvent,
1103 const int totalBxInEvent,
1104 const unsigned int numberPhysTriggers,
1105 const std::vector<double>& prescaleFactorsAlgoTrig,
1106 const std::vector<unsigned int>& triggerMaskAlgoTrig,
1107 const std::vector<int>& triggerMaskVetoAlgoTrig,
1108 const bool algorithmTriggersUnprescaled,
1109 const bool algorithmTriggersUnmasked) {
1111 LogDebug(
"L1TGlobal") <<
"\n**** GlobalBoard apply Final Decision Logic ";
1115 if (m_prescaleCounterAlgoTrig.empty()
or 1116 (m_currentLumi !=
iEvent.luminosityBlock() and m_resetPSCountersEachLumiSec)) {
1117 m_prescaleCounterAlgoTrig.clear();
1118 m_prescaleCounterAlgoTrig.reserve(totalBxInEvent);
1119 auto const& prescaleCountersAlgoTrig =
1120 m_semiRandomInitialPSCounters ? prescaleCountersWithSemirandomInitialCounter(prescaleFactorsAlgoTrig,
iEvent)
1121 : prescaleCounters(prescaleFactorsAlgoTrig);
1122 for (
int iBxInEvent = 0; iBxInEvent < totalBxInEvent; ++iBxInEvent) {
1123 m_prescaleCounterAlgoTrig.push_back(prescaleCountersAlgoTrig);
1126 m_currentLumi =
iEvent.luminosityBlock();
1131 m_uGtAlgBlk.copyInitialToInterm();
1136 if (!algorithmTriggersUnprescaled) {
1138 int const inBxInEvent = totalBxInEvent / 2 + iBxInEvent;
1140 bool temp_algPrescaledOr =
false;
1141 bool alreadyReported =
false;
1142 for (
unsigned int iBit = 0; iBit < numberPhysTriggers; ++iBit) {
1143 bool const bitValue = m_uGtAlgBlk.getAlgoDecisionInitial(iBit);
1146 if (iBit < prescaleFactorsAlgoTrig.size()) {
1147 if (prescaleFactorsAlgoTrig.at(iBit) != 1) {
1148 bool const triggered = m_prescaleCounterAlgoTrig.at(inBxInEvent).at(iBit).accept();
1150 temp_algPrescaledOr =
true;
1153 m_uGtAlgBlk.setAlgoDecisionInterm(iBit,
false);
1157 temp_algPrescaledOr =
true;
1160 else if (!alreadyReported) {
1161 alreadyReported =
true;
1162 edm::LogWarning(
"L1TGlobal") <<
"\nWarning: algoBit >= prescaleFactorsAlgoTrig.size() in bx " << iBxInEvent;
1167 m_algPrescaledOr = temp_algPrescaledOr;
1171 m_algPrescaledOr = m_algInitialOr;
1177 m_uGtAlgBlk.copyIntermToFinal();
1179 if (!algorithmTriggersUnmasked) {
1180 bool temp_algFinalOr =
false;
1181 bool alreadyReported =
false;
1182 for (
unsigned int iBit = 0; iBit < numberPhysTriggers; ++iBit) {
1183 const bool bitValue = m_uGtAlgBlk.getAlgoDecisionInterm(iBit);
1187 bool isMasked =
false;
1188 if (iBit < triggerMaskAlgoTrig.size())
1189 isMasked = (triggerMaskAlgoTrig.at(iBit) == 0);
1190 else if (!alreadyReported) {
1191 alreadyReported =
true;
1192 edm::LogWarning(
"L1TGlobal") <<
"\nWarning: algoBit >= triggerMaskAlgoTrig.size() in bx " << iBxInEvent;
1195 bool const passMask = (bitValue && !isMasked);
1198 temp_algFinalOr =
true;
1200 m_uGtAlgBlk.setAlgoDecisionFinal(iBit,
false);
1203 if (triggerMaskVetoAlgoTrig.at(iBit) == 1)
1204 m_algFinalOrVeto =
true;
1208 m_algIntermOr = temp_algFinalOr;
1211 m_algIntermOr = m_algPrescaledOr;
1218 m_algFinalOr = (m_algIntermOr & !m_algFinalOrVeto);
1223 std::unique_ptr<GlobalAlgBlkBxCollection>& uGtAlgRecord,
1228 LogDebug(
"L1TGlobal") <<
"\n**** GlobalBoard fill DAQ Records for bx= " << iBxInEvent;
1232 m_uGtAlgBlk.setbxInEventNr((iBxInEvent & 0xF));
1233 m_uGtAlgBlk.setPreScColumn(prescaleSet);
1234 m_uGtAlgBlk.setL1MenuUUID(menuUUID);
1235 m_uGtAlgBlk.setL1FirmwareUUID(firmwareUUID);
1237 m_uGtAlgBlk.setFinalORVeto(m_algFinalOrVeto);
1238 m_uGtAlgBlk.setFinalORPreVeto(m_algIntermOr);
1239 m_uGtAlgBlk.setFinalOR(m_algFinalOr);
1241 uGtAlgRecord->push_back(iBxInEvent, m_uGtAlgBlk);
1251 m_uGtAlgBlk.reset();
1254 m_storedAXOScore = -999.0;
1255 m_uGtAXOScore.reset();
1257 m_gtlDecisionWord.reset();
1258 m_gtlAlgorithmOR.reset();
1263 m_candL1Mu->clear();
1264 m_candL1Mu->setBXRange(m_bxFirst_, m_bxLast_);
1269 m_candL1MuShower->clear();
1270 m_candL1MuShower->setBXRange(m_bxFirst_, m_bxLast_);
1275 m_candL1EG->clear();
1276 m_candL1Tau->clear();
1277 m_candL1Jet->clear();
1278 m_candL1EtSum->clear();
1279 m_candL1EtSumZdc->clear();
1280 m_cicadaScore = 0.0;
1282 m_candL1EG->setBXRange(m_bxFirst_, m_bxLast_);
1283 m_candL1Tau->setBXRange(m_bxFirst_, m_bxLast_);
1284 m_candL1Jet->setBXRange(m_bxFirst_, m_bxLast_);
1285 m_candL1EtSum->setBXRange(m_bxFirst_, m_bxLast_);
1286 m_candL1EtSumZdc->setBXRange(m_bxFirst_, m_bxLast_);
1290 m_candL1External->clear();
1291 m_candL1External->setBXRange(m_bxFirst_, m_bxLast_);
1296 LogTrace(
"L1TGlobal") <<
"\nl1t::L1GlobalTrigger: uGMT data received for BxInEvent = " << iBxInEvent;
1298 int nrL1Mu = m_candL1Mu->size(iBxInEvent);
1299 LogTrace(
"L1TGlobal") <<
"Number of GMT muons = " << nrL1Mu <<
"\n";
1304 std::vector<double>
const& prescaleFactorsAlgoTrig) {
1305 std::vector<PrescaleCounter>
out;
1306 out.reserve(prescaleFactorsAlgoTrig.size());
1307 for (
size_t iAlgo = 0; iAlgo < prescaleFactorsAlgoTrig.size(); ++iAlgo) {
1308 out.emplace_back(prescaleFactorsAlgoTrig[iAlgo]);
1315 std::vector<double>
const& prescaleFactorsAlgoTrig,
edm::Event const&
iEvent) {
1319 std::srand(
iEvent.id().run());
1320 std::srand(std::rand() +
iEvent.id().luminosityBlock());
1321 std::srand(std::rand() +
iEvent.id().event());
1322 int const semirandom = std::rand();
1324 std::vector<PrescaleCounter>
out;
1325 out.reserve(prescaleFactorsAlgoTrig.size());
1327 for (
size_t iAlgo = 0; iAlgo < prescaleFactorsAlgoTrig.size(); ++iAlgo) {
1328 out.emplace_back(prescaleFactorsAlgoTrig[iAlgo]);
1332 auto& prescaleCounter =
out.back();
1333 if (prescaleCounter.prescale_count > 0) {
1334 prescaleCounter.trigger_counter = semirandom % prescaleCounter.prescale_count;
1343 trigger_counter += m_singlestep;
1345 if (prescale_count == 0
or trigger_counter < prescale_count)
1348 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 receiveMuonObjectData(const edm::Event &, const edm::EDGetTokenT< BXVector< l1t::Muon >> &, const bool receiveMu, const int nrL1Mu, const std::vector< l1t::Muon > *muonVec_bxm2, const std::vector< l1t::Muon > *muonVec_bxm1)
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
AXOL1TLScore m_uGtAXOScore
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 print(std::ostream &myCout) const override
print condition
void fillAXOScore(int iBxInEvent, std::unique_ptr< AXOL1TLScoreBxCollection > &AxoScoreRecord)