101 delete m_candL1MuShower;
105 delete m_candL1EtSum;
106 delete m_candL1EtSumZdc;
107 delete m_candL1External;
117 const int nrL1MuShower,
126 m_candL1Mu->setBXRange(m_bxFirst_, m_bxLast_);
127 m_candL1MuShower->setBXRange(m_bxFirst_, m_bxLast_);
128 m_candL1EG->setBXRange(m_bxFirst_, m_bxLast_);
129 m_candL1Tau->setBXRange(m_bxFirst_, m_bxLast_);
130 m_candL1Jet->setBXRange(m_bxFirst_, m_bxLast_);
131 m_candL1EtSum->setBXRange(m_bxFirst_, m_bxLast_);
132 m_candL1EtSumZdc->setBXRange(m_bxFirst_, m_bxLast_);
133 m_candL1External->setBXRange(m_bxFirst_, m_bxLast_);
137 LogDebug(
"L1TGlobal") <<
"\t Initializing Board with bxFirst = " << m_bxFirst_ <<
", bxLast = " << m_bxLast_;
147 const bool receiveEG,
149 const bool receiveTau,
151 const bool receiveJet,
153 const bool receiveEtSums,
154 const bool receiveEtSumsZdc) {
156 LogDebug(
"L1TGlobal") <<
"\n**** Board receiving Calo Data ";
164 iEvent.getByToken(egInputToken, egData);
168 edm::LogWarning(
"L1TGlobal") <<
"\nWarning: Input tag for the BXVector<l1t::EGamma> collection" 169 <<
"\nrequested in configuration, but not found in the event.\n";
173 for (
int i = egData->getFirstBX();
i <= egData->getLastBX(); ++
i) {
175 if (i < m_bxFirst_ || i > m_bxLast_)
180 for (std::vector<l1t::EGamma>::const_iterator eg = egData->begin(
i); eg != egData->end(
i); ++eg) {
182 (*m_candL1EG).push_back(
i, &(*eg));
184 edm::LogWarning(
"L1TGlobal") <<
" Too many EG (" << nObj <<
") for uGT Configuration maxEG =" << nrL1EG;
186 LogDebug(
"L1TGlobal") <<
"EG Pt " << eg->hwPt() <<
" Eta " << eg->hwEta() <<
" Phi " << eg->hwPhi()
187 <<
" Qual " << eg->hwQual() <<
" Iso " << eg->hwIso();
197 iEvent.getByToken(tauInputToken, tauData);
201 edm::LogWarning(
"L1TGlobal") <<
"\nWarning: Input tag for the BXVector<l1t::Tau> collection" 202 <<
"\nrequested in configuration, but not found in the event.\n";
206 for (
int i = tauData->getFirstBX();
i <= tauData->getLastBX(); ++
i) {
208 if (i < m_bxFirst_ || i > m_bxLast_)
213 for (std::vector<l1t::Tau>::const_iterator
tau = tauData->begin(
i);
tau != tauData->end(
i); ++
tau) {
214 if (nObj < nrL1Tau) {
215 (*m_candL1Tau).push_back(
i, &(*
tau));
217 LogTrace(
"L1TGlobal") <<
" Too many Tau (" << nObj <<
") for uGT Configuration maxTau =" << nrL1Tau;
220 LogDebug(
"L1TGlobal") <<
"tau Pt " <<
tau->hwPt() <<
" Eta " <<
tau->hwEta() <<
" Phi " <<
tau->hwPhi()
221 <<
" Qual " <<
tau->hwQual() <<
" Iso " <<
tau->hwIso();
235 edm::LogWarning(
"L1TGlobal") <<
"\nWarning: Input tag for the BXVector<l1t::Jet> collection" 236 <<
"\nrequested in configuration, but not found in the event.\n";
242 if (i < m_bxFirst_ || i > m_bxLast_)
248 if (nObj < nrL1Jet) {
249 (*m_candL1Jet).push_back(
i, &(*
jet));
251 edm::LogWarning(
"L1TGlobal") <<
" Too many Jets (" << nObj <<
") for uGT Configuration maxJet =" << nrL1Jet;
254 LogDebug(
"L1TGlobal") <<
"Jet Pt " <<
jet->hwPt() <<
" Eta " <<
jet->hwEta() <<
" Phi " <<
jet->hwPhi()
255 <<
" Qual " <<
jet->hwQual() <<
" Iso " <<
jet->hwIso();
264 iEvent.getByToken(sumInputToken, etSumData);
268 edm::LogWarning(
"L1TGlobal") <<
"\nWarning: Input tag for the BXVector<l1t::EtSum> collection" 269 <<
"\nrequested in configuration, but not found in the event.\n";
272 for (
int i = etSumData->getFirstBX();
i <= etSumData->getLastBX(); ++
i) {
274 if (i < m_bxFirst_ || i > m_bxLast_)
278 for (std::vector<l1t::EtSum>::const_iterator etsum = etSumData->begin(
i); etsum != etSumData->end(
i); ++etsum) {
279 (*m_candL1EtSum).push_back(
i, &(*etsum));
324 if (receiveEtSumsZdc) {
326 iEvent.getByToken(sumZdcInputToken, etSumData);
330 edm::LogWarning(
"L1TGlobal") <<
"\nWarning: Input tag for the ZDC Energy Sums collection" 331 <<
"\nrequested in configuration, but not found in the event.\n";
334 for (
int i = etSumData->getFirstBX();
i <= etSumData->getLastBX(); ++
i) {
336 if (i < m_bxFirst_ || i > m_bxLast_)
339 for (std::vector<l1t::EtSum>::const_iterator etsum = etSumData->begin(
i); etsum != etSumData->end(
i); ++etsum) {
340 (*m_candL1EtSumZdc).push_back(
i, &(*etsum));
350 const bool receiveMu,
353 LogDebug(
"L1TGlobal") <<
"\n**** GlobalBoard receiving muon data = ";
362 iEvent.getByToken(muInputToken, muonData);
366 edm::LogWarning(
"L1TGlobal") <<
"\nWarning: Input tag for the BXVector<l1t::Muon> collection" 367 <<
"\nrequested in configuration, but not found in the event.\n";
371 for (
int i = muonData->getFirstBX();
i <= muonData->getLastBX(); ++
i) {
373 if (i < m_bxFirst_ || i > m_bxLast_)
378 for (std::vector<l1t::Muon>::const_iterator
mu = muonData->begin(
i);
mu != muonData->end(
i); ++
mu) {
380 (*m_candL1Mu).push_back(
i, &(*
mu));
382 edm::LogWarning(
"L1TGlobal") <<
" Too many Muons (" << nObj <<
") for uGT Configuration maxMu =" << nrL1Mu;
385 LogDebug(
"L1TGlobal") <<
"Muon Pt " <<
mu->hwPt() <<
" EtaAtVtx " <<
mu->hwEtaAtVtx() <<
" PhiAtVtx " 386 <<
mu->hwPhiAtVtx() <<
" Qual " <<
mu->hwQual() <<
" Iso " <<
mu->hwIso();
397 const bool receiveMuShower,
398 const int nrL1MuShower) {
400 if (receiveMuShower) {
402 iEvent.getByToken(muShowerInputToken, muonData);
406 edm::LogWarning(
"L1TGlobal") <<
"\nWarning: Input tag for the BXVector<l1t::MuonShower> collection" 407 <<
"\nrequested in configuration, but not found in the event.\n";
411 for (
int i = muonData->getFirstBX();
i <= muonData->getLastBX(); ++
i) {
413 if (i < m_bxFirst_ || i > m_bxLast_)
418 for (std::vector<l1t::MuonShower>::const_iterator
mu = muonData->begin(
i);
mu != muonData->end(
i); ++
mu) {
419 if (nObj < nrL1MuShower) {
424 std::shared_ptr<l1t::MuonShower> musOneNominalInTime =
425 std::make_shared<l1t::MuonShower>(
false,
false,
false,
false,
false,
false);
426 std::shared_ptr<l1t::MuonShower> musOneTightInTime =
427 std::make_shared<l1t::MuonShower>(
false,
false,
false,
false,
false,
false);
428 std::shared_ptr<l1t::MuonShower> musTwoLooseDiffSectorsInTime =
429 std::make_shared<l1t::MuonShower>(
false,
false,
false,
false,
false,
false);
430 std::shared_ptr<l1t::MuonShower> musOutOfTime0 =
431 std::make_shared<l1t::MuonShower>(
false,
false,
false,
false,
false,
false);
432 std::shared_ptr<l1t::MuonShower> musOutOfTime1 =
433 std::make_shared<l1t::MuonShower>(
false,
false,
false,
false,
false,
false);
435 musOneNominalInTime->setOneNominalInTime(
mu->isOneNominalInTime());
436 musOneTightInTime->setOneTightInTime(
mu->isOneTightInTime());
437 musTwoLooseDiffSectorsInTime->setTwoLooseDiffSectorsInTime(
mu->isTwoLooseDiffSectorsInTime());
438 musOutOfTime0->setMusOutOfTime0(
mu->musOutOfTime0());
439 musOutOfTime1->setMusOutOfTime1(
mu->musOutOfTime1());
441 (*m_candL1MuShower).push_back(
i, musOneNominalInTime);
442 (*m_candL1MuShower).push_back(
i, musOneTightInTime);
443 (*m_candL1MuShower).push_back(
i, musTwoLooseDiffSectorsInTime);
444 (*m_candL1MuShower).push_back(
i, musOutOfTime0);
445 (*m_candL1MuShower).push_back(
i, musOutOfTime1);
449 <<
") for uGT Configuration maxMuShower =" << nrL1MuShower;
461 const bool receiveExt) {
463 LogDebug(
"L1TGlobal") <<
"\n**** GlobalBoard receiving external data = ";
472 iEvent.getByToken(extInputToken, extData);
476 edm::LogWarning(
"L1TGlobal") <<
"\nWarning: Input tag for the BXVector<GlobalExtBlk> collection" 477 <<
"\nrequested in configuration, but not found in the event.\n";
481 for (
int i = extData->getFirstBX();
i <= extData->getLastBX(); ++
i) {
483 if (i < m_bxFirst_ || i > m_bxLast_)
487 for (std::vector<GlobalExtBlk>::const_iterator
ext = extData->begin(
i);
ext != extData->end(
i); ++
ext) {
488 (*m_candL1External).push_back(
i, &(*
ext));
499 const bool produceL1GtObjectMapRecord,
500 const int iBxInEvent,
501 std::unique_ptr<GlobalObjectMapRecord>& gtObjectMapRecord,
502 const unsigned int numberPhysTriggers,
504 const int nrL1MuShower,
508 const std::vector<ConditionMap>& conditionMap = m_l1GtMenu->
gtConditionMap();
512 LogDebug(
"L1TGlobal") <<
" L1 Menu Scales -- Set Name: " << scaleSetName;
516 m_algInitialOr =
false;
517 m_algPrescaledOr =
false;
518 m_algIntermOr =
false;
519 m_algFinalOr =
false;
520 m_algFinalOrVeto =
false;
522 const std::vector<std::vector<MuonTemplate>>& corrMuon = m_l1GtMenu->
corMuonTemplate();
524 const std::vector<std::vector<CaloTemplate>>& corrCalo = m_l1GtMenu->
corCaloTemplate();
526 const std::vector<std::vector<EnergySumTemplate>>& corrEnergySum = m_l1GtMenu->
corEnergySumTemplate();
528 LogDebug(
"L1TGlobal") <<
"Size corrMuon " << corrMuon.size() <<
"\nSize corrCalo " << corrCalo.size()
529 <<
"\nSize corrSums " << corrEnergySum.size();
537 if (m_conditionResultMaps.size() != conditionMap.size()) {
538 m_conditionResultMaps.clear();
539 m_conditionResultMaps.resize(conditionMap.size());
544 for (std::vector<ConditionMap>::const_iterator itCondOnChip = conditionMap.begin();
545 itCondOnChip != conditionMap.end();
551 for (
CItCond itCond = itCondOnChip->begin(); itCond != itCondOnChip->end(); itCond++) {
553 switch ((itCond->second)->condCategory()) {
556 const int ifMuEtaNumberBits = 0;
564 cMapResults[itCond->first] = muCondition;
566 if (m_verbosity && m_isDebugEnabled) {
567 std::ostringstream myCout;
568 muCondition->
print(myCout);
570 LogTrace(
"L1TGlobal") << myCout.str();
582 cMapResults[itCond->first] = muShowerCondition;
584 if (m_verbosity && m_isDebugEnabled) {
585 std::ostringstream myCout;
586 muShowerCondition->
print(myCout);
588 edm::LogWarning(
"L1TGlobal") <<
"MuonShowerCondition " << myCout.str();
595 const int ifCaloEtaNumberBits = 0;
598 new CaloCondition(itCond->second,
this, nrL1EG, nrL1Jet, nrL1Tau, ifCaloEtaNumberBits);
604 cMapResults[itCond->first] = caloCondition;
606 if (m_verbosity && m_isDebugEnabled) {
607 std::ostringstream myCout;
608 caloCondition->
print(myCout);
610 LogTrace(
"L1TGlobal") << myCout.str();
621 cMapResults[itCond->first] = eSumCondition;
623 if (m_verbosity && m_isDebugEnabled) {
624 std::ostringstream myCout;
625 eSumCondition->
print(myCout);
627 LogTrace(
"L1TGlobal") << myCout.str();
638 cMapResults[itCond->first] = eSumZdcCondition;
640 if (m_verbosity && m_isDebugEnabled) {
641 std::ostringstream myCout;
642 eSumZdcCondition->
print(myCout);
644 LogTrace(
"L1TGlobal") << myCout.str();
656 cMapResults[itCond->first] = axol1tlCondition;
658 if (m_verbosity && m_isDebugEnabled) {
659 std::ostringstream myCout;
660 axol1tlCondition->
print(myCout);
674 cMapResults[itCond->first] = extCondition;
676 if (m_verbosity && m_isDebugEnabled) {
677 std::ostringstream myCout;
678 extCondition->
print(myCout);
680 LogTrace(
"L1TGlobal") << myCout.str();
690 const int cond0Ind = corrTemplate->
cond0Index();
691 const int cond1Ind = corrTemplate->
cond1Index();
697 int cond0NrL1Objects = 0;
698 int cond1NrL1Objects = 0;
699 LogDebug(
"L1TGlobal") <<
" cond0NrL1Objects" << cond0NrL1Objects <<
" cond1NrL1Objects " 702 switch (cond0Categ) {
704 cond0Condition = &((corrMuon[iChip])[cond0Ind]);
707 cond0Condition = &((corrCalo[iChip])[cond0Ind]);
710 cond0Condition = &((corrEnergySum[iChip])[cond0Ind]);
717 switch (cond1Categ) {
719 cond1Condition = &((corrMuon[iChip])[cond1Ind]);
722 cond1Condition = &((corrCalo[iChip])[cond1Ind]);
725 cond1Condition = &((corrEnergySum[iChip])[cond1Ind]);
738 cMapResults[itCond->first] = correlationCond;
740 if (m_verbosity && m_isDebugEnabled) {
741 std::ostringstream myCout;
742 correlationCond->
print(myCout);
744 LogTrace(
"L1TGlobal") << myCout.str();
757 const int cond0Ind = corrTemplate->
cond0Index();
758 const int cond1Ind = corrTemplate->
cond1Index();
759 const int cond2Ind = corrTemplate->
cond2Index();
766 int cond0NrL1Objects = 0;
767 int cond1NrL1Objects = 0;
768 int cond2NrL1Objects = 0;
769 LogDebug(
"L1TGlobal") <<
" cond0NrL1Objects " << cond0NrL1Objects <<
" cond1NrL1Objects " 770 << cond1NrL1Objects <<
" cond2NrL1Objects " << cond2NrL1Objects;
772 cond0Condition = &((corrMuon[iChip])[cond0Ind]);
774 LogDebug(
"L1TGlobal") <<
"No muon0 to evaluate three-body correlation condition";
777 cond1Condition = &((corrMuon[iChip])[cond1Ind]);
779 LogDebug(
"L1TGlobal") <<
"No muon1 to evaluate three-body correlation condition";
782 cond2Condition = &((corrMuon[iChip])[cond2Ind]);
784 LogDebug(
"L1TGlobal") <<
"No muon2 to evaluate three-body correlation condition";
791 correlationThreeBodyCond->
setScales(>Scales);
793 cMapResults[itCond->first] = correlationThreeBodyCond;
795 if (m_verbosity && m_isDebugEnabled) {
796 std::ostringstream myCout;
797 correlationThreeBodyCond->
print(myCout);
799 LogTrace(
"L1TGlobal") << myCout.str();
811 const int cond0Ind = corrTemplate->
cond0Index();
812 const int cond1Ind = corrTemplate->
cond1Index();
813 const int cond2Ind = corrTemplate->
cond2Index();
820 int cond0NrL1Objects = 0;
821 int cond1NrL1Objects = 0;
822 int cond2NrL1Objects = 0;
823 LogDebug(
"L1TGlobal") <<
" cond0NrL1Objects" << cond0NrL1Objects <<
" cond1NrL1Objects " << cond1NrL1Objects
824 <<
" cond2NrL1Objects " << cond2NrL1Objects;
826 switch (cond0Categ) {
828 cond0Condition = &((corrMuon[iChip])[cond0Ind]);
831 cond0Condition = &((corrCalo[iChip])[cond0Ind]);
834 cond0Condition = &((corrEnergySum[iChip])[cond0Ind]);
841 switch (cond1Categ) {
843 cond1Condition = &((corrMuon[iChip])[cond1Ind]);
846 cond1Condition = &((corrCalo[iChip])[cond1Ind]);
849 cond1Condition = &((corrEnergySum[iChip])[cond1Ind]);
856 switch (cond2Categ) {
858 cond2Condition = &((corrMuon[iChip])[cond2Ind]);
861 cond2Condition = &((corrCalo[iChip])[cond2Ind]);
864 cond2Condition = &((corrEnergySum[iChip])[cond2Ind]);
875 correlationCondWOR->
setScales(>Scales);
878 cMapResults[itCond->first] = correlationCondWOR;
880 if (m_verbosity && m_isDebugEnabled) {
881 std::ostringstream myCout;
882 correlationCondWOR->
print(myCout);
884 LogTrace(
"L1TGlobal") << myCout.str();
906 std::vector<GlobalObjectMap> objMapVec;
907 if (produceL1GtObjectMapRecord && (iBxInEvent == 0))
908 objMapVec.reserve(numberPhysTriggers);
910 for (
CItAlgo itAlgo = algorithmMap.begin(); itAlgo != algorithmMap.end(); itAlgo++) {
912 gtAlg.
evaluateAlgorithm((itAlgo->second).algoChipNumber(), m_conditionResultMaps);
914 int algBitNumber = (itAlgo->second).algoBitNumber();
917 LogDebug(
"L1TGlobal") <<
" ===> for iBxInEvent = " << iBxInEvent <<
":\t algBitName = " << itAlgo->first
918 <<
",\t algBitNumber = " << algBitNumber <<
",\t algResult = " << algResult;
922 m_uGtAlgBlk.setAlgoDecisionInitial(algBitNumber, algResult);
923 m_algInitialOr =
true;
926 if (m_verbosity && m_isDebugEnabled) {
927 std::ostringstream myCout;
928 (itAlgo->second).
print(myCout);
931 LogTrace(
"L1TGlobal") << myCout.str();
935 if (produceL1GtObjectMapRecord && (iBxInEvent == 0)) {
936 std::vector<L1TObjectTypeInCond> otypes;
941 for (
auto imap = conditionMap.begin(); imap != conditionMap.end(); imap++) {
942 auto match = imap->find(iop->tokenName);
944 if (match != imap->end()) {
948 otype = match->second->objectType();
950 for (
auto itype =
otype.begin(); itype !=
otype.end(); itype++) {
956 edm::LogWarning(
"L1TGlobal") <<
"\n Failed to find match for operand token " << iop->tokenName <<
"\n";
958 otypes.push_back(
otype);
973 if (m_verbosity && m_isDebugEnabled) {
974 std::ostringstream myCout1;
975 objMap.
print(myCout1);
977 LogTrace(
"L1TGlobal") << myCout1.str();
980 objMapVec.push_back(objMap);
985 if (produceL1GtObjectMapRecord && (iBxInEvent == 0)) {
986 gtObjectMapRecord->swapGtObjectMap(objMapVec);
992 for (std::vector<AlgorithmEvaluation::ConditionEvaluationMap>::iterator itCondOnChip = m_conditionResultMaps.begin();
993 itCondOnChip != m_conditionResultMaps.end();
996 delete itCond->second;
997 itCond->second =
nullptr;
1006 const int iBxInEvent,
1007 const int totalBxInEvent,
1008 const unsigned int numberPhysTriggers,
1009 const std::vector<double>& prescaleFactorsAlgoTrig,
1010 const std::vector<unsigned int>& triggerMaskAlgoTrig,
1011 const std::vector<int>& triggerMaskVetoAlgoTrig,
1012 const bool algorithmTriggersUnprescaled,
1013 const bool algorithmTriggersUnmasked) {
1015 LogDebug(
"L1TGlobal") <<
"\n**** GlobalBoard apply Final Decision Logic ";
1019 if (m_prescaleCounterAlgoTrig.empty()
or 1020 (m_currentLumi !=
iEvent.luminosityBlock() and m_resetPSCountersEachLumiSec)) {
1021 m_prescaleCounterAlgoTrig.clear();
1022 m_prescaleCounterAlgoTrig.reserve(totalBxInEvent);
1023 auto const& prescaleCountersAlgoTrig =
1024 m_semiRandomInitialPSCounters ? prescaleCountersWithSemirandomInitialCounter(prescaleFactorsAlgoTrig,
iEvent)
1025 : prescaleCounters(prescaleFactorsAlgoTrig);
1026 for (
int iBxInEvent = 0; iBxInEvent < totalBxInEvent; ++iBxInEvent) {
1027 m_prescaleCounterAlgoTrig.push_back(prescaleCountersAlgoTrig);
1030 m_currentLumi =
iEvent.luminosityBlock();
1035 m_uGtAlgBlk.copyInitialToInterm();
1040 if (!algorithmTriggersUnprescaled) {
1042 int const inBxInEvent = totalBxInEvent / 2 + iBxInEvent;
1044 bool temp_algPrescaledOr =
false;
1045 bool alreadyReported =
false;
1046 for (
unsigned int iBit = 0; iBit < numberPhysTriggers; ++iBit) {
1047 bool const bitValue = m_uGtAlgBlk.getAlgoDecisionInitial(iBit);
1050 if (iBit < prescaleFactorsAlgoTrig.size()) {
1051 if (prescaleFactorsAlgoTrig.at(iBit) != 1) {
1052 bool const triggered = m_prescaleCounterAlgoTrig.at(inBxInEvent).at(iBit).accept();
1054 temp_algPrescaledOr =
true;
1057 m_uGtAlgBlk.setAlgoDecisionInterm(iBit,
false);
1061 temp_algPrescaledOr =
true;
1064 else if (!alreadyReported) {
1065 alreadyReported =
true;
1066 edm::LogWarning(
"L1TGlobal") <<
"\nWarning: algoBit >= prescaleFactorsAlgoTrig.size() in bx " << iBxInEvent;
1071 m_algPrescaledOr = temp_algPrescaledOr;
1075 m_algPrescaledOr = m_algInitialOr;
1081 m_uGtAlgBlk.copyIntermToFinal();
1083 if (!algorithmTriggersUnmasked) {
1084 bool temp_algFinalOr =
false;
1085 bool alreadyReported =
false;
1086 for (
unsigned int iBit = 0; iBit < numberPhysTriggers; ++iBit) {
1087 const bool bitValue = m_uGtAlgBlk.getAlgoDecisionInterm(iBit);
1091 bool isMasked =
false;
1092 if (iBit < triggerMaskAlgoTrig.size())
1093 isMasked = (triggerMaskAlgoTrig.at(iBit) == 0);
1094 else if (!alreadyReported) {
1095 alreadyReported =
true;
1096 edm::LogWarning(
"L1TGlobal") <<
"\nWarning: algoBit >= triggerMaskAlgoTrig.size() in bx " << iBxInEvent;
1099 bool const passMask = (bitValue && !isMasked);
1102 temp_algFinalOr =
true;
1104 m_uGtAlgBlk.setAlgoDecisionFinal(iBit,
false);
1107 if (triggerMaskVetoAlgoTrig.at(iBit) == 1)
1108 m_algFinalOrVeto =
true;
1112 m_algIntermOr = temp_algFinalOr;
1115 m_algIntermOr = m_algPrescaledOr;
1122 m_algFinalOr = (m_algIntermOr & !m_algFinalOrVeto);
1127 std::unique_ptr<GlobalAlgBlkBxCollection>& uGtAlgRecord,
1132 LogDebug(
"L1TGlobal") <<
"\n**** GlobalBoard fill DAQ Records for bx= " << iBxInEvent;
1136 m_uGtAlgBlk.setbxInEventNr((iBxInEvent & 0xF));
1137 m_uGtAlgBlk.setPreScColumn(prescaleSet);
1138 m_uGtAlgBlk.setL1MenuUUID(menuUUID);
1139 m_uGtAlgBlk.setL1FirmwareUUID(firmwareUUID);
1141 m_uGtAlgBlk.setFinalORVeto(m_algFinalOrVeto);
1142 m_uGtAlgBlk.setFinalORPreVeto(m_algIntermOr);
1143 m_uGtAlgBlk.setFinalOR(m_algFinalOr);
1145 uGtAlgRecord->push_back(iBxInEvent, m_uGtAlgBlk);
1155 m_uGtAlgBlk.reset();
1157 m_gtlDecisionWord.reset();
1158 m_gtlAlgorithmOR.reset();
1163 m_candL1Mu->clear();
1164 m_candL1Mu->setBXRange(m_bxFirst_, m_bxLast_);
1169 m_candL1MuShower->clear();
1170 m_candL1MuShower->setBXRange(m_bxFirst_, m_bxLast_);
1175 m_candL1EG->clear();
1176 m_candL1Tau->clear();
1177 m_candL1Jet->clear();
1178 m_candL1EtSum->clear();
1179 m_candL1EtSumZdc->clear();
1181 m_candL1EG->setBXRange(m_bxFirst_, m_bxLast_);
1182 m_candL1Tau->setBXRange(m_bxFirst_, m_bxLast_);
1183 m_candL1Jet->setBXRange(m_bxFirst_, m_bxLast_);
1184 m_candL1EtSum->setBXRange(m_bxFirst_, m_bxLast_);
1185 m_candL1EtSumZdc->setBXRange(m_bxFirst_, m_bxLast_);
1189 m_candL1External->clear();
1190 m_candL1External->setBXRange(m_bxFirst_, m_bxLast_);
1195 LogTrace(
"L1TGlobal") <<
"\nl1t::L1GlobalTrigger: uGMT data received for BxInEvent = " << iBxInEvent;
1197 int nrL1Mu = m_candL1Mu->size(iBxInEvent);
1198 LogTrace(
"L1TGlobal") <<
"Number of GMT muons = " << nrL1Mu <<
"\n";
1203 std::vector<double>
const& prescaleFactorsAlgoTrig) {
1204 std::vector<PrescaleCounter>
out;
1205 out.reserve(prescaleFactorsAlgoTrig.size());
1206 for (
size_t iAlgo = 0; iAlgo < prescaleFactorsAlgoTrig.size(); ++iAlgo) {
1207 out.emplace_back(prescaleFactorsAlgoTrig[iAlgo]);
1214 std::vector<double>
const& prescaleFactorsAlgoTrig,
edm::Event const&
iEvent) {
1218 std::srand(
iEvent.id().run());
1219 std::srand(std::rand() +
iEvent.id().luminosityBlock());
1220 std::srand(std::rand() +
iEvent.id().event());
1221 int const semirandom = std::rand();
1223 std::vector<PrescaleCounter>
out;
1224 out.reserve(prescaleFactorsAlgoTrig.size());
1226 for (
size_t iAlgo = 0; iAlgo < prescaleFactorsAlgoTrig.size(); ++iAlgo) {
1227 out.emplace_back(prescaleFactorsAlgoTrig[iAlgo]);
1231 auto& prescaleCounter =
out.back();
1232 if (prescaleCounter.prescale_count > 0) {
1233 prescaleCounter.trigger_counter = semirandom % prescaleCounter.prescale_count;
1242 trigger_counter += m_singlestep;
1244 if (prescale_count == 0
or trigger_counter < prescale_count)
1247 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
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