99 delete m_candL1MuShower;
103 delete m_candL1EtSum;
104 delete m_candL1EtSumZdc;
105 delete m_candL1External;
115 const int nrL1MuShower,
124 m_candL1Mu->setBXRange(m_bxFirst_, m_bxLast_);
125 m_candL1MuShower->setBXRange(m_bxFirst_, m_bxLast_);
126 m_candL1EG->setBXRange(m_bxFirst_, m_bxLast_);
127 m_candL1Tau->setBXRange(m_bxFirst_, m_bxLast_);
128 m_candL1Jet->setBXRange(m_bxFirst_, m_bxLast_);
129 m_candL1EtSum->setBXRange(m_bxFirst_, m_bxLast_);
130 m_candL1EtSumZdc->setBXRange(m_bxFirst_, m_bxLast_);
131 m_candL1External->setBXRange(m_bxFirst_, m_bxLast_);
135 LogDebug(
"L1TGlobal") <<
"\t Initializing Board with bxFirst = " << m_bxFirst_ <<
", bxLast = " << m_bxLast_;
145 const bool receiveEG,
147 const bool receiveTau,
149 const bool receiveJet,
151 const bool receiveEtSums,
152 const bool receiveEtSumsZdc) {
154 LogDebug(
"L1TGlobal") <<
"\n**** Board receiving Calo Data ";
162 iEvent.getByToken(egInputToken, egData);
166 edm::LogWarning(
"L1TGlobal") <<
"\nWarning: Input tag for the BXVector<l1t::EGamma> collection" 167 <<
"\nrequested in configuration, but not found in the event.\n";
171 for (
int i = egData->getFirstBX();
i <= egData->getLastBX(); ++
i) {
173 if (i < m_bxFirst_ || i > m_bxLast_)
178 for (std::vector<l1t::EGamma>::const_iterator eg = egData->begin(
i); eg != egData->end(
i); ++eg) {
180 (*m_candL1EG).push_back(
i, &(*eg));
182 edm::LogWarning(
"L1TGlobal") <<
" Too many EG (" << nObj <<
") for uGT Configuration maxEG =" << nrL1EG;
184 LogDebug(
"L1TGlobal") <<
"EG Pt " << eg->hwPt() <<
" Eta " << eg->hwEta() <<
" Phi " << eg->hwPhi()
185 <<
" Qual " << eg->hwQual() <<
" Iso " << eg->hwIso();
195 iEvent.getByToken(tauInputToken, tauData);
199 edm::LogWarning(
"L1TGlobal") <<
"\nWarning: Input tag for the BXVector<l1t::Tau> collection" 200 <<
"\nrequested in configuration, but not found in the event.\n";
204 for (
int i = tauData->getFirstBX();
i <= tauData->getLastBX(); ++
i) {
206 if (i < m_bxFirst_ || i > m_bxLast_)
211 for (std::vector<l1t::Tau>::const_iterator
tau = tauData->begin(
i);
tau != tauData->end(
i); ++
tau) {
212 if (nObj < nrL1Tau) {
213 (*m_candL1Tau).push_back(
i, &(*
tau));
215 LogTrace(
"L1TGlobal") <<
" Too many Tau (" << nObj <<
") for uGT Configuration maxTau =" << nrL1Tau;
218 LogDebug(
"L1TGlobal") <<
"tau Pt " <<
tau->hwPt() <<
" Eta " <<
tau->hwEta() <<
" Phi " <<
tau->hwPhi()
219 <<
" Qual " <<
tau->hwQual() <<
" Iso " <<
tau->hwIso();
233 edm::LogWarning(
"L1TGlobal") <<
"\nWarning: Input tag for the BXVector<l1t::Jet> collection" 234 <<
"\nrequested in configuration, but not found in the event.\n";
240 if (i < m_bxFirst_ || i > m_bxLast_)
246 if (nObj < nrL1Jet) {
247 (*m_candL1Jet).push_back(
i, &(*
jet));
249 edm::LogWarning(
"L1TGlobal") <<
" Too many Jets (" << nObj <<
") for uGT Configuration maxJet =" << nrL1Jet;
252 LogDebug(
"L1TGlobal") <<
"Jet Pt " <<
jet->hwPt() <<
" Eta " <<
jet->hwEta() <<
" Phi " <<
jet->hwPhi()
253 <<
" Qual " <<
jet->hwQual() <<
" Iso " <<
jet->hwIso();
262 iEvent.getByToken(sumInputToken, etSumData);
266 edm::LogWarning(
"L1TGlobal") <<
"\nWarning: Input tag for the BXVector<l1t::EtSum> collection" 267 <<
"\nrequested in configuration, but not found in the event.\n";
270 for (
int i = etSumData->getFirstBX();
i <= etSumData->getLastBX(); ++
i) {
272 if (i < m_bxFirst_ || i > m_bxLast_)
276 for (std::vector<l1t::EtSum>::const_iterator etsum = etSumData->begin(
i); etsum != etSumData->end(
i); ++etsum) {
277 (*m_candL1EtSum).push_back(
i, &(*etsum));
322 if (receiveEtSumsZdc) {
324 iEvent.getByToken(sumZdcInputToken, etSumData);
328 edm::LogWarning(
"L1TGlobal") <<
"\nWarning: Input tag for the ZDC Energy Sums collection" 329 <<
"\nrequested in configuration, but not found in the event.\n";
332 for (
int i = etSumData->getFirstBX();
i <= etSumData->getLastBX(); ++
i) {
334 if (i < m_bxFirst_ || i > m_bxLast_)
337 for (std::vector<l1t::EtSum>::const_iterator etsum = etSumData->begin(
i); etsum != etSumData->end(
i); ++etsum) {
338 (*m_candL1EtSumZdc).push_back(
i, &(*etsum));
348 const bool receiveMu,
351 LogDebug(
"L1TGlobal") <<
"\n**** GlobalBoard receiving muon data = ";
360 iEvent.getByToken(muInputToken, muonData);
364 edm::LogWarning(
"L1TGlobal") <<
"\nWarning: Input tag for the BXVector<l1t::Muon> collection" 365 <<
"\nrequested in configuration, but not found in the event.\n";
369 for (
int i = muonData->getFirstBX();
i <= muonData->getLastBX(); ++
i) {
371 if (i < m_bxFirst_ || i > m_bxLast_)
376 for (std::vector<l1t::Muon>::const_iterator
mu = muonData->begin(
i);
mu != muonData->end(
i); ++
mu) {
378 (*m_candL1Mu).push_back(
i, &(*
mu));
380 edm::LogWarning(
"L1TGlobal") <<
" Too many Muons (" << nObj <<
") for uGT Configuration maxMu =" << nrL1Mu;
383 LogDebug(
"L1TGlobal") <<
"Muon Pt " <<
mu->hwPt() <<
" EtaAtVtx " <<
mu->hwEtaAtVtx() <<
" PhiAtVtx " 384 <<
mu->hwPhiAtVtx() <<
" Qual " <<
mu->hwQual() <<
" Iso " <<
mu->hwIso();
395 const bool receiveMuShower,
396 const int nrL1MuShower) {
398 if (receiveMuShower) {
400 iEvent.getByToken(muShowerInputToken, muonData);
404 edm::LogWarning(
"L1TGlobal") <<
"\nWarning: Input tag for the BXVector<l1t::MuonShower> collection" 405 <<
"\nrequested in configuration, but not found in the event.\n";
409 for (
int i = muonData->getFirstBX();
i <= muonData->getLastBX(); ++
i) {
411 if (i < m_bxFirst_ || i > m_bxLast_)
416 for (std::vector<l1t::MuonShower>::const_iterator
mu = muonData->begin(
i);
mu != muonData->end(
i); ++
mu) {
417 if (nObj < nrL1MuShower) {
422 std::shared_ptr<l1t::MuonShower> musOneNominalInTime =
423 std::make_shared<l1t::MuonShower>(
false,
false,
false,
false,
false,
false);
424 std::shared_ptr<l1t::MuonShower> musOneTightInTime =
425 std::make_shared<l1t::MuonShower>(
false,
false,
false,
false,
false,
false);
426 std::shared_ptr<l1t::MuonShower> musTwoLooseDiffSectorsInTime =
427 std::make_shared<l1t::MuonShower>(
false,
false,
false,
false,
false,
false);
428 std::shared_ptr<l1t::MuonShower> musOutOfTime0 =
429 std::make_shared<l1t::MuonShower>(
false,
false,
false,
false,
false,
false);
430 std::shared_ptr<l1t::MuonShower> musOutOfTime1 =
431 std::make_shared<l1t::MuonShower>(
false,
false,
false,
false,
false,
false);
433 musOneNominalInTime->setOneNominalInTime(
mu->isOneNominalInTime());
434 musOneTightInTime->setOneTightInTime(
mu->isOneTightInTime());
435 musTwoLooseDiffSectorsInTime->setTwoLooseDiffSectorsInTime(
mu->isTwoLooseDiffSectorsInTime());
436 musOutOfTime0->setMusOutOfTime0(
mu->musOutOfTime0());
437 musOutOfTime1->setMusOutOfTime1(
mu->musOutOfTime1());
439 (*m_candL1MuShower).push_back(
i, musOneNominalInTime);
440 (*m_candL1MuShower).push_back(
i, musOneTightInTime);
441 (*m_candL1MuShower).push_back(
i, musTwoLooseDiffSectorsInTime);
442 (*m_candL1MuShower).push_back(
i, musOutOfTime0);
443 (*m_candL1MuShower).push_back(
i, musOutOfTime1);
447 <<
") for uGT Configuration maxMuShower =" << nrL1MuShower;
459 const bool receiveExt) {
461 LogDebug(
"L1TGlobal") <<
"\n**** GlobalBoard receiving external data = ";
470 iEvent.getByToken(extInputToken, extData);
474 edm::LogWarning(
"L1TGlobal") <<
"\nWarning: Input tag for the BXVector<GlobalExtBlk> collection" 475 <<
"\nrequested in configuration, but not found in the event.\n";
479 for (
int i = extData->getFirstBX();
i <= extData->getLastBX(); ++
i) {
481 if (i < m_bxFirst_ || i > m_bxLast_)
485 for (std::vector<GlobalExtBlk>::const_iterator
ext = extData->begin(
i);
ext != extData->end(
i); ++
ext) {
486 (*m_candL1External).push_back(
i, &(*
ext));
497 const bool produceL1GtObjectMapRecord,
498 const int iBxInEvent,
499 std::unique_ptr<GlobalObjectMapRecord>& gtObjectMapRecord,
500 const unsigned int numberPhysTriggers,
502 const int nrL1MuShower,
506 const std::vector<ConditionMap>& conditionMap = m_l1GtMenu->
gtConditionMap();
510 LogDebug(
"L1TGlobal") <<
" L1 Menu Scales -- Set Name: " << scaleSetName;
514 m_algInitialOr =
false;
515 m_algPrescaledOr =
false;
516 m_algIntermOr =
false;
517 m_algFinalOr =
false;
518 m_algFinalOrVeto =
false;
520 const std::vector<std::vector<MuonTemplate>>& corrMuon = m_l1GtMenu->
corMuonTemplate();
522 const std::vector<std::vector<CaloTemplate>>& corrCalo = m_l1GtMenu->
corCaloTemplate();
524 const std::vector<std::vector<EnergySumTemplate>>& corrEnergySum = m_l1GtMenu->
corEnergySumTemplate();
526 LogDebug(
"L1TGlobal") <<
"Size corrMuon " << corrMuon.size() <<
"\nSize corrCalo " << corrCalo.size()
527 <<
"\nSize corrSums " << corrEnergySum.size();
535 if (m_conditionResultMaps.size() != conditionMap.size()) {
536 m_conditionResultMaps.clear();
537 m_conditionResultMaps.resize(conditionMap.size());
542 for (std::vector<ConditionMap>::const_iterator itCondOnChip = conditionMap.begin();
543 itCondOnChip != conditionMap.end();
549 for (
CItCond itCond = itCondOnChip->begin(); itCond != itCondOnChip->end(); itCond++) {
551 switch ((itCond->second)->condCategory()) {
554 const int ifMuEtaNumberBits = 0;
562 cMapResults[itCond->first] = muCondition;
564 if (m_verbosity && m_isDebugEnabled) {
565 std::ostringstream myCout;
566 muCondition->
print(myCout);
568 LogTrace(
"L1TGlobal") << myCout.str();
580 cMapResults[itCond->first] = muShowerCondition;
582 if (m_verbosity && m_isDebugEnabled) {
583 std::ostringstream myCout;
584 muShowerCondition->
print(myCout);
586 edm::LogWarning(
"L1TGlobal") <<
"MuonShowerCondition " << myCout.str();
593 const int ifCaloEtaNumberBits = 0;
596 new CaloCondition(itCond->second,
this, nrL1EG, nrL1Jet, nrL1Tau, ifCaloEtaNumberBits);
602 cMapResults[itCond->first] = caloCondition;
604 if (m_verbosity && m_isDebugEnabled) {
605 std::ostringstream myCout;
606 caloCondition->
print(myCout);
608 LogTrace(
"L1TGlobal") << myCout.str();
619 cMapResults[itCond->first] = eSumCondition;
621 if (m_verbosity && m_isDebugEnabled) {
622 std::ostringstream myCout;
623 eSumCondition->
print(myCout);
625 LogTrace(
"L1TGlobal") << myCout.str();
636 cMapResults[itCond->first] = eSumZdcCondition;
638 if (m_verbosity && m_isDebugEnabled) {
639 std::ostringstream myCout;
640 eSumZdcCondition->
print(myCout);
642 LogTrace(
"L1TGlobal") << myCout.str();
654 cMapResults[itCond->first] = extCondition;
656 if (m_verbosity && m_isDebugEnabled) {
657 std::ostringstream myCout;
658 extCondition->
print(myCout);
660 LogTrace(
"L1TGlobal") << myCout.str();
670 const int cond0Ind = corrTemplate->
cond0Index();
671 const int cond1Ind = corrTemplate->
cond1Index();
677 int cond0NrL1Objects = 0;
678 int cond1NrL1Objects = 0;
679 LogDebug(
"L1TGlobal") <<
" cond0NrL1Objects" << cond0NrL1Objects <<
" cond1NrL1Objects " 682 switch (cond0Categ) {
684 cond0Condition = &((corrMuon[iChip])[cond0Ind]);
687 cond0Condition = &((corrCalo[iChip])[cond0Ind]);
690 cond0Condition = &((corrEnergySum[iChip])[cond0Ind]);
697 switch (cond1Categ) {
699 cond1Condition = &((corrMuon[iChip])[cond1Ind]);
702 cond1Condition = &((corrCalo[iChip])[cond1Ind]);
705 cond1Condition = &((corrEnergySum[iChip])[cond1Ind]);
718 cMapResults[itCond->first] = correlationCond;
720 if (m_verbosity && m_isDebugEnabled) {
721 std::ostringstream myCout;
722 correlationCond->
print(myCout);
724 LogTrace(
"L1TGlobal") << myCout.str();
737 const int cond0Ind = corrTemplate->
cond0Index();
738 const int cond1Ind = corrTemplate->
cond1Index();
739 const int cond2Ind = corrTemplate->
cond2Index();
746 int cond0NrL1Objects = 0;
747 int cond1NrL1Objects = 0;
748 int cond2NrL1Objects = 0;
749 LogDebug(
"L1TGlobal") <<
" cond0NrL1Objects " << cond0NrL1Objects <<
" cond1NrL1Objects " 750 << cond1NrL1Objects <<
" cond2NrL1Objects " << cond2NrL1Objects;
752 cond0Condition = &((corrMuon[iChip])[cond0Ind]);
754 LogDebug(
"L1TGlobal") <<
"No muon0 to evaluate three-body correlation condition";
757 cond1Condition = &((corrMuon[iChip])[cond1Ind]);
759 LogDebug(
"L1TGlobal") <<
"No muon1 to evaluate three-body correlation condition";
762 cond2Condition = &((corrMuon[iChip])[cond2Ind]);
764 LogDebug(
"L1TGlobal") <<
"No muon2 to evaluate three-body correlation condition";
771 correlationThreeBodyCond->
setScales(>Scales);
773 cMapResults[itCond->first] = correlationThreeBodyCond;
775 if (m_verbosity && m_isDebugEnabled) {
776 std::ostringstream myCout;
777 correlationThreeBodyCond->
print(myCout);
779 LogTrace(
"L1TGlobal") << myCout.str();
791 const int cond0Ind = corrTemplate->
cond0Index();
792 const int cond1Ind = corrTemplate->
cond1Index();
793 const int cond2Ind = corrTemplate->
cond2Index();
800 int cond0NrL1Objects = 0;
801 int cond1NrL1Objects = 0;
802 int cond2NrL1Objects = 0;
803 LogDebug(
"L1TGlobal") <<
" cond0NrL1Objects" << cond0NrL1Objects <<
" cond1NrL1Objects " << cond1NrL1Objects
804 <<
" cond2NrL1Objects " << cond2NrL1Objects;
806 switch (cond0Categ) {
808 cond0Condition = &((corrMuon[iChip])[cond0Ind]);
811 cond0Condition = &((corrCalo[iChip])[cond0Ind]);
814 cond0Condition = &((corrEnergySum[iChip])[cond0Ind]);
821 switch (cond1Categ) {
823 cond1Condition = &((corrMuon[iChip])[cond1Ind]);
826 cond1Condition = &((corrCalo[iChip])[cond1Ind]);
829 cond1Condition = &((corrEnergySum[iChip])[cond1Ind]);
836 switch (cond2Categ) {
838 cond2Condition = &((corrMuon[iChip])[cond2Ind]);
841 cond2Condition = &((corrCalo[iChip])[cond2Ind]);
844 cond2Condition = &((corrEnergySum[iChip])[cond2Ind]);
855 correlationCondWOR->
setScales(>Scales);
858 cMapResults[itCond->first] = correlationCondWOR;
860 if (m_verbosity && m_isDebugEnabled) {
861 std::ostringstream myCout;
862 correlationCondWOR->
print(myCout);
864 LogTrace(
"L1TGlobal") << myCout.str();
886 std::vector<GlobalObjectMap> objMapVec;
887 if (produceL1GtObjectMapRecord && (iBxInEvent == 0))
888 objMapVec.reserve(numberPhysTriggers);
890 for (
CItAlgo itAlgo = algorithmMap.begin(); itAlgo != algorithmMap.end(); itAlgo++) {
892 gtAlg.
evaluateAlgorithm((itAlgo->second).algoChipNumber(), m_conditionResultMaps);
894 int algBitNumber = (itAlgo->second).algoBitNumber();
897 LogDebug(
"L1TGlobal") <<
" ===> for iBxInEvent = " << iBxInEvent <<
":\t algBitName = " << itAlgo->first
898 <<
",\t algBitNumber = " << algBitNumber <<
",\t algResult = " << algResult;
902 m_uGtAlgBlk.setAlgoDecisionInitial(algBitNumber, algResult);
903 m_algInitialOr =
true;
906 if (m_verbosity && m_isDebugEnabled) {
907 std::ostringstream myCout;
908 (itAlgo->second).
print(myCout);
911 LogTrace(
"L1TGlobal") << myCout.str();
915 if (produceL1GtObjectMapRecord && (iBxInEvent == 0)) {
916 std::vector<L1TObjectTypeInCond> otypes;
921 for (
auto imap = conditionMap.begin(); imap != conditionMap.end(); imap++) {
922 auto match = imap->find(iop->tokenName);
924 if (match != imap->end()) {
928 otype = match->second->objectType();
930 for (
auto itype =
otype.begin(); itype !=
otype.end(); itype++) {
936 edm::LogWarning(
"L1TGlobal") <<
"\n Failed to find match for operand token " << iop->tokenName <<
"\n";
938 otypes.push_back(
otype);
953 if (m_verbosity && m_isDebugEnabled) {
954 std::ostringstream myCout1;
955 objMap.
print(myCout1);
957 LogTrace(
"L1TGlobal") << myCout1.str();
960 objMapVec.push_back(objMap);
965 if (produceL1GtObjectMapRecord && (iBxInEvent == 0)) {
966 gtObjectMapRecord->swapGtObjectMap(objMapVec);
972 for (std::vector<AlgorithmEvaluation::ConditionEvaluationMap>::iterator itCondOnChip = m_conditionResultMaps.begin();
973 itCondOnChip != m_conditionResultMaps.end();
976 delete itCond->second;
977 itCond->second =
nullptr;
986 const int iBxInEvent,
987 const int totalBxInEvent,
988 const unsigned int numberPhysTriggers,
989 const std::vector<double>& prescaleFactorsAlgoTrig,
990 const std::vector<unsigned int>& triggerMaskAlgoTrig,
991 const std::vector<int>& triggerMaskVetoAlgoTrig,
992 const bool algorithmTriggersUnprescaled,
993 const bool algorithmTriggersUnmasked) {
995 LogDebug(
"L1TGlobal") <<
"\n**** GlobalBoard apply Final Decision Logic ";
999 if (m_prescaleCounterAlgoTrig.empty()
or 1000 (m_currentLumi !=
iEvent.luminosityBlock() and m_resetPSCountersEachLumiSec)) {
1001 m_prescaleCounterAlgoTrig.clear();
1002 m_prescaleCounterAlgoTrig.reserve(totalBxInEvent);
1003 auto const& prescaleCountersAlgoTrig =
1004 m_semiRandomInitialPSCounters ? prescaleCountersWithSemirandomInitialCounter(prescaleFactorsAlgoTrig,
iEvent)
1005 : prescaleCounters(prescaleFactorsAlgoTrig);
1006 for (
int iBxInEvent = 0; iBxInEvent < totalBxInEvent; ++iBxInEvent) {
1007 m_prescaleCounterAlgoTrig.push_back(prescaleCountersAlgoTrig);
1010 m_currentLumi =
iEvent.luminosityBlock();
1015 m_uGtAlgBlk.copyInitialToInterm();
1020 if (!algorithmTriggersUnprescaled) {
1022 int const inBxInEvent = totalBxInEvent / 2 + iBxInEvent;
1024 bool temp_algPrescaledOr =
false;
1025 bool alreadyReported =
false;
1026 for (
unsigned int iBit = 0; iBit < numberPhysTriggers; ++iBit) {
1027 bool const bitValue = m_uGtAlgBlk.getAlgoDecisionInitial(iBit);
1030 if (iBit < prescaleFactorsAlgoTrig.size()) {
1031 if (prescaleFactorsAlgoTrig.at(iBit) != 1) {
1032 bool const triggered = m_prescaleCounterAlgoTrig.at(inBxInEvent).at(iBit).accept();
1034 temp_algPrescaledOr =
true;
1037 m_uGtAlgBlk.setAlgoDecisionInterm(iBit,
false);
1041 temp_algPrescaledOr =
true;
1044 else if (!alreadyReported) {
1045 alreadyReported =
true;
1046 edm::LogWarning(
"L1TGlobal") <<
"\nWarning: algoBit >= prescaleFactorsAlgoTrig.size() in bx " << iBxInEvent;
1051 m_algPrescaledOr = temp_algPrescaledOr;
1055 m_algPrescaledOr = m_algInitialOr;
1061 m_uGtAlgBlk.copyIntermToFinal();
1063 if (!algorithmTriggersUnmasked) {
1064 bool temp_algFinalOr =
false;
1065 bool alreadyReported =
false;
1066 for (
unsigned int iBit = 0; iBit < numberPhysTriggers; ++iBit) {
1067 const bool bitValue = m_uGtAlgBlk.getAlgoDecisionInterm(iBit);
1071 bool isMasked =
false;
1072 if (iBit < triggerMaskAlgoTrig.size())
1073 isMasked = (triggerMaskAlgoTrig.at(iBit) == 0);
1074 else if (!alreadyReported) {
1075 alreadyReported =
true;
1076 edm::LogWarning(
"L1TGlobal") <<
"\nWarning: algoBit >= triggerMaskAlgoTrig.size() in bx " << iBxInEvent;
1079 bool const passMask = (bitValue && !isMasked);
1082 temp_algFinalOr =
true;
1084 m_uGtAlgBlk.setAlgoDecisionFinal(iBit,
false);
1087 if (triggerMaskVetoAlgoTrig.at(iBit) == 1)
1088 m_algFinalOrVeto =
true;
1092 m_algIntermOr = temp_algFinalOr;
1095 m_algIntermOr = m_algPrescaledOr;
1102 m_algFinalOr = (m_algIntermOr & !m_algFinalOrVeto);
1107 std::unique_ptr<GlobalAlgBlkBxCollection>& uGtAlgRecord,
1112 LogDebug(
"L1TGlobal") <<
"\n**** GlobalBoard fill DAQ Records for bx= " << iBxInEvent;
1116 m_uGtAlgBlk.setbxInEventNr((iBxInEvent & 0xF));
1117 m_uGtAlgBlk.setPreScColumn(prescaleSet);
1118 m_uGtAlgBlk.setL1MenuUUID(menuUUID);
1119 m_uGtAlgBlk.setL1FirmwareUUID(firmwareUUID);
1121 m_uGtAlgBlk.setFinalORVeto(m_algFinalOrVeto);
1122 m_uGtAlgBlk.setFinalORPreVeto(m_algIntermOr);
1123 m_uGtAlgBlk.setFinalOR(m_algFinalOr);
1125 uGtAlgRecord->push_back(iBxInEvent, m_uGtAlgBlk);
1135 m_uGtAlgBlk.reset();
1137 m_gtlDecisionWord.reset();
1138 m_gtlAlgorithmOR.reset();
1143 m_candL1Mu->clear();
1144 m_candL1Mu->setBXRange(m_bxFirst_, m_bxLast_);
1149 m_candL1MuShower->clear();
1150 m_candL1MuShower->setBXRange(m_bxFirst_, m_bxLast_);
1155 m_candL1EG->clear();
1156 m_candL1Tau->clear();
1157 m_candL1Jet->clear();
1158 m_candL1EtSum->clear();
1159 m_candL1EtSumZdc->clear();
1161 m_candL1EG->setBXRange(m_bxFirst_, m_bxLast_);
1162 m_candL1Tau->setBXRange(m_bxFirst_, m_bxLast_);
1163 m_candL1Jet->setBXRange(m_bxFirst_, m_bxLast_);
1164 m_candL1EtSum->setBXRange(m_bxFirst_, m_bxLast_);
1165 m_candL1EtSumZdc->setBXRange(m_bxFirst_, m_bxLast_);
1169 m_candL1External->clear();
1170 m_candL1External->setBXRange(m_bxFirst_, m_bxLast_);
1175 LogTrace(
"L1TGlobal") <<
"\nl1t::L1GlobalTrigger: uGMT data received for BxInEvent = " << iBxInEvent;
1177 int nrL1Mu = m_candL1Mu->size(iBxInEvent);
1178 LogTrace(
"L1TGlobal") <<
"Number of GMT muons = " << nrL1Mu <<
"\n";
1183 std::vector<double>
const& prescaleFactorsAlgoTrig) {
1184 std::vector<PrescaleCounter>
out;
1185 out.reserve(prescaleFactorsAlgoTrig.size());
1186 for (
size_t iAlgo = 0; iAlgo < prescaleFactorsAlgoTrig.size(); ++iAlgo) {
1187 out.emplace_back(prescaleFactorsAlgoTrig[iAlgo]);
1194 std::vector<double>
const& prescaleFactorsAlgoTrig,
edm::Event const&
iEvent) {
1198 std::srand(
iEvent.id().run());
1199 std::srand(std::rand() +
iEvent.id().luminosityBlock());
1200 std::srand(std::rand() +
iEvent.id().event());
1201 int const semirandom = std::rand();
1203 std::vector<PrescaleCounter>
out;
1204 out.reserve(prescaleFactorsAlgoTrig.size());
1206 for (
size_t iAlgo = 0; iAlgo < prescaleFactorsAlgoTrig.size(); ++iAlgo) {
1207 out.emplace_back(prescaleFactorsAlgoTrig[iAlgo]);
1211 auto& prescaleCounter =
out.back();
1212 if (prescaleCounter.prescale_count > 0) {
1213 prescaleCounter.trigger_counter = semirandom % prescaleCounter.prescale_count;
1222 trigger_counter += m_singlestep;
1224 if (prescale_count == 0
or trigger_counter < prescale_count)
1227 trigger_counter -= prescale_count;
void setAlgoBitNumber(int algoBitNumberValue)
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
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
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)
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 bool receiveEG, const int nrL1EG, const bool receiveTau, const int nrL1Tau, const bool receiveJet, const int nrL1Jet, const bool receiveEtSums, const bool receiveEtSumsZdc)
receive data from Global Muon Trigger
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