CMS 3D CMS Logo

L1TGlobalProducer.cc
Go to the documentation of this file.
1 // L1TGlobalProducer.cc
2 //author: Brian Winer - Ohio State
3 // Vladimir Rekovic - extend for overlap removal
4 
6 
7 // system include files
8 #include <memory>
9 #include <iostream>
10 #include <iomanip>
11 #include <algorithm>
12 
23 
27 
32 
36 
38 
39 #include "TriggerMenuParser.h"
40 
41 using namespace l1t;
42 
45  // These parameters are part of the L1T/HLT interface, avoid changing if possible::
46  desc.add<edm::InputTag>("MuonInputTag", edm::InputTag(""))
47  ->setComment("InputTag for Global Muon Trigger (required parameter: default value is invalid)");
48  desc.add<edm::InputTag>("EGammaInputTag", edm::InputTag(""))
49  ->setComment("InputTag for Calo Trigger EGamma (required parameter: default value is invalid)");
50  desc.add<edm::InputTag>("TauInputTag", edm::InputTag(""))
51  ->setComment("InputTag for Calo Trigger Tau (required parameter: default value is invalid)");
52  desc.add<edm::InputTag>("JetInputTag", edm::InputTag(""))
53  ->setComment("InputTag for Calo Trigger Jet (required parameter: default value is invalid)");
54  desc.add<edm::InputTag>("EtSumInputTag", edm::InputTag(""))
55  ->setComment("InputTag for Calo Trigger EtSum (required parameter: default value is invalid)");
56  desc.add<edm::InputTag>("ExtInputTag", edm::InputTag(""))
57  ->setComment("InputTag for external conditions (not required, but recommend to specify explicitly in config)");
58  desc.add<edm::InputTag>("AlgoBlkInputTag", edm::InputTag("gtDigis"))
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");
66  // These parameters have well defined default values and are not currently
67  // part of the L1T/HLT interface. They can be cleaned up or updated at will:
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);
77  desc.add<std::string>("TriggerMenuLuminosity", "startup");
78  desc.add<std::string>("PrescaleCSVFile", "prescale_L1TGlobal.csv");
79  descriptions.add("L1TGlobalProducer", desc);
80 }
81 
82 // constructors
83 
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")),
91 
92  m_produceL1GtDaqRecord(parSet.getParameter<bool>("ProduceL1GtDaqRecord")),
93  m_produceL1GtObjectMapRecord(parSet.getParameter<bool>("ProduceL1GtObjectMapRecord")),
94 
95  m_emulateBxInEvent(parSet.getParameter<int>("EmulateBxInEvent")),
96  m_L1DataBxInEvent(parSet.getParameter<int>("L1DataBxInEvent")),
97 
98  m_alternativeNrBxBoardDaq(parSet.getParameter<unsigned int>("AlternativeNrBxBoardDaq")),
99  m_psBstLengthBytes(parSet.getParameter<int>("BstLengthBytes")),
100 
101  m_prescaleSet(parSet.getParameter<unsigned int>("PrescaleSet")),
102 
103  m_algorithmTriggersUnprescaled(parSet.getParameter<bool>("AlgorithmTriggersUnprescaled")),
104  m_algorithmTriggersUnmasked(parSet.getParameter<bool>("AlgorithmTriggersUnmasked")),
105 
106  m_verbosity(parSet.getUntrackedParameter<int>("Verbosity")),
107  m_printL1Menu(parSet.getUntrackedParameter<bool>("PrintL1Menu")),
108  m_isDebugEnabled(edm::isDebugEnabled()),
109  m_getPrescaleColumnFromData(parSet.getParameter<bool>("GetPrescaleColumnFromData")),
110  m_algoblkInputTag(parSet.getParameter<edm::InputTag>("AlgoBlkInputTag")) {
111  m_egInputToken = consumes<BXVector<EGamma>>(m_egInputTag);
112  m_tauInputToken = consumes<BXVector<Tau>>(m_tauInputTag);
113  m_jetInputToken = consumes<BXVector<Jet>>(m_jetInputTag);
114  m_sumInputToken = consumes<BXVector<EtSum>>(m_sumInputTag);
115  m_muInputToken = consumes<BXVector<Muon>>(m_muInputTag);
116  m_extInputToken = consumes<BXVector<GlobalExtBlk>>(m_extInputTag);
118  m_algoblkInputToken = consumes<BXVector<GlobalAlgBlk>>(m_algoblkInputTag);
119 
120  if (m_verbosity) {
121  LogTrace("L1TGlobalProducer") << "\nInput tag for muon collection from uGMT: " << m_muInputTag
122  << "\nInput tag for calorimeter jet collections from Cal: " << m_jetInputTag
123  << "\nInput tag for external conditions : " << m_extInputTag << std::endl;
124 
125  LogTrace("L1TGlobalProducer") << "\nProduce the L1 uGT DAQ readout record: " << m_produceL1GtDaqRecord
126  << "\nProduce the L1 uGT Object Map record: "
127  << m_produceL1GtObjectMapRecord << " \n"
128  << "\nNumber of BxInEvent to be emulated: " << m_emulateBxInEvent << " \n"
129  << "\nAlternative for number of BX in GT DAQ record: 0x" << std::hex
130  << m_alternativeNrBxBoardDaq << " \n"
131  << "\nRun algorithm triggers unprescaled: "
133  << "\nRun algorithm triggers unmasked (all enabled): " << m_algorithmTriggersUnmasked
134  << "\n"
135  << std::endl;
136  }
137 
138  if ((m_emulateBxInEvent > 0) && ((m_emulateBxInEvent % 2) == 0)) {
140 
141  if (m_verbosity) {
142  edm::LogWarning("L1TGlobalProducer")
143  << "\nWARNING: Number of bunch crossing to be emulated rounded to: " << m_emulateBxInEvent
144  << "\n The number must be an odd number!\n"
145  << std::endl;
146  }
147  }
148 
149  if ((m_L1DataBxInEvent > 0) && ((m_L1DataBxInEvent % 2) == 0)) {
151 
152  if (m_verbosity) {
153  edm::LogWarning("L1TGlobalProducer")
154  << "\nWARNING: Number of bunch crossing for incoming L1 Data rounded to: " << m_L1DataBxInEvent
155  << "\n The number must be an odd number!\n"
156  << std::endl;
157  }
158  } else if (m_L1DataBxInEvent < 0) {
159  m_L1DataBxInEvent = 1;
160 
161  if (m_verbosity) {
162  edm::LogWarning("L1TGlobalProducer")
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"
165  << std::endl;
166  }
167  }
168 
169  // register products
171  produces<GlobalAlgBlkBxCollection>();
172  //blwEXT produces<GlobalExtBlkBxCollection>();
173  }
174 
176  produces<GlobalObjectMapRecord>();
177  }
178 
179  // create new uGt Board
180  m_uGtBrd = std::make_unique<GlobalBoard>();
181  m_uGtBrd->setVerbosity(m_verbosity);
182 
183  // initialize cached IDs
184 
185  //
186  m_l1GtParCacheID = 0ULL;
187  m_l1GtMenuCacheID = 0ULL;
188 
191 
192  m_nrL1Mu = 0;
193  m_nrL1EG = 0;
194  m_nrL1Tau = 0;
195 
196  m_nrL1Jet = 0;
197 
200 
201  //
202  m_l1GtParCacheID = 0ULL;
203 
204  m_totalBxInEvent = 0;
205 
207  m_bstLengthBytes = 0;
208 
209  //
210  m_l1GtBMCacheID = 0ULL;
211 
212  //
213  m_l1GtPfAlgoCacheID = 0ULL;
214 
215  m_l1GtTmAlgoCacheID = 0ULL;
216 
218 
219  m_currentLumi = 0;
220 
221  // Set default, initial, dummy prescale factor table
222  std::vector<std::vector<int>> temp_prescaleTable;
223 
224  temp_prescaleTable.push_back(std::vector<int>());
225  m_initialPrescaleFactorsAlgoTrig = temp_prescaleTable;
226 }
227 
228 // destructor
230 
231 // member functions
232 
233 // method called to produce the data
235  // process event iEvent
236  // get / update the stable parameters from the EventSetup
237  // local cache & check on cacheIdentifier
238 
239  unsigned long long l1GtParCacheID = evSetup.get<L1TGlobalParametersRcd>().cacheIdentifier();
240 
241  if (m_l1GtParCacheID != l1GtParCacheID) {
243  evSetup.get<L1TGlobalParametersRcd>().get(l1GtStablePar);
244  m_l1GtStablePar = l1GtStablePar.product();
245  const GlobalParamsHelper* data = GlobalParamsHelper::readFromEventSetup(m_l1GtStablePar);
246 
247  // number of bx
248  m_totalBxInEvent = data->totalBxInEvent();
249 
250  // number of physics triggers
251  m_numberPhysTriggers = data->numberPhysTriggers();
252 
253  // number of objects of each type
254  m_nrL1Mu = data->numberL1Mu();
255 
256  // EG
257  m_nrL1EG = data->numberL1EG();
258 
259  // jets
260  m_nrL1Jet = data->numberL1Jet();
261 
262  // taus
263  m_nrL1Tau = data->numberL1Tau();
264 
265  if (m_L1DataBxInEvent < 1)
266  m_L1DataBxInEvent = 1;
267  int minL1DataBxInEvent = (m_L1DataBxInEvent + 1) / 2 - m_L1DataBxInEvent;
268  int maxL1DataBxInEvent = (m_L1DataBxInEvent + 1) / 2 - 1;
269 
270  // Initialize Board
271  m_uGtBrd->init(
272  m_numberPhysTriggers, m_nrL1Mu, m_nrL1EG, m_nrL1Tau, m_nrL1Jet, minL1DataBxInEvent, maxL1DataBxInEvent);
273 
274  //
275  m_l1GtParCacheID = l1GtParCacheID;
276  }
277 
278  if (m_emulateBxInEvent < 0) {
280  }
281 
282  if (m_emulateBxInEvent < 1)
283  m_emulateBxInEvent = 1;
284  int minEmulBxInEvent = (m_emulateBxInEvent + 1) / 2 - m_emulateBxInEvent;
285  int maxEmulBxInEvent = (m_emulateBxInEvent + 1) / 2 - 1;
286 
287  // get / update the trigger menu from the EventSetup
288  // local cache & check on cacheIdentifier
289  unsigned long long l1GtMenuCacheID = evSetup.get<L1TUtmTriggerMenuRcd>().cacheIdentifier();
290 
291  if (m_l1GtMenuCacheID != l1GtMenuCacheID) {
292  const GlobalParamsHelper* data = GlobalParamsHelper::readFromEventSetup(m_l1GtStablePar);
293 
295  evSetup.get<L1TUtmTriggerMenuRcd>().get(l1GtMenu);
296  const L1TUtmTriggerMenu* utml1GtMenu = l1GtMenu.product();
297 
298  // Instantiate Parser
300 
301  gtParser.setGtNumberConditionChips(data->numberChips());
302  gtParser.setGtPinsOnConditionChip(data->pinsOnChip());
303  gtParser.setGtOrderConditionChip(data->orderOfChip());
304  gtParser.setGtNumberPhysTriggers(data->numberPhysTriggers());
305 
306  //Parse menu into emulator classes
307  gtParser.parseCondFormats(utml1GtMenu);
308 
309  // transfer the condition map and algorithm map from parser to L1uGtTriggerMenu
310  m_l1GtMenu = std::make_unique<TriggerMenu>(gtParser.gtTriggerMenuName(),
311  data->numberChips(),
312  gtParser.vecMuonTemplate(),
313  gtParser.vecCaloTemplate(),
314  gtParser.vecEnergySumTemplate(),
315  gtParser.vecExternalTemplate(),
316  gtParser.vecCorrelationTemplate(),
318  gtParser.corMuonTemplate(),
319  gtParser.corCaloTemplate(),
320  gtParser.corEnergySumTemplate());
321 
322  m_l1GtMenu->setGtTriggerMenuInterface(gtParser.gtTriggerMenuInterface());
323  m_l1GtMenu->setGtTriggerMenuImplementation(gtParser.gtTriggerMenuImplementation());
324  m_l1GtMenu->setGtScaleDbKey(gtParser.gtScaleDbKey());
325  m_l1GtMenu->setGtScales(gtParser.gtScales());
326  m_l1GtMenu->setGtTriggerMenuUUID(gtParser.gtTriggerMenuUUID());
327 
328  m_l1GtMenu->setGtAlgorithmMap(gtParser.gtAlgorithmMap());
329  m_l1GtMenu->setGtAlgorithmAliasMap(gtParser.gtAlgorithmAliasMap());
330 
331  m_l1GtMenu->buildGtConditionMap();
332 
333  int printV = 2;
334  if (m_printL1Menu)
335  m_l1GtMenu->print(std::cout, printV);
336 
337  m_l1GtMenuCacheID = l1GtMenuCacheID;
338  }
339 
340  // get / update the board maps from the EventSetup
341  // local cache & check on cacheIdentifier
342 
343  /* *** Drop L1GtBoard Maps for now
344  typedef std::vector<L1GtBoard>::const_iterator CItBoardMaps;
345 
346  unsigned long long l1GtBMCacheID = evSetup.get<L1GtBoardMapsRcd>().cacheIdentifier();
347 */
348 
349  /* ** Drop board mapping for now
350  if (m_l1GtBMCacheID != l1GtBMCacheID) {
351 
352  edm::ESHandle< L1GtBoardMaps > l1GtBM;
353  evSetup.get< L1GtBoardMapsRcd >().get( l1GtBM );
354  m_l1GtBM = l1GtBM.product();
355 
356  m_l1GtBMCacheID = l1GtBMCacheID;
357 
358  }
359 
360 
361  // TODO need changes in CondFormats to cache the maps
362  const std::vector<L1GtBoard>& boardMaps = m_l1GtBM->gtBoardMaps();
363 */
364  // get / update the prescale factors from the EventSetup
365  // local cache & check on cacheIdentifier
366 
367  // Only get event record if not unprescaled and not unmasked
369  unsigned long long l1GtPfAlgoCacheID = evSetup.get<L1TGlobalPrescalesVetosRcd>().cacheIdentifier();
370 
371  if (m_l1GtPfAlgoCacheID != l1GtPfAlgoCacheID) {
372  edm::ESHandle<L1TGlobalPrescalesVetos> l1GtPrescalesVetoes;
373  evSetup.get<L1TGlobalPrescalesVetosRcd>().get(l1GtPrescalesVetoes);
374  const L1TGlobalPrescalesVetos* es = l1GtPrescalesVetoes.product();
375  m_l1GtPrescalesVetoes = PrescalesVetosHelper::readFromEventSetup(es);
376 
379 
380  m_l1GtPfAlgoCacheID = l1GtPfAlgoCacheID;
381  }
383  (m_currentLumi != iEvent.luminosityBlock())) { // get prescale column from unpacked data
384 
385  m_currentLumi = iEvent.luminosityBlock();
386 
388  iEvent.getByToken(m_algoblkInputToken, m_uGtAlgBlk);
389 
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());
393  } else {
394  m_prescaleSet = 1;
395  edm::LogError("L1TGlobalProduce")
396  << "Could not find valid algo block. Setting prescale column to 1" << std::endl;
397  }
398  }
399  } else {
400  // Set Prescale factors to initial dummy values
401  m_prescaleSet = 0;
405  }
406 
407  // get / update the trigger mask from the EventSetup
408  // local cache & check on cacheIdentifier
409 
410  /* **** For now Leave out Masks *****
411  unsigned long long l1GtTmAlgoCacheID =
412  evSetup.get<L1GtTriggerMaskAlgoTrigRcd>().cacheIdentifier();
413 
414  if (m_l1GtTmAlgoCacheID != l1GtTmAlgoCacheID) {
415 
416  edm::ESHandle< L1GtTriggerMask > l1GtTmAlgo;
417  evSetup.get< L1GtTriggerMaskAlgoTrigRcd >().get( l1GtTmAlgo );
418  m_l1GtTmAlgo = l1GtTmAlgo.product();
419 
420  m_triggerMaskAlgoTrig = m_l1GtTmAlgo->gtTriggerMask();
421 
422  m_l1GtTmAlgoCacheID = l1GtTmAlgoCacheID;
423 
424  }
425 */
426 
427  /* **** For now Leave out Veto Masks *****
428  unsigned long long l1GtTmVetoAlgoCacheID =
429  evSetup.get<L1GtTriggerMaskVetoAlgoTrigRcd>().cacheIdentifier();
430 
431  if (m_l1GtTmVetoAlgoCacheID != l1GtTmVetoAlgoCacheID) {
432 
433  edm::ESHandle< L1GtTriggerMask > l1GtTmVetoAlgo;
434  evSetup.get< L1GtTriggerMaskVetoAlgoTrigRcd >().get( l1GtTmVetoAlgo );
435  m_l1GtTmVetoAlgo = l1GtTmVetoAlgo.product();
436 
437  m_triggerMaskVetoAlgoTrig = m_l1GtTmVetoAlgo->gtTriggerMask();
438 
439  m_l1GtTmVetoAlgoCacheID = l1GtTmVetoAlgoCacheID;
440 
441  }
442 */
443 
444  // ****** Board Maps Need to be redone....hard code for now ******
445  // loop over blocks in the GT DAQ record receiving data, count them if they are active
446  // all board type are defined in CondFormats/L1TObjects/L1GtFwd
447  // &
448  // set the active flag for each object type received from GMT and GCT
449  // all objects in the GT system
450 
451  //
452  bool receiveMu = true;
453  bool receiveEG = true;
454  bool receiveTau = true;
455  bool receiveJet = true;
456  bool receiveEtSums = true;
457  bool receiveExt = true;
458 
459  /* *** Boards need redefining *****
460  for (CItBoardMaps
461  itBoard = boardMaps.begin();
462  itBoard != boardMaps.end(); ++itBoard) {
463 
464  int iPosition = itBoard->gtPositionDaqRecord();
465  if (iPosition > 0) {
466 
467  int iActiveBit = itBoard->gtBitDaqActiveBoards();
468  bool activeBoard = false;
469 
470  if (iActiveBit >= 0) {
471  activeBoard = m_activeBoardsGtDaq & (1 << iActiveBit);
472  }
473 
474  // use board if: in the record, but not in ActiveBoardsMap (iActiveBit < 0)
475  // in the record and ActiveBoardsMap, and active
476  if ((iActiveBit < 0) || activeBoard) {
477 
478 // ****** Decide what board manipulation (if any we want here)
479 
480  }
481  }
482 
483  }
484 */
485 
486  // Produce the Output Records for the GT
487  std::unique_ptr<GlobalAlgBlkBxCollection> uGtAlgRecord(
488  new GlobalAlgBlkBxCollection(0, minEmulBxInEvent, maxEmulBxInEvent));
489 
490  // * produce the GlobalObjectMapRecord
491  std::unique_ptr<GlobalObjectMapRecord> gtObjectMapRecord(new GlobalObjectMapRecord());
492 
493  // fill the boards not depending on the BxInEvent in the L1 GT DAQ record
494  // GMT, PSB and FDL depend on BxInEvent
495 
496  // fill in emulator the same bunch crossing (12 bits - hardwired number of bits...)
497  // and the same local bunch crossing for all boards
498  int bxCross = iEvent.bunchCrossing();
499  uint16_t bxCrossHw = 0;
500  if ((bxCross & 0xFFF) == bxCross) {
501  bxCrossHw = static_cast<uint16_t>(bxCross);
502  } else {
503  bxCrossHw = 0; // Bx number too large, set to 0!
504  if (m_verbosity) {
505  LogDebug("L1TGlobalProducer") << "\nBunch cross number [hex] = " << std::hex << bxCross
506  << "\n larger than 12 bits. Set to 0! \n"
507  << std::dec << std::endl;
508  }
509  }
510  LogDebug("L1TGlobalProducer") << "HW BxCross " << bxCrossHw << std::endl;
511 
512  // get the prescale factor from the configuration for now
513  // prescale set index counts from zero
514  unsigned int pfAlgoSetIndex = m_prescaleSet;
515 
516  auto max = (*m_prescaleFactorsAlgoTrig).size() - 1;
517  if (pfAlgoSetIndex > max) {
518  edm::LogWarning("L1TGlobalProducer") << "\nAttempting to access prescale algo set: " << m_prescaleSet
519  << "\nNumber of prescale algo sets available: 0.." << max
520  << "Setting former to latter." << std::endl;
521  pfAlgoSetIndex = max;
522  }
523 
524  const std::vector<int>& prescaleFactorsAlgoTrig = (*m_prescaleFactorsAlgoTrig).at(pfAlgoSetIndex);
525 
526  // For now, set masks according to prescale value of 0
528  for (unsigned int iAlgo = 0; iAlgo < prescaleFactorsAlgoTrig.size(); iAlgo++) {
529  unsigned int value = prescaleFactorsAlgoTrig[iAlgo];
530  value = (value == 0) ? 0 : 1;
532  }
534 
535  const std::vector<unsigned int>& triggerMaskAlgoTrig = *m_triggerMaskAlgoTrig;
536  const std::vector<int>& triggerMaskVetoAlgoTrig = *m_triggerMaskVetoAlgoTrig;
537 
538  LogDebug("L1TGlobalProducer") << "Size of prescale vector" << prescaleFactorsAlgoTrig.size() << std::endl;
539 
540  // Load the calorimeter input onto the uGt Board
541  m_uGtBrd->receiveCaloObjectData(iEvent,
546  receiveEG,
547  m_nrL1EG,
548  receiveTau,
549  m_nrL1Tau,
550  receiveJet,
551  m_nrL1Jet,
552  receiveEtSums);
553 
554  m_uGtBrd->receiveMuonObjectData(iEvent, m_muInputToken, receiveMu, m_nrL1Mu);
555 
556  m_uGtBrd->receiveExternalData(iEvent, m_extInputToken, receiveExt);
557 
558  // loop over BxInEvent
559  for (int iBxInEvent = minEmulBxInEvent; iBxInEvent <= maxEmulBxInEvent; ++iBxInEvent) {
560  // run GTL
561  LogDebug("L1TGlobalProducer") << "\nL1TGlobalProducer : running GTL for bx = " << iBxInEvent << "\n" << std::endl;
562 
563  // Run the GTL for this BX
564  m_uGtBrd->runGTL(iEvent,
565  evSetup,
566  m_l1GtMenu.get(),
568  iBxInEvent,
569  gtObjectMapRecord,
571  m_nrL1Mu,
572  m_nrL1EG,
573  m_nrL1Tau,
574  m_nrL1Jet);
575 
576  // run FDL
577  LogDebug("L1TGlobalProducer") << "\nL1TGlobalProducer : running FDL for bx = " << iBxInEvent << "\n" << std::endl;
578 
579  // Run the Final Decision Logic for this BX
580  m_uGtBrd->runFDL(iEvent,
581  iBxInEvent,
584  prescaleFactorsAlgoTrig,
585  triggerMaskAlgoTrig,
586  triggerMaskVetoAlgoTrig,
589 
590  // Fill in the DAQ Records
592  m_uGtBrd->fillAlgRecord(iBxInEvent,
593  uGtAlgRecord,
595  m_l1GtMenu->gtTriggerMenuUUID(),
596  m_l1GtMenu->gtTriggerMenuImplementation());
597  }
598 
599  } //End Loop over Bx
600 
601  // Add explicit reset of Board
602  m_uGtBrd->reset();
603 
604  if (m_verbosity && m_isDebugEnabled) {
605  std::ostringstream myCoutStream;
606 
607  for (int bx = minEmulBxInEvent; bx < maxEmulBxInEvent; bx++) {
609  (uGtAlgRecord->at(bx, 0)).print(myCoutStream);
610  }
611 
612  LogTrace("L1TGlobalProducer") << "\n The following L1 GT DAQ readout record was produced:\n"
613  << myCoutStream.str() << "\n"
614  << std::endl;
615 
616  myCoutStream.str("");
617  myCoutStream.clear();
618 
619  const std::vector<GlobalObjectMap> objMapVec = gtObjectMapRecord->gtObjectMap();
620 
621  for (std::vector<GlobalObjectMap>::const_iterator it = objMapVec.begin(); it != objMapVec.end(); ++it) {
622  (*it).print(myCoutStream);
623  }
624 
625  LogDebug("L1TGlobalProducer") << "Test gtObjectMapRecord in L1TGlobalProducer \n\n"
626  << myCoutStream.str() << "\n\n"
627  << std::endl;
628 
629  myCoutStream.str("");
630  myCoutStream.clear();
631  }
632 
633  // register products
635  iEvent.put(std::move(uGtAlgRecord));
636  }
637 
639  iEvent.put(std::move(gtObjectMapRecord));
640  }
641 }
642 
643 //define this as a plug-in
646 #include <cstdint>
L1TGlobalProducer::m_l1GtPrescalesVetoes
const l1t::PrescalesVetosHelper * m_l1GtPrescalesVetoes
prescale factors
Definition: L1TGlobalProducer.h:87
ConfigurationDescriptions.h
l1t::TriggerMenuParser::vecCorrelationTemplate
const std::vector< std::vector< CorrelationTemplate > > & vecCorrelationTemplate() const
Definition: TriggerMenuParser.h:142
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
L1TGlobalProducer::m_jetInputToken
edm::EDGetTokenT< BXVector< l1t::Jet > > m_jetInputToken
Definition: L1TGlobalProducer.h:124
RefProd.h
L1TGlobalPrescalesVetosRcd
Definition: L1TGlobalPrescalesVetosRcd.h:11
L1TGlobalProducer
Definition: L1TGlobalProducer.h:36
L1TGlobalProducer::m_l1GtPfAlgoCacheID
unsigned long long m_l1GtPfAlgoCacheID
Definition: L1TGlobalProducer.h:88
L1TGlobalProducer::m_uGtBrd
std::unique_ptr< l1t::GlobalBoard > m_uGtBrd
Definition: L1TGlobalProducer.h:111
electrons_cff.bool
bool
Definition: electrons_cff.py:372
L1TGlobalProducer::m_verbosity
int m_verbosity
verbosity level
Definition: L1TGlobalProducer.h:169
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
l1t::TriggerMenuParser::setGtPinsOnConditionChip
void setGtPinsOnConditionChip(const unsigned int &)
Definition: TriggerMenuParser.cc:70
GlobalObjectMapRecord.h
L1TUtmTriggerMenuRcd.h
MessageLogger.h
GlobalObjectMapRecord
Definition: GlobalObjectMapRecord.h:29
l1t::TriggerMenuParser::gtAlgorithmMap
const AlgorithmMap & gtAlgorithmMap() const
get / set the algorithm map (by name)
Definition: TriggerMenuParser.h:175
L1TGlobalProducer::m_numberPhysTriggers
unsigned int m_numberPhysTriggers
Definition: L1TGlobalProducer.h:57
l1t::TriggerMenuParser::setGtNumberPhysTriggers
void setGtNumberPhysTriggers(const unsigned int &)
Definition: TriggerMenuParser.cc:81
L1TGlobalProducer::m_algoblkInputTag
edm::InputTag m_algoblkInputTag
Definition: L1TGlobalProducer.h:174
ESHandle.h
L1TGlobalProducer::m_extInputToken
edm::EDGetTokenT< BXVector< GlobalExtBlk > > m_extInputToken
Definition: L1TGlobalProducer.h:129
L1TGlobalProducer::m_l1GtParCacheID
unsigned long long m_l1GtParCacheID
Definition: L1TGlobalProducer.h:50
L1TUtmTriggerMenuRcd
Definition: L1TUtmTriggerMenuRcd.h:11
L1TGlobalProducer::m_totalBxInEvent
int m_totalBxInEvent
total number of Bx's in the event coming from EventSetup
Definition: L1TGlobalProducer.h:74
L1TGlobalProducer::m_nrL1Mu
int m_nrL1Mu
Definition: L1TGlobalProducer.h:63
GlobalParamsHelper.h
L1TGlobalProducer::m_initialTriggerMaskAlgoTrig
std::vector< unsigned int > m_initialTriggerMaskAlgoTrig
Definition: L1TGlobalProducer.h:106
L1TGlobalParametersRcd.h
edm
HLT enums.
Definition: AlignableModifier.h:19
GlobalExtBlk.h
L1TGlobalProducer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: L1TGlobalProducer.cc:234
l1t::TriggerMenuParser::gtTriggerMenuName
const std::string & gtTriggerMenuName() const
Definition: TriggerMenuParser.h:100
l1t::TriggerMenuParser::gtTriggerMenuInterface
const std::string & gtTriggerMenuInterface() const
get / set the trigger menu names
Definition: TriggerMenuParser.h:95
gather_cfg.cout
cout
Definition: gather_cfg.py:144
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
l1t::TriggerMenuParser::gtAlgorithmAliasMap
const AlgorithmMap & gtAlgorithmAliasMap() const
get / set the algorithm map (by alias)
Definition: TriggerMenuParser.h:180
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
L1TGlobalProducer::m_jetInputTag
edm::InputTag m_jetInputTag
Definition: L1TGlobalProducer.h:120
L1TGlobalProducer::m_l1GtStablePar
const L1TGlobalParameters * m_l1GtStablePar
cached stuff
Definition: L1TGlobalProducer.h:49
L1TGlobalProducer::m_l1GtTmAlgoCacheID
unsigned long long m_l1GtTmAlgoCacheID
Definition: L1TGlobalProducer.h:100
l1t::TriggerMenuParser::vecMuonTemplate
const std::vector< std::vector< MuonTemplate > > & vecMuonTemplate() const
get / set the vectors containing the conditions
Definition: TriggerMenuParser.h:118
L1TGlobalProducer::m_l1GtTmVetoAlgoCacheID
unsigned long long m_l1GtTmVetoAlgoCacheID
Definition: L1TGlobalProducer.h:103
l1t::TriggerMenuParser::parseCondFormats
void parseCondFormats(const L1TUtmTriggerMenu *utmMenu)
Definition: TriggerMenuParser.cc:190
GlobalAlgBlkBxCollection
BXVector< GlobalAlgBlk > GlobalAlgBlkBxCollection
Definition: GlobalAlgBlk.h:31
L1TGlobalProducer::m_muInputTag
edm::InputTag m_muInputTag
input tag for muon collection from GMT
Definition: L1TGlobalProducer.h:114
edm::Handle
Definition: AssociativeIterator.h:50
l1t::PrescalesVetosHelper::prescaleTable
const std::vector< std::vector< int > > & prescaleTable() const
Definition: PrescalesVetosHelper.h:51
L1TGlobalProducer::m_sumInputTag
edm::InputTag m_sumInputTag
Definition: L1TGlobalProducer.h:121
L1TGlobalProducer::m_tauInputToken
edm::EDGetTokenT< BXVector< l1t::Tau > > m_tauInputToken
Definition: L1TGlobalProducer.h:123
L1TGlobalPrescalesVetosRcd.h
L1TGlobalProducer::m_produceL1GtObjectMapRecord
bool m_produceL1GtObjectMapRecord
logical flag to produce the L1 GT object map record
Definition: L1TGlobalProducer.h:135
L1TGlobalProducer::m_algorithmTriggersUnprescaled
bool m_algorithmTriggersUnprescaled
Definition: L1TGlobalProducer.h:162
L1TUtmTriggerMenu
Definition: L1TUtmTriggerMenu.h:36
MakerMacros.h
l1t::TriggerMenuParser::vecCaloTemplate
const std::vector< std::vector< CaloTemplate > > & vecCaloTemplate() const
Definition: TriggerMenuParser.h:122
L1TGlobalProducer::m_produceL1GtDaqRecord
bool m_produceL1GtDaqRecord
logical flag to produce the L1 GT DAQ readout record
Definition: L1TGlobalProducer.h:132
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
L1TGlobalPrescalesVetos
Definition: L1TGlobalPrescalesVetos.h:13
L1TGlobalProducer::m_isDebugEnabled
bool m_isDebugEnabled
Definition: L1TGlobalProducer.h:171
L1TGlobalProducer::m_initialPrescaleFactorsAlgoTrig
std::vector< std::vector< int > > m_initialPrescaleFactorsAlgoTrig
Definition: L1TGlobalProducer.h:91
edm::ESHandle
Definition: DTSurvey.h:22
L1TGlobalProducer::~L1TGlobalProducer
~L1TGlobalProducer() override
Definition: L1TGlobalProducer.cc:229
typedefs.h
L1TGlobalProducer::m_triggerMaskVetoAlgoTrig
const std::vector< int > * m_triggerMaskVetoAlgoTrig
Definition: L1TGlobalProducer.h:108
L1TGlobalProducer::m_extInputTag
edm::InputTag m_extInputTag
input tag for external conditions
Definition: L1TGlobalProducer.h:128
l1t::TriggerMenuParser::gtTriggerMenuUUID
const int gtTriggerMenuUUID() const
Definition: TriggerMenuParser.h:205
ParameterSetDescription.h
L1TGlobalProducer::m_l1GtMenuCacheID
unsigned long long m_l1GtMenuCacheID
Definition: L1TGlobalProducer.h:54
l1t::TriggerMenuParser::vecExternalTemplate
const std::vector< std::vector< ExternalTemplate > > & vecExternalTemplate() const
Definition: TriggerMenuParser.h:135
L1TGlobalProducer::m_alternativeNrBxBoardDaq
unsigned int m_alternativeNrBxBoardDaq
Definition: L1TGlobalProducer.h:151
L1TGlobalProducer::m_L1DataBxInEvent
int m_L1DataBxInEvent
Bx expected in Data coming to GT.
Definition: L1TGlobalProducer.h:147
L1TGlobalProducer::m_nrL1Tau
int m_nrL1Tau
Definition: L1TGlobalProducer.h:65
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::LogWarning
Definition: MessageLogger.h:141
L1TUtmTriggerMenu.h
edm::ParameterSetDescription::addUntracked
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:100
L1TGlobalParameters.h
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
MessageDrop.h
edm::ParameterSet
Definition: ParameterSet.h:36
l1t::GlobalParamsHelper
Definition: GlobalParamsHelper.h:33
edm::LogError
Definition: MessageLogger.h:183
Event.h
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
l1t
delete x;
Definition: CaloConfig.h:22
L1TGlobalProducer::m_tauInputTag
edm::InputTag m_tauInputTag
Definition: L1TGlobalProducer.h:119
L1TGlobalParametersRcd
Definition: L1TGlobalParametersRcd.h:4
TriggerMenu.h
L1TGlobalProducer::m_l1GtMenu
std::unique_ptr< TriggerMenu > m_l1GtMenu
Definition: L1TGlobalProducer.h:53
ModuleDef.h
createfilelist.int
int
Definition: createfilelist.py:10
iEvent
int iEvent
Definition: GenABIO.cc:224
value
Definition: value.py:1
L1TGlobalProducer::m_initialTriggerMaskVetoAlgoTrig
std::vector< int > m_initialTriggerMaskVetoAlgoTrig
Definition: L1TGlobalProducer.h:109
l1t::TriggerMenuParser::corMuonTemplate
const std::vector< std::vector< MuonTemplate > > & corMuonTemplate() const
Definition: TriggerMenuParser.h:158
GlobalAlgBlk.h
edm::EventSetup
Definition: EventSetup.h:57
L1TGlobalProducer::m_algorithmTriggersUnmasked
bool m_algorithmTriggersUnmasked
Definition: L1TGlobalProducer.h:166
L1TGlobalProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: L1TGlobalProducer.cc:43
get
#define get
L1TGlobalProducer::m_muInputToken
edm::EDGetTokenT< BXVector< l1t::Muon > > m_muInputToken
Definition: L1TGlobalProducer.h:115
L1TGlobalProducer::m_nrL1EG
int m_nrL1EG
Definition: L1TGlobalProducer.h:64
L1TGlobalProducer::m_sumInputToken
edm::EDGetTokenT< BXVector< l1t::EtSum > > m_sumInputToken
Definition: L1TGlobalProducer.h:125
edm::print
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
InputTag.h
L1TGlobalPrescalesVetos.h
L1TGlobalProducer::m_emulateBxInEvent
int m_emulateBxInEvent
Definition: L1TGlobalProducer.h:144
l1t::TriggerMenuParser::gtScaleDbKey
const std::string & gtScaleDbKey() const
menu associated scale key
Definition: TriggerMenuParser.h:110
L1TGlobalProducer::m_printL1Menu
bool m_printL1Menu
Definition: L1TGlobalProducer.h:170
L1TGlobalProducer::L1TGlobalProducer
L1TGlobalProducer(const edm::ParameterSet &)
Definition: L1TGlobalProducer.cc:84
L1TGlobalProducer::m_prescaleFactorsAlgoTrig
const std::vector< std::vector< int > > * m_prescaleFactorsAlgoTrig
Definition: L1TGlobalProducer.h:90
L1TGlobalProducer::m_ifCaloEtaNumberBits
int m_ifCaloEtaNumberBits
Definition: L1TGlobalProducer.h:71
L1TGlobalProducer::m_bstLengthBytes
unsigned int m_bstLengthBytes
length of BST record (in bytes) from event setup
Definition: L1TGlobalProducer.h:80
l1t::TriggerMenuParser::gtScales
const GlobalScales & gtScales() const
menu associated scales
Definition: TriggerMenuParser.h:113
eostools.move
def move(src, dest)
Definition: eostools.py:511
L1TGlobalProducer::m_getPrescaleColumnFromData
bool m_getPrescaleColumnFromData
Definition: L1TGlobalProducer.h:173
TriggerMenuParser.h
L1TGlobalProducer::m_prescaleSet
unsigned int m_prescaleSet
prescale set used
Definition: L1TGlobalProducer.h:157
l1t::TriggerMenuParser::gtTriggerMenuImplementation
const unsigned long gtTriggerMenuImplementation() const
Definition: TriggerMenuParser.h:105
L1TGlobalProducer::m_nrL1Jet
int m_nrL1Jet
Definition: L1TGlobalProducer.h:67
l1t::TriggerMenuParser::setGtOrderConditionChip
void setGtOrderConditionChip(const std::vector< int > &)
Definition: TriggerMenuParser.cc:76
l1t::TriggerMenuParser::setGtNumberConditionChips
void setGtNumberConditionChips(const unsigned int &)
Definition: TriggerMenuParser.cc:65
L1TGlobalProducer::m_egInputToken
edm::EDGetTokenT< BXVector< l1t::EGamma > > m_egInputToken
Definition: L1TGlobalProducer.h:122
EventSetup.h
L1TGlobalProducer::m_algoblkInputToken
edm::EDGetToken m_algoblkInputToken
Definition: L1TGlobalProducer.h:175
L1TGlobalProducer::m_l1GtBMCacheID
unsigned long long m_l1GtBMCacheID
Definition: L1TGlobalProducer.h:84
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
edm::isDebugEnabled
bool isDebugEnabled()
Definition: MessageLogger.cc:71
l1t::TriggerMenuParser::corCaloTemplate
const std::vector< std::vector< CaloTemplate > > & corCaloTemplate() const
Definition: TriggerMenuParser.h:163
L1TGlobalProducer::m_numberDaqPartitions
unsigned int m_numberDaqPartitions
Definition: L1TGlobalProducer.h:60
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:671
L1TGlobalProducer.h
L1TGlobalProducer::m_currentLumi
uint m_currentLumi
Definition: L1TGlobalProducer.h:96
l1t::TriggerMenuParser::vecEnergySumTemplate
const std::vector< std::vector< EnergySumTemplate > > & vecEnergySumTemplate() const
Definition: TriggerMenuParser.h:127
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
l1t::TriggerMenuParser
Definition: TriggerMenuParser.h:57
edm::Event
Definition: Event.h:73
l1t::TriggerMenuParser::corEnergySumTemplate
const std::vector< std::vector< EnergySumTemplate > > & corEnergySumTemplate() const
Definition: TriggerMenuParser.h:168
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
L1TGlobalProducer::m_triggerMaskAlgoTrig
const std::vector< unsigned int > * m_triggerMaskAlgoTrig
Definition: L1TGlobalProducer.h:105
edm::InputTag
Definition: InputTag.h:15
l1t::TriggerMenuParser::vecCorrelationWithOverlapRemovalTemplate
const std::vector< std::vector< CorrelationWithOverlapRemovalTemplate > > & vecCorrelationWithOverlapRemovalTemplate() const
Definition: TriggerMenuParser.h:149
L1TGlobalProducer::m_ifMuEtaNumberBits
int m_ifMuEtaNumberBits
Definition: L1TGlobalProducer.h:70
l1t::PrescalesVetosHelper::triggerMaskVeto
const std::vector< int > & triggerMaskVeto() const
Definition: PrescalesVetosHelper.h:56
L1TGlobalProducer::m_activeBoardsGtDaq
uint16_t m_activeBoardsGtDaq
active boards in L1 GT DAQ record
Definition: L1TGlobalProducer.h:77
L1TGlobalProducer::m_egInputTag
edm::InputTag m_egInputTag
input tag for calorimeter collections from GCT
Definition: L1TGlobalProducer.h:118