41 ->setComment(
"InputTag for Global Muon Trigger (required parameter: default value is invalid)");
43 ->setComment(
"InputTag for Calo Trigger EGamma (required parameter: default value is invalid)");
45 ->setComment(
"InputTag for Calo Trigger Tau (required parameter: default value is invalid)");
47 ->setComment(
"InputTag for Calo Trigger Jet (required parameter: default value is invalid)");
49 ->setComment(
"InputTag for Calo Trigger EtSum (required parameter: default value is invalid)");
51 ->setComment(
"InputTag for external conditions (not required, but recommend to specify explicitly in config)");
54 "InputTag for unpacked Algblk (required only if GetPrescaleColumnFromData orRequireMenuToMatchAlgoBlkInput "
56 desc.add<
bool>(
"GetPrescaleColumnFromData",
false)
57 ->setComment(
"Get prescale column from unpacked GlobalAlgBck. Otherwise use value specified in PrescaleSet");
58 desc.add<
bool>(
"AlgorithmTriggersUnprescaled",
false)
59 ->setComment(
"not required, but recommend to specify explicitly in config");
60 desc.add<
bool>(
"RequireMenuToMatchAlgoBlkInput",
true)
62 "This requires that the L1 menu record to match the menu used to produce the inputed L1 results, should be "
63 "true when used by the HLT to produce the object map");
64 desc.add<
bool>(
"AlgorithmTriggersUnmasked",
false)
65 ->setComment(
"not required, but recommend to specify explicitly in config");
68 desc.add<
bool>(
"ProduceL1GtDaqRecord",
true);
69 desc.add<
bool>(
"ProduceL1GtObjectMapRecord",
true);
70 desc.add<
int>(
"EmulateBxInEvent", 1);
71 desc.add<
int>(
"L1DataBxInEvent", 5);
72 desc.add<
unsigned int>(
"AlternativeNrBxBoardDaq", 0);
73 desc.add<
int>(
"BstLengthBytes", -1);
74 desc.add<
unsigned int>(
"PrescaleSet", 1);
75 desc.addUntracked<
int>(
"Verbosity", 0);
76 desc.addUntracked<
bool>(
"PrintL1Menu",
false);
79 descriptions.
add(
"L1TGlobalProducer",
desc);
85 : m_muInputTag(parSet.getParameter<
edm::
InputTag>(
"MuonInputTag")),
86 m_egInputTag(parSet.getParameter<
edm::
InputTag>(
"EGammaInputTag")),
87 m_tauInputTag(parSet.getParameter<
edm::
InputTag>(
"TauInputTag")),
88 m_jetInputTag(parSet.getParameter<
edm::
InputTag>(
"JetInputTag")),
89 m_sumInputTag(parSet.getParameter<
edm::
InputTag>(
"EtSumInputTag")),
90 m_extInputTag(parSet.getParameter<
edm::
InputTag>(
"ExtInputTag")),
92 m_produceL1GtDaqRecord(parSet.getParameter<
bool>(
"ProduceL1GtDaqRecord")),
93 m_produceL1GtObjectMapRecord(parSet.getParameter<
bool>(
"ProduceL1GtObjectMapRecord")),
95 m_emulateBxInEvent(parSet.getParameter<
int>(
"EmulateBxInEvent")),
96 m_L1DataBxInEvent(parSet.getParameter<
int>(
"L1DataBxInEvent")),
98 m_alternativeNrBxBoardDaq(parSet.getParameter<unsigned
int>(
"AlternativeNrBxBoardDaq")),
99 m_psBstLengthBytes(parSet.getParameter<
int>(
"BstLengthBytes")),
101 m_prescaleSet(parSet.getParameter<unsigned
int>(
"PrescaleSet")),
103 m_algorithmTriggersUnprescaled(parSet.getParameter<
bool>(
"AlgorithmTriggersUnprescaled")),
104 m_algorithmTriggersUnmasked(parSet.getParameter<
bool>(
"AlgorithmTriggersUnmasked")),
106 m_verbosity(parSet.getUntrackedParameter<
int>(
"Verbosity")),
107 m_printL1Menu(parSet.getUntrackedParameter<
bool>(
"PrintL1Menu")),
109 m_getPrescaleColumnFromData(parSet.getParameter<
bool>(
"GetPrescaleColumnFromData")),
110 m_requireMenuToMatchAlgoBlkInput(parSet.getParameter<
bool>(
"RequireMenuToMatchAlgoBlkInput")),
111 m_algoblkInputTag(parSet.getParameter<
edm::
InputTag>(
"AlgoBlkInputTag")) {
119 m_l1GtMenuToken = esConsumes<L1TUtmTriggerMenu, L1TUtmTriggerMenuRcd>();
129 <<
"\nInput tag for calorimeter jet collections from Cal: " <<
m_jetInputTag
130 <<
"\nInput tag for external conditions : " <<
m_extInputTag << std::endl;
133 <<
"\nProduce the L1 uGT Object Map record: "
136 <<
"\nAlternative for number of BX in GT DAQ record: 0x" << std::hex
138 <<
"\nRun algorithm triggers unprescaled: "
150 <<
"\nWARNING: Number of bunch crossing to be emulated rounded to: " <<
m_emulateBxInEvent
151 <<
"\n The number must be an odd number!\n"
161 <<
"\nWARNING: Number of bunch crossing for incoming L1 Data rounded to: " <<
m_L1DataBxInEvent
162 <<
"\n The number must be an odd number!\n"
170 <<
"\nWARNING: Number of bunch crossing for incoming L1 Data was changed to: " <<
m_L1DataBxInEvent
171 <<
"\n The number must be an odd positive number!\n"
178 produces<GlobalAlgBlkBxCollection>();
183 produces<GlobalObjectMapRecord>();
187 m_uGtBrd = std::make_unique<GlobalBoard>();
229 std::vector<std::vector<double>> temp_prescaleTable;
231 temp_prescaleTable.push_back(std::vector<double>());
306 if (m_uGtAlgBlk->size() >= 1) {
307 if ((*m_uGtAlgBlk)[0].getL1FirmwareUUID() != static_cast<int>(utml1GtMenu->
getFirmwareUuidHashed())) {
309 <<
" Error L1 menu loaded in via conditions does not match the L1 actually run "
311 <<
". This means that the mapping of the names to the bits may be incorrect. Please check the "
312 "L1TUtmTriggerMenuRcd record supplied. Unless you know what you are doing, do not simply disable this "
313 "check via the config as this a major error and the indication of something very wrong";
411 if (m_uGtAlgBlk.
isValid() && !m_uGtAlgBlk->isEmpty(0)) {
412 std::vector<GlobalAlgBlk>::const_iterator algBlk = m_uGtAlgBlk->begin(0);
413 m_prescaleSet = static_cast<unsigned int>(algBlk->getPreScColumn());
417 <<
"Could not find valid algo block. Setting prescale column to 1" << std::endl;
473 bool receiveMu =
true;
474 bool receiveEG =
true;
475 bool receiveTau =
true;
476 bool receiveJet =
true;
477 bool receiveEtSums =
true;
478 bool receiveExt =
true;
508 std::unique_ptr<GlobalAlgBlkBxCollection> uGtAlgRecord(
519 int bxCross =
iEvent.bunchCrossing();
520 uint16_t bxCrossHw = 0;
521 if ((bxCross & 0xFFF) == bxCross) {
522 bxCrossHw = static_cast<uint16_t>(bxCross);
526 LogDebug(
"L1TGlobalProducer") <<
"\nBunch cross number [hex] = " << std::hex << bxCross
527 <<
"\n larger than 12 bits. Set to 0! \n"
531 LogDebug(
"L1TGlobalProducer") <<
"HW BxCross " << bxCrossHw << std::endl;
537 auto max = (*m_prescaleFactorsAlgoTrig).size() - 1;
538 if (pfAlgoSetIndex >
max) {
540 <<
"\nNumber of prescale algo sets available: 0.." <<
max
541 <<
"Setting former to latter." << std::endl;
542 pfAlgoSetIndex =
max;
545 const std::vector<double>& prescaleFactorsAlgoTrig = (*m_prescaleFactorsAlgoTrig).at(pfAlgoSetIndex);
549 for (
unsigned int iAlgo = 0; iAlgo < prescaleFactorsAlgoTrig.size(); iAlgo++) {
550 unsigned int value = prescaleFactorsAlgoTrig[iAlgo];
559 LogDebug(
"L1TGlobalProducer") <<
"Size of prescale vector" << prescaleFactorsAlgoTrig.size() << std::endl;
580 for (
int iBxInEvent = minEmulBxInEvent; iBxInEvent <= maxEmulBxInEvent; ++iBxInEvent) {
582 LogDebug(
"L1TGlobalProducer") <<
"\nL1TGlobalProducer : running GTL for bx = " << iBxInEvent <<
"\n" << std::endl;
598 LogDebug(
"L1TGlobalProducer") <<
"\nL1TGlobalProducer : running FDL for bx = " << iBxInEvent <<
"\n" << std::endl;
605 prescaleFactorsAlgoTrig,
607 triggerMaskVetoAlgoTrig,
626 std::ostringstream myCoutStream;
628 for (
int bx = minEmulBxInEvent;
bx < maxEmulBxInEvent;
bx++) {
630 (uGtAlgRecord->at(
bx, 0)).
print(myCoutStream);
633 LogTrace(
"L1TGlobalProducer") <<
"\n The following L1 GT DAQ readout record was produced:\n"
634 << myCoutStream.str() <<
"\n"
637 myCoutStream.str(
"");
638 myCoutStream.clear();
640 const std::vector<GlobalObjectMap> objMapVec = gtObjectMapRecord->gtObjectMap();
642 for (std::vector<GlobalObjectMap>::const_iterator it = objMapVec.begin(); it != objMapVec.end(); ++it) {
643 (*it).print(myCoutStream);
646 LogDebug(
"L1TGlobalProducer") <<
"Test gtObjectMapRecord in L1TGlobalProducer \n\n"
647 << myCoutStream.str() <<
"\n\n"
650 myCoutStream.str(
"");
651 myCoutStream.clear();