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 // Elisa Fontanesi - extended for three-body correlation conditions
5 
7 
8 // system include files
9 #include <memory>
10 #include <iostream>
11 #include <iomanip>
12 #include <algorithm>
13 
24 
26 
30 
32 
33 #include "TriggerMenuParser.h"
34 
35 using namespace l1t;
36 
39  // These parameters are part of the L1T/HLT interface, avoid changing if possible::
40  desc.add<edm::InputTag>("MuonInputTag", edm::InputTag(""))
41  ->setComment("InputTag for Global Muon Trigger (required parameter: default value is invalid)");
42  desc.add<edm::InputTag>("EGammaInputTag", edm::InputTag(""))
43  ->setComment("InputTag for Calo Trigger EGamma (required parameter: default value is invalid)");
44  desc.add<edm::InputTag>("TauInputTag", edm::InputTag(""))
45  ->setComment("InputTag for Calo Trigger Tau (required parameter: default value is invalid)");
46  desc.add<edm::InputTag>("JetInputTag", edm::InputTag(""))
47  ->setComment("InputTag for Calo Trigger Jet (required parameter: default value is invalid)");
48  desc.add<edm::InputTag>("EtSumInputTag", edm::InputTag(""))
49  ->setComment("InputTag for Calo Trigger EtSum (required parameter: default value is invalid)");
50  desc.add<edm::InputTag>("ExtInputTag", edm::InputTag(""))
51  ->setComment("InputTag for external conditions (not required, but recommend to specify explicitly in config)");
52  desc.add<edm::InputTag>("AlgoBlkInputTag", edm::InputTag("hltGtStage2Digis"))
53  ->setComment(
54  "InputTag for unpacked Algblk (required only if GetPrescaleColumnFromData orRequireMenuToMatchAlgoBlkInput "
55  "set to true)");
56  desc.add<bool>("GetPrescaleColumnFromData", false)
57  ->setComment("Get prescale column from unpacked GlobalAlgBck. Otherwise use value specified in PrescaleSet");
58  desc.add<bool>("AlgorithmTriggersUnprescaled", false)
59  ->setComment("not required, but recommend to specify explicitly in config");
60  desc.add<bool>("RequireMenuToMatchAlgoBlkInput", true)
61  ->setComment(
62  "This requires that the L1 menu record to match the menu used to produce the inputed L1 results, should be "
63  "true when used by the HLT to produce the object map");
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_requireMenuToMatchAlgoBlkInput(parSet.getParameter<bool>("RequireMenuToMatchAlgoBlkInput")),
111  m_algoblkInputTag(parSet.getParameter<edm::InputTag>("AlgoBlkInputTag")) {
112  m_egInputToken = consumes<BXVector<EGamma>>(m_egInputTag);
113  m_tauInputToken = consumes<BXVector<Tau>>(m_tauInputTag);
114  m_jetInputToken = consumes<BXVector<Jet>>(m_jetInputTag);
115  m_sumInputToken = consumes<BXVector<EtSum>>(m_sumInputTag);
116  m_muInputToken = consumes<BXVector<Muon>>(m_muInputTag);
117  m_extInputToken = consumes<BXVector<GlobalExtBlk>>(m_extInputTag);
118  m_l1GtStableParToken = esConsumes<L1TGlobalParameters, L1TGlobalParametersRcd>();
119  m_l1GtMenuToken = esConsumes<L1TUtmTriggerMenu, L1TUtmTriggerMenuRcd>();
121  m_l1GtPrescaleVetosToken = esConsumes<L1TGlobalPrescalesVetosFract, L1TGlobalPrescalesVetosFractRcd>();
122  }
124  m_algoblkInputToken = consumes<BXVector<GlobalAlgBlk>>(m_algoblkInputTag);
125  }
126 
127  if (m_verbosity) {
128  LogTrace("L1TGlobalProducer") << "\nInput tag for muon collection from uGMT: " << m_muInputTag
129  << "\nInput tag for calorimeter jet collections from Cal: " << m_jetInputTag
130  << "\nInput tag for external conditions : " << m_extInputTag << std::endl;
131 
132  LogTrace("L1TGlobalProducer") << "\nProduce the L1 uGT DAQ readout record: " << m_produceL1GtDaqRecord
133  << "\nProduce the L1 uGT Object Map record: "
134  << m_produceL1GtObjectMapRecord << " \n"
135  << "\nNumber of BxInEvent to be emulated: " << m_emulateBxInEvent << " \n"
136  << "\nAlternative for number of BX in GT DAQ record: 0x" << std::hex
137  << m_alternativeNrBxBoardDaq << " \n"
138  << "\nRun algorithm triggers unprescaled: "
140  << "\nRun algorithm triggers unmasked (all enabled): " << m_algorithmTriggersUnmasked
141  << "\n"
142  << std::endl;
143  }
144 
145  if ((m_emulateBxInEvent > 0) && ((m_emulateBxInEvent % 2) == 0)) {
147 
148  if (m_verbosity) {
149  edm::LogWarning("L1TGlobalProducer")
150  << "\nWARNING: Number of bunch crossing to be emulated rounded to: " << m_emulateBxInEvent
151  << "\n The number must be an odd number!\n"
152  << std::endl;
153  }
154  }
155 
156  if ((m_L1DataBxInEvent > 0) && ((m_L1DataBxInEvent % 2) == 0)) {
158 
159  if (m_verbosity) {
160  edm::LogWarning("L1TGlobalProducer")
161  << "\nWARNING: Number of bunch crossing for incoming L1 Data rounded to: " << m_L1DataBxInEvent
162  << "\n The number must be an odd number!\n"
163  << std::endl;
164  }
165  } else if (m_L1DataBxInEvent < 0) {
166  m_L1DataBxInEvent = 1;
167 
168  if (m_verbosity) {
169  edm::LogWarning("L1TGlobalProducer")
170  << "\nWARNING: Number of bunch crossing for incoming L1 Data was changed to: " << m_L1DataBxInEvent
171  << "\n The number must be an odd positive number!\n"
172  << std::endl;
173  }
174  }
175 
176  // register products
178  produces<GlobalAlgBlkBxCollection>();
179  //blwEXT produces<GlobalExtBlkBxCollection>();
180  }
181 
183  produces<GlobalObjectMapRecord>();
184  }
185 
186  // create new uGt Board
187  m_uGtBrd = std::make_unique<GlobalBoard>();
188  m_uGtBrd->setVerbosity(m_verbosity);
189 
190  // initialize cached IDs
191 
192  //
193  m_l1GtParCacheID = 0ULL;
194  m_l1GtMenuCacheID = 0ULL;
195 
198 
199  m_nrL1Mu = 0;
200  m_nrL1EG = 0;
201  m_nrL1Tau = 0;
202 
203  m_nrL1Jet = 0;
204 
207 
208  //
209  m_l1GtParCacheID = 0ULL;
210 
211  m_totalBxInEvent = 0;
212 
214  m_bstLengthBytes = 0;
215 
216  //
217  m_l1GtBMCacheID = 0ULL;
218 
219  //
220  m_l1GtPfAlgoCacheID = 0ULL;
221 
222  m_l1GtTmAlgoCacheID = 0ULL;
223 
225 
226  m_currentLumi = 0;
227 
228  // Set default, initial, dummy prescale factor table
229  std::vector<std::vector<double>> temp_prescaleTable;
230 
231  temp_prescaleTable.push_back(std::vector<double>());
232  m_initialPrescaleFactorsAlgoTrig = temp_prescaleTable;
233 }
234 
235 // destructor
237 
238 // member functions
239 
240 // method called to produce the data
242  // process event iEvent
243  // get / update the stable parameters from the EventSetup
244  // local cache & check on cacheIdentifier
245 
246  unsigned long long l1GtParCacheID = evSetup.get<L1TGlobalParametersRcd>().cacheIdentifier();
247 
248  if (m_l1GtParCacheID != l1GtParCacheID) {
250  m_l1GtStablePar = l1GtStablePar.product();
251  const GlobalParamsHelper* data = GlobalParamsHelper::readFromEventSetup(m_l1GtStablePar);
252 
253  // number of bx
254  m_totalBxInEvent = data->totalBxInEvent();
255 
256  // number of physics triggers
257  m_numberPhysTriggers = data->numberPhysTriggers();
258 
259  // number of objects of each type
260  m_nrL1Mu = data->numberL1Mu();
261 
262  // EG
263  m_nrL1EG = data->numberL1EG();
264 
265  // jets
266  m_nrL1Jet = data->numberL1Jet();
267 
268  // taus
269  m_nrL1Tau = data->numberL1Tau();
270 
271  if (m_L1DataBxInEvent < 1)
272  m_L1DataBxInEvent = 1;
273  int minL1DataBxInEvent = (m_L1DataBxInEvent + 1) / 2 - m_L1DataBxInEvent;
274  int maxL1DataBxInEvent = (m_L1DataBxInEvent + 1) / 2 - 1;
275 
276  // Initialize Board
277  m_uGtBrd->init(
278  m_numberPhysTriggers, m_nrL1Mu, m_nrL1EG, m_nrL1Tau, m_nrL1Jet, minL1DataBxInEvent, maxL1DataBxInEvent);
279 
280  //
281  m_l1GtParCacheID = l1GtParCacheID;
282  }
283 
284  if (m_emulateBxInEvent < 0) {
286  }
287 
288  if (m_emulateBxInEvent < 1)
289  m_emulateBxInEvent = 1;
290  int minEmulBxInEvent = (m_emulateBxInEvent + 1) / 2 - m_emulateBxInEvent;
291  int maxEmulBxInEvent = (m_emulateBxInEvent + 1) / 2 - 1;
292 
293  // get / update the trigger menu from the EventSetup
294  // local cache & check on cacheIdentifier
295  unsigned long long l1GtMenuCacheID = evSetup.get<L1TUtmTriggerMenuRcd>().cacheIdentifier();
296 
297  if (m_l1GtMenuCacheID != l1GtMenuCacheID) {
298  const GlobalParamsHelper* data = GlobalParamsHelper::readFromEventSetup(m_l1GtStablePar);
299 
301  const L1TUtmTriggerMenu* utml1GtMenu = l1GtMenu.product();
302 
305  iEvent.getByToken(m_algoblkInputToken, m_uGtAlgBlk);
306  if (m_uGtAlgBlk->size() >= 1) {
307  if ((*m_uGtAlgBlk)[0].getL1FirmwareUUID() != static_cast<int>(utml1GtMenu->getFirmwareUuidHashed())) {
308  throw cms::Exception("ConditionsError")
309  << " Error L1 menu loaded in via conditions does not match the L1 actually run "
310  << (*m_uGtAlgBlk)[0].getL1FirmwareUUID() << " vs " << utml1GtMenu->getFirmwareUuidHashed()
311  << ". This means that the mapping of the names to the bits may be incorrect. Please check the "
312  "L1TUtmTriggerMenuRcd record supplied. Unless you know what you are doing, do not simply disable this "
313  "check via the config as this a major error and the indication of something very wrong";
314  }
315  }
316  }
317 
318  // Instantiate Parser
320 
321  gtParser.setGtNumberConditionChips(data->numberChips());
322  gtParser.setGtPinsOnConditionChip(data->pinsOnChip());
323  gtParser.setGtOrderConditionChip(data->orderOfChip());
324  gtParser.setGtNumberPhysTriggers(data->numberPhysTriggers());
325 
326  //Parse menu into emulator classes
327  gtParser.parseCondFormats(utml1GtMenu);
328 
329  // transfer the condition map and algorithm map from parser to L1uGtTriggerMenu
330  m_l1GtMenu = std::make_unique<TriggerMenu>(gtParser.gtTriggerMenuName(),
331  data->numberChips(),
332  gtParser.vecMuonTemplate(),
333  gtParser.vecCaloTemplate(),
334  gtParser.vecEnergySumTemplate(),
335  gtParser.vecExternalTemplate(),
336  gtParser.vecCorrelationTemplate(),
339  gtParser.corMuonTemplate(),
340  gtParser.corCaloTemplate(),
341  gtParser.corEnergySumTemplate());
342 
343  m_l1GtMenu->setGtTriggerMenuInterface(gtParser.gtTriggerMenuInterface());
344  m_l1GtMenu->setGtTriggerMenuImplementation(gtParser.gtTriggerMenuImplementation());
345  m_l1GtMenu->setGtScaleDbKey(gtParser.gtScaleDbKey());
346  m_l1GtMenu->setGtScales(gtParser.gtScales());
347  m_l1GtMenu->setGtTriggerMenuUUID(gtParser.gtTriggerMenuUUID());
348 
349  m_l1GtMenu->setGtAlgorithmMap(gtParser.gtAlgorithmMap());
350  m_l1GtMenu->setGtAlgorithmAliasMap(gtParser.gtAlgorithmAliasMap());
351 
352  m_l1GtMenu->buildGtConditionMap();
353 
354  int printV = 2;
355  if (m_printL1Menu)
356  m_l1GtMenu->print(std::cout, printV);
357 
358  m_l1GtMenuCacheID = l1GtMenuCacheID;
359  }
360 
361  // get / update the board maps from the EventSetup
362  // local cache & check on cacheIdentifier
363 
364  /* *** Drop L1GtBoard Maps for now
365  typedef std::vector<L1GtBoard>::const_iterator CItBoardMaps;
366 
367  unsigned long long l1GtBMCacheID = evSetup.get<L1GtBoardMapsRcd>().cacheIdentifier();
368 */
369 
370  /* ** Drop board mapping for now
371  if (m_l1GtBMCacheID != l1GtBMCacheID) {
372 
373  edm::ESHandle< L1GtBoardMaps > l1GtBM;
374  evSetup.get< L1GtBoardMapsRcd >().get( l1GtBM );
375  m_l1GtBM = l1GtBM.product();
376 
377  m_l1GtBMCacheID = l1GtBMCacheID;
378 
379  }
380 
381 
382  // TODO need changes in CondFormats to cache the maps
383  const std::vector<L1GtBoard>& boardMaps = m_l1GtBM->gtBoardMaps();
384 */
385  // get / update the prescale factors from the EventSetup
386  // local cache & check on cacheIdentifier
387 
388  // Only get event record if not unprescaled and not unmasked
390  unsigned long long l1GtPfAlgoCacheID = evSetup.get<L1TGlobalPrescalesVetosFractRcd>().cacheIdentifier();
391 
392  if (m_l1GtPfAlgoCacheID != l1GtPfAlgoCacheID) {
393  edm::ESHandle<L1TGlobalPrescalesVetosFract> l1GtPrescalesFractVetoes =
395  const L1TGlobalPrescalesVetosFract* es = l1GtPrescalesFractVetoes.product();
396  m_l1GtPrescalesVetosFract = PrescalesVetosFractHelper::readFromEventSetup(es);
397 
400 
401  m_l1GtPfAlgoCacheID = l1GtPfAlgoCacheID;
402  }
404  (m_currentLumi != iEvent.luminosityBlock())) { // get prescale column from unpacked data
405 
406  m_currentLumi = iEvent.luminosityBlock();
407 
409  iEvent.getByToken(m_algoblkInputToken, m_uGtAlgBlk);
410 
411  if (m_uGtAlgBlk.isValid() && !m_uGtAlgBlk->isEmpty(0)) {
412  std::vector<GlobalAlgBlk>::const_iterator algBlk = m_uGtAlgBlk->begin(0);
413  m_prescaleSet = static_cast<unsigned int>(algBlk->getPreScColumn());
414  } else {
415  m_prescaleSet = 1;
416  edm::LogError("L1TGlobalProduce")
417  << "Could not find valid algo block. Setting prescale column to 1" << std::endl;
418  }
419  }
420  } else {
421  // Set Prescale factors to initial dummy values
422  m_prescaleSet = 0;
426  }
427 
428  // get / update the trigger mask from the EventSetup
429  // local cache & check on cacheIdentifier
430 
431  /* **** For now Leave out Masks *****
432  unsigned long long l1GtTmAlgoCacheID =
433  evSetup.get<L1GtTriggerMaskAlgoTrigRcd>().cacheIdentifier();
434 
435  if (m_l1GtTmAlgoCacheID != l1GtTmAlgoCacheID) {
436 
437  edm::ESHandle< L1GtTriggerMask > l1GtTmAlgo;
438  evSetup.get< L1GtTriggerMaskAlgoTrigRcd >().get( l1GtTmAlgo );
439  m_l1GtTmAlgo = l1GtTmAlgo.product();
440 
441  m_triggerMaskAlgoTrig = m_l1GtTmAlgo->gtTriggerMask();
442 
443  m_l1GtTmAlgoCacheID = l1GtTmAlgoCacheID;
444 
445  }
446 */
447 
448  /* **** For now Leave out Veto Masks *****
449  unsigned long long l1GtTmVetoAlgoCacheID =
450  evSetup.get<L1GtTriggerMaskVetoAlgoTrigRcd>().cacheIdentifier();
451 
452  if (m_l1GtTmVetoAlgoCacheID != l1GtTmVetoAlgoCacheID) {
453 
454  edm::ESHandle< L1GtTriggerMask > l1GtTmVetoAlgo;
455  evSetup.get< L1GtTriggerMaskVetoAlgoTrigRcd >().get( l1GtTmVetoAlgo );
456  m_l1GtTmVetoAlgo = l1GtTmVetoAlgo.product();
457 
458  m_triggerMaskVetoAlgoTrig = m_l1GtTmVetoAlgo->gtTriggerMask();
459 
460  m_l1GtTmVetoAlgoCacheID = l1GtTmVetoAlgoCacheID;
461 
462  }
463 */
464 
465  // ****** Board Maps Need to be redone....hard code for now ******
466  // loop over blocks in the GT DAQ record receiving data, count them if they are active
467  // all board type are defined in CondFormats/L1TObjects/L1GtFwd
468  // &
469  // set the active flag for each object type received from GMT and GCT
470  // all objects in the GT system
471 
472  //
473  bool receiveMu = true;
474  bool receiveEG = true;
475  bool receiveTau = true;
476  bool receiveJet = true;
477  bool receiveEtSums = true;
478  bool receiveExt = true;
479 
480  /* *** Boards need redefining *****
481  for (CItBoardMaps
482  itBoard = boardMaps.begin();
483  itBoard != boardMaps.end(); ++itBoard) {
484 
485  int iPosition = itBoard->gtPositionDaqRecord();
486  if (iPosition > 0) {
487 
488  int iActiveBit = itBoard->gtBitDaqActiveBoards();
489  bool activeBoard = false;
490 
491  if (iActiveBit >= 0) {
492  activeBoard = m_activeBoardsGtDaq & (1 << iActiveBit);
493  }
494 
495  // use board if: in the record, but not in ActiveBoardsMap (iActiveBit < 0)
496  // in the record and ActiveBoardsMap, and active
497  if ((iActiveBit < 0) || activeBoard) {
498 
499 // ****** Decide what board manipulation (if any we want here)
500 
501  }
502  }
503 
504  }
505 */
506 
507  // Produce the Output Records for the GT
508  std::unique_ptr<GlobalAlgBlkBxCollection> uGtAlgRecord(
509  new GlobalAlgBlkBxCollection(0, minEmulBxInEvent, maxEmulBxInEvent));
510 
511  // * produce the GlobalObjectMapRecord
512  std::unique_ptr<GlobalObjectMapRecord> gtObjectMapRecord(new GlobalObjectMapRecord());
513 
514  // fill the boards not depending on the BxInEvent in the L1 GT DAQ record
515  // GMT, PSB and FDL depend on BxInEvent
516 
517  // fill in emulator the same bunch crossing (12 bits - hardwired number of bits...)
518  // and the same local bunch crossing for all boards
519  int bxCross = iEvent.bunchCrossing();
520  uint16_t bxCrossHw = 0;
521  if ((bxCross & 0xFFF) == bxCross) {
522  bxCrossHw = static_cast<uint16_t>(bxCross);
523  } else {
524  bxCrossHw = 0; // Bx number too large, set to 0!
525  if (m_verbosity) {
526  LogDebug("L1TGlobalProducer") << "\nBunch cross number [hex] = " << std::hex << bxCross
527  << "\n larger than 12 bits. Set to 0! \n"
528  << std::dec << std::endl;
529  }
530  }
531  LogDebug("L1TGlobalProducer") << "HW BxCross " << bxCrossHw << std::endl;
532 
533  // get the prescale factor from the configuration for now
534  // prescale set index counts from zero
535  unsigned int pfAlgoSetIndex = m_prescaleSet;
536 
537  auto max = (*m_prescaleFactorsAlgoTrig).size() - 1;
538  if (pfAlgoSetIndex > max) {
539  edm::LogWarning("L1TGlobalProducer") << "\nAttempting to access prescale algo set: " << m_prescaleSet
540  << "\nNumber of prescale algo sets available: 0.." << max
541  << "Setting former to latter." << std::endl;
542  pfAlgoSetIndex = max;
543  }
544 
545  const std::vector<double>& prescaleFactorsAlgoTrig = (*m_prescaleFactorsAlgoTrig).at(pfAlgoSetIndex);
546 
547  // For now, set masks according to prescale value of 0
549  for (unsigned int iAlgo = 0; iAlgo < prescaleFactorsAlgoTrig.size(); iAlgo++) {
550  unsigned int value = prescaleFactorsAlgoTrig[iAlgo];
551  value = (value == 0) ? 0 : 1;
553  }
555 
556  const std::vector<unsigned int>& triggerMaskAlgoTrig = *m_triggerMaskAlgoTrig;
557  const std::vector<int>& triggerMaskVetoAlgoTrig = *m_triggerMaskVetoAlgoTrig;
558 
559  LogDebug("L1TGlobalProducer") << "Size of prescale vector" << prescaleFactorsAlgoTrig.size() << std::endl;
560 
561  // Load the calorimeter input onto the uGt Board
562  m_uGtBrd->receiveCaloObjectData(iEvent,
567  receiveEG,
568  m_nrL1EG,
569  receiveTau,
570  m_nrL1Tau,
571  receiveJet,
572  m_nrL1Jet,
573  receiveEtSums);
574 
575  m_uGtBrd->receiveMuonObjectData(iEvent, m_muInputToken, receiveMu, m_nrL1Mu);
576 
577  m_uGtBrd->receiveExternalData(iEvent, m_extInputToken, receiveExt);
578 
579  // loop over BxInEvent
580  for (int iBxInEvent = minEmulBxInEvent; iBxInEvent <= maxEmulBxInEvent; ++iBxInEvent) {
581  // run GTL
582  LogDebug("L1TGlobalProducer") << "\nL1TGlobalProducer : running GTL for bx = " << iBxInEvent << "\n" << std::endl;
583 
584  // Run the GTL for this BX
585  m_uGtBrd->runGTL(iEvent,
586  evSetup,
587  m_l1GtMenu.get(),
589  iBxInEvent,
590  gtObjectMapRecord,
592  m_nrL1Mu,
593  m_nrL1EG,
594  m_nrL1Tau,
595  m_nrL1Jet);
596 
597  // run FDL
598  LogDebug("L1TGlobalProducer") << "\nL1TGlobalProducer : running FDL for bx = " << iBxInEvent << "\n" << std::endl;
599 
600  // Run the Final Decision Logic for this BX
601  m_uGtBrd->runFDL(iEvent,
602  iBxInEvent,
605  prescaleFactorsAlgoTrig,
606  triggerMaskAlgoTrig,
607  triggerMaskVetoAlgoTrig,
610 
611  // Fill in the DAQ Records
613  m_uGtBrd->fillAlgRecord(iBxInEvent,
614  uGtAlgRecord,
616  m_l1GtMenu->gtTriggerMenuUUID(),
617  m_l1GtMenu->gtTriggerMenuImplementation());
618  }
619 
620  } //End Loop over Bx
621 
622  // Add explicit reset of Board
623  m_uGtBrd->reset();
624 
625  if (m_verbosity && m_isDebugEnabled) {
626  std::ostringstream myCoutStream;
627 
628  for (int bx = minEmulBxInEvent; bx < maxEmulBxInEvent; bx++) {
630  (uGtAlgRecord->at(bx, 0)).print(myCoutStream);
631  }
632 
633  LogTrace("L1TGlobalProducer") << "\n The following L1 GT DAQ readout record was produced:\n"
634  << myCoutStream.str() << "\n"
635  << std::endl;
636 
637  myCoutStream.str("");
638  myCoutStream.clear();
639 
640  const std::vector<GlobalObjectMap> objMapVec = gtObjectMapRecord->gtObjectMap();
641 
642  for (std::vector<GlobalObjectMap>::const_iterator it = objMapVec.begin(); it != objMapVec.end(); ++it) {
643  (*it).print(myCoutStream);
644  }
645 
646  LogDebug("L1TGlobalProducer") << "Test gtObjectMapRecord in L1TGlobalProducer \n\n"
647  << myCoutStream.str() << "\n\n"
648  << std::endl;
649 
650  myCoutStream.str("");
651  myCoutStream.clear();
652  }
653 
654  // register products
656  iEvent.put(std::move(uGtAlgRecord));
657  }
658 
660  iEvent.put(std::move(gtObjectMapRecord));
661  }
662 }
663 
664 //define this as a plug-in
667 #include <cstdint>
ConfigurationDescriptions.h
l1t::TriggerMenuParser::vecCorrelationTemplate
const std::vector< std::vector< CorrelationTemplate > > & vecCorrelationTemplate() const
Definition: TriggerMenuParser.h:147
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
L1TGlobalProducer::m_jetInputToken
edm::EDGetTokenT< BXVector< l1t::Jet > > m_jetInputToken
Definition: L1TGlobalProducer.h:131
RefProd.h
l1t::PrescalesVetosFractHelper::triggerMaskVeto
const std::vector< int > & triggerMaskVeto() const
Definition: PrescalesVetosFractHelper.h:56
L1TGlobalProducer
Definition: L1TGlobalProducer.h:43
L1TGlobalProducer::m_l1GtPfAlgoCacheID
unsigned long long m_l1GtPfAlgoCacheID
Definition: L1TGlobalProducer.h:95
L1TGlobalProducer::m_uGtBrd
std::unique_ptr< l1t::GlobalBoard > m_uGtBrd
Definition: L1TGlobalProducer.h:118
electrons_cff.bool
bool
Definition: electrons_cff.py:366
L1TGlobalProducer::m_verbosity
int m_verbosity
verbosity level
Definition: L1TGlobalProducer.h:176
l1t::TriggerMenuParser::setGtPinsOnConditionChip
void setGtPinsOnConditionChip(const unsigned int &)
Definition: TriggerMenuParser.cc:74
GlobalObjectMapRecord.h
MessageLogger.h
GlobalObjectMapRecord
Definition: GlobalObjectMapRecord.h:29
L1TGlobalProducer::m_prescaleFactorsAlgoTrig
const std::vector< std::vector< double > > * m_prescaleFactorsAlgoTrig
Definition: L1TGlobalProducer.h:97
l1t::TriggerMenuParser::gtAlgorithmMap
const AlgorithmMap & gtAlgorithmMap() const
get / set the algorithm map (by name)
Definition: TriggerMenuParser.h:188
L1TGlobalProducer::m_numberPhysTriggers
unsigned int m_numberPhysTriggers
Definition: L1TGlobalProducer.h:64
l1t::TriggerMenuParser::setGtNumberPhysTriggers
void setGtNumberPhysTriggers(const unsigned int &)
Definition: TriggerMenuParser.cc:85
L1TGlobalProducer::m_requireMenuToMatchAlgoBlkInput
bool m_requireMenuToMatchAlgoBlkInput
Definition: L1TGlobalProducer.h:181
L1TGlobalProducer::m_algoblkInputTag
edm::InputTag m_algoblkInputTag
Definition: L1TGlobalProducer.h:182
ESHandle.h
L1TGlobalProducer::m_extInputToken
edm::EDGetTokenT< BXVector< GlobalExtBlk > > m_extInputToken
Definition: L1TGlobalProducer.h:136
L1TGlobalProducer::m_l1GtParCacheID
unsigned long long m_l1GtParCacheID
Definition: L1TGlobalProducer.h:57
L1TUtmTriggerMenuRcd
Definition: L1TUtmTriggerMenuRcd.h:11
L1TGlobalProducer::m_l1GtPrescalesVetosFract
const l1t::PrescalesVetosFractHelper * m_l1GtPrescalesVetosFract
prescale factors
Definition: L1TGlobalProducer.h:94
L1TGlobalProducer::m_totalBxInEvent
int m_totalBxInEvent
total number of Bx's in the event coming from EventSetup
Definition: L1TGlobalProducer.h:81
L1TGlobalProducer::m_nrL1Mu
int m_nrL1Mu
Definition: L1TGlobalProducer.h:70
GlobalParamsHelper.h
L1TGlobalProducer::m_initialTriggerMaskAlgoTrig
std::vector< unsigned int > m_initialTriggerMaskAlgoTrig
Definition: L1TGlobalProducer.h:113
edm
HLT enums.
Definition: AlignableModifier.h:19
GlobalExtBlk.h
L1TGlobalProducer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: L1TGlobalProducer.cc:241
l1t::TriggerMenuParser::gtTriggerMenuName
const std::string & gtTriggerMenuName() const
Definition: TriggerMenuParser.h:106
l1t::TriggerMenuParser::gtTriggerMenuInterface
const std::string & gtTriggerMenuInterface() const
get / set the trigger menu names
Definition: TriggerMenuParser.h:101
gather_cfg.cout
cout
Definition: gather_cfg.py:144
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89301
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:193
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
L1TGlobalProducer::m_jetInputTag
edm::InputTag m_jetInputTag
Definition: L1TGlobalProducer.h:127
L1TGlobalProducer::m_l1GtStablePar
const L1TGlobalParameters * m_l1GtStablePar
cached stuff
Definition: L1TGlobalProducer.h:56
L1TGlobalProducer::m_l1GtTmAlgoCacheID
unsigned long long m_l1GtTmAlgoCacheID
Definition: L1TGlobalProducer.h:107
l1t::TriggerMenuParser::vecMuonTemplate
const std::vector< std::vector< MuonTemplate > > & vecMuonTemplate() const
get / set the vectors containing the conditions
Definition: TriggerMenuParser.h:124
L1TGlobalProducer::m_l1GtTmVetoAlgoCacheID
unsigned long long m_l1GtTmVetoAlgoCacheID
Definition: L1TGlobalProducer.h:110
l1t::TriggerMenuParser::parseCondFormats
void parseCondFormats(const L1TUtmTriggerMenu *utmMenu)
Definition: TriggerMenuParser.cc:199
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:121
edm::Handle
Definition: AssociativeIterator.h:50
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
L1TGlobalProducer::m_sumInputTag
edm::InputTag m_sumInputTag
Definition: L1TGlobalProducer.h:128
L1TGlobalProducer::m_tauInputToken
edm::EDGetTokenT< BXVector< l1t::Tau > > m_tauInputToken
Definition: L1TGlobalProducer.h:130
L1TGlobalProducer::m_l1GtStableParToken
edm::ESGetToken< L1TGlobalParameters, L1TGlobalParametersRcd > m_l1GtStableParToken
Definition: L1TGlobalProducer.h:185
L1TGlobalProducer::m_produceL1GtObjectMapRecord
bool m_produceL1GtObjectMapRecord
logical flag to produce the L1 GT object map record
Definition: L1TGlobalProducer.h:142
L1TGlobalProducer::m_algorithmTriggersUnprescaled
bool m_algorithmTriggersUnprescaled
Definition: L1TGlobalProducer.h:169
L1TUtmTriggerMenu
Definition: L1TUtmTriggerMenu.h:25
L1TGlobalProducer::m_l1GtPrescaleVetosToken
edm::ESGetToken< L1TGlobalPrescalesVetosFract, L1TGlobalPrescalesVetosFractRcd > m_l1GtPrescaleVetosToken
Definition: L1TGlobalProducer.h:187
MakerMacros.h
l1t::TriggerMenuParser::vecCaloTemplate
const std::vector< std::vector< CaloTemplate > > & vecCaloTemplate() const
Definition: TriggerMenuParser.h:128
L1TGlobalProducer::m_produceL1GtDaqRecord
bool m_produceL1GtDaqRecord
logical flag to produce the L1 GT DAQ readout record
Definition: L1TGlobalProducer.h:139
edm::EventSetup::get
T get() const
Definition: EventSetup.h:87
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
L1TGlobalProducer::m_isDebugEnabled
bool m_isDebugEnabled
Definition: L1TGlobalProducer.h:178
L1TGlobalProducer::m_initialPrescaleFactorsAlgoTrig
std::vector< std::vector< double > > m_initialPrescaleFactorsAlgoTrig
Definition: L1TGlobalProducer.h:98
edm::ESHandle
Definition: DTSurvey.h:22
L1TGlobalProducer::~L1TGlobalProducer
~L1TGlobalProducer() override
Definition: L1TGlobalProducer.cc:236
typedefs.h
L1TGlobalProducer::m_triggerMaskVetoAlgoTrig
const std::vector< int > * m_triggerMaskVetoAlgoTrig
Definition: L1TGlobalProducer.h:115
L1TGlobalProducer::m_extInputTag
edm::InputTag m_extInputTag
input tag for external conditions
Definition: L1TGlobalProducer.h:135
l1t::TriggerMenuParser::gtTriggerMenuUUID
const int gtTriggerMenuUUID() const
Definition: TriggerMenuParser.h:218
ParameterSetDescription.h
L1TGlobalProducer::m_l1GtMenuCacheID
unsigned long long m_l1GtMenuCacheID
Definition: L1TGlobalProducer.h:61
l1t::TriggerMenuParser::vecExternalTemplate
const std::vector< std::vector< ExternalTemplate > > & vecExternalTemplate() const
Definition: TriggerMenuParser.h:140
L1TGlobalProducer::m_alternativeNrBxBoardDaq
unsigned int m_alternativeNrBxBoardDaq
Definition: L1TGlobalProducer.h:158
L1TGlobalProducer::m_L1DataBxInEvent
int m_L1DataBxInEvent
Bx expected in Data coming to GT.
Definition: L1TGlobalProducer.h:154
L1TGlobalProducer::m_nrL1Tau
int m_nrL1Tau
Definition: L1TGlobalProducer.h:72
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
MessageDrop.h
edm::ParameterSet
Definition: ParameterSet.h:47
l1t::GlobalParamsHelper
Definition: GlobalParamsHelper.h:33
Event.h
print
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:46
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
l1t
delete x;
Definition: CaloConfig.h:22
L1TGlobalPrescalesVetosFract
Definition: L1TGlobalPrescalesVetosFract.h:13
L1TGlobalProducer::m_tauInputTag
edm::InputTag m_tauInputTag
Definition: L1TGlobalProducer.h:126
L1TGlobalParametersRcd
Definition: L1TGlobalParametersRcd.h:4
l1t::TriggerMenuParser::vecCorrelationThreeBodyTemplate
const std::vector< std::vector< CorrelationThreeBodyTemplate > > & vecCorrelationThreeBodyTemplate() const
Definition: TriggerMenuParser.h:154
TriggerMenu.h
L1TGlobalProducer::m_l1GtMenu
std::unique_ptr< TriggerMenu > m_l1GtMenu
Definition: L1TGlobalProducer.h:60
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:116
l1t::TriggerMenuParser::corMuonTemplate
const std::vector< std::vector< MuonTemplate > > & corMuonTemplate() const
Definition: TriggerMenuParser.h:171
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:155
GlobalAlgBlk.h
L1TGlobalPrescalesVetosFractRcd
Definition: L1TGlobalPrescalesVetosFractRcd.h:11
edm::EventSetup
Definition: EventSetup.h:58
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
L1TGlobalProducer::m_algorithmTriggersUnmasked
bool m_algorithmTriggersUnmasked
Definition: L1TGlobalProducer.h:173
L1TGlobalProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: L1TGlobalProducer.cc:37
L1TGlobalProducer::m_muInputToken
edm::EDGetTokenT< BXVector< l1t::Muon > > m_muInputToken
Definition: L1TGlobalProducer.h:122
L1TGlobalProducer::m_nrL1EG
int m_nrL1EG
Definition: L1TGlobalProducer.h:71
L1TGlobalProducer::m_sumInputToken
edm::EDGetTokenT< BXVector< l1t::EtSum > > m_sumInputToken
Definition: L1TGlobalProducer.h:132
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
l1t::PrescalesVetosFractHelper::prescaleTable
const std::vector< std::vector< double > > & prescaleTable() const
Definition: PrescalesVetosFractHelper.h:51
InputTag.h
L1TGlobalProducer::m_emulateBxInEvent
int m_emulateBxInEvent
Definition: L1TGlobalProducer.h:151
l1t::TriggerMenuParser::gtScaleDbKey
const std::string & gtScaleDbKey() const
menu associated scale key
Definition: TriggerMenuParser.h:116
L1TGlobalProducer::m_printL1Menu
bool m_printL1Menu
Definition: L1TGlobalProducer.h:177
L1TGlobalProducer::L1TGlobalProducer
L1TGlobalProducer(const edm::ParameterSet &)
Definition: L1TGlobalProducer.cc:84
L1TGlobalProducer::m_ifCaloEtaNumberBits
int m_ifCaloEtaNumberBits
Definition: L1TGlobalProducer.h:78
L1TGlobalProducer::m_bstLengthBytes
unsigned int m_bstLengthBytes
length of BST record (in bytes) from event setup
Definition: L1TGlobalProducer.h:87
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
l1t::TriggerMenuParser::gtScales
const GlobalScales & gtScales() const
menu associated scales
Definition: TriggerMenuParser.h:119
eostools.move
def move(src, dest)
Definition: eostools.py:511
L1TGlobalProducer::m_getPrescaleColumnFromData
bool m_getPrescaleColumnFromData
Definition: L1TGlobalProducer.h:180
TriggerMenuParser.h
L1TGlobalProducer::m_prescaleSet
unsigned int m_prescaleSet
prescale set used
Definition: L1TGlobalProducer.h:164
l1t::TriggerMenuParser::gtTriggerMenuImplementation
const unsigned long gtTriggerMenuImplementation() const
Definition: TriggerMenuParser.h:111
L1TGlobalProducer::m_nrL1Jet
int m_nrL1Jet
Definition: L1TGlobalProducer.h:74
l1t::TriggerMenuParser::setGtOrderConditionChip
void setGtOrderConditionChip(const std::vector< int > &)
Definition: TriggerMenuParser.cc:80
Exception
Definition: hltDiff.cc:245
l1t::TriggerMenuParser::setGtNumberConditionChips
void setGtNumberConditionChips(const unsigned int &)
Definition: TriggerMenuParser.cc:69
L1TGlobalProducer::m_egInputToken
edm::EDGetTokenT< BXVector< l1t::EGamma > > m_egInputToken
Definition: L1TGlobalProducer.h:129
EventSetup.h
L1TGlobalProducer::m_algoblkInputToken
edm::EDGetToken m_algoblkInputToken
Definition: L1TGlobalProducer.h:183
L1TGlobalProducer::m_l1GtBMCacheID
unsigned long long m_l1GtBMCacheID
Definition: L1TGlobalProducer.h:91
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
edm::isDebugEnabled
bool isDebugEnabled()
Definition: MessageLogger.cc:12
l1t::TriggerMenuParser::corCaloTemplate
const std::vector< std::vector< CaloTemplate > > & corCaloTemplate() const
Definition: TriggerMenuParser.h:176
L1TUtmTriggerMenu::getFirmwareUuidHashed
const unsigned long getFirmwareUuidHashed() const
Definition: L1TUtmTriggerMenu.cc:5
L1TGlobalProducer::m_numberDaqPartitions
unsigned int m_numberDaqPartitions
Definition: L1TGlobalProducer.h:67
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:234
L1TGlobalProducer.h
L1TGlobalProducer::m_currentLumi
uint m_currentLumi
Definition: L1TGlobalProducer.h:103
l1t::TriggerMenuParser::vecEnergySumTemplate
const std::vector< std::vector< EnergySumTemplate > > & vecEnergySumTemplate() const
Definition: TriggerMenuParser.h:133
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
l1t::TriggerMenuParser
Definition: TriggerMenuParser.h:63
edm::Event
Definition: Event.h:73
l1t::TriggerMenuParser::corEnergySumTemplate
const std::vector< std::vector< EnergySumTemplate > > & corEnergySumTemplate() const
Definition: TriggerMenuParser.h:181
L1TGlobalProducer::m_l1GtMenuToken
edm::ESGetToken< L1TUtmTriggerMenu, L1TUtmTriggerMenuRcd > m_l1GtMenuToken
Definition: L1TGlobalProducer.h:186
TauDecayModes.dec
dec
Definition: TauDecayModes.py:142
L1TGlobalProducer::m_triggerMaskAlgoTrig
const std::vector< unsigned int > * m_triggerMaskAlgoTrig
Definition: L1TGlobalProducer.h:112
edm::InputTag
Definition: InputTag.h:15
l1t::TriggerMenuParser::vecCorrelationWithOverlapRemovalTemplate
const std::vector< std::vector< CorrelationWithOverlapRemovalTemplate > > & vecCorrelationWithOverlapRemovalTemplate() const
Definition: TriggerMenuParser.h:162
L1TGlobalProducer::m_ifMuEtaNumberBits
int m_ifMuEtaNumberBits
Definition: L1TGlobalProducer.h:77
L1TGlobalProducer::m_activeBoardsGtDaq
uint16_t m_activeBoardsGtDaq
active boards in L1 GT DAQ record
Definition: L1TGlobalProducer.h:84
L1TGlobalProducer::m_egInputTag
edm::InputTag m_egInputTag
input tag for calorimeter collections from GCT
Definition: L1TGlobalProducer.h:125