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