42 ->setComment(
"InputTag for Global Muon Trigger (required parameter: default value is invalid)");
44 ->setComment(
"InputTag for Global Muon Shower Trigger (required parameter: default value is invalid)");
46 ->setComment(
"InputTag for Calo Trigger EGamma (required parameter: default value is invalid)");
48 ->setComment(
"InputTag for Calo Trigger Tau (required parameter: default value is invalid)");
50 ->setComment(
"InputTag for Calo Trigger Jet (required parameter: default value is invalid)");
52 ->setComment(
"InputTag for Calo Trigger EtSum (required parameter: default value is invalid)");
54 ->setComment(
"InputTag for ZDC EtSums Plus and Minus (required parameter: default value is invalid)");
56 ->setComment(
"InputTag for CICADA Anomaly Detection (required parameter: default value is invalid)");
58 ->setComment(
"InputTag for external conditions (not required, but recommend to specify explicitly in config)");
61 "InputTag for unpacked Algblk (required only if GetPrescaleColumnFromData orRequireMenuToMatchAlgoBlkInput " 63 desc.add<
bool>(
"GetPrescaleColumnFromData",
false)
64 ->setComment(
"Get prescale column from unpacked GlobalAlgBck. Otherwise use value specified in PrescaleSet");
65 desc.add<
bool>(
"AlgorithmTriggersUnprescaled",
false)
66 ->setComment(
"not required, but recommend to specify explicitly in config");
67 desc.add<
bool>(
"RequireMenuToMatchAlgoBlkInput",
true)
69 "This requires that the L1 menu record to match the menu used to produce the inputed L1 results, should be " 70 "true when used by the HLT to produce the object map");
71 desc.add<
bool>(
"AlgorithmTriggersUnmasked",
false)
72 ->setComment(
"not required, but recommend to specify explicitly in config");
75 desc.add<
bool>(
"useMuonShowers",
false);
78 desc.add<
bool>(
"produceAXOL1TLScore",
false);
84 desc.add<
bool>(
"resetPSCountersEachLumiSec",
false);
88 desc.add<
bool>(
"semiRandomInitialPSCounters",
false);
92 desc.add<
bool>(
"ProduceL1GtDaqRecord",
true);
93 desc.add<
bool>(
"ProduceL1GtObjectMapRecord",
true);
94 desc.add<
int>(
"EmulateBxInEvent", 1);
95 desc.add<
int>(
"L1DataBxInEvent", 5);
96 desc.add<
unsigned int>(
"AlternativeNrBxBoardDaq", 0);
97 desc.add<
int>(
"BstLengthBytes", -1);
98 desc.add<
unsigned int>(
"PrescaleSet", 1);
99 desc.addUntracked<
int>(
"Verbosity", 0);
100 desc.addUntracked<
bool>(
"PrintL1Menu",
false);
102 descriptions.
add(
"L1TGlobalProducer",
desc);
108 : m_muInputTag(parSet.getParameter<
edm::
InputTag>(
"MuonInputTag")),
109 m_muShowerInputTag(parSet.getParameter<
edm::
InputTag>(
"MuonShowerInputTag")),
110 m_egInputTag(parSet.getParameter<
edm::
InputTag>(
"EGammaInputTag")),
111 m_tauInputTag(parSet.getParameter<
edm::
InputTag>(
"TauInputTag")),
112 m_jetInputTag(parSet.getParameter<
edm::
InputTag>(
"JetInputTag")),
113 m_sumInputTag(parSet.getParameter<
edm::
InputTag>(
"EtSumInputTag")),
114 m_sumZdcInputTag(parSet.getParameter<
edm::
InputTag>(
"EtSumZdcInputTag")),
115 m_CICADAInputTag(parSet.getParameter<
edm::
InputTag>(
"CICADAInputTag")),
116 m_extInputTag(parSet.getParameter<
edm::
InputTag>(
"ExtInputTag")),
118 m_produceL1GtDaqRecord(parSet.getParameter<
bool>(
"ProduceL1GtDaqRecord")),
119 m_produceL1GtObjectMapRecord(parSet.getParameter<
bool>(
"ProduceL1GtObjectMapRecord")),
121 m_emulateBxInEvent(parSet.getParameter<
int>(
"EmulateBxInEvent")),
122 m_L1DataBxInEvent(parSet.getParameter<
int>(
"L1DataBxInEvent")),
124 m_alternativeNrBxBoardDaq(parSet.getParameter<unsigned
int>(
"AlternativeNrBxBoardDaq")),
125 m_psBstLengthBytes(parSet.getParameter<
int>(
"BstLengthBytes")),
127 m_prescaleSet(parSet.getParameter<unsigned
int>(
"PrescaleSet")),
129 m_algorithmTriggersUnprescaled(parSet.getParameter<
bool>(
"AlgorithmTriggersUnprescaled")),
130 m_algorithmTriggersUnmasked(parSet.getParameter<
bool>(
"AlgorithmTriggersUnmasked")),
132 m_verbosity(parSet.getUntrackedParameter<
int>(
"Verbosity")),
133 m_printL1Menu(parSet.getUntrackedParameter<
bool>(
"PrintL1Menu")),
135 m_getPrescaleColumnFromData(parSet.getParameter<
bool>(
"GetPrescaleColumnFromData")),
136 m_requireMenuToMatchAlgoBlkInput(parSet.getParameter<
bool>(
"RequireMenuToMatchAlgoBlkInput")),
137 m_algoblkInputTag(parSet.getParameter<
edm::
InputTag>(
"AlgoBlkInputTag")),
138 m_resetPSCountersEachLumiSec(parSet.getParameter<
bool>(
"resetPSCountersEachLumiSec")),
139 m_semiRandomInitialPSCounters(parSet.getParameter<
bool>(
"semiRandomInitialPSCounters")),
140 m_useMuonShowers(parSet.getParameter<
bool>(
"useMuonShowers")),
141 m_produceAXOL1TLScore(parSet.getParameter<
bool>(
"produceAXOL1TLScore")) {
153 m_l1GtMenuToken = esConsumes<L1TUtmTriggerMenu, L1TUtmTriggerMenuRcd>();
163 <<
"\nInput tag for calorimeter jet collections from Cal: " <<
m_jetInputTag 164 <<
"\nInput tag for external conditions : " <<
m_extInputTag << std::endl;
167 <<
"\nProduce the L1 uGT Object Map record: " 170 <<
"\nAlternative for number of BX in GT DAQ record: 0x" << std::hex
172 <<
"\nRun algorithm triggers unprescaled: " 184 <<
"\nWARNING: Number of bunch crossing to be emulated rounded to: " <<
m_emulateBxInEvent 185 <<
"\n The number must be an odd number!\n" 195 <<
"\nWARNING: Number of bunch crossing for incoming L1 Data rounded to: " <<
m_L1DataBxInEvent 196 <<
"\n The number must be an odd number!\n" 204 <<
"\nWARNING: Number of bunch crossing for incoming L1 Data was changed to: " <<
m_L1DataBxInEvent 205 <<
"\n The number must be an odd positive number!\n" 212 produces<GlobalAlgBlkBxCollection>();
217 produces<GlobalObjectMapRecord>();
221 produces<AXOL1TLScoreBxCollection>(
"AXOScore");
225 m_uGtBrd = std::make_unique<GlobalBoard>();
274 std::vector<std::vector<double>> temp_prescaleTable;
276 temp_prescaleTable.push_back(std::vector<double>());
363 if (m_uGtAlgBlk->size() >= 1) {
364 if ((*m_uGtAlgBlk)[0].getL1FirmwareUUID() !=
static_cast<int>(utml1GtMenu->
getFirmwareUuidHashed())) {
366 <<
" Error L1 menu loaded in via conditions does not match the L1 actually run " 368 <<
". This means that the mapping of the names to the bits may be incorrect. Please check the " 369 "L1TUtmTriggerMenuRcd record supplied. Unless you know what you are doing, do not simply disable this " 370 "check via the config as this a major error and the indication of something very wrong";
472 if (m_uGtAlgBlk.
isValid() && !m_uGtAlgBlk->isEmpty(0)) {
473 std::vector<GlobalAlgBlk>::const_iterator algBlk = m_uGtAlgBlk->begin(0);
474 m_prescaleSet =
static_cast<unsigned int>(algBlk->getPreScColumn());
478 <<
"Could not find valid algo block. Setting prescale column to 1" << std::endl;
534 bool receiveMu =
true;
535 bool receiveMuShower =
true;
536 bool receiveEG =
true;
537 bool receiveTau =
true;
538 bool receiveJet =
true;
539 bool receiveEtSums =
true;
540 bool receiveEtSumsZdc =
true;
541 bool receiveCICADA =
true;
542 bool receiveExt =
true;
572 std::unique_ptr<GlobalAlgBlkBxCollection> uGtAlgRecord(
578 std::unique_ptr<AXOL1TLScoreBxCollection> uGtAXOScoreRecord(
nullptr);
580 uGtAXOScoreRecord = std::make_unique<AXOL1TLScoreBxCollection>();
588 int bxCross =
iEvent.bunchCrossing();
589 uint16_t bxCrossHw = 0;
590 if ((bxCross & 0xFFF) == bxCross) {
591 bxCrossHw =
static_cast<uint16_t
>(bxCross);
595 LogDebug(
"L1TGlobalProducer") <<
"\nBunch cross number [hex] = " << std::hex << bxCross
596 <<
"\n larger than 12 bits. Set to 0! \n" 600 LogDebug(
"L1TGlobalProducer") <<
"HW BxCross " << bxCrossHw << std::endl;
606 auto max = (*m_prescaleFactorsAlgoTrig).size() - 1;
607 if (pfAlgoSetIndex >
max) {
609 <<
"\nNumber of prescale algo sets available: 0.." <<
max 610 <<
"Setting former to latter." << std::endl;
611 pfAlgoSetIndex =
max;
614 const std::vector<double>& prescaleFactorsAlgoTrig = (*m_prescaleFactorsAlgoTrig).at(pfAlgoSetIndex);
618 for (
unsigned int iAlgo = 0; iAlgo < prescaleFactorsAlgoTrig.size(); iAlgo++) {
619 unsigned int value = prescaleFactorsAlgoTrig[iAlgo];
628 LogDebug(
"L1TGlobalProducer") <<
"Size of prescale vector" << prescaleFactorsAlgoTrig.size() << std::endl;
659 for (
int iBxInEvent = minEmulBxInEvent; iBxInEvent <= maxEmulBxInEvent; ++iBxInEvent) {
661 LogDebug(
"L1TGlobalProducer") <<
"\nL1TGlobalProducer : running GTL for bx = " << iBxInEvent <<
"\n" << std::endl;
678 LogDebug(
"L1TGlobalProducer") <<
"\nL1TGlobalProducer : running FDL for bx = " << iBxInEvent <<
"\n" << std::endl;
685 prescaleFactorsAlgoTrig,
687 triggerMaskVetoAlgoTrig,
702 m_uGtBrd->fillAXOScore(iBxInEvent, uGtAXOScoreRecord);
709 for (std::vector<const l1t::Muon*>::const_iterator iMu = (*(
m_uGtBrd->getCandL1Mu())).begin(0);
710 iMu != (*(
m_uGtBrd->getCandL1Mu())).end(0);
718 std::ostringstream myCoutStream;
720 for (
int bx = minEmulBxInEvent;
bx < maxEmulBxInEvent;
bx++) {
722 (uGtAlgRecord->at(
bx, 0)).
print(myCoutStream);
725 LogTrace(
"L1TGlobalProducer") <<
"\n The following L1 GT DAQ readout record was produced:\n" 726 << myCoutStream.str() <<
"\n" 729 myCoutStream.str(
"");
730 myCoutStream.clear();
732 const std::vector<GlobalObjectMap> objMapVec = gtObjectMapRecord->gtObjectMap();
734 for (std::vector<GlobalObjectMap>::const_iterator
it = objMapVec.begin();
it != objMapVec.end(); ++
it) {
735 (*it).print(myCoutStream);
738 LogDebug(
"L1TGlobalProducer") <<
"Test gtObjectMapRecord in L1TGlobalProducer \n\n" 739 << myCoutStream.str() <<
"\n\n" 742 myCoutStream.str(
"");
743 myCoutStream.clear();
edm::EDGetTokenT< BXVector< float > > m_CICADAInputToken
edm::InputTag m_jetInputTag
unsigned int m_numberDaqPartitions
edm::InputTag m_algoblkInputTag
unsigned long long m_l1GtParCacheID
unsigned long long m_l1GtTmVetoAlgoCacheID
bool m_semiRandomInitialPSCounters
const std::vector< unsigned int > * m_triggerMaskAlgoTrig
int m_verbosity
verbosity level
uint16_t m_activeBoardsGtDaq
active boards in L1 GT DAQ record
edm::InputTag m_egInputTag
input tag for calorimeter collections from Calo Layer 2 (GCT) or Zero Degree Calorimeter (ZDC) ...
edm::EDGetTokenT< BXVector< l1t::Tau > > m_tauInputToken
const l1t::PrescalesVetosFractHelper * m_l1GtPrescalesVetosFract
prescale factors
bool m_produceL1GtObjectMapRecord
logical flag to produce the L1 GT object map record
int m_totalBxInEvent
total number of Bx's in the event coming from EventSetup
unsigned int m_numberPhysTriggers
bool m_requireMenuToMatchAlgoBlkInput
const L1TGlobalParameters * m_l1GtStablePar
cached stuff
edm::EDGetTokenT< BXVector< GlobalExtBlk > > m_extInputToken
edm::ESGetToken< L1TGlobalParameters, L1TGlobalParametersRcd > m_l1GtStableParToken
BXVector< GlobalAlgBlk > GlobalAlgBlkBxCollection
unsigned long long m_l1GtTmAlgoCacheID
std::vector< std::vector< double > > m_initialPrescaleFactorsAlgoTrig
edm::InputTag m_sumZdcInputTag
Log< level::Error, false > LogError
~L1TGlobalProducer() override
std::vector< unsigned int > m_initialTriggerMaskAlgoTrig
edm::ESGetToken< L1TGlobalPrescalesVetosFract, L1TGlobalPrescalesVetosFractRcd > m_l1GtPrescaleVetosToken
const std::vector< int > * m_triggerMaskVetoAlgoTrig
unsigned int m_alternativeNrBxBoardDaq
edm::InputTag m_sumInputTag
edm::InputTag m_muInputTag
input tag for muon collection from the Global Muon Trigger (GMT)
edm::InputTag m_extInputTag
input tag for external conditions
T const * product() const
unsigned long long m_l1GtMenuCacheID
edm::InputTag m_tauInputTag
edm::InputTag m_muShowerInputTag
std::unique_ptr< TriggerMenu > m_l1GtMenu
bool m_algorithmTriggersUnprescaled
std::vector< int > m_initialTriggerMaskVetoAlgoTrig
bool m_produceAXOL1TLScore
bool m_produceL1GtDaqRecord
logical flag to produce the L1 GT DAQ readout record
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
bool m_algorithmTriggersUnmasked
edm::EDGetTokenT< BXVector< l1t::Muon > > m_muInputToken
std::vector< l1t::Muon > muonVec_bxm1
#define DEFINE_FWK_MODULE(type)
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
bool m_getPrescaleColumnFromData
unsigned int m_prescaleSet
prescale set used
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
edm::EDGetTokenT< BXVector< l1t::EtSum > > m_sumInputToken
int m_L1DataBxInEvent
Bx expected in Data coming to GT.
L1TGlobalProducer(const edm::ParameterSet &)
const std::vector< int > & triggerMaskVeto() const
unsigned long long m_l1GtBMCacheID
int m_ifCaloEtaNumberBits
edm::InputTag m_CICADAInputTag
void add(std::string const &label, ParameterSetDescription const &psetDescription)
edm::EDGetToken m_algoblkInputToken
unsigned int m_bstLengthBytes
length of BST record (in bytes) from event setup
char data[epos_bytes_allocation]
edm::EDGetTokenT< BXVector< l1t::EtSum > > m_sumZdcInputToken
bool m_resetPSCountersEachLumiSec
std::vector< l1t::Muon > muonVec_bxm2
edm::ESGetToken< L1TUtmTriggerMenu, L1TUtmTriggerMenuRcd > m_l1GtMenuToken
unsigned long long m_l1GtPfAlgoCacheID
std::unique_ptr< l1t::GlobalBoard > m_uGtBrd
Log< level::Warning, false > LogWarning
const std::vector< std::vector< double > > * m_prescaleFactorsAlgoTrig
edm::EDGetTokenT< BXVector< l1t::MuonShower > > m_muShowerInputToken
const std::vector< std::vector< double > > & prescaleTable() const
edm::EDGetTokenT< BXVector< l1t::Jet > > m_jetInputToken
edm::EDGetTokenT< BXVector< l1t::EGamma > > m_egInputToken
void produce(edm::Event &, const edm::EventSetup &) override