CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
L1TMenuHelper Class Reference

#include <L1TMenuHelper.h>

Public Member Functions

std::string enumToStringL1GtConditionCategory (L1GtConditionCategory iConditionCategory)
 
std::string enumToStringL1GtConditionType (L1GtConditionType iConditionType)
 
std::string enumToStringL1GtObject (L1GtObject iObject)
 
unsigned int getEtaRangeByAlias (const TString &iCategory, const TString &iAlias)
 
std::map< std::string, std::string > getLUSOTrigger (const std::map< std::string, bool > &iCategories, int IndexRefPrescaleFactors, L1GtUtils const &myUtils)
 
int getPrescaleByAlias (const TString &iCategory, const TString &iAlias)
 
unsigned int getQualityAlias (const TString &iCategory, const TString &iAlias)
 
 L1TMenuHelper (const edm::EventSetup &iSetup)
 
std::map< std::string, std::string > testAlgos (const std::map< std::string, std::string > &)
 
 ~L1TMenuHelper ()
 

Private Attributes

edm::ESHandle< L1GtPrescaleFactorsl1GtPfAlgo
 
const L1GtTriggerMenum_l1GtMenu
 
const std::vector< std::vector< int > > * m_prescaleFactorsAlgoTrig
 
std::vector< SingleObjectTriggerm_vTrigCenJet
 
std::vector< SingleObjectTriggerm_vTrigEG
 
std::vector< SingleObjectTriggerm_vTrigETM
 
std::vector< SingleObjectTriggerm_vTrigETT
 
std::vector< SingleObjectTriggerm_vTrigForJet
 
std::vector< SingleObjectTriggerm_vTrigHTM
 
std::vector< SingleObjectTriggerm_vTrigHTT
 
std::vector< SingleObjectTriggerm_vTrigIsoEG
 
std::vector< SingleObjectTriggerm_vTrigJet
 
std::vector< SingleObjectTriggerm_vTrigMu
 
std::vector< SingleObjectTriggerm_vTrigTauJet
 
edm::ESHandle< L1GtTriggerMenumenuRcd
 

Detailed Description

Definition at line 79 of file L1TMenuHelper.h.

Constructor & Destructor Documentation

◆ L1TMenuHelper()

L1TMenuHelper::L1TMenuHelper ( const edm::EventSetup iSetup)

Definition at line 38 of file L1TMenuHelper.cc.

38  {
39  iSetup.get<L1GtTriggerMenuRcd>().get(menuRcd);
41 
42  const L1GtPrescaleFactors* m_l1GtPfAlgo = l1GtPfAlgo.product();
43 
44  m_l1GtMenu = menuRcd.product(); // Getting the menu
45  m_prescaleFactorsAlgoTrig = &(m_l1GtPfAlgo->gtPrescaleFactors()); // Retriving the list of prescale sets
46 }

References edm::EventSetup::get(), edm::get(), and L1GtPrescaleFactors::gtPrescaleFactors().

◆ ~L1TMenuHelper()

L1TMenuHelper::~L1TMenuHelper ( )

Definition at line 51 of file L1TMenuHelper.cc.

51 {}

Member Function Documentation

◆ enumToStringL1GtConditionCategory()

string L1TMenuHelper::enumToStringL1GtConditionCategory ( L1GtConditionCategory  iConditionCategory)

Definition at line 558 of file L1TMenuHelper.cc.

558  {
559  string out;
560 
561  switch (iConditionCategory) {
562  case CondNull:
563  out = "CondNull";
564  break;
565  case CondMuon:
566  out = "CondMuon";
567  break;
568  case CondCalo:
569  out = "CondCalo";
570  break;
571  case CondEnergySum:
572  out = "CondEnergySum";
573  break;
574  case CondJetCounts:
575  out = "CondJetCounts";
576  break;
577  case CondCorrelation:
578  out = "CondCorrelation";
579  break;
580  case CondCastor:
581  out = "CondCastor";
582  break;
583  case CondHfBitCounts:
584  out = "CondHfBitCounts";
585  break;
586  case CondHfRingEtSums:
587  out = "CondHfRingEtSums";
588  break;
589  case CondBptx:
590  out = "CondBptx";
591  break;
592  case CondExternal:
593  out = "CondExternal";
594  break;
595  default:
596  out = "Unknown";
597  break;
598  };
599 
600  return out;
601 }

References CondBptx, CondCalo, CondCastor, CondCorrelation, CondEnergySum, CondExternal, CondHfBitCounts, CondHfRingEtSums, CondJetCounts, CondMuon, CondNull, and MillePedeFileConverter_cfg::out.

◆ enumToStringL1GtConditionType()

string L1TMenuHelper::enumToStringL1GtConditionType ( L1GtConditionType  iConditionType)

Definition at line 491 of file L1TMenuHelper.cc.

491  {
492  string out;
493 
494  switch (iConditionType) {
495  case TypeNull:
496  out = "TypeNull";
497  break;
498  case Type1s:
499  out = "Type1s";
500  break;
501  case Type2s:
502  out = "Type2s";
503  break;
504  case Type2wsc:
505  out = "Type2wsc";
506  break;
507  case Type2cor:
508  out = "Type2cor";
509  break;
510  case Type3s:
511  out = "Type3s";
512  break;
513  case Type4s:
514  out = "Type4s";
515  break;
516  case TypeETM:
517  out = "TypeETM";
518  break;
519  case TypeETT:
520  out = "TypeETT";
521  break;
522  case TypeHTT:
523  out = "TypeHTT";
524  break;
525  case TypeHTM:
526  out = "TypeHTM";
527  break;
528  case TypeJetCounts:
529  out = "TypeJetCounts";
530  break;
531  case TypeCastor:
532  out = "TypeCastor";
533  break;
534  case TypeHfBitCounts:
535  out = "TypeHfBitCounts";
536  break;
537  case TypeHfRingEtSums:
538  out = "TypeHfRingEtSums";
539  break;
540  case TypeBptx:
541  out = "TypeBptx";
542  break;
543  case TypeExternal:
544  out = "TypeExternal";
545  break;
546  default:
547  out = "Unknown";
548  break;
549  };
550 
551  return out;
552 }

References MillePedeFileConverter_cfg::out, Type1s, Type2cor, Type2s, Type2wsc, Type3s, Type4s, TypeBptx, TypeCastor, TypeETM, TypeETT, TypeExternal, TypeHfBitCounts, TypeHfRingEtSums, TypeHTM, TypeHTT, TypeJetCounts, and TypeNull.

◆ enumToStringL1GtObject()

string L1TMenuHelper::enumToStringL1GtObject ( L1GtObject  iObject)

Definition at line 424 of file L1TMenuHelper.cc.

424  {
425  string out;
426 
427  switch (iObject) {
428  case Mu:
429  out = "Mu";
430  break;
431  case NoIsoEG:
432  out = "NoIsoEG";
433  break;
434  case IsoEG:
435  out = "IsoEG";
436  break;
437  case CenJet:
438  out = "CenJet";
439  break;
440  case ForJet:
441  out = "ForJet";
442  break;
443  case TauJet:
444  out = "TauJet";
445  break;
446  case ETM:
447  out = "ETM";
448  break;
449  case ETT:
450  out = "ETT";
451  break;
452  case HTT:
453  out = "HTT";
454  break;
455  case HTM:
456  out = "HTM";
457  break;
458  case JetCounts:
459  out = "JetCounts";
460  break;
461  case HfBitCounts:
462  out = "HfBitCounts";
463  break;
464  case HfRingEtSums:
465  out = "HfRingEtSums";
466  break;
467  case TechTrig:
468  out = "TechTrig";
469  break;
470  case Castor:
471  out = "Castor";
472  break;
473  case BPTX:
474  out = "BPTX";
475  break;
476  case GtExternal:
477  out = "GtExternal";
478  break;
479  default:
480  out = "Unknown";
481  break;
482  };
483 
484  return out;
485 }

References BPTX, Castor, CenJet, ETM, ETT, ForJet, GtExternal, HfBitCounts, HfRingEtSums, HTM, HTT, IsoEG, JetCounts, Mu, NoIsoEG, MillePedeFileConverter_cfg::out, TauJet, and TechTrig.

◆ getEtaRangeByAlias()

unsigned int L1TMenuHelper::getEtaRangeByAlias ( const TString &  iCategory,
const TString &  iAlias 
)

Definition at line 679 of file L1TMenuHelper.cc.

679  {
680  unsigned int out = -1;
681 
682  if (iCategory == "Mu") {
683  for (unsigned int i = 0; i < m_vTrigMu.size(); i++) {
684  if (m_vTrigMu[i].alias == iAlias) {
685  return m_vTrigMu[i].etaRange;
686  }
687  }
688  } else if (iCategory == "EG") {
689  for (unsigned int i = 0; i < m_vTrigEG.size(); i++) {
690  if (m_vTrigEG[i].alias == iAlias) {
691  return m_vTrigEG[i].etaRange;
692  }
693  }
694  } else if (iCategory == "IsoEG") {
695  for (unsigned int i = 0; i < m_vTrigIsoEG.size(); i++) {
696  if (m_vTrigIsoEG[i].alias == iAlias) {
697  return m_vTrigIsoEG[i].etaRange;
698  }
699  }
700  } else if (iCategory == "Jet") {
701  for (unsigned int i = 0; i < m_vTrigJet.size(); i++) {
702  if (m_vTrigJet[i].alias == iAlias) {
703  return m_vTrigJet[i].etaRange;
704  }
705  }
706  } else if (iCategory == "CenJet") {
707  for (unsigned int i = 0; i < m_vTrigCenJet.size(); i++) {
708  if (m_vTrigCenJet[i].alias == iAlias) {
709  return m_vTrigCenJet[i].etaRange;
710  }
711  }
712  } else if (iCategory == "ForJet") {
713  for (unsigned int i = 0; i < m_vTrigForJet.size(); i++) {
714  if (m_vTrigForJet[i].alias == iAlias) {
715  return m_vTrigForJet[i].etaRange;
716  }
717  }
718  } else if (iCategory == "TauJet") {
719  for (unsigned int i = 0; i < m_vTrigTauJet.size(); i++) {
720  if (m_vTrigTauJet[i].alias == iAlias) {
721  return m_vTrigTauJet[i].etaRange;
722  }
723  }
724  } else if (iCategory == "ETT") {
725  for (unsigned int i = 0; i < m_vTrigETT.size(); i++) {
726  if (m_vTrigETT[i].alias == iAlias) {
727  return m_vTrigETT[i].etaRange;
728  }
729  }
730  } else if (iCategory == "ETM") {
731  for (unsigned int i = 0; i < m_vTrigETM.size(); i++) {
732  if (m_vTrigETM[i].alias == iAlias) {
733  return m_vTrigETM[i].etaRange;
734  }
735  }
736  } else if (iCategory == "HTT") {
737  for (unsigned int i = 0; i < m_vTrigHTT.size(); i++) {
738  if (m_vTrigHTT[i].alias == iAlias) {
739  return m_vTrigHTT[i].etaRange;
740  }
741  }
742  } else if (iCategory == "HTM") {
743  for (unsigned int i = 0; i < m_vTrigHTM.size(); i++) {
744  if (m_vTrigHTM[i].alias == iAlias) {
745  return m_vTrigHTM[i].etaRange;
746  }
747  }
748  }
749 
750  return out;
751 }

References SiStripOfflineCRack_cfg::alias, mps_fire::i, and MillePedeFileConverter_cfg::out.

Referenced by L1TRate_Offline::bookHistograms(), and L1TRate::bookHistograms().

◆ getLUSOTrigger()

map< string, string > L1TMenuHelper::getLUSOTrigger ( const std::map< std::string, bool > &  iCategories,
int  IndexRefPrescaleFactors,
L1GtUtils const &  myUtils 
)

Definition at line 57 of file L1TMenuHelper.cc.

59  {
60  map<string, string> out;
61 
62  // Getting information from the menu
63  const AlgorithmMap* theAlgoMap = &m_l1GtMenu->gtAlgorithmAliasMap();
64  const vector<vector<L1GtMuonTemplate> >* vMuonConditions = &m_l1GtMenu->vecMuonTemplate();
65  const vector<vector<L1GtCaloTemplate> >* vCaloConditions = &m_l1GtMenu->vecCaloTemplate();
66  const vector<vector<L1GtEnergySumTemplate> >* vEnergySumConditions = &m_l1GtMenu->vecEnergySumTemplate();
67 
68  // Getting reference prescales
69  const vector<int>& refPrescaleFactors = (*m_prescaleFactorsAlgoTrig).at(IndexRefPrescaleFactors);
70 
71  AlgorithmMap MyAlgos;
72 
73  map<string, SingleObjectCondition> myConditions;
74 
75  for (unsigned int a = 0; a < vMuonConditions->size(); a++) {
76  for (unsigned int b = 0; b < (*vMuonConditions)[a].size(); b++) {
77  const L1GtMuonTemplate* MuonCondition = &(*vMuonConditions)[a][b];
78 
79  // Selecting conditions that require single objects
80  if (MuonCondition->condType() == Type1s && MuonCondition->nrObjects() == 1) {
81  SingleObjectCondition tCondition;
82 
83  tCondition.name = MuonCondition->condName();
84  tCondition.conditionCategory = MuonCondition->condCategory();
85  tCondition.conditionType = MuonCondition->condType();
86  tCondition.object = MuonCondition->objectType()[0];
87  tCondition.threshold = (*MuonCondition->objectParameter())[0].ptHighThreshold;
88  tCondition.quality = (*MuonCondition->objectParameter())[0].qualityRange;
89  tCondition.etaRange = (*MuonCondition->objectParameter())[0].etaRange;
90 
91  myConditions[MuonCondition->condName()] = tCondition;
92  }
93  }
94  }
95 
96  for (unsigned int a = 0; a < vCaloConditions->size(); a++) {
97  for (unsigned int b = 0; b < (*vCaloConditions)[a].size(); b++) {
98  const L1GtCaloTemplate* CaloCondition = &(*vCaloConditions)[a][b];
99 
100  if (CaloCondition->condType() == Type1s && CaloCondition->nrObjects() == 1) {
101  SingleObjectCondition tCondition;
102 
103  tCondition.name = CaloCondition->condName();
104  tCondition.conditionCategory = CaloCondition->condCategory();
105  tCondition.conditionType = CaloCondition->condType();
106  tCondition.object = CaloCondition->objectType()[0];
107  tCondition.threshold = (*CaloCondition->objectParameter())[0].etThreshold;
108  tCondition.quality = 0;
109  tCondition.etaRange = (*CaloCondition->objectParameter())[0].etaRange;
110 
111  myConditions[CaloCondition->condName()] = tCondition;
112  }
113  }
114  }
115 
116  for (unsigned int a = 0; a < vEnergySumConditions->size(); a++) {
117  for (unsigned int b = 0; b < (*vEnergySumConditions)[a].size(); b++) {
118  const L1GtEnergySumTemplate* EnergySumCondition = &(*vEnergySumConditions)[a][b];
119 
120  if ((EnergySumCondition->condType() == TypeETT || EnergySumCondition->condType() == TypeETM ||
121  EnergySumCondition->condType() == TypeHTT || EnergySumCondition->condType() == TypeHTM) &&
122  EnergySumCondition->nrObjects() == 1) {
123  SingleObjectCondition tCondition;
124 
125  tCondition.name = EnergySumCondition->condName();
126  tCondition.conditionCategory = EnergySumCondition->condCategory();
127  tCondition.conditionType = EnergySumCondition->condType();
128  tCondition.object = EnergySumCondition->objectType()[0];
129  tCondition.threshold = (*EnergySumCondition->objectParameter())[0].etThreshold;
130  tCondition.quality = 0;
131  tCondition.etaRange = 0;
132 
133  myConditions[EnergySumCondition->condName()] = tCondition;
134  }
135  }
136  }
137 
138  for (CItAlgo iAlgo = theAlgoMap->begin(); iAlgo != theAlgoMap->end(); ++iAlgo) {
139  int error;
140 
141  bool algoIsValid = true;
142  unsigned int maxThreshold = 0;
143  int tAlgoMask = myUtils.triggerMask(iAlgo->first, error);
144  L1GtObject tObject = Mu; // Initial dummy value
145  unsigned int tQuality = 0; // Only aplicable to Muons
146  unsigned int tEtaRange = 0;
147 
148  // Objects associated
149  bool isMu = false;
150  bool isNoIsoEG = false;
151  bool isIsoEG = false;
152  bool isCenJet = false;
153  bool isForJet = false;
154  bool isTauJet = false;
155  bool isETM = false;
156  bool isETT = false;
157  bool isHTT = false;
158  bool isHTM = false;
159 
160  // Check if the trigger is masked
161  if (tAlgoMask != 0) {
162  algoIsValid = false;
163  } else {
164  const L1GtAlgorithm* pAlgo = &(iAlgo->second);
165 
166  for (unsigned int i = 0; i < pAlgo->algoRpnVector().size(); i++) {
167  // Algorithm cannot be single algo if it requires 2 simultaneous conditions
168  // FIXME: Should be improved to be sure one of the conditions is not technical (ex: BPTX)
169  if (pAlgo->algoRpnVector()[i].operation == L1GtLogicParser::OP_AND) {
170  algoIsValid = false;
171  break;
172  } else if (pAlgo->algoRpnVector()[i].operation == L1GtLogicParser::OP_OPERAND) {
173  string AlgoCondition = pAlgo->algoRpnVector()[i].operand;
174  map<string, SingleObjectCondition>::const_iterator ciCond = myConditions.find(AlgoCondition);
175 
176  // If there is no matching condition (i.e. its not a single object or energy sum condition)
177  // ignore this this L1 algo
178  if (ciCond == myConditions.end()) {
179  algoIsValid = false;
180  break;
181  }
182  // If trigger was not invalidated by this condition we register its objects and threshold
183  else {
184  // Updating value for the object with the maximum threshold for this triger
185  if (maxThreshold < (*ciCond).second.threshold) {
186  maxThreshold = (*ciCond).second.threshold;
187  tObject = (*ciCond).second.object;
188  tQuality = (*ciCond).second.quality;
189  tEtaRange = (*ciCond).second.etaRange;
190  }
191 
192  if ((*ciCond).second.object == Mu) {
193  isMu = true;
194  } else if ((*ciCond).second.object == NoIsoEG) {
195  isNoIsoEG = true;
196  } else if ((*ciCond).second.object == IsoEG) {
197  isIsoEG = true;
198  } else if ((*ciCond).second.object == CenJet) {
199  isCenJet = true;
200  } else if ((*ciCond).second.object == ForJet) {
201  isForJet = true;
202  } else if ((*ciCond).second.object == TauJet) {
203  isTauJet = true;
204  } else if ((*ciCond).second.object == ETM) {
205  isETM = true;
206  } else if ((*ciCond).second.object == ETT) {
207  isETT = true;
208  } else if ((*ciCond).second.object == HTT) {
209  isHTT = true;
210  } else if ((*ciCond).second.object == HTM) {
211  isHTM = true;
212  }
213  }
214  }
215  }
216  }
217 
218  if (algoIsValid) {
219  SingleObjectTrigger tTrigger;
220  tTrigger.alias = iAlgo->first;
221  tTrigger.bit = (iAlgo->second).algoBitNumber();
222  tTrigger.prescale = refPrescaleFactors[tTrigger.bit];
223  tTrigger.threshold = maxThreshold;
224  tTrigger.object = tObject;
225  tTrigger.quality = tQuality; // Only aplicable to Muons
226  tTrigger.etaRange = tEtaRange; // Only aplicable to EG and Muons
227 
228  // Counting the number of different trigger conditions
229  int nCond = 0;
230  if (isMu) {
231  nCond++;
232  }
233  if (isNoIsoEG) {
234  nCond++;
235  }
236  if (isIsoEG) {
237  nCond++;
238  }
239  if (isCenJet) {
240  nCond++;
241  }
242  if (isForJet) {
243  nCond++;
244  }
245  if (isTauJet) {
246  nCond++;
247  }
248  if (isETM) {
249  nCond++;
250  }
251  if (isETT) {
252  nCond++;
253  }
254  if (isHTT) {
255  nCond++;
256  }
257  if (isHTM) {
258  nCond++;
259  }
260 
261  // If the trigger matched one of the pre-defined categories it is added to
262  // the corresponding trigger vector
263  if (nCond == 1 && isMu == true) {
264  //TODO: tTrigger.etaRange
265  m_vTrigMu.push_back(tTrigger);
266  } else if (nCond == 2 && isNoIsoEG == true && isIsoEG == true) {
267  m_vTrigEG.push_back(tTrigger);
268  } else if (nCond == 1 && isIsoEG == true) {
269  m_vTrigIsoEG.push_back(tTrigger);
270  } else if (nCond == 3 && isCenJet == true && isForJet == true && isTauJet == true) {
271  m_vTrigJet.push_back(tTrigger);
272  } else if (nCond == 1 && isCenJet == true) {
273  m_vTrigCenJet.push_back(tTrigger);
274  } else if (nCond == 1 && isForJet == true) {
275  m_vTrigForJet.push_back(tTrigger);
276  } else if (nCond == 1 && isTauJet == true) {
277  m_vTrigTauJet.push_back(tTrigger);
278  } else if (nCond == 1 && isETT == true) {
279  m_vTrigETT.push_back(tTrigger);
280  } else if (nCond == 1 && isETM == true) {
281  m_vTrigETM.push_back(tTrigger);
282  } else if (nCond == 1 && isHTT == true) {
283  m_vTrigHTT.push_back(tTrigger);
284  } else if (nCond == 1 && isHTM == true) {
285  m_vTrigHTM.push_back(tTrigger);
286  }
287  }
288  }
289 
290  //--------------------------------------------------------------------------------------
291  // Now that we have built vectors of SingleObjectTrigger by category we can select for
292  // each category the lowest unprescaled single object trigger.
293  // NOTE: Since it is not guaranteed that all categories will have at least one unprescaled
294  // trigger this method will return in that case the lowest prescale trigger available
295  //--------------------------------------------------------------------------------------
296 
297  string selTrigMu = "Undefined";
298  string selTrigEG = "Undefined";
299  string selTrigIsoEG = "Undefined";
300  string selTrigJet = "Undefined";
301  string selTrigCenJet = "Undefined";
302  string selTrigForJet = "Undefined";
303  string selTrigTauJet = "Undefined";
304  string selTrigETT = "Undefined";
305  string selTrigETM = "Undefined";
306  string selTrigHTT = "Undefined";
307  string selTrigHTM = "Undefined";
308 
309  if (!m_vTrigMu.empty()) {
310  sort(m_vTrigMu.begin(), m_vTrigMu.end());
311  selTrigMu = m_vTrigMu[0].alias;
312  }
313  if (!m_vTrigEG.empty()) {
314  sort(m_vTrigEG.begin(), m_vTrigEG.end());
315  selTrigEG = m_vTrigEG[0].alias;
316  }
317  if (!m_vTrigIsoEG.empty()) {
318  sort(m_vTrigIsoEG.begin(), m_vTrigIsoEG.end());
319  selTrigIsoEG = m_vTrigIsoEG[0].alias;
320  }
321  if (!m_vTrigJet.empty()) {
322  sort(m_vTrigJet.begin(), m_vTrigJet.end());
323  selTrigJet = m_vTrigJet[0].alias;
324  }
325  if (!m_vTrigCenJet.empty()) {
326  sort(m_vTrigCenJet.begin(), m_vTrigCenJet.end());
327  selTrigCenJet = m_vTrigCenJet[0].alias;
328  }
329  if (!m_vTrigForJet.empty()) {
330  sort(m_vTrigForJet.begin(), m_vTrigForJet.end());
331  selTrigForJet = m_vTrigForJet[0].alias;
332  }
333  if (!m_vTrigTauJet.empty()) {
334  sort(m_vTrigTauJet.begin(), m_vTrigTauJet.end());
335  selTrigTauJet = m_vTrigTauJet[0].alias;
336  }
337  if (!m_vTrigETT.empty()) {
338  sort(m_vTrigETT.begin(), m_vTrigETT.end());
339  selTrigETT = m_vTrigETT[0].alias;
340  }
341  if (!m_vTrigETM.empty()) {
342  sort(m_vTrigETM.begin(), m_vTrigETM.end());
343  selTrigETM = m_vTrigETM[0].alias;
344  }
345  if (!m_vTrigHTT.empty()) {
346  sort(m_vTrigHTT.begin(), m_vTrigHTT.end());
347  selTrigHTT = m_vTrigHTT[0].alias;
348  }
349  if (!m_vTrigHTM.empty()) {
350  sort(m_vTrigHTM.begin(), m_vTrigHTM.end());
351  selTrigHTM = m_vTrigHTM[0].alias;
352  }
353 
354  auto check = [](const map<string, bool>& cats, const char* key) -> bool {
355  auto it = cats.find(key);
356  if (it != cats.end())
357  return it->second;
358 
359  return false;
360  };
361 
362  if (check(iCategories, "Mu")) {
363  out["Mu"] = selTrigMu;
364  }
365  if (check(iCategories, "EG")) {
366  out["EG"] = selTrigEG;
367  }
368  if (check(iCategories, "IsoEG")) {
369  out["IsoEG"] = selTrigIsoEG;
370  }
371  if (check(iCategories, "Jet")) {
372  out["Jet"] = selTrigJet;
373  }
374  if (check(iCategories, "CenJet")) {
375  out["CenJet"] = selTrigCenJet;
376  }
377  if (check(iCategories, "ForJet")) {
378  out["ForJet"] = selTrigForJet;
379  }
380  if (check(iCategories, "TauJet")) {
381  out["TauJet"] = selTrigTauJet;
382  }
383  if (check(iCategories, "ETT")) {
384  out["ETT"] = selTrigETT;
385  }
386  if (check(iCategories, "ETM")) {
387  out["ETM"] = selTrigETM;
388  }
389  if (check(iCategories, "HTT")) {
390  out["HTT"] = selTrigHTT;
391  }
392  if (check(iCategories, "HTM")) {
393  out["HTM"] = selTrigHTM;
394  }
395 
396  return out;
397 }

References a, L1GtAlgorithm::algoRpnVector(), SingleObjectTrigger::alias, b, SingleObjectTrigger::bit, CenJet, edm::check(), L1GtCondition::condCategory(), SingleObjectCondition::conditionCategory, SingleObjectCondition::conditionType, L1GtCondition::condName(), L1GtCondition::condType(), relativeConstraints::error, SingleObjectCondition::etaRange, SingleObjectTrigger::etaRange, generateTowerEtThresholdLUT::etaRange, ETM, ETT, ForJet, HTM, HTT, mps_fire::i, jets_cff::isMu, IsoEG, crabWrapper::key, HLT_2018_cff::maxThreshold, Mu, SingleObjectCondition::name, NoIsoEG, L1GtCondition::nrObjects(), SingleObjectCondition::object, SingleObjectTrigger::object, L1GtMuonTemplate::objectParameter(), L1GtCondition::objectType(), L1GtLogicParser::OP_AND, L1GtLogicParser::OP_OPERAND, MillePedeFileConverter_cfg::out, SingleObjectTrigger::prescale, SingleObjectCondition::quality, SingleObjectTrigger::quality, TauJet, SingleObjectCondition::threshold, SingleObjectTrigger::threshold, L1GtUtils::triggerMask(), Type1s, TypeETM, TypeETT, TypeHTM, and TypeHTT.

Referenced by L1TRate_Offline::bookHistograms(), L1TRate::bookHistograms(), L1TSync::bookHistograms(), and L1TSync_Offline::bookHistograms().

◆ getPrescaleByAlias()

int L1TMenuHelper::getPrescaleByAlias ( const TString &  iCategory,
const TString &  iAlias 
)

Definition at line 604 of file L1TMenuHelper.cc.

604  {
605  int out = -1;
606 
607  if (iCategory == "Mu") {
608  for (unsigned int i = 0; i < m_vTrigMu.size(); i++) {
609  if (m_vTrigMu[i].alias == iAlias) {
610  return m_vTrigMu[i].prescale;
611  }
612  }
613  } else if (iCategory == "EG") {
614  for (unsigned int i = 0; i < m_vTrigEG.size(); i++) {
615  if (m_vTrigEG[i].alias == iAlias) {
616  return m_vTrigEG[i].prescale;
617  }
618  }
619  } else if (iCategory == "IsoEG") {
620  for (unsigned int i = 0; i < m_vTrigIsoEG.size(); i++) {
621  if (m_vTrigIsoEG[i].alias == iAlias) {
622  return m_vTrigIsoEG[i].prescale;
623  }
624  }
625  } else if (iCategory == "Jet") {
626  for (unsigned int i = 0; i < m_vTrigJet.size(); i++) {
627  if (m_vTrigJet[i].alias == iAlias) {
628  return m_vTrigJet[i].prescale;
629  }
630  }
631  } else if (iCategory == "CenJet") {
632  for (unsigned int i = 0; i < m_vTrigCenJet.size(); i++) {
633  if (m_vTrigCenJet[i].alias == iAlias) {
634  return m_vTrigCenJet[i].prescale;
635  }
636  }
637  } else if (iCategory == "ForJet") {
638  for (unsigned int i = 0; i < m_vTrigForJet.size(); i++) {
639  if (m_vTrigForJet[i].alias == iAlias) {
640  return m_vTrigForJet[i].prescale;
641  }
642  }
643  } else if (iCategory == "TauJet") {
644  for (unsigned int i = 0; i < m_vTrigTauJet.size(); i++) {
645  if (m_vTrigTauJet[i].alias == iAlias) {
646  return m_vTrigTauJet[i].prescale;
647  }
648  }
649  } else if (iCategory == "ETT") {
650  for (unsigned int i = 0; i < m_vTrigETT.size(); i++) {
651  if (m_vTrigETT[i].alias == iAlias) {
652  return m_vTrigETT[i].prescale;
653  }
654  }
655  } else if (iCategory == "ETM") {
656  for (unsigned int i = 0; i < m_vTrigETM.size(); i++) {
657  if (m_vTrigETM[i].alias == iAlias) {
658  return m_vTrigETM[i].prescale;
659  }
660  }
661  } else if (iCategory == "HTT") {
662  for (unsigned int i = 0; i < m_vTrigHTT.size(); i++) {
663  if (m_vTrigHTT[i].alias == iAlias) {
664  return m_vTrigHTT[i].prescale;
665  }
666  }
667  } else if (iCategory == "HTM") {
668  for (unsigned int i = 0; i < m_vTrigHTM.size(); i++) {
669  if (m_vTrigHTM[i].alias == iAlias) {
670  return m_vTrigHTM[i].prescale;
671  }
672  }
673  }
674 
675  return out;
676 }

References SiStripOfflineCRack_cfg::alias, mps_fire::i, and MillePedeFileConverter_cfg::out.

Referenced by L1TRate_Offline::bookHistograms(), and L1TRate::bookHistograms().

◆ getQualityAlias()

unsigned int L1TMenuHelper::getQualityAlias ( const TString &  iCategory,
const TString &  iAlias 
)

Definition at line 754 of file L1TMenuHelper.cc.

754  {
755  unsigned int out = -1;
756 
757  if (iCategory == "Mu") {
758  for (unsigned int i = 0; i < m_vTrigMu.size(); i++) {
759  if (m_vTrigMu[i].alias == iAlias) {
760  return m_vTrigMu[i].quality;
761  }
762  }
763  } else if (iCategory == "EG") {
764  for (unsigned int i = 0; i < m_vTrigEG.size(); i++) {
765  if (m_vTrigEG[i].alias == iAlias) {
766  return m_vTrigEG[i].quality;
767  }
768  }
769  } else if (iCategory == "IsoEG") {
770  for (unsigned int i = 0; i < m_vTrigIsoEG.size(); i++) {
771  if (m_vTrigIsoEG[i].alias == iAlias) {
772  return m_vTrigIsoEG[i].quality;
773  }
774  }
775  } else if (iCategory == "Jet") {
776  for (unsigned int i = 0; i < m_vTrigJet.size(); i++) {
777  if (m_vTrigJet[i].alias == iAlias) {
778  return m_vTrigJet[i].quality;
779  }
780  }
781  } else if (iCategory == "CenJet") {
782  for (unsigned int i = 0; i < m_vTrigCenJet.size(); i++) {
783  if (m_vTrigCenJet[i].alias == iAlias) {
784  return m_vTrigCenJet[i].quality;
785  }
786  }
787  } else if (iCategory == "ForJet") {
788  for (unsigned int i = 0; i < m_vTrigForJet.size(); i++) {
789  if (m_vTrigForJet[i].alias == iAlias) {
790  return m_vTrigForJet[i].quality;
791  }
792  }
793  } else if (iCategory == "TauJet") {
794  for (unsigned int i = 0; i < m_vTrigTauJet.size(); i++) {
795  if (m_vTrigTauJet[i].alias == iAlias) {
796  return m_vTrigTauJet[i].quality;
797  }
798  }
799  } else if (iCategory == "ETT") {
800  for (unsigned int i = 0; i < m_vTrigETT.size(); i++) {
801  if (m_vTrigETT[i].alias == iAlias) {
802  return m_vTrigETT[i].quality;
803  }
804  }
805  } else if (iCategory == "ETM") {
806  for (unsigned int i = 0; i < m_vTrigETM.size(); i++) {
807  if (m_vTrigETM[i].alias == iAlias) {
808  return m_vTrigETM[i].quality;
809  }
810  }
811  } else if (iCategory == "HTT") {
812  for (unsigned int i = 0; i < m_vTrigHTT.size(); i++) {
813  if (m_vTrigHTT[i].alias == iAlias) {
814  return m_vTrigHTT[i].quality;
815  }
816  }
817  } else if (iCategory == "HTM") {
818  for (unsigned int i = 0; i < m_vTrigHTM.size(); i++) {
819  if (m_vTrigHTM[i].alias == iAlias) {
820  return m_vTrigHTM[i].quality;
821  }
822  }
823  }
824 
825  return out;
826 }

References SiStripOfflineCRack_cfg::alias, mps_fire::i, and MillePedeFileConverter_cfg::out.

Referenced by L1TRate_Offline::bookHistograms(), and L1TRate::bookHistograms().

◆ testAlgos()

map< string, string > L1TMenuHelper::testAlgos ( const std::map< std::string, std::string > &  )

Definition at line 399 of file L1TMenuHelper.cc.

399  {
400  map<string, string> iAlgos = _iAlgos;
401  // Getting information from the menu
402  const AlgorithmMap* theAlgoMap = &m_l1GtMenu->gtAlgorithmAliasMap();
403 
404  for (map<string, string>::const_iterator i = iAlgos.begin(); iAlgos.end() != i; i++) {
405  string tCategory = (*i).first;
406  string tTrigger = (*i).second;
407 
408  if (tTrigger.empty()) {
409  iAlgos[tCategory] = "Undefined";
410  } else {
411  if (theAlgoMap->find(tTrigger) == theAlgoMap->end()) {
412  iAlgos[tCategory] = "Undefined (Wrong Name)";
413  }
414  }
415  }
416 
417  return iAlgos;
418 }

References mps_fire::i.

Referenced by L1TSync::bookHistograms(), and L1TSync_Offline::bookHistograms().

Member Data Documentation

◆ l1GtPfAlgo

edm::ESHandle<L1GtPrescaleFactors> L1TMenuHelper::l1GtPfAlgo
private

Definition at line 102 of file L1TMenuHelper.h.

◆ m_l1GtMenu

const L1GtTriggerMenu* L1TMenuHelper::m_l1GtMenu
private

Definition at line 104 of file L1TMenuHelper.h.

◆ m_prescaleFactorsAlgoTrig

const std::vector<std::vector<int> >* L1TMenuHelper::m_prescaleFactorsAlgoTrig
private

Definition at line 105 of file L1TMenuHelper.h.

◆ m_vTrigCenJet

std::vector<SingleObjectTrigger> L1TMenuHelper::m_vTrigCenJet
private

Definition at line 112 of file L1TMenuHelper.h.

◆ m_vTrigEG

std::vector<SingleObjectTrigger> L1TMenuHelper::m_vTrigEG
private

Definition at line 109 of file L1TMenuHelper.h.

◆ m_vTrigETM

std::vector<SingleObjectTrigger> L1TMenuHelper::m_vTrigETM
private

Definition at line 115 of file L1TMenuHelper.h.

◆ m_vTrigETT

std::vector<SingleObjectTrigger> L1TMenuHelper::m_vTrigETT
private

Definition at line 116 of file L1TMenuHelper.h.

◆ m_vTrigForJet

std::vector<SingleObjectTrigger> L1TMenuHelper::m_vTrigForJet
private

Definition at line 113 of file L1TMenuHelper.h.

◆ m_vTrigHTM

std::vector<SingleObjectTrigger> L1TMenuHelper::m_vTrigHTM
private

Definition at line 118 of file L1TMenuHelper.h.

◆ m_vTrigHTT

std::vector<SingleObjectTrigger> L1TMenuHelper::m_vTrigHTT
private

Definition at line 117 of file L1TMenuHelper.h.

◆ m_vTrigIsoEG

std::vector<SingleObjectTrigger> L1TMenuHelper::m_vTrigIsoEG
private

Definition at line 110 of file L1TMenuHelper.h.

◆ m_vTrigJet

std::vector<SingleObjectTrigger> L1TMenuHelper::m_vTrigJet
private

Definition at line 111 of file L1TMenuHelper.h.

◆ m_vTrigMu

std::vector<SingleObjectTrigger> L1TMenuHelper::m_vTrigMu
private

Definition at line 108 of file L1TMenuHelper.h.

◆ m_vTrigTauJet

std::vector<SingleObjectTrigger> L1TMenuHelper::m_vTrigTauJet
private

Definition at line 114 of file L1TMenuHelper.h.

◆ menuRcd

edm::ESHandle<L1GtTriggerMenu> L1TMenuHelper::menuRcd
private

Definition at line 101 of file L1TMenuHelper.h.

TypeHTT
Definition: L1GtDefinitions.h:101
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
L1TMenuHelper::m_vTrigForJet
std::vector< SingleObjectTrigger > m_vTrigForJet
Definition: L1TMenuHelper.h:113
CondCastor
Definition: L1GtDefinitions.h:128
TypeHfRingEtSums
Definition: L1GtDefinitions.h:106
TypeExternal
Definition: L1GtDefinitions.h:108
L1GtLogicParser::OP_AND
Definition: L1GtLogicParser.h:42
HTM
Definition: L1GtObject.h:38
SingleObjectCondition::object
L1GtObject object
Definition: L1TMenuHelper.h:40
mps_fire.i
i
Definition: mps_fire.py:355
CondEnergySum
Definition: L1GtDefinitions.h:125
GtExternal
Definition: L1GtObject.h:45
L1GtPrescaleFactors
Definition: L1GtPrescaleFactors.h:32
Type4s
Definition: L1GtDefinitions.h:98
HLT_2018_cff.maxThreshold
maxThreshold
Definition: HLT_2018_cff.py:7191
L1GtCondition::nrObjects
const int nrObjects() const
get number of trigger objects
Definition: L1GtCondition.cc:62
L1GtEnergySumTemplate
Definition: L1GtEnergySumTemplate.h:34
generateTowerEtThresholdLUT.etaRange
etaRange
Definition: generateTowerEtThresholdLUT.py:55
L1GtCondition::condType
const L1GtConditionType & condType() const
get / set the type of the condition (1s, etc)
Definition: L1GtCondition.h:62
ETM
Definition: L1GtObject.h:35
Castor
Definition: L1GtObject.h:43
TypeJetCounts
Definition: L1GtDefinitions.h:103
Type2s
Definition: L1GtDefinitions.h:94
L1GtPrescaleFactors::gtPrescaleFactors
const std::vector< std::vector< int > > & gtPrescaleFactors() const
get the prescale factors by reference
Definition: L1GtPrescaleFactors.h:45
L1TMenuHelper::m_prescaleFactorsAlgoTrig
const std::vector< std::vector< int > > * m_prescaleFactorsAlgoTrig
Definition: L1TMenuHelper.h:105
L1TMenuHelper::m_vTrigCenJet
std::vector< SingleObjectTrigger > m_vTrigCenJet
Definition: L1TMenuHelper.h:112
SingleObjectTrigger::bit
unsigned int bit
Definition: L1TMenuHelper.h:50
L1GtMuonTemplate::objectParameter
const std::vector< ObjectParameter > * objectParameter() const
Definition: L1GtMuonTemplate.h:85
L1TMenuHelper::m_vTrigHTM
std::vector< SingleObjectTrigger > m_vTrigHTM
Definition: L1TMenuHelper.h:118
NoIsoEG
Definition: L1GtObject.h:30
L1GtCondition::objectType
const std::vector< L1GtObject > & objectType() const
get / set the trigger object type(s) in the condition
Definition: L1GtCondition.h:67
L1TMenuHelper::m_vTrigEG
std::vector< SingleObjectTrigger > m_vTrigEG
Definition: L1TMenuHelper.h:109
L1GtTriggerMenu::vecCaloTemplate
const std::vector< std::vector< L1GtCaloTemplate > > & vecCaloTemplate() const
Definition: L1GtTriggerMenu.h:111
IsoEG
Definition: L1GtObject.h:31
relativeConstraints.error
error
Definition: relativeConstraints.py:53
Type3s
Definition: L1GtDefinitions.h:97
SingleObjectCondition::name
std::string name
Definition: L1TMenuHelper.h:37
CondExternal
Definition: L1GtDefinitions.h:132
CondCorrelation
Definition: L1GtDefinitions.h:127
L1TMenuHelper::m_vTrigHTT
std::vector< SingleObjectTrigger > m_vTrigHTT
Definition: L1TMenuHelper.h:117
SingleObjectTrigger::threshold
unsigned int threshold
Definition: L1TMenuHelper.h:52
RPCNoise_example.check
check
Definition: RPCNoise_example.py:71
SingleObjectTrigger::prescale
int prescale
Definition: L1TMenuHelper.h:51
Type2cor
Definition: L1GtDefinitions.h:96
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
CItAlgo
AlgorithmMap::const_iterator CItAlgo
iterators through map containing the algorithms
Definition: L1GtTriggerMenuFwd.h:38
HTT
Definition: L1GtObject.h:37
HfBitCounts
Definition: L1GtObject.h:40
L1GtTriggerMenuRcd
Definition: L1GtTriggerMenuRcd.h:32
HfRingEtSums
Definition: L1GtObject.h:41
CondMuon
Definition: L1GtDefinitions.h:123
AlgorithmMap
std::map< std::string, L1GtAlgorithm > AlgorithmMap
map containing the algorithms
Definition: L1GtTriggerMenuFwd.h:31
L1TMenuHelper::m_l1GtMenu
const L1GtTriggerMenu * m_l1GtMenu
Definition: L1TMenuHelper.h:104
CenJet
Definition: L1GtObject.h:32
CaloCondition
L1GtCondition::condCategory
const L1GtConditionCategory & condCategory() const
get / set the category of the condition
Definition: L1GtCondition.h:57
TypeETT
Definition: L1GtDefinitions.h:100
Type2wsc
Definition: L1GtDefinitions.h:95
b
double b
Definition: hdecay.h:118
CondCalo
Definition: L1GtDefinitions.h:124
TechTrig
Definition: L1GtObject.h:42
SingleObjectTrigger
Definition: L1TMenuHelper.h:47
CondNull
Definition: L1GtDefinitions.h:122
L1TMenuHelper::m_vTrigETM
std::vector< SingleObjectTrigger > m_vTrigETM
Definition: L1TMenuHelper.h:115
CondJetCounts
Definition: L1GtDefinitions.h:126
L1TMenuHelper::m_vTrigMu
std::vector< SingleObjectTrigger > m_vTrigMu
Definition: L1TMenuHelper.h:108
TypeBptx
Definition: L1GtDefinitions.h:107
TauJet
Definition: L1GtObject.h:34
SingleObjectTrigger::alias
std::string alias
Definition: L1TMenuHelper.h:49
L1TMenuHelper::m_vTrigJet
std::vector< SingleObjectTrigger > m_vTrigJet
Definition: L1TMenuHelper.h:111
a
double a
Definition: hdecay.h:119
L1GtAlgorithm
Definition: L1GtAlgorithm.h:32
L1GtTriggerMenu::vecEnergySumTemplate
const std::vector< std::vector< L1GtEnergySumTemplate > > & vecEnergySumTemplate() const
Definition: L1GtTriggerMenu.h:116
EnergySumCondition
L1GtCaloTemplate
Definition: L1GtCaloTemplate.h:34
TypeHfBitCounts
Definition: L1GtDefinitions.h:105
TypeCastor
Definition: L1GtDefinitions.h:104
L1GtAlgorithm::algoRpnVector
const std::vector< L1GtLogicParser::TokenRPN > & algoRpnVector() const
return the RPN vector
Definition: L1GtAlgorithm.h:69
SingleObjectCondition::etaRange
unsigned int etaRange
Definition: L1TMenuHelper.h:42
L1TMenuHelper::m_vTrigIsoEG
std::vector< SingleObjectTrigger > m_vTrigIsoEG
Definition: L1TMenuHelper.h:110
L1GtLogicParser::OP_OPERAND
Definition: L1GtLogicParser.h:45
ETT
Definition: L1GtObject.h:36
TypeHTM
Definition: L1GtDefinitions.h:102
L1GtTriggerMenu::gtAlgorithmAliasMap
const AlgorithmMap & gtAlgorithmAliasMap() const
get / set the algorithm map (by alias)
Definition: L1GtTriggerMenu.h:192
CondHfBitCounts
Definition: L1GtDefinitions.h:129
SingleObjectTrigger::object
L1GtObject object
Definition: L1TMenuHelper.h:48
get
#define get
L1TMenuHelper::m_vTrigTauJet
std::vector< SingleObjectTrigger > m_vTrigTauJet
Definition: L1TMenuHelper.h:114
SingleObjectCondition::conditionCategory
L1GtConditionCategory conditionCategory
Definition: L1TMenuHelper.h:38
L1TMenuHelper::m_vTrigETT
std::vector< SingleObjectTrigger > m_vTrigETT
Definition: L1TMenuHelper.h:116
CondBptx
Definition: L1GtDefinitions.h:131
Mu
Definition: L1GtObject.h:29
SingleObjectTrigger::etaRange
unsigned int etaRange
Definition: L1TMenuHelper.h:54
L1TMenuHelper::l1GtPfAlgo
edm::ESHandle< L1GtPrescaleFactors > l1GtPfAlgo
Definition: L1TMenuHelper.h:102
SiStripOfflineCRack_cfg.alias
alias
Definition: SiStripOfflineCRack_cfg.py:129
TypeETM
Definition: L1GtDefinitions.h:99
SingleObjectCondition
Definition: L1TMenuHelper.h:36
TypeNull
Definition: L1GtDefinitions.h:92
ForJet
Definition: L1GtObject.h:33
JetCounts
Definition: L1GtObject.h:39
CondHfRingEtSums
Definition: L1GtDefinitions.h:130
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
SingleObjectCondition::threshold
unsigned int threshold
Definition: L1TMenuHelper.h:43
SingleObjectCondition::conditionType
L1GtConditionType conditionType
Definition: L1TMenuHelper.h:39
BPTX
Definition: L1GtObject.h:44
L1TMenuHelper::menuRcd
edm::ESHandle< L1GtTriggerMenu > menuRcd
Definition: L1TMenuHelper.h:101
Type1s
Definition: L1GtDefinitions.h:93
L1GtPrescaleFactorsAlgoTrigRcd
Definition: L1GtPrescaleFactorsAlgoTrigRcd.h:38
SingleObjectCondition::quality
unsigned int quality
Definition: L1TMenuHelper.h:41
L1GtCondition::condName
const std::string & condName() const
get / set condition name
Definition: L1GtCondition.h:52
SingleObjectTrigger::quality
unsigned int quality
Definition: L1TMenuHelper.h:53
crabWrapper.key
key
Definition: crabWrapper.py:19
jets_cff.isMu
isMu
Definition: jets_cff.py:288
L1GtTriggerMenu::vecMuonTemplate
const std::vector< std::vector< L1GtMuonTemplate > > & vecMuonTemplate() const
get / set the vectors containing the conditions
Definition: L1GtTriggerMenu.h:106
L1GtObject
L1GtMuonTemplate
Definition: L1GtMuonTemplate.h:34