CMS 3D CMS Logo

GlobalBoard.cc
Go to the documentation of this file.
1 
21 // this class header
23 
24 // user include files
28 
40 
43 
44 // Conditions for uGt
54 
57 
59 
60 // forward declarations
61 
62 // constructor
64  : m_candL1Mu(new BXVector<const l1t::Muon*>),
65  m_candL1MuShower(new BXVector<const l1t::MuonShower*>),
66  m_candL1EG(new BXVector<const l1t::L1Candidate*>),
67  m_candL1Tau(new BXVector<const l1t::L1Candidate*>),
68  m_candL1Jet(new BXVector<const l1t::L1Candidate*>),
69  m_candL1EtSum(new BXVector<const l1t::EtSum*>),
70  m_candL1External(new BXVector<const GlobalExtBlk*>),
71  m_firstEv(true),
72  m_firstEvLumiSegment(true),
73  m_currentLumi(0),
74  m_isDebugEnabled(edm::isDebugEnabled()) {
76 
77  m_gtlAlgorithmOR.reset();
78  m_gtlDecisionWord.reset();
79 
80  // initialize cached IDs
81  m_l1GtMenuCacheID = 0ULL;
84 
85  // Counter for number of events board sees
87 
88  // Need to expand use with more than one uGt GlobalBoard for now assume 1
89  m_uGtBoardNumber = 0;
90  m_uGtFinalBoard = true;
91 }
92 
93 // destructor
95  //reset(); //why would we need a reset?
96  delete m_candL1Mu;
97  delete m_candL1MuShower;
98  delete m_candL1EG;
99  delete m_candL1Tau;
100  delete m_candL1Jet;
101  delete m_candL1EtSum;
102  delete m_candL1External;
103 
104  // delete m_gtEtaPhiConversions;
105 }
106 
107 // operations
108 void l1t::GlobalBoard::setBxFirst(int bx) { m_bxFirst_ = bx; }
109 
110 void l1t::GlobalBoard::setBxLast(int bx) { m_bxLast_ = bx; }
111 
112 void l1t::GlobalBoard::init(const int numberPhysTriggers,
113  const int nrL1Mu,
114  const int nrL1MuShower,
115  const int nrL1EG,
116  const int nrL1Tau,
117  const int nrL1Jet,
118  int bxFirst,
119  int bxLast) {
120  setBxFirst(bxFirst);
121  setBxLast(bxLast);
122 
123  m_candL1Mu->setBXRange(m_bxFirst_, m_bxLast_);
124  m_candL1MuShower->setBXRange(m_bxFirst_, m_bxLast_);
125  m_candL1EG->setBXRange(m_bxFirst_, m_bxLast_);
126  m_candL1Tau->setBXRange(m_bxFirst_, m_bxLast_);
127  m_candL1Jet->setBXRange(m_bxFirst_, m_bxLast_);
128  m_candL1EtSum->setBXRange(m_bxFirst_, m_bxLast_);
129  m_candL1External->setBXRange(m_bxFirst_, m_bxLast_);
130 
131  m_uGtAlgBlk.reset();
132 
133  LogDebug("L1TGlobal") << "\t Initializing Board with bxFirst = " << m_bxFirst_ << ", bxLast = " << m_bxLast_
134  << std::endl;
135 }
136 
137 // receive data from Calorimeter
139  const edm::EDGetTokenT<BXVector<l1t::EGamma>>& egInputToken,
140  const edm::EDGetTokenT<BXVector<l1t::Tau>>& tauInputToken,
141  const edm::EDGetTokenT<BXVector<l1t::Jet>>& jetInputToken,
142  const edm::EDGetTokenT<BXVector<l1t::EtSum>>& sumInputToken,
143  const bool receiveEG,
144  const int nrL1EG,
145  const bool receiveTau,
146  const int nrL1Tau,
147  const bool receiveJet,
148  const int nrL1Jet,
149  const bool receiveEtSums) {
150  if (m_verbosity) {
151  LogDebug("L1TGlobal") << "\n**** Board receiving Calo Data "
152  //<< "\n from input tag " << caloInputTag << "\n"
153  << std::endl;
154  }
155 
156  resetCalo();
157 
158  // get data from Calorimeter
159  if (receiveEG) {
161  iEvent.getByToken(egInputToken, egData);
162 
163  if (!egData.isValid()) {
164  if (m_verbosity) {
165  edm::LogWarning("L1TGlobal") << "\nWarning: BXVector<l1t::EGamma> with input tag "
166  //<< caloInputTag
167  << "\nrequested in configuration, but not found in the event.\n"
168  << std::endl;
169  }
170  } else {
171  // bx in EG data
172  for (int i = egData->getFirstBX(); i <= egData->getLastBX(); ++i) {
173  // Prevent from pushing back bx that is outside of allowed range
174  if (i < m_bxFirst_ || i > m_bxLast_)
175  continue;
176 
177  //Loop over EG in this bx
178  int nObj = 0;
179  for (std::vector<l1t::EGamma>::const_iterator eg = egData->begin(i); eg != egData->end(i); ++eg) {
180  if (nObj < nrL1EG) {
181  (*m_candL1EG).push_back(i, &(*eg));
182  } else {
183  edm::LogWarning("L1TGlobal") << " Too many EG (" << nObj << ") for uGT Configuration maxEG =" << nrL1EG
184  << std::endl;
185  }
186  LogDebug("L1TGlobal") << "EG Pt " << eg->hwPt() << " Eta " << eg->hwEta() << " Phi " << eg->hwPhi()
187  << " Qual " << eg->hwQual() << " Iso " << eg->hwIso() << std::endl;
188 
189  nObj++;
190  } //end loop over EG in bx
191  } //end loop over bx
192 
193  } //end if over valid EG data
194 
195  } //end if ReveiveEG data
196 
197  if (receiveTau) {
199  iEvent.getByToken(tauInputToken, tauData);
200 
201  if (!tauData.isValid()) {
202  if (m_verbosity) {
203  edm::LogWarning("L1TGlobal") << "\nWarning: BXVector<l1t::Tau> with input tag "
204  //<< caloInputTag
205  << "\nrequested in configuration, but not found in the event.\n"
206  << std::endl;
207  }
208  } else {
209  // bx in tau data
210  for (int i = tauData->getFirstBX(); i <= tauData->getLastBX(); ++i) {
211  // Prevent from pushing back bx that is outside of allowed range
212  if (i < m_bxFirst_ || i > m_bxLast_)
213  continue;
214 
215  //Loop over tau in this bx
216  int nObj = 0;
217  for (std::vector<l1t::Tau>::const_iterator tau = tauData->begin(i); tau != tauData->end(i); ++tau) {
218  if (nObj < nrL1Tau) {
219  (*m_candL1Tau).push_back(i, &(*tau));
220  } else {
221  LogTrace("L1TGlobal") << " Too many Tau (" << nObj << ") for uGT Configuration maxTau =" << nrL1Tau
222  << std::endl;
223  }
224 
225  LogDebug("L1TGlobal") << "tau Pt " << tau->hwPt() << " Eta " << tau->hwEta() << " Phi " << tau->hwPhi()
226  << " Qual " << tau->hwQual() << " Iso " << tau->hwIso() << std::endl;
227  nObj++;
228 
229  } //end loop over tau in bx
230  } //end loop over bx
231 
232  } //end if over valid tau data
233 
234  } //end if ReveiveTau data
235 
236  if (receiveJet) {
238  iEvent.getByToken(jetInputToken, jetData);
239 
240  if (!jetData.isValid()) {
241  if (m_verbosity) {
242  edm::LogWarning("L1TGlobal") << "\nWarning: BXVector<l1t::Jet> with input tag "
243  //<< caloInputTag
244  << "\nrequested in configuration, but not found in the event.\n"
245  << std::endl;
246  }
247  } else {
248  // bx in jet data
249  for (int i = jetData->getFirstBX(); i <= jetData->getLastBX(); ++i) {
250  // Prevent from pushing back bx that is outside of allowed range
251  if (i < m_bxFirst_ || i > m_bxLast_)
252  continue;
253 
254  //Loop over jet in this bx
255  int nObj = 0;
256  for (std::vector<l1t::Jet>::const_iterator jet = jetData->begin(i); jet != jetData->end(i); ++jet) {
257  if (nObj < nrL1Jet) {
258  (*m_candL1Jet).push_back(i, &(*jet));
259  } else {
260  edm::LogWarning("L1TGlobal") << " Too many Jets (" << nObj << ") for uGT Configuration maxJet =" << nrL1Jet
261  << std::endl;
262  }
263 
264  LogDebug("L1TGlobal") << "Jet Pt " << jet->hwPt() << " Eta " << jet->hwEta() << " Phi " << jet->hwPhi()
265  << " Qual " << jet->hwQual() << " Iso " << jet->hwIso() << std::endl;
266  nObj++;
267  } //end loop over jet in bx
268  } //end loop over bx
269 
270  } //end if over valid jet data
271 
272  } //end if ReveiveJet data
273 
274  if (receiveEtSums) {
276  iEvent.getByToken(sumInputToken, etSumData);
277 
278  if (!etSumData.isValid()) {
279  if (m_verbosity) {
280  edm::LogWarning("L1TGlobal") << "\nWarning: BXVector<l1t::EtSum> with input tag "
281  //<< caloInputTag
282  << "\nrequested in configuration, but not found in the event.\n"
283  << std::endl;
284  }
285  } else {
286  for (int i = etSumData->getFirstBX(); i <= etSumData->getLastBX(); ++i) {
287  // Prevent from pushing back bx that is outside of allowed range
288  if (i < m_bxFirst_ || i > m_bxLast_)
289  continue;
290 
291  //Loop over jet in this bx
292  for (std::vector<l1t::EtSum>::const_iterator etsum = etSumData->begin(i); etsum != etSumData->end(i); ++etsum) {
293  (*m_candL1EtSum).push_back(i, &(*etsum));
294 
295  /* In case we need to split these out
296  switch ( etsum->getType() ) {
297  case l1t::EtSum::EtSumType::kMissingEt:
298  {
299  //(*m_candETM).push_back(i,&(*etsum));
300  LogDebug("L1TGlobal") << "ETM: Pt " << etsum->hwPt() << " Phi " << etsum->hwPhi() << std::endl;
301  }
302  break;
303  case l1t::EtSum::EtSumType::kMissingHt:
304  {
305  //(*m_candHTM).push_back(i,&(*etsum));
306  LogDebug("L1TGlobal") << "HTM: Pt " << etsum->hwPt() << " Phi " << etsum->hwPhi() << std::endl;
307  }
308  break;
309  case l1t::EtSum::EtSumType::kTotalEt:
310  {
311  //(*m_candETT).push_back(i,&(*etsum));
312  LogDebug("L1TGlobal") << "ETT: Pt " << etsum->hwPt() << std::endl;
313  }
314  break;
315  case l1t::EtSum::EtSumType::kTotalHt:
316  {
317  //(*m_candHTT).push_back(i,&(*etsum));
318  LogDebug("L1TGlobal") << "HTT: Pt " << etsum->hwPt() << std::endl;
319  }
320  break;
321  case l1t::EtSum::EtSumType::kTowerCount:
322  {
323  //(*m_candTowerCount).push_back(i,&(*etsum));
324  LogDebug("L1TGlobal") << "TowerCount: " << etsum->hwPt() << std::endl;
325  }
326  break;
327  default:
328  LogDebug("L1TGlobal") << "Default encounted " << std::endl;
329  break;
330  }
331 */
332 
333  } //end loop over jet in bx
334  } //end loop over Bx
335  }
336  }
337 }
338 
339 // receive data from Global Muon Trigger
341  const edm::EDGetTokenT<BXVector<l1t::Muon>>& muInputToken,
342  const bool receiveMu,
343  const int nrL1Mu) {
344  if (m_verbosity) {
345  LogDebug("L1TGlobal") << "\n**** GlobalBoard receiving muon data = "
346  //<< "\n from input tag " << muInputTag << "\n"
347  << std::endl;
348  }
349 
350  resetMu();
351 
352  // get data from Global Muon Trigger
353  if (receiveMu) {
355  iEvent.getByToken(muInputToken, muonData);
356 
357  if (!muonData.isValid()) {
358  if (m_verbosity) {
359  edm::LogWarning("L1TGlobal") << "\nWarning: BXVector<l1t::Muon> with input tag "
360  //<< muInputTag
361  << "\nrequested in configuration, but not found in the event.\n"
362  << std::endl;
363  }
364  } else {
365  // bx in muon data
366  for (int i = muonData->getFirstBX(); i <= muonData->getLastBX(); ++i) {
367  // Prevent from pushing back bx that is outside of allowed range
368  if (i < m_bxFirst_ || i > m_bxLast_)
369  continue;
370 
371  //Loop over Muons in this bx
372  int nObj = 0;
373  for (std::vector<l1t::Muon>::const_iterator mu = muonData->begin(i); mu != muonData->end(i); ++mu) {
374  if (nObj < nrL1Mu) {
375  (*m_candL1Mu).push_back(i, &(*mu));
376  } else {
377  edm::LogWarning("L1TGlobal") << " Too many Muons (" << nObj << ") for uGT Configuration maxMu =" << nrL1Mu
378  << std::endl;
379  }
380 
381  LogDebug("L1TGlobal") << "Muon Pt " << mu->hwPt() << " EtaAtVtx " << mu->hwEtaAtVtx() << " PhiAtVtx "
382  << mu->hwPhiAtVtx() << " Qual " << mu->hwQual() << " Iso " << mu->hwIso()
383  << std::endl;
384  nObj++;
385  } //end loop over muons in bx
386  } //end loop over bx
387 
388  } //end if over valid muon data
389 
390  } //end if ReveiveMuon data
391 }
392 
393 // receive muon shower data from Global Muon Trigger
395  const edm::EDGetTokenT<BXVector<l1t::MuonShower>>& muShowerInputToken,
396  const bool receiveMuShower,
397  const int nrL1MuShower) {
398  // get data from Global Muon Trigger
399  if (receiveMuShower) {
401  iEvent.getByToken(muShowerInputToken, muonData);
402 
403  if (!muonData.isValid()) {
404  if (m_verbosity) {
405  edm::LogWarning("L1TGlobal") << "\nWarning: BXVector<l1t::MuonShower> with input tag "
406  << "\nrequested in configuration, but not found in the event.\n"
407  << std::endl;
408  }
409  } else {
410  //Loop over Muon Showers in this bx
411  int nObj = 0;
412  for (auto mu = muonData->begin(0); mu != muonData->end(0); ++mu) {
413  if (nObj < nrL1MuShower) {
414  /* Important here to split up the single object into 4 separate MuonShower
415  bits for the global board. This is because the UTM library considers those bits separate as well
416  */
417  l1t::MuonShower mus0;
418  l1t::MuonShower mus1;
419  l1t::MuonShower musOutOfTime0;
420  l1t::MuonShower musOutOfTime1;
421 
422  mus0.setMus0(mu->mus0());
423  mus1.setMus1(mu->mus1());
424  musOutOfTime0.setMusOutOfTime0(mu->musOutOfTime0());
425  musOutOfTime1.setMusOutOfTime1(mu->musOutOfTime1());
426 
427  (*m_candL1MuShower).push_back(0, &mus0);
428  (*m_candL1MuShower).push_back(0, &mus1);
429  (*m_candL1MuShower).push_back(0, &musOutOfTime0);
430  (*m_candL1MuShower).push_back(0, &musOutOfTime1);
431  } else {
432  edm::LogWarning("L1TGlobal") << " Too many Muon Showers (" << nObj
433  << ") for uGT Configuration maxMuShower =" << nrL1MuShower << std::endl;
434  }
435  nObj++;
436  } //end loop over muon showers in bx
437  } //end if over valid muon shower data
438  } //end if ReveiveMuonShower data
439 }
440 
441 // receive data from Global External Conditions
443  const edm::EDGetTokenT<BXVector<GlobalExtBlk>>& extInputToken,
444  const bool receiveExt) {
445  if (m_verbosity) {
446  LogDebug("L1TGlobal") << "\n**** GlobalBoard receiving external data = "
447  //<< "\n from input tag " << muInputTag << "\n"
448  << std::endl;
449  }
450 
451  resetExternal();
452 
453  // get data from Global Muon Trigger
454  if (receiveExt) {
456  iEvent.getByToken(extInputToken, extData);
457 
458  if (!extData.isValid()) {
459  if (m_verbosity) {
460  edm::LogWarning("L1TGlobal") << "\nWarning: BXVector<GlobalExtBlk> with input tag "
461  //<< muInputTag
462  << "\nrequested in configuration, but not found in the event.\n"
463  << std::endl;
464  }
465  } else {
466  // bx in muon data
467  for (int i = extData->getFirstBX(); i <= extData->getLastBX(); ++i) {
468  // Prevent from pushing back bx that is outside of allowed range
469  if (i < m_bxFirst_ || i > m_bxLast_)
470  continue;
471 
472  //Loop over ext in this bx
473  for (std::vector<GlobalExtBlk>::const_iterator ext = extData->begin(i); ext != extData->end(i); ++ext) {
474  (*m_candL1External).push_back(i, &(*ext));
475  } //end loop over ext in bx
476  } //end loop over bx
477 
478  } //end if over valid ext data
479 
480  } //end if ReveiveExt data
481 }
482 
483 // run GTL
485  const edm::EventSetup& evSetup,
486  const TriggerMenu* m_l1GtMenu,
487  const bool produceL1GtObjectMapRecord,
488  const int iBxInEvent,
489  std::unique_ptr<GlobalObjectMapRecord>& gtObjectMapRecord,
490  const unsigned int numberPhysTriggers,
491  const int nrL1Mu,
492  const int nrL1MuShower,
493  const int nrL1EG,
494  const int nrL1Tau,
495  const int nrL1Jet) {
496  const std::vector<ConditionMap>& conditionMap = m_l1GtMenu->gtConditionMap();
497  const AlgorithmMap& algorithmMap = m_l1GtMenu->gtAlgorithmMap();
498  const GlobalScales& gtScales = m_l1GtMenu->gtScales();
499  const std::string scaleSetName = gtScales.getScalesName();
500  LogDebug("L1TGlobal") << " L1 Menu Scales -- Set Name: " << scaleSetName << std::endl;
501 
502  // Reset AlgBlk for this bx
503  m_uGtAlgBlk.reset();
504  m_algInitialOr = false;
505  m_algPrescaledOr = false;
506  m_algIntermOr = false;
507  m_algFinalOr = false;
508  m_algFinalOrVeto = false;
509 
510  const std::vector<std::vector<MuonTemplate>>& corrMuon = m_l1GtMenu->corMuonTemplate();
511 
512  // Comment out for now
513  const std::vector<std::vector<CaloTemplate>>& corrCalo = m_l1GtMenu->corCaloTemplate();
514 
515  const std::vector<std::vector<EnergySumTemplate>>& corrEnergySum = m_l1GtMenu->corEnergySumTemplate();
516 
517  LogDebug("L1TGlobal") << "Size corrMuon " << corrMuon.size() << "\nSize corrCalo " << corrCalo.size()
518  << "\nSize corrSums " << corrEnergySum.size() << std::endl;
519 
520  // loop over condition maps (one map per condition chip)
521  // then loop over conditions in the map
522  // save the results in temporary maps
523 
524  // never happens in production but at first event...
525  if (m_conditionResultMaps.size() != conditionMap.size()) {
526  m_conditionResultMaps.clear();
527  m_conditionResultMaps.resize(conditionMap.size());
528  }
529 
530  int iChip = -1;
531 
532  for (std::vector<ConditionMap>::const_iterator itCondOnChip = conditionMap.begin();
533  itCondOnChip != conditionMap.end();
534  itCondOnChip++) {
535  iChip++;
536 
537  AlgorithmEvaluation::ConditionEvaluationMap& cMapResults = m_conditionResultMaps[iChip];
538 
539  for (CItCond itCond = itCondOnChip->begin(); itCond != itCondOnChip->end(); itCond++) {
540  // evaluate condition
541  switch ((itCond->second)->condCategory()) {
542  case CondMuon: {
543  // BLW Not sure what to do with this for now
544  const int ifMuEtaNumberBits = 0;
545 
546  MuCondition* muCondition = new MuCondition(itCond->second, this, nrL1Mu, ifMuEtaNumberBits);
547 
548  muCondition->setVerbosity(m_verbosity);
549 
550  muCondition->evaluateConditionStoreResult(iBxInEvent);
551 
552  // BLW COmment out for now
553  cMapResults[itCond->first] = muCondition;
554 
555  if (m_verbosity && m_isDebugEnabled) {
556  std::ostringstream myCout;
557  muCondition->print(myCout);
558 
559  LogTrace("L1TGlobal") << myCout.str() << std::endl;
560  }
561  //delete muCondition;
562 
563  } break;
564  case CondMuonShower: {
565  MuonShowerCondition* muShowerCondition = new MuonShowerCondition(itCond->second, this, nrL1MuShower);
566 
567  muShowerCondition->setVerbosity(m_verbosity);
568 
569  muShowerCondition->evaluateConditionStoreResult(iBxInEvent);
570 
571  cMapResults[itCond->first] = muShowerCondition;
572 
573  if (m_verbosity && m_isDebugEnabled) {
574  std::ostringstream myCout;
575  muShowerCondition->print(myCout);
576 
577  edm::LogWarning("L1TGlobal") << "MuonShowerCondition " << myCout.str() << std::endl;
578  }
579  //delete muShowerCondition;
580 
581  } break;
582  case CondCalo: {
583  // BLW Not sure w hat to do with this for now
584  const int ifCaloEtaNumberBits = 0;
585 
586  CaloCondition* caloCondition =
587  new CaloCondition(itCond->second, this, nrL1EG, nrL1Jet, nrL1Tau, ifCaloEtaNumberBits);
588 
589  caloCondition->setVerbosity(m_verbosity);
590 
591  caloCondition->evaluateConditionStoreResult(iBxInEvent);
592 
593  cMapResults[itCond->first] = caloCondition;
594 
595  if (m_verbosity && m_isDebugEnabled) {
596  std::ostringstream myCout;
597  caloCondition->print(myCout);
598 
599  LogTrace("L1TGlobal") << myCout.str() << std::endl;
600  }
601  // delete caloCondition;
602 
603  } break;
604  case CondEnergySum: {
605  EnergySumCondition* eSumCondition = new EnergySumCondition(itCond->second, this);
606 
607  eSumCondition->setVerbosity(m_verbosity);
608  eSumCondition->evaluateConditionStoreResult(iBxInEvent);
609 
610  cMapResults[itCond->first] = eSumCondition;
611 
612  if (m_verbosity && m_isDebugEnabled) {
613  std::ostringstream myCout;
614  eSumCondition->print(myCout);
615 
616  LogTrace("L1TGlobal") << myCout.str() << std::endl;
617  }
618  // delete eSumCondition;
619 
620  } break;
621 
622  case CondExternal: {
623  ExternalCondition* extCondition = new ExternalCondition(itCond->second, this);
624 
625  extCondition->setVerbosity(m_verbosity);
626  extCondition->evaluateConditionStoreResult(iBxInEvent);
627 
628  cMapResults[itCond->first] = extCondition;
629 
630  if (m_verbosity && m_isDebugEnabled) {
631  std::ostringstream myCout;
632  extCondition->print(myCout);
633 
634  LogTrace("L1TGlobal") << myCout.str() << std::endl;
635  }
636  // delete extCondition;
637 
638  } break;
639  case CondCorrelation: {
640  // get first the sub-conditions
641  const CorrelationTemplate* corrTemplate = static_cast<const CorrelationTemplate*>(itCond->second);
642  const GtConditionCategory cond0Categ = corrTemplate->cond0Category();
643  const GtConditionCategory cond1Categ = corrTemplate->cond1Category();
644  const int cond0Ind = corrTemplate->cond0Index();
645  const int cond1Ind = corrTemplate->cond1Index();
646 
647  const GlobalCondition* cond0Condition = nullptr;
648  const GlobalCondition* cond1Condition = nullptr;
649 
650  // maximum number of objects received for evaluation of l1t::Type1s condition
651  int cond0NrL1Objects = 0;
652  int cond1NrL1Objects = 0;
653  LogDebug("L1TGlobal") << " cond0NrL1Objects" << cond0NrL1Objects << " cond1NrL1Objects " << cond1NrL1Objects
654  << std::endl;
655 
656  switch (cond0Categ) {
657  case CondMuon: {
658  cond0Condition = &((corrMuon[iChip])[cond0Ind]);
659  } break;
660  case CondCalo: {
661  cond0Condition = &((corrCalo[iChip])[cond0Ind]);
662  } break;
663  case CondEnergySum: {
664  cond0Condition = &((corrEnergySum[iChip])[cond0Ind]);
665  } break;
666  default: {
667  // do nothing, should not arrive here
668  } break;
669  }
670 
671  switch (cond1Categ) {
672  case CondMuon: {
673  cond1Condition = &((corrMuon[iChip])[cond1Ind]);
674  } break;
675  case CondCalo: {
676  cond1Condition = &((corrCalo[iChip])[cond1Ind]);
677  } break;
678  case CondEnergySum: {
679  cond1Condition = &((corrEnergySum[iChip])[cond1Ind]);
680  } break;
681  default: {
682  // do nothing, should not arrive here
683  } break;
684  }
685 
686  CorrCondition* correlationCond = new CorrCondition(itCond->second, cond0Condition, cond1Condition, this);
687 
688  correlationCond->setVerbosity(m_verbosity);
689  correlationCond->setScales(&gtScales);
690  correlationCond->evaluateConditionStoreResult(iBxInEvent);
691 
692  cMapResults[itCond->first] = correlationCond;
693 
694  if (m_verbosity && m_isDebugEnabled) {
695  std::ostringstream myCout;
696  correlationCond->print(myCout);
697 
698  LogTrace("L1TGlobal") << myCout.str() << std::endl;
699  }
700 
701  // delete correlationCond;
702 
703  } break;
705  // get first the sub-conditions
706  const CorrelationThreeBodyTemplate* corrTemplate =
707  static_cast<const CorrelationThreeBodyTemplate*>(itCond->second);
708  const GtConditionCategory cond0Categ = corrTemplate->cond0Category();
709  const GtConditionCategory cond1Categ = corrTemplate->cond1Category();
710  const GtConditionCategory cond2Categ = corrTemplate->cond2Category();
711  const int cond0Ind = corrTemplate->cond0Index();
712  const int cond1Ind = corrTemplate->cond1Index();
713  const int cond2Ind = corrTemplate->cond2Index();
714 
715  const GlobalCondition* cond0Condition = nullptr;
716  const GlobalCondition* cond1Condition = nullptr;
717  const GlobalCondition* cond2Condition = nullptr;
718 
719  // maximum number of objects received for evaluation of l1t::Type1s condition
720  int cond0NrL1Objects = 0;
721  int cond1NrL1Objects = 0;
722  int cond2NrL1Objects = 0;
723  LogDebug("L1TGlobal") << " cond0NrL1Objects " << cond0NrL1Objects << " cond1NrL1Objects "
724  << cond1NrL1Objects << " cond2NrL1Objects " << cond2NrL1Objects << std::endl;
725  if (cond0Categ == CondMuon) {
726  cond0Condition = &((corrMuon[iChip])[cond0Ind]);
727  } else {
728  LogDebug("L1TGlobal") << "No muon0 to evaluate three-body correlation condition";
729  }
730  if (cond1Categ == CondMuon) {
731  cond1Condition = &((corrMuon[iChip])[cond1Ind]);
732  } else {
733  LogDebug("L1TGlobal") << "No muon1 to evaluate three-body correlation condition";
734  }
735  if (cond2Categ == CondMuon) {
736  cond2Condition = &((corrMuon[iChip])[cond2Ind]);
737  } else {
738  LogDebug("L1TGlobal") << "No muon2 to evaluate three-body correlation condition";
739  }
740 
741  CorrThreeBodyCondition* correlationThreeBodyCond =
742  new CorrThreeBodyCondition(itCond->second, cond0Condition, cond1Condition, cond2Condition, this);
743 
744  correlationThreeBodyCond->setVerbosity(m_verbosity);
745  correlationThreeBodyCond->setScales(&gtScales);
746  correlationThreeBodyCond->evaluateConditionStoreResult(iBxInEvent);
747  cMapResults[itCond->first] = correlationThreeBodyCond;
748 
749  if (m_verbosity && m_isDebugEnabled) {
750  std::ostringstream myCout;
751  correlationThreeBodyCond->print(myCout);
752 
753  LogTrace("L1TGlobal") << myCout.str() << std::endl;
754  }
755  // delete correlationThreeBodyCond;
756  } break;
757 
759  // get first the sub-conditions
760  const CorrelationWithOverlapRemovalTemplate* corrTemplate =
761  static_cast<const CorrelationWithOverlapRemovalTemplate*>(itCond->second);
762  const GtConditionCategory cond0Categ = corrTemplate->cond0Category();
763  const GtConditionCategory cond1Categ = corrTemplate->cond1Category();
764  const GtConditionCategory cond2Categ = corrTemplate->cond2Category();
765  const int cond0Ind = corrTemplate->cond0Index();
766  const int cond1Ind = corrTemplate->cond1Index();
767  const int cond2Ind = corrTemplate->cond2Index();
768 
769  const GlobalCondition* cond0Condition = nullptr;
770  const GlobalCondition* cond1Condition = nullptr;
771  const GlobalCondition* cond2Condition = nullptr;
772 
773  // maximum number of objects received for evaluation of l1t::Type1s condition
774  int cond0NrL1Objects = 0;
775  int cond1NrL1Objects = 0;
776  int cond2NrL1Objects = 0;
777  LogDebug("L1TGlobal") << " cond0NrL1Objects" << cond0NrL1Objects << " cond1NrL1Objects " << cond1NrL1Objects
778  << " cond2NrL1Objects " << cond2NrL1Objects << std::endl;
779 
780  switch (cond0Categ) {
781  case CondMuon: {
782  cond0Condition = &((corrMuon[iChip])[cond0Ind]);
783  } break;
784  case CondCalo: {
785  cond0Condition = &((corrCalo[iChip])[cond0Ind]);
786  } break;
787  case CondEnergySum: {
788  cond0Condition = &((corrEnergySum[iChip])[cond0Ind]);
789  } break;
790  default: {
791  // do nothing, should not arrive here
792  } break;
793  }
794 
795  switch (cond1Categ) {
796  case CondMuon: {
797  cond1Condition = &((corrMuon[iChip])[cond1Ind]);
798  } break;
799  case CondCalo: {
800  cond1Condition = &((corrCalo[iChip])[cond1Ind]);
801  } break;
802  case CondEnergySum: {
803  cond1Condition = &((corrEnergySum[iChip])[cond1Ind]);
804  } break;
805  default: {
806  // do nothing, should not arrive here
807  } break;
808  }
809 
810  switch (cond2Categ) {
811  case CondMuon: {
812  cond2Condition = &((corrMuon[iChip])[cond2Ind]);
813  } break;
814  case CondCalo: {
815  cond2Condition = &((corrCalo[iChip])[cond2Ind]);
816  } break;
817  case CondEnergySum: {
818  cond2Condition = &((corrEnergySum[iChip])[cond2Ind]);
819  } break;
820  default: {
821  // do nothing, should not arrive here
822  } break;
823  }
824 
825  CorrWithOverlapRemovalCondition* correlationCondWOR =
826  new CorrWithOverlapRemovalCondition(itCond->second, cond0Condition, cond1Condition, cond2Condition, this);
827 
828  correlationCondWOR->setVerbosity(m_verbosity);
829  correlationCondWOR->setScales(&gtScales);
830  correlationCondWOR->evaluateConditionStoreResult(iBxInEvent);
831 
832  cMapResults[itCond->first] = correlationCondWOR;
833 
834  if (m_verbosity && m_isDebugEnabled) {
835  std::ostringstream myCout;
836  correlationCondWOR->print(myCout);
837 
838  LogTrace("L1TGlobal") << myCout.str() << std::endl;
839  }
840 
841  // delete correlationCondWOR;
842 
843  } break;
844  case CondNull: {
845  // do nothing
846 
847  } break;
848  default: {
849  // do nothing
850 
851  } break;
852  }
853  }
854  }
855 
856  // loop over algorithm map
858  // empty vector for object maps - filled during loop
859  std::vector<GlobalObjectMap> objMapVec;
860  if (produceL1GtObjectMapRecord && (iBxInEvent == 0))
861  objMapVec.reserve(numberPhysTriggers);
862 
863  for (CItAlgo itAlgo = algorithmMap.begin(); itAlgo != algorithmMap.end(); itAlgo++) {
864  AlgorithmEvaluation gtAlg(itAlgo->second);
865  gtAlg.evaluateAlgorithm((itAlgo->second).algoChipNumber(), m_conditionResultMaps);
866 
867  int algBitNumber = (itAlgo->second).algoBitNumber();
868  bool algResult = gtAlg.gtAlgoResult();
869 
870  LogDebug("L1TGlobal") << " ===> for iBxInEvent = " << iBxInEvent << ":\t algBitName = " << itAlgo->first
871  << ",\t algBitNumber = " << algBitNumber << ",\t algResult = " << algResult << std::endl;
872 
873  if (algResult) {
874  // m_gtlAlgorithmOR.set(algBitNumber);
875  m_uGtAlgBlk.setAlgoDecisionInitial(algBitNumber, algResult);
876  m_algInitialOr = true;
877  }
878 
879  if (m_verbosity && m_isDebugEnabled) {
880  std::ostringstream myCout;
881  (itAlgo->second).print(myCout);
882  gtAlg.print(myCout);
883 
884  LogTrace("L1TGlobal") << myCout.str() << std::endl;
885  }
886 
887  // object maps only for BxInEvent = 0
888  if (produceL1GtObjectMapRecord && (iBxInEvent == 0)) {
889  std::vector<L1TObjectTypeInCond> otypes;
890  for (auto iop = gtAlg.operandTokenVector().begin(); iop != gtAlg.operandTokenVector().end(); ++iop) {
891  //cout << "INFO: operand name: " << iop->tokenName << "\n";
892  int myChip = -1;
893  int found = 0;
895  for (auto imap = conditionMap.begin(); imap != conditionMap.end(); imap++) {
896  myChip++;
897  auto match = imap->find(iop->tokenName);
898 
899  if (match != imap->end()) {
900  found = 1;
901  //cout << "DEBUG: found match for " << iop->tokenName << " at " << match->first << "\n";
902 
903  otype = match->second->objectType();
904 
905  for (auto itype = otype.begin(); itype != otype.end(); itype++) {
906  //cout << "type: " << *itype << "\n";
907  }
908  }
909  }
910  if (!found) {
911  edm::LogWarning("L1TGlobal") << "\n Failed to find match for operand token " << iop->tokenName << "\n";
912  } else {
913  otypes.push_back(otype);
914  }
915  }
916 
917  // set object map
918  GlobalObjectMap objMap;
919 
920  objMap.setAlgoName(itAlgo->first);
921  objMap.setAlgoBitNumber(algBitNumber);
922  objMap.setAlgoGtlResult(algResult);
925  // gtAlg is empty now...
926  objMap.swapObjectTypeVector(otypes);
927 
928  if (m_verbosity && m_isDebugEnabled) {
929  std::ostringstream myCout1;
930  objMap.print(myCout1);
931 
932  LogTrace("L1TGlobal") << myCout1.str() << std::endl;
933  }
934 
935  objMapVec.push_back(objMap);
936  }
937  }
938 
939  // object maps only for BxInEvent = 0
940  if (produceL1GtObjectMapRecord && (iBxInEvent == 0)) {
941  gtObjectMapRecord->swapGtObjectMap(objMapVec);
942  }
943 
944  // loop over condition maps (one map per condition chip)
945  // then loop over conditions in the map
946  // delete the conditions created with new, zero pointer, do not clear map, keep the vector as is...
947  for (std::vector<AlgorithmEvaluation::ConditionEvaluationMap>::iterator itCondOnChip = m_conditionResultMaps.begin();
948  itCondOnChip != m_conditionResultMaps.end();
949  itCondOnChip++) {
950  for (AlgorithmEvaluation::ItEvalMap itCond = itCondOnChip->begin(); itCond != itCondOnChip->end(); itCond++) {
951  delete itCond->second;
952  itCond->second = nullptr;
953  }
954  }
955 }
956 
957 // run GTL
959  const int iBxInEvent,
960  const int totalBxInEvent,
961  const unsigned int numberPhysTriggers,
962  const std::vector<double>& prescaleFactorsAlgoTrig,
963  const std::vector<unsigned int>& triggerMaskAlgoTrig,
964  const std::vector<int>& triggerMaskVetoAlgoTrig,
965  const bool algorithmTriggersUnprescaled,
966  const bool algorithmTriggersUnmasked) {
967  if (m_verbosity) {
968  LogDebug("L1TGlobal") << "\n**** GlobalBoard apply Final Decision Logic " << std::endl;
969  }
970 
971  // prescale counters are reset at the beginning of the luminosity segment
972  if (m_firstEv) {
973  // prescale counters: numberPhysTriggers counters per bunch cross
974  m_prescaleCounterAlgoTrig.reserve(totalBxInEvent);
975 
976  auto const& prescaleCountersAlgoTrig =
977  m_semiRandomInitialPSCounters ? semirandomNumber(iEvent, prescaleFactorsAlgoTrig) : prescaleFactorsAlgoTrig;
978 
979  for (int iBxInEvent = 0; iBxInEvent <= totalBxInEvent; ++iBxInEvent) {
980  m_prescaleCounterAlgoTrig.push_back(prescaleCountersAlgoTrig);
981  }
982  m_firstEv = false;
983  m_currentLumi = iEvent.luminosityBlock();
984  }
985 
986  // update and clear prescales at the beginning of the luminosity segment
987  if (m_firstEvLumiSegment || (m_currentLumi != iEvent.luminosityBlock() && m_resetPSCountersEachLumiSec)) {
988  m_prescaleCounterAlgoTrig.clear();
989  for (int iBxInEvent = 0; iBxInEvent <= totalBxInEvent; ++iBxInEvent) {
990  if (m_semiRandomInitialPSCounters) {
991  m_prescaleCounterAlgoTrig.push_back(semirandomNumber(iEvent, prescaleFactorsAlgoTrig));
992  } else {
993  m_prescaleCounterAlgoTrig.push_back(prescaleFactorsAlgoTrig);
994  }
995  }
996  m_firstEvLumiSegment = false;
997  m_currentLumi = iEvent.luminosityBlock();
998  }
999 
1000  // Copy Algorithm bits to Prescaled word
1001  // Prescaling and Masking done below if requested.
1002  m_uGtAlgBlk.copyInitialToInterm();
1003 
1004  // -------------------------------------------
1005  // Apply Prescales or skip if turned off
1006  // -------------------------------------------
1007  if (!algorithmTriggersUnprescaled) {
1008  // iBxInEvent is ... -2 -1 0 1 2 ... while counters are 0 1 2 3 4 ...
1009  int inBxInEvent = totalBxInEvent / 2 + iBxInEvent;
1010 
1011  bool temp_algPrescaledOr = false;
1012  bool alreadyReported = false;
1013  for (unsigned int iBit = 0; iBit < numberPhysTriggers; ++iBit) {
1014  bool bitValue = m_uGtAlgBlk.getAlgoDecisionInitial(iBit);
1015  if (bitValue) {
1016  // Make sure algo bit in range, warn otherwise
1017  if (iBit < prescaleFactorsAlgoTrig.size()) {
1018  if (prescaleFactorsAlgoTrig.at(iBit) != 1) {
1019  (m_prescaleCounterAlgoTrig.at(inBxInEvent).at(iBit))--;
1020  if (m_prescaleCounterAlgoTrig.at(inBxInEvent).at(iBit) == 0) {
1021  // bit already true in algoDecisionWord, just reset counter
1022  m_prescaleCounterAlgoTrig.at(inBxInEvent).at(iBit) = prescaleFactorsAlgoTrig.at(iBit);
1023  temp_algPrescaledOr = true;
1024  } else {
1025  // change bit to false in prescaled word and final decision word
1026  m_uGtAlgBlk.setAlgoDecisionInterm(iBit, false);
1027 
1028  } //if Prescale counter reached zero
1029  } //if prescale factor is not 1 (ie. no prescale)
1030  else {
1031  temp_algPrescaledOr = true;
1032  }
1033  } // require bit in range
1034  else if (!alreadyReported) {
1035  alreadyReported = true;
1036  edm::LogWarning("L1TGlobal") << "\nWarning: algoBit >= prescaleFactorsAlgoTrig.size() in bx " << iBxInEvent
1037  << std::endl;
1038  }
1039  } //if algo bit is set true
1040  } //loop over alg bits
1041 
1042  m_algPrescaledOr = temp_algPrescaledOr; //temp
1043 
1044  } else {
1045  // Since not Prescaling just take OR of Initial Work
1046  m_algPrescaledOr = m_algInitialOr;
1047 
1048  } //if we are going to apply prescales.
1049 
1050  // Copy Algorithm bits fron Prescaled word to Final Word
1051  // Masking done below if requested.
1052  m_uGtAlgBlk.copyIntermToFinal();
1053 
1054  if (!algorithmTriggersUnmasked) {
1055  bool temp_algFinalOr = false;
1056  bool alreadyReported = false;
1057  for (unsigned int iBit = 0; iBit < numberPhysTriggers; ++iBit) {
1058  bool bitValue = m_uGtAlgBlk.getAlgoDecisionInterm(iBit);
1059 
1060  if (bitValue) {
1061  //bool isMasked = ( triggerMaskAlgoTrig.at(iBit) == 0 );
1062  bool isMasked = false;
1063  if (iBit < triggerMaskAlgoTrig.size())
1064  isMasked = (triggerMaskAlgoTrig.at(iBit) == 0);
1065  else if (!alreadyReported) {
1066  alreadyReported = true;
1067  edm::LogWarning("L1TGlobal") << "\nWarning: algoBit >= triggerMaskAlgoTrig.size() in bx " << iBxInEvent
1068  << std::endl;
1069  }
1070 
1071  bool passMask = (bitValue && !isMasked);
1072 
1073  if (passMask)
1074  temp_algFinalOr = true;
1075  else
1076  m_uGtAlgBlk.setAlgoDecisionFinal(iBit, false);
1077 
1078  // Check if veto mask is true, if it is, set the event veto flag.
1079  if (triggerMaskVetoAlgoTrig.at(iBit) == 1)
1080  m_algFinalOrVeto = true;
1081  }
1082  }
1083 
1084  m_algIntermOr = temp_algFinalOr;
1085 
1086  } else {
1087  m_algIntermOr = m_algPrescaledOr;
1088 
1089  }
1090 
1091  // Set FinalOR for this board
1092  m_algFinalOr = (m_algIntermOr & !m_algFinalOrVeto);
1093 }
1094 
1095 // Fill DAQ Record
1097  std::unique_ptr<GlobalAlgBlkBxCollection>& uGtAlgRecord,
1098  int prescaleSet,
1099  int menuUUID,
1100  int firmwareUUID) {
1101  if (m_verbosity) {
1102  LogDebug("L1TGlobal") << "\n**** GlobalBoard fill DAQ Records for bx= " << iBxInEvent << std::endl;
1103  }
1104 
1105  // Set header information
1106  m_uGtAlgBlk.setbxInEventNr((iBxInEvent & 0xF));
1107  m_uGtAlgBlk.setPreScColumn(prescaleSet);
1108  m_uGtAlgBlk.setL1MenuUUID(menuUUID);
1109  m_uGtAlgBlk.setL1FirmwareUUID(firmwareUUID);
1110 
1111  m_uGtAlgBlk.setFinalORVeto(m_algFinalOrVeto);
1112  m_uGtAlgBlk.setFinalORPreVeto(m_algIntermOr);
1113  m_uGtAlgBlk.setFinalOR(m_algFinalOr);
1114 
1115  uGtAlgRecord->push_back(iBxInEvent, m_uGtAlgBlk);
1116 }
1117 
1118 // clear GTL
1120  resetMu();
1121  resetMuonShower();
1122  resetCalo();
1123  resetExternal();
1124 
1125  m_uGtAlgBlk.reset();
1126 
1127  m_gtlDecisionWord.reset();
1128  m_gtlAlgorithmOR.reset();
1129 }
1130 
1131 // clear muon
1133  m_candL1Mu->clear();
1134  m_candL1Mu->setBXRange(m_bxFirst_, m_bxLast_);
1135 }
1136 
1137 // clear muon shower
1139  m_candL1MuShower->clear();
1140  m_candL1MuShower->setBXRange(m_bxFirst_, m_bxLast_);
1141 }
1142 
1143 // clear calo
1145  m_candL1EG->clear();
1146  m_candL1Tau->clear();
1147  m_candL1Jet->clear();
1148  m_candL1EtSum->clear();
1149 
1150  m_candL1EG->setBXRange(m_bxFirst_, m_bxLast_);
1151  m_candL1Tau->setBXRange(m_bxFirst_, m_bxLast_);
1152  m_candL1Jet->setBXRange(m_bxFirst_, m_bxLast_);
1153  m_candL1EtSum->setBXRange(m_bxFirst_, m_bxLast_);
1154 }
1155 
1157  m_candL1External->clear();
1158  m_candL1External->setBXRange(m_bxFirst_, m_bxLast_);
1159 }
1160 
1161 // print Global Muon Trigger data received
1162 void l1t::GlobalBoard::printGmtData(const int iBxInEvent) const {
1163  LogTrace("L1TGlobal") << "\nl1t::L1GlobalTrigger: uGMT data received for BxInEvent = " << iBxInEvent << std::endl;
1164 
1165  int nrL1Mu = m_candL1Mu->size(iBxInEvent);
1166  LogTrace("L1TGlobal") << "Number of GMT muons = " << nrL1Mu << "\n" << std::endl;
1167 
1168  LogTrace("L1TGlobal") << std::endl;
1169 }
1170 
1171 //initializer prescale counter using a semi-random value between [1, prescale value]
1172 const std::vector<double> l1t::GlobalBoard::semirandomNumber(const edm::Event& iEvent,
1173  const std::vector<double>& prescaleFactorsAlgoTrig) {
1174  auto out = prescaleFactorsAlgoTrig;
1175  // pick a random number from a combination of run, lumi, event numbers
1176  std::srand(iEvent.id().run());
1177  std::srand(std::rand() + iEvent.id().luminosityBlock());
1178  // this causes different (semi)random number number for different streams
1179  // reminder: different streams have different initial event number
1180  std::srand(std::rand() + iEvent.id().event());
1181  // very large (semi)random number
1182  double const semirandom = std::rand();
1183  for (auto& ps : out) {
1184  // if the ps is smaller than 1 (e.g. ps=0, ps=1), it is not changed
1185  // else, replace ps with a semirandom integer in the [1,ps] range
1186  if (ps > 1) {
1187  auto nps = semirandom - floor(semirandom / ps) * ps;
1188  // if nps=0 or a wrong value (<0,>ps) use PS value (standard method)
1189  if (nps > 0 and nps <= ps)
1190  ps = nps;
1191  else {
1192  if (nps != 0) // complain only if nps <0 or nps >PS
1193  edm::LogWarning("L1TGlobal::semirandomNumber")
1194  << "\n The inital prescale counter obtained by L1TGlobal::semirandomNumber is wrong."
1195  << "\n This is probably do to the floating-point precision. Using the PS value."
1196  << "\n semirandom = " << semirandom << "\n PS = " << ps << "\n nps = " << nps
1197  << " <-- it should be in the range [0 , " << ps << "]" << std::endl;
1198  }
1199  }
1200  }
1201  return out;
1202 }
bool isDebugEnabled()
void setAlgoBitNumber(int algoBitNumberValue)
const int cond0Index() const
get / set the index of the two sub-conditions in the cor* vector from menu
const l1t::GlobalScales & gtScales() const
get the scales
Definition: TriggerMenu.h:191
void evaluateConditionStoreResult(const int bxEval)
call evaluateCondition and save last result
std::vector< l1t::GlobalObject > L1TObjectTypeInCond
void swapOperandTokenVector(std::vector< GlobalLogicParser::OperandToken > &operandTokenVectorValue)
const std::vector< std::vector< CaloTemplate > > & corCaloTemplate() const
Definition: TriggerMenu.h:168
void print(std::ostream &myCout) const override
print condition
Definition: MuCondition.cc:525
void print(std::ostream &myCout) const override
print condition
void print(std::ostream &myCout) const override
print condition
const l1t::AlgorithmMap & gtAlgorithmMap() const
get / set the algorithm map (by name)
Definition: TriggerMenu.h:181
void setVerbosity(const int verbosity)
const int cond1Index() const
virtual std::string getScalesName() const
Definition: GlobalScales.cc:27
void fillAlgRecord(int iBxInEvent, std::unique_ptr< GlobalAlgBlkBxCollection > &uGtAlgRecord, int prescaleSet, int menuUUID, int firmwareUUID)
Fill the Daq Records.
static const std::vector< double > semirandomNumber(const edm::Event &iEvent, const std::vector< double > &prescaleFactorsAlgoTrig)
const std::vector< std::vector< MuonTemplate > > & corMuonTemplate() const
Definition: TriggerMenu.h:163
unsigned long long m_l1MuTriggerScalesCacheID
Definition: GlobalBoard.h:219
delete x;
Definition: CaloConfig.h:22
void setBxLast(int bx)
Definition: GlobalBoard.cc:110
const l1t::GtConditionCategory cond1Category() const
const int cond0Index() const
get / set the index of the two sub-conditions in the cor* vector from menu
void print(std::ostream &myCout) const
print the full object map
const l1t::GtConditionCategory cond1Category() const
void swapObjectTypeVector(std::vector< L1TObjectTypeInCond > &objectTypeVectorValue)
void swapCombinationVector(std::vector< CombinationsInCond > &combinationVectorValue)
ConditionEvaluationMap::iterator ItEvalMap
void printGmtData(const int iBxInEvent) const
print received Muon dataWord
void print(std::ostream &myCout) const
unsigned long long m_l1GtMenuCacheID
Definition: GlobalBoard.h:212
void print(std::ostream &myCout) const override
print condition
#define LogTrace(id)
void setMus0(const bool bit)
Definition: MuonShower.h:59
void receiveCaloObjectData(edm::Event &, const edm::EDGetTokenT< BXVector< l1t::EGamma >> &, const edm::EDGetTokenT< BXVector< l1t::Tau >> &, const edm::EDGetTokenT< BXVector< l1t::Jet >> &, const edm::EDGetTokenT< BXVector< l1t::EtSum >> &, const bool receiveEG, const int nrL1EG, const bool receiveTau, const int nrL1Tau, const bool receiveJet, const int nrL1Jet, const bool receiveEtSums)
receive data from Global Muon Trigger
Definition: GlobalBoard.cc:138
const l1t::GtConditionCategory cond2Category() const
std::bitset< GlobalAlgBlk::maxPhysicsTriggers > m_gtlDecisionWord
Definition: GlobalBoard.h:242
ConditionMap::const_iterator CItCond
iterators through map containing the conditions
GtConditionCategory
condition categories
const l1t::GtConditionCategory cond0Category() const
get / set the category of the thre sub-conditions
int iEvent
Definition: GenABIO.cc:224
const l1t::GtConditionCategory cond0Category() const
get / set the category of the two sub-conditions
unsigned int m_boardEventCount
Definition: GlobalBoard.h:269
AlgorithmMap::const_iterator CItAlgo
iterators through map containing the algorithms
Definition: Muon.py:1
void reset()
reset the content of a GlobalAlgBlk
void print(std::ostream &myCout) const override
print condition
void runFDL(edm::Event &iEvent, const int iBxInEvent, const int totalBxInEvent, const unsigned int numberPhysTriggers, const std::vector< double > &prescaleFactorsAlgoTrig, const std::vector< unsigned int > &triggerMaskAlgoTrig, const std::vector< int > &triggerMaskVetoAlgoTrig, const bool algorithmTriggersUnprescaled, const bool algorithmTriggersUnmasked)
run the uGT FDL (Apply Prescales and Veto)
Definition: GlobalBoard.cc:958
void reset()
clear uGT
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
unsigned long long m_l1CaloGeometryCacheID
Definition: GlobalBoard.h:216
const l1t::GtConditionCategory cond1Category() const
void setAlgoGtlResult(bool algoGtlResultValue)
std::vector< CombinationsInCond > & gtAlgoCombinationVector()
void runGTL(edm::Event &iEvent, const edm::EventSetup &evSetup, const TriggerMenu *m_l1GtMenu, const bool produceL1GtObjectMapRecord, const int iBxInEvent, std::unique_ptr< GlobalObjectMapRecord > &gtObjectMapRecord, const unsigned int numberPhysTriggers, const int nrL1Mu, const int nrL1MuShower, const int nrL1EG, const int nrL1Tau, const int nrL1Jet)
run the uGT GTL (Conditions and Algorithms)
Definition: GlobalBoard.cc:484
void setScales(const GlobalScales *)
void setMusOutOfTime1(const bool bit)
Definition: MuonShower.h:62
void evaluateAlgorithm(const int chipNumber, const std::vector< ConditionEvaluationMap > &)
evaluate an algorithm
bool gtAlgoResult() const
get / set the result of the algorithm
GlobalAlgBlk m_uGtAlgBlk
Definition: GlobalBoard.h:244
void setBxFirst(int bx)
Definition: GlobalBoard.cc:108
void setAlgoName(const std::string &algoNameValue)
const std::vector< l1t::ConditionMap > & gtConditionMap() const
get / set / build the condition maps
Definition: TriggerMenu.h:79
bool isValid() const
Definition: HandleBase.h:70
const std::vector< std::vector< EnergySumTemplate > > & corEnergySumTemplate() const
Definition: TriggerMenu.h:174
void receiveMuonObjectData(edm::Event &, const edm::EDGetTokenT< BXVector< l1t::Muon >> &, const bool receiveMu, const int nrL1Mu)
Definition: GlobalBoard.cc:340
HLT enums.
void print(std::ostream &myCout) const override
print condition
virtual ~GlobalBoard()
Definition: GlobalBoard.cc:94
std::vector< GlobalLogicParser::OperandToken > & operandTokenVector()
void setScales(const GlobalScales *)
const int cond0Index() const
get / set the index of the three subconditions in the cor* vector from menu
void init(const int numberPhysTriggers, const int nrL1Mu, const int nrL1MuShower, const int nrL1EG, const int nrL1Tau, const int nrL1Jet, int bxFirst, int bxLast)
initialize the class (mainly reserve)
Definition: GlobalBoard.cc:112
void print(std::ostream &myCout) const override
print condition
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
std::unordered_map< std::string, ConditionEvaluation * > ConditionEvaluationMap
copy constructor
void setMus1(const bool bit)
Definition: MuonShower.h:60
const l1t::GtConditionCategory cond0Category() const
get / set the category of the three subconditions
Log< level::Warning, false > LogWarning
Definition: memstream.h:15
std::bitset< GlobalAlgBlk::maxPhysicsTriggers > m_gtlAlgorithmOR
Definition: GlobalBoard.h:241
void receiveMuonShowerObjectData(edm::Event &, const edm::EDGetTokenT< BXVector< l1t::MuonShower >> &, const bool receiveMuShower, const int nrL1MuShower)
Definition: GlobalBoard.cc:394
std::map< std::string, GlobalAlgorithm > AlgorithmMap
map containing the algorithms
const l1t::GtConditionCategory cond2Category() const
void receiveExternalData(edm::Event &, const edm::EDGetTokenT< BXVector< GlobalExtBlk >> &, const bool receiveExt)
Definition: GlobalBoard.cc:442
void setMusOutOfTime0(const bool bit)
Definition: MuonShower.h:61
void print(std::ostream &myCout) const override
print condition
#define LogDebug(id)