40 ->setComment(
"InputTag for Global Muon Trigger (required parameter: default value is invalid)");
42 ->setComment(
"InputTag for Calo Trigger EGamma (required parameter: default value is invalid)");
44 ->setComment(
"InputTag for Calo Trigger Tau (required parameter: default value is invalid)");
46 ->setComment(
"InputTag for Calo Trigger Jet (required parameter: default value is invalid)");
48 ->setComment(
"InputTag for Calo Trigger EtSum (required parameter: default value is invalid)");
50 ->setComment(
"InputTag for external conditions (not required, but recommend to specify explicitly in config)");
53 "InputTag for unpacked Algblk (required only if GetPrescaleColumnFromData orRequireMenuToMatchAlgoBlkInput "
55 desc.add<
bool>(
"GetPrescaleColumnFromData",
false)
56 ->setComment(
"Get prescale column from unpacked GlobalAlgBck. Otherwise use value specified in PrescaleSet");
57 desc.add<
bool>(
"AlgorithmTriggersUnprescaled",
false)
58 ->setComment(
"not required, but recommend to specify explicitly in config");
59 desc.add<
bool>(
"RequireMenuToMatchAlgoBlkInput",
true)
61 "This requires that the L1 menu record to match the menu used to produce the inputed L1 results, should be "
62 "true when used by the HLT to produce the object map");
63 desc.add<
bool>(
"AlgorithmTriggersUnmasked",
false)
64 ->setComment(
"not required, but recommend to specify explicitly in config");
67 desc.add<
bool>(
"ProduceL1GtDaqRecord",
true);
68 desc.add<
bool>(
"ProduceL1GtObjectMapRecord",
true);
69 desc.add<
int>(
"EmulateBxInEvent", 1);
70 desc.add<
int>(
"L1DataBxInEvent", 5);
71 desc.add<
unsigned int>(
"AlternativeNrBxBoardDaq", 0);
72 desc.add<
int>(
"BstLengthBytes", -1);
73 desc.add<
unsigned int>(
"PrescaleSet", 1);
74 desc.addUntracked<
int>(
"Verbosity", 0);
75 desc.addUntracked<
bool>(
"PrintL1Menu",
false);
78 descriptions.
add(
"L1TGlobalProducer",
desc);
84 : m_muInputTag(parSet.getParameter<
edm::
InputTag>(
"MuonInputTag")),
85 m_egInputTag(parSet.getParameter<
edm::
InputTag>(
"EGammaInputTag")),
86 m_tauInputTag(parSet.getParameter<
edm::
InputTag>(
"TauInputTag")),
87 m_jetInputTag(parSet.getParameter<
edm::
InputTag>(
"JetInputTag")),
88 m_sumInputTag(parSet.getParameter<
edm::
InputTag>(
"EtSumInputTag")),
89 m_extInputTag(parSet.getParameter<
edm::
InputTag>(
"ExtInputTag")),
91 m_produceL1GtDaqRecord(parSet.getParameter<
bool>(
"ProduceL1GtDaqRecord")),
92 m_produceL1GtObjectMapRecord(parSet.getParameter<
bool>(
"ProduceL1GtObjectMapRecord")),
94 m_emulateBxInEvent(parSet.getParameter<
int>(
"EmulateBxInEvent")),
95 m_L1DataBxInEvent(parSet.getParameter<
int>(
"L1DataBxInEvent")),
97 m_alternativeNrBxBoardDaq(parSet.getParameter<unsigned
int>(
"AlternativeNrBxBoardDaq")),
98 m_psBstLengthBytes(parSet.getParameter<
int>(
"BstLengthBytes")),
100 m_prescaleSet(parSet.getParameter<unsigned
int>(
"PrescaleSet")),
102 m_algorithmTriggersUnprescaled(parSet.getParameter<
bool>(
"AlgorithmTriggersUnprescaled")),
103 m_algorithmTriggersUnmasked(parSet.getParameter<
bool>(
"AlgorithmTriggersUnmasked")),
105 m_verbosity(parSet.getUntrackedParameter<
int>(
"Verbosity")),
106 m_printL1Menu(parSet.getUntrackedParameter<
bool>(
"PrintL1Menu")),
108 m_getPrescaleColumnFromData(parSet.getParameter<
bool>(
"GetPrescaleColumnFromData")),
109 m_requireMenuToMatchAlgoBlkInput(parSet.getParameter<
bool>(
"RequireMenuToMatchAlgoBlkInput")),
110 m_algoblkInputTag(parSet.getParameter<
edm::
InputTag>(
"AlgoBlkInputTag")) {
118 m_l1GtMenuToken = esConsumes<L1TUtmTriggerMenu, L1TUtmTriggerMenuRcd>();
128 <<
"\nInput tag for calorimeter jet collections from Cal: " <<
m_jetInputTag
129 <<
"\nInput tag for external conditions : " <<
m_extInputTag << std::endl;
132 <<
"\nProduce the L1 uGT Object Map record: "
135 <<
"\nAlternative for number of BX in GT DAQ record: 0x" << std::hex
137 <<
"\nRun algorithm triggers unprescaled: "
149 <<
"\nWARNING: Number of bunch crossing to be emulated rounded to: " <<
m_emulateBxInEvent
150 <<
"\n The number must be an odd number!\n"
160 <<
"\nWARNING: Number of bunch crossing for incoming L1 Data rounded to: " <<
m_L1DataBxInEvent
161 <<
"\n The number must be an odd number!\n"
169 <<
"\nWARNING: Number of bunch crossing for incoming L1 Data was changed to: " <<
m_L1DataBxInEvent
170 <<
"\n The number must be an odd positive number!\n"
177 produces<GlobalAlgBlkBxCollection>();
182 produces<GlobalObjectMapRecord>();
186 m_uGtBrd = std::make_unique<GlobalBoard>();
228 std::vector<std::vector<double>> temp_prescaleTable;
230 temp_prescaleTable.push_back(std::vector<double>());
305 if (m_uGtAlgBlk->size() >= 1) {
306 if ((*m_uGtAlgBlk)[0].getL1FirmwareUUID() != static_cast<int>(utml1GtMenu->
getFirmwareUuidHashed())) {
308 <<
" Error L1 menu loaded in via conditions does not match the L1 actually run "
310 <<
". This means that the mapping of the names to the bits may be incorrect. Please check the "
311 "L1TUtmTriggerMenuRcd record supplied. Unless you know what you are doing, do not simply disable this "
312 "check via the config as this a major error and the indication of something very wrong";
409 if (m_uGtAlgBlk.
isValid() && !m_uGtAlgBlk->isEmpty(0)) {
410 std::vector<GlobalAlgBlk>::const_iterator algBlk = m_uGtAlgBlk->begin(0);
411 m_prescaleSet = static_cast<unsigned int>(algBlk->getPreScColumn());
415 <<
"Could not find valid algo block. Setting prescale column to 1" << std::endl;
471 bool receiveMu =
true;
472 bool receiveEG =
true;
473 bool receiveTau =
true;
474 bool receiveJet =
true;
475 bool receiveEtSums =
true;
476 bool receiveExt =
true;
506 std::unique_ptr<GlobalAlgBlkBxCollection> uGtAlgRecord(
517 int bxCross =
iEvent.bunchCrossing();
518 uint16_t bxCrossHw = 0;
519 if ((bxCross & 0xFFF) == bxCross) {
520 bxCrossHw = static_cast<uint16_t>(bxCross);
524 LogDebug(
"L1TGlobalProducer") <<
"\nBunch cross number [hex] = " << std::hex << bxCross
525 <<
"\n larger than 12 bits. Set to 0! \n"
529 LogDebug(
"L1TGlobalProducer") <<
"HW BxCross " << bxCrossHw << std::endl;
535 auto max = (*m_prescaleFactorsAlgoTrig).size() - 1;
536 if (pfAlgoSetIndex >
max) {
538 <<
"\nNumber of prescale algo sets available: 0.." <<
max
539 <<
"Setting former to latter." << std::endl;
540 pfAlgoSetIndex =
max;
543 const std::vector<double>& prescaleFactorsAlgoTrig = (*m_prescaleFactorsAlgoTrig).at(pfAlgoSetIndex);
547 for (
unsigned int iAlgo = 0; iAlgo < prescaleFactorsAlgoTrig.size(); iAlgo++) {
548 unsigned int value = prescaleFactorsAlgoTrig[iAlgo];
557 LogDebug(
"L1TGlobalProducer") <<
"Size of prescale vector" << prescaleFactorsAlgoTrig.size() << std::endl;
578 for (
int iBxInEvent = minEmulBxInEvent; iBxInEvent <= maxEmulBxInEvent; ++iBxInEvent) {
580 LogDebug(
"L1TGlobalProducer") <<
"\nL1TGlobalProducer : running GTL for bx = " << iBxInEvent <<
"\n" << std::endl;
596 LogDebug(
"L1TGlobalProducer") <<
"\nL1TGlobalProducer : running FDL for bx = " << iBxInEvent <<
"\n" << std::endl;
603 prescaleFactorsAlgoTrig,
605 triggerMaskVetoAlgoTrig,
624 std::ostringstream myCoutStream;
626 for (
int bx = minEmulBxInEvent;
bx < maxEmulBxInEvent;
bx++) {
628 (uGtAlgRecord->at(
bx, 0)).
print(myCoutStream);
631 LogTrace(
"L1TGlobalProducer") <<
"\n The following L1 GT DAQ readout record was produced:\n"
632 << myCoutStream.str() <<
"\n"
635 myCoutStream.str(
"");
636 myCoutStream.clear();
638 const std::vector<GlobalObjectMap> objMapVec = gtObjectMapRecord->gtObjectMap();
640 for (std::vector<GlobalObjectMap>::const_iterator it = objMapVec.begin(); it != objMapVec.end(); ++it) {
641 (*it).print(myCoutStream);
644 LogDebug(
"L1TGlobalProducer") <<
"Test gtObjectMapRecord in L1TGlobalProducer \n\n"
645 << myCoutStream.str() <<
"\n\n"
648 myCoutStream.str(
"");
649 myCoutStream.clear();