72 m_firstEvLumiSegment(
true),
97 delete m_candL1MuShower;
101 delete m_candL1EtSum;
102 delete m_candL1External;
114 const int nrL1MuShower,
123 m_candL1Mu->setBXRange(m_bxFirst_, m_bxLast_);
124 m_candL1MuShower->setBXRange(m_bxFirst_, m_bxLast_);
125 m_candL1EG->setBXRange(m_bxFirst_, m_bxLast_);
126 m_candL1Tau->setBXRange(m_bxFirst_, m_bxLast_);
127 m_candL1Jet->setBXRange(m_bxFirst_, m_bxLast_);
128 m_candL1EtSum->setBXRange(m_bxFirst_, m_bxLast_);
129 m_candL1External->setBXRange(m_bxFirst_, m_bxLast_);
133 LogDebug(
"L1TGlobal") <<
"\t Initializing Board with bxFirst = " << m_bxFirst_ <<
", bxLast = " << m_bxLast_
143 const bool receiveEG,
145 const bool receiveTau,
147 const bool receiveJet,
149 const bool receiveEtSums) {
151 LogDebug(
"L1TGlobal") <<
"\n**** Board receiving Calo Data " 161 iEvent.getByToken(egInputToken, egData);
165 edm::LogWarning(
"L1TGlobal") <<
"\nWarning: BXVector<l1t::EGamma> with input tag " 167 <<
"\nrequested in configuration, but not found in the event.\n" 172 for (
int i = egData->getFirstBX();
i <= egData->getLastBX(); ++
i) {
174 if (i < m_bxFirst_ || i > m_bxLast_)
179 for (std::vector<l1t::EGamma>::const_iterator eg = egData->begin(
i); eg != egData->end(
i); ++eg) {
181 (*m_candL1EG).push_back(
i, &(*eg));
183 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() << std::endl;
199 iEvent.getByToken(tauInputToken, tauData);
203 edm::LogWarning(
"L1TGlobal") <<
"\nWarning: BXVector<l1t::Tau> with input tag " 205 <<
"\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
225 LogDebug(
"L1TGlobal") <<
"tau Pt " <<
tau->hwPt() <<
" Eta " <<
tau->hwEta() <<
" Phi " <<
tau->hwPhi()
226 <<
" Qual " <<
tau->hwQual() <<
" Iso " <<
tau->hwIso() << std::endl;
242 edm::LogWarning(
"L1TGlobal") <<
"\nWarning: BXVector<l1t::Jet> with input tag " 244 <<
"\nrequested in configuration, but not found in the event.\n" 251 if (i < m_bxFirst_ || i > m_bxLast_)
257 if (nObj < nrL1Jet) {
258 (*m_candL1Jet).push_back(
i, &(*
jet));
260 edm::LogWarning(
"L1TGlobal") <<
" Too many Jets (" << nObj <<
") for uGT Configuration maxJet =" << nrL1Jet
264 LogDebug(
"L1TGlobal") <<
"Jet Pt " <<
jet->hwPt() <<
" Eta " <<
jet->hwEta() <<
" Phi " <<
jet->hwPhi()
265 <<
" Qual " <<
jet->hwQual() <<
" Iso " <<
jet->hwIso() << std::endl;
276 iEvent.getByToken(sumInputToken, etSumData);
280 edm::LogWarning(
"L1TGlobal") <<
"\nWarning: BXVector<l1t::EtSum> with input tag " 282 <<
"\nrequested in configuration, but not found in the event.\n" 286 for (
int i = etSumData->getFirstBX();
i <= etSumData->getLastBX(); ++
i) {
288 if (i < m_bxFirst_ || i > m_bxLast_)
292 for (std::vector<l1t::EtSum>::const_iterator etsum = etSumData->begin(
i); etsum != etSumData->end(
i); ++etsum) {
293 (*m_candL1EtSum).push_back(
i, &(*etsum));
342 const bool receiveMu,
345 LogDebug(
"L1TGlobal") <<
"\n**** GlobalBoard receiving muon data = " 355 iEvent.getByToken(muInputToken, muonData);
359 edm::LogWarning(
"L1TGlobal") <<
"\nWarning: BXVector<l1t::Muon> with input tag " 361 <<
"\nrequested in configuration, but not found in the event.\n" 366 for (
int i = muonData->getFirstBX();
i <= muonData->getLastBX(); ++
i) {
368 if (i < m_bxFirst_ || i > m_bxLast_)
373 for (std::vector<l1t::Muon>::const_iterator
mu = muonData->begin(
i);
mu != muonData->end(
i); ++
mu) {
375 (*m_candL1Mu).push_back(
i, &(*
mu));
377 edm::LogWarning(
"L1TGlobal") <<
" Too many Muons (" << nObj <<
") for uGT Configuration maxMu =" << nrL1Mu
381 LogDebug(
"L1TGlobal") <<
"Muon Pt " <<
mu->hwPt() <<
" EtaAtVtx " <<
mu->hwEtaAtVtx() <<
" PhiAtVtx " 382 <<
mu->hwPhiAtVtx() <<
" Qual " <<
mu->hwQual() <<
" Iso " <<
mu->hwIso()
396 const bool receiveMuShower,
397 const int nrL1MuShower) {
399 if (receiveMuShower) {
401 iEvent.getByToken(muShowerInputToken, muonData);
405 edm::LogWarning(
"L1TGlobal") <<
"\nWarning: BXVector<l1t::MuonShower> with input tag " 406 <<
"\nrequested in configuration, but not found in the event.\n" 412 for (
auto mu = muonData->begin(0);
mu != muonData->end(0); ++
mu) {
413 if (nObj < nrL1MuShower) {
427 (*m_candL1MuShower).push_back(0, &mus0);
428 (*m_candL1MuShower).push_back(0, &mus1);
429 (*m_candL1MuShower).push_back(0, &musOutOfTime0);
430 (*m_candL1MuShower).push_back(0, &musOutOfTime1);
433 <<
") for uGT Configuration maxMuShower =" << nrL1MuShower << std::endl;
444 const bool receiveExt) {
446 LogDebug(
"L1TGlobal") <<
"\n**** GlobalBoard receiving external data = " 456 iEvent.getByToken(extInputToken, extData);
460 edm::LogWarning(
"L1TGlobal") <<
"\nWarning: BXVector<GlobalExtBlk> with input tag " 462 <<
"\nrequested in configuration, but not found in the event.\n" 467 for (
int i = extData->getFirstBX();
i <= extData->getLastBX(); ++
i) {
469 if (i < m_bxFirst_ || i > m_bxLast_)
473 for (std::vector<GlobalExtBlk>::const_iterator
ext = extData->begin(
i);
ext != extData->end(
i); ++
ext) {
474 (*m_candL1External).push_back(
i, &(*
ext));
487 const bool produceL1GtObjectMapRecord,
488 const int iBxInEvent,
489 std::unique_ptr<GlobalObjectMapRecord>& gtObjectMapRecord,
490 const unsigned int numberPhysTriggers,
492 const int nrL1MuShower,
496 const std::vector<ConditionMap>& conditionMap = m_l1GtMenu->
gtConditionMap();
500 LogDebug(
"L1TGlobal") <<
" L1 Menu Scales -- Set Name: " << scaleSetName << std::endl;
504 m_algInitialOr =
false;
505 m_algPrescaledOr =
false;
506 m_algIntermOr =
false;
507 m_algFinalOr =
false;
508 m_algFinalOrVeto =
false;
510 const std::vector<std::vector<MuonTemplate>>& corrMuon = m_l1GtMenu->
corMuonTemplate();
513 const std::vector<std::vector<CaloTemplate>>& corrCalo = m_l1GtMenu->
corCaloTemplate();
515 const std::vector<std::vector<EnergySumTemplate>>& corrEnergySum = m_l1GtMenu->
corEnergySumTemplate();
517 LogDebug(
"L1TGlobal") <<
"Size corrMuon " << corrMuon.size() <<
"\nSize corrCalo " << corrCalo.size()
518 <<
"\nSize corrSums " << corrEnergySum.size() << std::endl;
525 if (m_conditionResultMaps.size() != conditionMap.size()) {
526 m_conditionResultMaps.clear();
527 m_conditionResultMaps.resize(conditionMap.size());
532 for (std::vector<ConditionMap>::const_iterator itCondOnChip = conditionMap.begin();
533 itCondOnChip != conditionMap.end();
539 for (
CItCond itCond = itCondOnChip->begin(); itCond != itCondOnChip->end(); itCond++) {
541 switch ((itCond->second)->condCategory()) {
544 const int ifMuEtaNumberBits = 0;
553 cMapResults[itCond->first] = muCondition;
555 if (m_verbosity && m_isDebugEnabled) {
556 std::ostringstream myCout;
557 muCondition->
print(myCout);
559 LogTrace(
"L1TGlobal") << myCout.str() << std::endl;
571 cMapResults[itCond->first] = muShowerCondition;
573 if (m_verbosity && m_isDebugEnabled) {
574 std::ostringstream myCout;
575 muShowerCondition->
print(myCout);
577 edm::LogWarning(
"L1TGlobal") <<
"MuonShowerCondition " << myCout.str() << std::endl;
584 const int ifCaloEtaNumberBits = 0;
587 new CaloCondition(itCond->second,
this, nrL1EG, nrL1Jet, nrL1Tau, ifCaloEtaNumberBits);
593 cMapResults[itCond->first] = caloCondition;
595 if (m_verbosity && m_isDebugEnabled) {
596 std::ostringstream myCout;
597 caloCondition->
print(myCout);
599 LogTrace(
"L1TGlobal") << myCout.str() << std::endl;
610 cMapResults[itCond->first] = eSumCondition;
612 if (m_verbosity && m_isDebugEnabled) {
613 std::ostringstream myCout;
614 eSumCondition->
print(myCout);
616 LogTrace(
"L1TGlobal") << myCout.str() << std::endl;
628 cMapResults[itCond->first] = extCondition;
630 if (m_verbosity && m_isDebugEnabled) {
631 std::ostringstream myCout;
632 extCondition->
print(myCout);
634 LogTrace(
"L1TGlobal") << myCout.str() << std::endl;
644 const int cond0Ind = corrTemplate->
cond0Index();
645 const int cond1Ind = corrTemplate->
cond1Index();
651 int cond0NrL1Objects = 0;
652 int cond1NrL1Objects = 0;
653 LogDebug(
"L1TGlobal") <<
" cond0NrL1Objects" << cond0NrL1Objects <<
" cond1NrL1Objects " << cond1NrL1Objects
656 switch (cond0Categ) {
658 cond0Condition = &((corrMuon[iChip])[cond0Ind]);
661 cond0Condition = &((corrCalo[iChip])[cond0Ind]);
664 cond0Condition = &((corrEnergySum[iChip])[cond0Ind]);
671 switch (cond1Categ) {
673 cond1Condition = &((corrMuon[iChip])[cond1Ind]);
676 cond1Condition = &((corrCalo[iChip])[cond1Ind]);
679 cond1Condition = &((corrEnergySum[iChip])[cond1Ind]);
692 cMapResults[itCond->first] = correlationCond;
694 if (m_verbosity && m_isDebugEnabled) {
695 std::ostringstream myCout;
696 correlationCond->
print(myCout);
698 LogTrace(
"L1TGlobal") << myCout.str() << std::endl;
711 const int cond0Ind = corrTemplate->
cond0Index();
712 const int cond1Ind = corrTemplate->
cond1Index();
713 const int cond2Ind = corrTemplate->
cond2Index();
720 int cond0NrL1Objects = 0;
721 int cond1NrL1Objects = 0;
722 int cond2NrL1Objects = 0;
723 LogDebug(
"L1TGlobal") <<
" cond0NrL1Objects " << cond0NrL1Objects <<
" cond1NrL1Objects " 724 << cond1NrL1Objects <<
" cond2NrL1Objects " << cond2NrL1Objects << std::endl;
726 cond0Condition = &((corrMuon[iChip])[cond0Ind]);
728 LogDebug(
"L1TGlobal") <<
"No muon0 to evaluate three-body correlation condition";
731 cond1Condition = &((corrMuon[iChip])[cond1Ind]);
733 LogDebug(
"L1TGlobal") <<
"No muon1 to evaluate three-body correlation condition";
736 cond2Condition = &((corrMuon[iChip])[cond2Ind]);
738 LogDebug(
"L1TGlobal") <<
"No muon2 to evaluate three-body correlation condition";
745 correlationThreeBodyCond->
setScales(>Scales);
747 cMapResults[itCond->first] = correlationThreeBodyCond;
749 if (m_verbosity && m_isDebugEnabled) {
750 std::ostringstream myCout;
751 correlationThreeBodyCond->
print(myCout);
753 LogTrace(
"L1TGlobal") << myCout.str() << std::endl;
765 const int cond0Ind = corrTemplate->
cond0Index();
766 const int cond1Ind = corrTemplate->
cond1Index();
767 const int cond2Ind = corrTemplate->
cond2Index();
774 int cond0NrL1Objects = 0;
775 int cond1NrL1Objects = 0;
776 int cond2NrL1Objects = 0;
777 LogDebug(
"L1TGlobal") <<
" cond0NrL1Objects" << cond0NrL1Objects <<
" cond1NrL1Objects " << cond1NrL1Objects
778 <<
" cond2NrL1Objects " << cond2NrL1Objects << std::endl;
780 switch (cond0Categ) {
782 cond0Condition = &((corrMuon[iChip])[cond0Ind]);
785 cond0Condition = &((corrCalo[iChip])[cond0Ind]);
788 cond0Condition = &((corrEnergySum[iChip])[cond0Ind]);
795 switch (cond1Categ) {
797 cond1Condition = &((corrMuon[iChip])[cond1Ind]);
800 cond1Condition = &((corrCalo[iChip])[cond1Ind]);
803 cond1Condition = &((corrEnergySum[iChip])[cond1Ind]);
810 switch (cond2Categ) {
812 cond2Condition = &((corrMuon[iChip])[cond2Ind]);
815 cond2Condition = &((corrCalo[iChip])[cond2Ind]);
818 cond2Condition = &((corrEnergySum[iChip])[cond2Ind]);
829 correlationCondWOR->
setScales(>Scales);
832 cMapResults[itCond->first] = correlationCondWOR;
834 if (m_verbosity && m_isDebugEnabled) {
835 std::ostringstream myCout;
836 correlationCondWOR->
print(myCout);
838 LogTrace(
"L1TGlobal") << myCout.str() << std::endl;
859 std::vector<GlobalObjectMap> objMapVec;
860 if (produceL1GtObjectMapRecord && (iBxInEvent == 0))
861 objMapVec.reserve(numberPhysTriggers);
863 for (
CItAlgo itAlgo = algorithmMap.begin(); itAlgo != algorithmMap.end(); itAlgo++) {
865 gtAlg.
evaluateAlgorithm((itAlgo->second).algoChipNumber(), m_conditionResultMaps);
867 int algBitNumber = (itAlgo->second).algoBitNumber();
870 LogDebug(
"L1TGlobal") <<
" ===> for iBxInEvent = " << iBxInEvent <<
":\t algBitName = " << itAlgo->first
871 <<
",\t algBitNumber = " << algBitNumber <<
",\t algResult = " << algResult << std::endl;
875 m_uGtAlgBlk.setAlgoDecisionInitial(algBitNumber, algResult);
876 m_algInitialOr =
true;
879 if (m_verbosity && m_isDebugEnabled) {
880 std::ostringstream myCout;
881 (itAlgo->second).
print(myCout);
884 LogTrace(
"L1TGlobal") << myCout.str() << std::endl;
888 if (produceL1GtObjectMapRecord && (iBxInEvent == 0)) {
889 std::vector<L1TObjectTypeInCond> otypes;
895 for (
auto imap = conditionMap.begin(); imap != conditionMap.end(); imap++) {
897 auto match = imap->find(iop->tokenName);
899 if (
match != imap->end()) {
905 for (
auto itype =
otype.begin(); itype !=
otype.end(); itype++) {
911 edm::LogWarning(
"L1TGlobal") <<
"\n Failed to find match for operand token " << iop->tokenName <<
"\n";
913 otypes.push_back(
otype);
928 if (m_verbosity && m_isDebugEnabled) {
929 std::ostringstream myCout1;
930 objMap.
print(myCout1);
932 LogTrace(
"L1TGlobal") << myCout1.str() << std::endl;
935 objMapVec.push_back(objMap);
940 if (produceL1GtObjectMapRecord && (iBxInEvent == 0)) {
941 gtObjectMapRecord->swapGtObjectMap(objMapVec);
947 for (std::vector<AlgorithmEvaluation::ConditionEvaluationMap>::iterator itCondOnChip = m_conditionResultMaps.begin();
948 itCondOnChip != m_conditionResultMaps.end();
951 delete itCond->second;
952 itCond->second =
nullptr;
959 const int iBxInEvent,
960 const int totalBxInEvent,
961 const unsigned int numberPhysTriggers,
962 const std::vector<double>& prescaleFactorsAlgoTrig,
963 const std::vector<unsigned int>& triggerMaskAlgoTrig,
964 const std::vector<int>& triggerMaskVetoAlgoTrig,
965 const bool algorithmTriggersUnprescaled,
966 const bool algorithmTriggersUnmasked) {
968 LogDebug(
"L1TGlobal") <<
"\n**** GlobalBoard apply Final Decision Logic " << std::endl;
974 m_prescaleCounterAlgoTrig.reserve(totalBxInEvent);
976 auto const& prescaleCountersAlgoTrig =
977 m_semiRandomInitialPSCounters ? semirandomNumber(
iEvent, prescaleFactorsAlgoTrig) : prescaleFactorsAlgoTrig;
979 for (
int iBxInEvent = 0; iBxInEvent <= totalBxInEvent; ++iBxInEvent) {
980 m_prescaleCounterAlgoTrig.push_back(prescaleCountersAlgoTrig);
983 m_currentLumi =
iEvent.luminosityBlock();
987 if (m_firstEvLumiSegment || (m_currentLumi !=
iEvent.luminosityBlock() && m_resetPSCountersEachLumiSec)) {
988 m_prescaleCounterAlgoTrig.clear();
989 for (
int iBxInEvent = 0; iBxInEvent <= totalBxInEvent; ++iBxInEvent) {
990 if (m_semiRandomInitialPSCounters) {
991 m_prescaleCounterAlgoTrig.push_back(semirandomNumber(
iEvent, prescaleFactorsAlgoTrig));
993 m_prescaleCounterAlgoTrig.push_back(prescaleFactorsAlgoTrig);
996 m_firstEvLumiSegment =
false;
997 m_currentLumi =
iEvent.luminosityBlock();
1002 m_uGtAlgBlk.copyInitialToInterm();
1007 if (!algorithmTriggersUnprescaled) {
1009 int inBxInEvent = totalBxInEvent / 2 + iBxInEvent;
1011 bool temp_algPrescaledOr =
false;
1012 bool alreadyReported =
false;
1013 for (
unsigned int iBit = 0; iBit < numberPhysTriggers; ++iBit) {
1014 bool bitValue = m_uGtAlgBlk.getAlgoDecisionInitial(iBit);
1017 if (iBit < prescaleFactorsAlgoTrig.size()) {
1018 if (prescaleFactorsAlgoTrig.at(iBit) != 1) {
1019 (m_prescaleCounterAlgoTrig.at(inBxInEvent).at(iBit))--;
1020 if (m_prescaleCounterAlgoTrig.at(inBxInEvent).at(iBit) == 0) {
1022 m_prescaleCounterAlgoTrig.at(inBxInEvent).at(iBit) = prescaleFactorsAlgoTrig.at(iBit);
1023 temp_algPrescaledOr =
true;
1026 m_uGtAlgBlk.setAlgoDecisionInterm(iBit,
false);
1031 temp_algPrescaledOr =
true;
1034 else if (!alreadyReported) {
1035 alreadyReported =
true;
1036 edm::LogWarning(
"L1TGlobal") <<
"\nWarning: algoBit >= prescaleFactorsAlgoTrig.size() in bx " << iBxInEvent
1042 m_algPrescaledOr = temp_algPrescaledOr;
1046 m_algPrescaledOr = m_algInitialOr;
1052 m_uGtAlgBlk.copyIntermToFinal();
1054 if (!algorithmTriggersUnmasked) {
1055 bool temp_algFinalOr =
false;
1056 bool alreadyReported =
false;
1057 for (
unsigned int iBit = 0; iBit < numberPhysTriggers; ++iBit) {
1058 bool bitValue = m_uGtAlgBlk.getAlgoDecisionInterm(iBit);
1062 bool isMasked =
false;
1063 if (iBit < triggerMaskAlgoTrig.size())
1064 isMasked = (triggerMaskAlgoTrig.at(iBit) == 0);
1065 else if (!alreadyReported) {
1066 alreadyReported =
true;
1067 edm::LogWarning(
"L1TGlobal") <<
"\nWarning: algoBit >= triggerMaskAlgoTrig.size() in bx " << iBxInEvent
1071 bool passMask = (bitValue && !isMasked);
1074 temp_algFinalOr =
true;
1076 m_uGtAlgBlk.setAlgoDecisionFinal(iBit,
false);
1079 if (triggerMaskVetoAlgoTrig.at(iBit) == 1)
1080 m_algFinalOrVeto =
true;
1084 m_algIntermOr = temp_algFinalOr;
1087 m_algIntermOr = m_algPrescaledOr;
1092 m_algFinalOr = (m_algIntermOr & !m_algFinalOrVeto);
1097 std::unique_ptr<GlobalAlgBlkBxCollection>& uGtAlgRecord,
1102 LogDebug(
"L1TGlobal") <<
"\n**** GlobalBoard fill DAQ Records for bx= " << iBxInEvent << std::endl;
1106 m_uGtAlgBlk.setbxInEventNr((iBxInEvent & 0xF));
1107 m_uGtAlgBlk.setPreScColumn(prescaleSet);
1108 m_uGtAlgBlk.setL1MenuUUID(menuUUID);
1109 m_uGtAlgBlk.setL1FirmwareUUID(firmwareUUID);
1111 m_uGtAlgBlk.setFinalORVeto(m_algFinalOrVeto);
1112 m_uGtAlgBlk.setFinalORPreVeto(m_algIntermOr);
1113 m_uGtAlgBlk.setFinalOR(m_algFinalOr);
1115 uGtAlgRecord->push_back(iBxInEvent, m_uGtAlgBlk);
1125 m_uGtAlgBlk.reset();
1127 m_gtlDecisionWord.reset();
1128 m_gtlAlgorithmOR.reset();
1133 m_candL1Mu->clear();
1134 m_candL1Mu->setBXRange(m_bxFirst_, m_bxLast_);
1139 m_candL1MuShower->clear();
1140 m_candL1MuShower->setBXRange(m_bxFirst_, m_bxLast_);
1145 m_candL1EG->clear();
1146 m_candL1Tau->clear();
1147 m_candL1Jet->clear();
1148 m_candL1EtSum->clear();
1150 m_candL1EG->setBXRange(m_bxFirst_, m_bxLast_);
1151 m_candL1Tau->setBXRange(m_bxFirst_, m_bxLast_);
1152 m_candL1Jet->setBXRange(m_bxFirst_, m_bxLast_);
1153 m_candL1EtSum->setBXRange(m_bxFirst_, m_bxLast_);
1157 m_candL1External->clear();
1158 m_candL1External->setBXRange(m_bxFirst_, m_bxLast_);
1163 LogTrace(
"L1TGlobal") <<
"\nl1t::L1GlobalTrigger: uGMT data received for BxInEvent = " << iBxInEvent << std::endl;
1165 int nrL1Mu = m_candL1Mu->size(iBxInEvent);
1166 LogTrace(
"L1TGlobal") <<
"Number of GMT muons = " << nrL1Mu <<
"\n" << std::endl;
1168 LogTrace(
"L1TGlobal") << std::endl;
1173 const std::vector<double>& prescaleFactorsAlgoTrig) {
1174 auto out = prescaleFactorsAlgoTrig;
1176 std::srand(
iEvent.id().run());
1177 std::srand(std::rand() +
iEvent.id().luminosityBlock());
1180 std::srand(std::rand() +
iEvent.id().event());
1182 double const semirandom = std::rand();
1183 for (
auto& ps :
out) {
1187 auto nps = semirandom - floor(semirandom / ps) * ps;
1189 if (nps > 0 and nps <= ps)
1194 <<
"\n The inital prescale counter obtained by L1TGlobal::semirandomNumber is wrong." 1195 <<
"\n This is probably do to the floating-point precision. Using the PS value." 1196 <<
"\n semirandom = " << semirandom <<
"\n PS = " << ps <<
"\n nps = " << nps
1197 <<
" <-- it should be in the range [0 , " << ps <<
"]" << std::endl;
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
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.
static const std::vector< double > semirandomNumber(const edm::Event &iEvent, const std::vector< double > &prescaleFactorsAlgoTrig)
unsigned long long m_l1MuTriggerScalesCacheID
const l1t::GtConditionCategory cond1Category() const
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
void setMus0(const bool bit)
void receiveCaloObjectData(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 bool receiveEG, const int nrL1EG, const bool receiveTau, const int nrL1Tau, const bool receiveJet, const int nrL1Jet, const bool receiveEtSums)
receive data from Global Muon Trigger
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 reset()
reset the content of a GlobalAlgBlk
void print(std::ostream &myCout) const override
print condition
void runFDL(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)
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()
void runGTL(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 setScales(const GlobalScales *)
void setMusOutOfTime1(const bool bit)
void evaluateAlgorithm(const int chipNumber, const std::vector< ConditionEvaluationMap > &)
evaluate an algorithm
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 receiveMuonObjectData(edm::Event &, const edm::EDGetTokenT< BXVector< l1t::Muon >> &, const bool receiveMu, const int nrL1Mu)
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::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
std::unordered_map< std::string, ConditionEvaluation * > ConditionEvaluationMap
copy constructor
void setMus1(const bool bit)
const l1t::GtConditionCategory cond0Category() const
get / set the category of the three subconditions
Log< level::Warning, false > LogWarning
std::bitset< GlobalAlgBlk::maxPhysicsTriggers > m_gtlAlgorithmOR
void receiveMuonShowerObjectData(edm::Event &, const edm::EDGetTokenT< BXVector< l1t::MuonShower >> &, const bool receiveMuShower, const int nrL1MuShower)
std::map< std::string, GlobalAlgorithm > AlgorithmMap
map containing the algorithms
const l1t::GtConditionCategory cond2Category() const
void receiveExternalData(edm::Event &, const edm::EDGetTokenT< BXVector< GlobalExtBlk >> &, const bool receiveExt)
void setMusOutOfTime0(const bool bit)
void print(std::ostream &myCout) const override
print condition