41 ->setComment(
"InputTag for Global Muon Trigger (required parameter: default value is invalid)");
43 ->setComment(
"InputTag for Global Muon Shower Trigger (required parameter: default value is invalid)");
45 ->setComment(
"InputTag for Calo Trigger EGamma (required parameter: default value is invalid)");
47 ->setComment(
"InputTag for Calo Trigger Tau (required parameter: default value is invalid)");
49 ->setComment(
"InputTag for Calo Trigger Jet (required parameter: default value is invalid)");
51 ->setComment(
"InputTag for Calo Trigger EtSum (required parameter: default value is invalid)");
53 ->setComment(
"InputTag for external conditions (not required, but recommend to specify explicitly in config)");
56 "InputTag for unpacked Algblk (required only if GetPrescaleColumnFromData orRequireMenuToMatchAlgoBlkInput "
58 desc.
add<
bool>(
"GetPrescaleColumnFromData",
false)
59 ->setComment(
"Get prescale column from unpacked GlobalAlgBck. Otherwise use value specified in PrescaleSet");
60 desc.
add<
bool>(
"AlgorithmTriggersUnprescaled",
false)
61 ->setComment(
"not required, but recommend to specify explicitly in config");
62 desc.
add<
bool>(
"RequireMenuToMatchAlgoBlkInput",
true)
64 "This requires that the L1 menu record to match the menu used to produce the inputed L1 results, should be "
65 "true when used by the HLT to produce the object map");
66 desc.
add<
bool>(
"AlgorithmTriggersUnmasked",
false)
67 ->setComment(
"not required, but recommend to specify explicitly in config");
70 desc.
add<
bool>(
"useMuonShowers",
false);
71 desc.
add<
bool>(
"resetPSCountersEachLumiSec",
true);
74 desc.
add<
bool>(
"ProduceL1GtDaqRecord",
true);
75 desc.
add<
bool>(
"ProduceL1GtObjectMapRecord",
true);
76 desc.
add<
int>(
"EmulateBxInEvent", 1);
77 desc.
add<
int>(
"L1DataBxInEvent", 5);
78 desc.
add<
unsigned int>(
"AlternativeNrBxBoardDaq", 0);
79 desc.
add<
int>(
"BstLengthBytes", -1);
80 desc.
add<
unsigned int>(
"PrescaleSet", 1);
84 descriptions.
add(
"L1TGlobalProducer", desc);
90 : m_muInputTag(parSet.getParameter<edm::
InputTag>(
"MuonInputTag")),
91 m_muShowerInputTag(parSet.getParameter<edm::
InputTag>(
"MuonShowerInputTag")),
92 m_egInputTag(parSet.getParameter<edm::
InputTag>(
"EGammaInputTag")),
93 m_tauInputTag(parSet.getParameter<edm::
InputTag>(
"TauInputTag")),
94 m_jetInputTag(parSet.getParameter<edm::
InputTag>(
"JetInputTag")),
95 m_sumInputTag(parSet.getParameter<edm::
InputTag>(
"EtSumInputTag")),
96 m_extInputTag(parSet.getParameter<edm::
InputTag>(
"ExtInputTag")),
98 m_produceL1GtDaqRecord(parSet.getParameter<bool>(
"ProduceL1GtDaqRecord")),
99 m_produceL1GtObjectMapRecord(parSet.getParameter<bool>(
"ProduceL1GtObjectMapRecord")),
101 m_emulateBxInEvent(parSet.getParameter<int>(
"EmulateBxInEvent")),
102 m_L1DataBxInEvent(parSet.getParameter<int>(
"L1DataBxInEvent")),
104 m_alternativeNrBxBoardDaq(parSet.getParameter<unsigned int>(
"AlternativeNrBxBoardDaq")),
105 m_psBstLengthBytes(parSet.getParameter<int>(
"BstLengthBytes")),
107 m_prescaleSet(parSet.getParameter<unsigned int>(
"PrescaleSet")),
109 m_algorithmTriggersUnprescaled(parSet.getParameter<bool>(
"AlgorithmTriggersUnprescaled")),
110 m_algorithmTriggersUnmasked(parSet.getParameter<bool>(
"AlgorithmTriggersUnmasked")),
112 m_verbosity(parSet.getUntrackedParameter<int>(
"Verbosity")),
113 m_printL1Menu(parSet.getUntrackedParameter<bool>(
"PrintL1Menu")),
115 m_getPrescaleColumnFromData(parSet.getParameter<bool>(
"GetPrescaleColumnFromData")),
116 m_requireMenuToMatchAlgoBlkInput(parSet.getParameter<bool>(
"RequireMenuToMatchAlgoBlkInput")),
117 m_algoblkInputTag(parSet.getParameter<edm::
InputTag>(
"AlgoBlkInputTag")),
118 m_resetPSCountersEachLumiSec(parSet.getParameter<bool>(
"resetPSCountersEachLumiSec")),
119 m_useMuonShowers(parSet.getParameter<bool>(
"useMuonShowers")) {
129 m_l1GtMenuToken = esConsumes<L1TUtmTriggerMenu, L1TUtmTriggerMenuRcd>();
139 <<
"\nInput tag for calorimeter jet collections from Cal: " <<
m_jetInputTag
140 <<
"\nInput tag for external conditions : " <<
m_extInputTag << std::endl;
143 <<
"\nProduce the L1 uGT Object Map record: "
146 <<
"\nAlternative for number of BX in GT DAQ record: 0x" << std::hex
148 <<
"\nRun algorithm triggers unprescaled: "
160 <<
"\nWARNING: Number of bunch crossing to be emulated rounded to: " <<
m_emulateBxInEvent
161 <<
"\n The number must be an odd number!\n"
171 <<
"\nWARNING: Number of bunch crossing for incoming L1 Data rounded to: " <<
m_L1DataBxInEvent
172 <<
"\n The number must be an odd number!\n"
180 <<
"\nWARNING: Number of bunch crossing for incoming L1 Data was changed to: " <<
m_L1DataBxInEvent
181 <<
"\n The number must be an odd positive number!\n"
188 produces<GlobalAlgBlkBxCollection>();
193 produces<GlobalObjectMapRecord>();
197 m_uGtBrd = std::make_unique<GlobalBoard>();
241 std::vector<std::vector<double>> temp_prescaleTable;
243 temp_prescaleTable.push_back(std::vector<double>());
330 if (m_uGtAlgBlk->size() >= 1) {
331 if ((*m_uGtAlgBlk)[0].getL1FirmwareUUID() !=
static_cast<int>(utml1GtMenu->
getFirmwareUuidHashed())) {
333 <<
" Error L1 menu loaded in via conditions does not match the L1 actually run "
335 <<
". This means that the mapping of the names to the bits may be incorrect. Please check the "
336 "L1TUtmTriggerMenuRcd record supplied. Unless you know what you are doing, do not simply disable this "
337 "check via the config as this a major error and the indication of something very wrong";
436 if (m_uGtAlgBlk.
isValid() && !m_uGtAlgBlk->isEmpty(0)) {
437 std::vector<GlobalAlgBlk>::const_iterator algBlk = m_uGtAlgBlk->begin(0);
438 m_prescaleSet =
static_cast<unsigned int>(algBlk->getPreScColumn());
442 <<
"Could not find valid algo block. Setting prescale column to 1" << std::endl;
498 bool receiveMu =
true;
499 bool receiveMuShower =
true;
500 bool receiveEG =
true;
501 bool receiveTau =
true;
502 bool receiveJet =
true;
503 bool receiveEtSums =
true;
504 bool receiveExt =
true;
534 std::unique_ptr<GlobalAlgBlkBxCollection> uGtAlgRecord(
546 uint16_t bxCrossHw = 0;
547 if ((bxCross & 0xFFF) == bxCross) {
548 bxCrossHw =
static_cast<uint16_t
>(bxCross);
552 LogDebug(
"L1TGlobalProducer") <<
"\nBunch cross number [hex] = " << std::hex << bxCross
553 <<
"\n larger than 12 bits. Set to 0! \n"
557 LogDebug(
"L1TGlobalProducer") <<
"HW BxCross " << bxCrossHw << std::endl;
563 auto max = (*m_prescaleFactorsAlgoTrig).size() - 1;
564 if (pfAlgoSetIndex >
max) {
566 <<
"\nNumber of prescale algo sets available: 0.." <<
max
567 <<
"Setting former to latter." << std::endl;
568 pfAlgoSetIndex =
max;
571 const std::vector<double>& prescaleFactorsAlgoTrig = (*m_prescaleFactorsAlgoTrig).at(pfAlgoSetIndex);
575 for (
unsigned int iAlgo = 0; iAlgo < prescaleFactorsAlgoTrig.size(); iAlgo++) {
576 unsigned int value = prescaleFactorsAlgoTrig[iAlgo];
577 value = (value == 0) ? 0 : 1;
585 LogDebug(
"L1TGlobalProducer") <<
"Size of prescale vector" << prescaleFactorsAlgoTrig.size() << std::endl;
588 m_uGtBrd->receiveCaloObjectData(iEvent,
609 for (
int iBxInEvent = minEmulBxInEvent; iBxInEvent <= maxEmulBxInEvent; ++iBxInEvent) {
611 LogDebug(
"L1TGlobalProducer") <<
"\nL1TGlobalProducer : running GTL for bx = " << iBxInEvent <<
"\n" << std::endl;
628 LogDebug(
"L1TGlobalProducer") <<
"\nL1TGlobalProducer : running FDL for bx = " << iBxInEvent <<
"\n" << std::endl;
634 m_numberPhysTriggers,
635 prescaleFactorsAlgoTrig,
637 triggerMaskVetoAlgoTrig,
656 std::ostringstream myCoutStream;
658 for (
int bx = minEmulBxInEvent;
bx < maxEmulBxInEvent;
bx++) {
660 (uGtAlgRecord->at(
bx, 0)).
print(myCoutStream);
663 LogTrace(
"L1TGlobalProducer") <<
"\n The following L1 GT DAQ readout record was produced:\n"
664 << myCoutStream.str() <<
"\n"
667 myCoutStream.str(
"");
668 myCoutStream.clear();
670 const std::vector<GlobalObjectMap> objMapVec = gtObjectMapRecord->gtObjectMap();
672 for (std::vector<GlobalObjectMap>::const_iterator it = objMapVec.begin(); it != objMapVec.end(); ++it) {
673 (*it).print(myCoutStream);
676 LogDebug(
"L1TGlobalProducer") <<
"Test gtObjectMapRecord in L1TGlobalProducer \n\n"
677 << myCoutStream.str() <<
"\n\n"
680 myCoutStream.str(
"");
681 myCoutStream.clear();
edm::InputTag m_jetInputTag
unsigned int m_numberDaqPartitions
edm::InputTag m_algoblkInputTag
unsigned long long m_l1GtParCacheID
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
unsigned int numberL1Jet() const
get / set the number of L1 jets received by GT
unsigned long long m_l1GtTmVetoAlgoCacheID
const std::vector< unsigned int > * m_triggerMaskAlgoTrig
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
int m_verbosity
verbosity level
unsigned int numberL1EG() const
get / set the number of L1 e/gamma objects received by GT
bool getByToken(EDGetToken token, Handle< PROD > &result) const
uint16_t m_activeBoardsGtDaq
active boards in L1 GT DAQ record
edm::InputTag m_egInputTag
input tag for calorimeter collections from GCT
edm::EDGetTokenT< BXVector< l1t::Tau > > m_tauInputToken
const l1t::PrescalesVetosFractHelper * m_l1GtPrescalesVetosFract
prescale factors
#define DEFINE_FWK_MODULE(type)
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
const std::vector< int > & triggerMaskVeto() const
unsigned int numberPhysTriggers() const
get / set the number of physics trigger algorithms
int bunchCrossing() const
edm::LuminosityBlockNumber_t luminosityBlock() const
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
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 GMT
edm::InputTag m_extInputTag
input tag for external conditions
unsigned long long m_l1GtMenuCacheID
edm::InputTag m_tauInputTag
const std::vector< int > & orderOfChip() const
edm::InputTag m_muShowerInputTag
std::unique_ptr< TriggerMenu > m_l1GtMenu
bool m_algorithmTriggersUnprescaled
std::vector< int > m_initialTriggerMaskVetoAlgoTrig
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
unsigned int numberL1Tau() const
get / set the number of L1 tau received by GT
ParameterDescriptionBase * add(U const &iLabel, T const &value)
const std::vector< std::vector< double > > & prescaleTable() 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 &)
unsigned long long m_l1GtBMCacheID
int m_ifCaloEtaNumberBits
T const * product() const
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]
bool m_resetPSCountersEachLumiSec
int totalBxInEvent() const
get / set the number of bx in hardware
edm::ESGetToken< L1TUtmTriggerMenu, L1TUtmTriggerMenuRcd > m_l1GtMenuToken
unsigned long long m_l1GtPfAlgoCacheID
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
std::unique_ptr< l1t::GlobalBoard > m_uGtBrd
Log< level::Warning, false > LogWarning
const std::vector< std::vector< double > > * m_prescaleFactorsAlgoTrig
unsigned int numberL1Mu() const
get / set the number of L1 muons received by GT
edm::EDGetTokenT< BXVector< l1t::MuonShower > > m_muShowerInputToken
unsigned int pinsOnChip() const
get / set the number of pins on the GTL condition chips
edm::EDGetTokenT< BXVector< l1t::Jet > > m_jetInputToken
unsigned int numberChips() const
get / set the number of condition chips in GTL
edm::EDGetTokenT< BXVector< l1t::EGamma > > m_egInputToken
void produce(edm::Event &, const edm::EventSetup &) override