47 ->setComment(
"InputTag for Global Muon Trigger (required parameter: default value is invalid)");
49 ->setComment(
"InputTag for Calo Trigger EGamma (required parameter: default value is invalid)");
51 ->setComment(
"InputTag for Calo Trigger Tau (required parameter: default value is invalid)");
53 ->setComment(
"InputTag for Calo Trigger Jet (required parameter: default value is invalid)");
55 ->setComment(
"InputTag for Calo Trigger EtSum (required parameter: default value is invalid)");
57 ->setComment(
"InputTag for external conditions (not required, but recommend to specify explicitly in config)");
59 ->setComment(
"InputTag for unpacked Algblk (required only if GetPrescaleColumnFromData set to true)");
60 desc.
add<
bool>(
"GetPrescaleColumnFromData",
false)
61 ->setComment(
"Get prescale column from unpacked GlobalAlgBck. Otherwise use value specified in PrescaleSet");
62 desc.
add<
bool>(
"AlgorithmTriggersUnprescaled",
false)
63 ->setComment(
"not required, but recommend to specify explicitly in config");
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);
78 desc.
add<
std::string>(
"PrescaleCSVFile",
"prescale_L1TGlobal.csv");
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_algoblkInputTag(parSet.getParameter<
edm::
InputTag>(
"AlgoBlkInputTag")) {
122 <<
"\nInput tag for calorimeter jet collections from Cal: " <<
m_jetInputTag 123 <<
"\nInput tag for external conditions : " <<
m_extInputTag << std::endl;
126 <<
"\nProduce the L1 uGT Object Map record: " 129 <<
"\nAlternative for number of BX in GT DAQ record: 0x" << std::hex
131 <<
"\nRun algorithm triggers unprescaled: " 143 <<
"\nWARNING: Number of bunch crossing to be emulated rounded to: " <<
m_emulateBxInEvent 144 <<
"\n The number must be an odd number!\n" 154 <<
"\nWARNING: Number of bunch crossing for incoming L1 Data rounded to: " <<
m_L1DataBxInEvent 155 <<
"\n The number must be an odd number!\n" 163 <<
"\nWARNING: Number of bunch crossing for incoming L1 Data was changed to: " <<
m_L1DataBxInEvent 164 <<
"\n The number must be an odd positive number!\n" 171 produces<GlobalAlgBlkBxCollection>();
176 produces<GlobalObjectMapRecord>();
180 m_uGtBrd = std::make_unique<GlobalBoard>();
222 std::vector<std::vector<int>> temp_prescaleTable;
224 temp_prescaleTable.push_back(std::vector<int>());
390 if (m_uGtAlgBlk.
isValid() && !m_uGtAlgBlk->isEmpty(0)) {
391 std::vector<GlobalAlgBlk>::const_iterator algBlk = m_uGtAlgBlk->begin(0);
392 m_prescaleSet =
static_cast<unsigned int>(algBlk->getPreScColumn());
396 <<
"Could not find valid algo block. Setting prescale column to 1" << std::endl;
452 bool receiveMu =
true;
453 bool receiveEG =
true;
454 bool receiveTau =
true;
455 bool receiveJet =
true;
456 bool receiveEtSums =
true;
457 bool receiveExt =
true;
487 std::unique_ptr<GlobalAlgBlkBxCollection> uGtAlgRecord(
499 uint16_t bxCrossHw = 0;
500 if ((bxCross & 0xFFF) == bxCross) {
501 bxCrossHw =
static_cast<uint16_t
>(bxCross);
505 LogDebug(
"L1TGlobalProducer") <<
"\nBunch cross number [hex] = " << std::hex << bxCross
506 <<
"\n larger than 12 bits. Set to 0! \n" 510 LogDebug(
"L1TGlobalProducer") <<
"HW BxCross " << bxCrossHw << std::endl;
516 auto max = (*m_prescaleFactorsAlgoTrig).size() - 1;
517 if (pfAlgoSetIndex >
max) {
519 <<
"\nNumber of prescale algo sets available: 0.." <<
max 520 <<
"Setting former to latter." << std::endl;
521 pfAlgoSetIndex =
max;
524 const std::vector<int>& prescaleFactorsAlgoTrig = (*m_prescaleFactorsAlgoTrig).at(pfAlgoSetIndex);
528 for (
unsigned int iAlgo = 0; iAlgo < prescaleFactorsAlgoTrig.size(); iAlgo++) {
529 unsigned int value = prescaleFactorsAlgoTrig[iAlgo];
530 value = (value == 0) ? 0 : 1;
538 LogDebug(
"L1TGlobalProducer") <<
"Size of prescale vector" << prescaleFactorsAlgoTrig.size() << std::endl;
541 m_uGtBrd->receiveCaloObjectData(iEvent,
559 for (
int iBxInEvent = minEmulBxInEvent; iBxInEvent <= maxEmulBxInEvent; ++iBxInEvent) {
561 LogDebug(
"L1TGlobalProducer") <<
"\nL1TGlobalProducer : running GTL for bx = " << iBxInEvent <<
"\n" << std::endl;
577 LogDebug(
"L1TGlobalProducer") <<
"\nL1TGlobalProducer : running FDL for bx = " << iBxInEvent <<
"\n" << std::endl;
583 m_numberPhysTriggers,
584 prescaleFactorsAlgoTrig,
586 triggerMaskVetoAlgoTrig,
605 std::ostringstream myCoutStream;
607 for (
int bx = minEmulBxInEvent;
bx < maxEmulBxInEvent;
bx++) {
609 (uGtAlgRecord->at(
bx, 0)).
print(myCoutStream);
612 LogTrace(
"L1TGlobalProducer") <<
"\n The following L1 GT DAQ readout record was produced:\n" 613 << myCoutStream.str() <<
"\n" 616 myCoutStream.str(
"");
617 myCoutStream.clear();
619 const std::vector<GlobalObjectMap> objMapVec = gtObjectMapRecord->gtObjectMap();
621 for (std::vector<GlobalObjectMap>::const_iterator it = objMapVec.begin(); it != objMapVec.end(); ++it) {
622 (*it).print(myCoutStream);
625 LogDebug(
"L1TGlobalProducer") <<
"Test gtObjectMapRecord in L1TGlobalProducer \n\n" 626 << myCoutStream.str() <<
"\n\n" 629 myCoutStream.str(
"");
630 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< std::vector< int > > & prescaleTable() const
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
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 numberPhysTriggers() const
get / set the number of physics trigger algorithms
int bunchCrossing() const
edm::LuminosityBlockNumber_t luminosityBlock() const
unsigned int m_numberPhysTriggers
const L1TGlobalParameters * m_l1GtStablePar
cached stuff
edm::EDGetTokenT< BXVector< GlobalExtBlk > > m_extInputToken
BXVector< GlobalAlgBlk > GlobalAlgBlkBxCollection
unsigned long long m_l1GtTmAlgoCacheID
~L1TGlobalProducer() override
std::vector< unsigned int > m_initialTriggerMaskAlgoTrig
S & print(S &os, JobReport::InputFile const &f)
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
#define DEFINE_FWK_MODULE(type)
unsigned long long m_l1GtMenuCacheID
edm::InputTag m_tauInputTag
const std::vector< int > & orderOfChip() const
const std::vector< int > & triggerMaskVeto() const
std::unique_ptr< TriggerMenu > m_l1GtMenu
bool m_algorithmTriggersUnprescaled
std::vector< std::vector< int > > m_initialPrescaleFactorsAlgoTrig
std::vector< int > m_initialTriggerMaskVetoAlgoTrig
bool m_produceL1GtDaqRecord
logical flag to produce the L1 GT DAQ readout record
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)
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
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]
int totalBxInEvent() const
get / set the number of bx in hardware
const l1t::PrescalesVetosHelper * m_l1GtPrescalesVetoes
prescale factors
const std::vector< std::vector< int > > * m_prescaleFactorsAlgoTrig
unsigned long long m_l1GtPfAlgoCacheID
std::unique_ptr< l1t::GlobalBoard > m_uGtBrd
unsigned int numberL1Mu() const
get / set the number of L1 muons received by GT
T const * product() const
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