CMS 3D CMS Logo

L1TMenuHelper.cc
Go to the documentation of this file.
1 
2 /*
3  * \file L1TMenuHelper.cc
4  *
5  * \author J. Pela, P. Musella
6  *
7 */
8 
9 #include "TString.h"
10 
13 
15 
16 // L1Gt - Trigger Menu
20 
21 // L1Gt - Prescales
24 
25 // L1Gt - Masks
28 
30 
31 using namespace edm;
32 using namespace std;
33 
34 //-------------------------------------------------------------------------------------
35 //
36 //-------------------------------------------------------------------------------------
37 L1TMenuHelper::L1TMenuHelper(const edm::EventSetup& iSetup, const Tokens& tokens) {
38  m_l1GtMenu = &iSetup.getData(tokens.menu); // Getting the menu
39  m_prescaleFactorsAlgoTrig =
40  &(iSetup.getData(tokens.l1GtPfAlgo).gtPrescaleFactors()); // Retriving the list of prescale sets
41 }
42 
43 //-------------------------------------------------------------------------------------
44 //
45 //-------------------------------------------------------------------------------------
47 
48 //-------------------------------------------------------------------------------------
49 // Method: fetLUSOTrigger
50 // * Get Lowest Unprescaled Single Object Triggers and Energy Sums
51 //-------------------------------------------------------------------------------------
52 map<string, string> L1TMenuHelper::getLUSOTrigger(const map<string, bool>& iCategories,
53  int IndexRefPrescaleFactors,
54  L1GtUtils const& myUtils) {
55  map<string, string> out;
56 
57  // Getting information from the menu
58  const AlgorithmMap* theAlgoMap = &m_l1GtMenu->gtAlgorithmAliasMap();
59  const vector<vector<L1GtMuonTemplate> >* vMuonConditions = &m_l1GtMenu->vecMuonTemplate();
60  const vector<vector<L1GtCaloTemplate> >* vCaloConditions = &m_l1GtMenu->vecCaloTemplate();
61  const vector<vector<L1GtEnergySumTemplate> >* vEnergySumConditions = &m_l1GtMenu->vecEnergySumTemplate();
62 
63  // Getting reference prescales
64  const vector<int>& refPrescaleFactors = (*m_prescaleFactorsAlgoTrig).at(IndexRefPrescaleFactors);
65 
66  AlgorithmMap MyAlgos;
67 
68  map<string, SingleObjectCondition> myConditions;
69 
70  for (unsigned int a = 0; a < vMuonConditions->size(); a++) {
71  for (unsigned int b = 0; b < (*vMuonConditions)[a].size(); b++) {
72  const L1GtMuonTemplate* MuonCondition = &(*vMuonConditions)[a][b];
73 
74  // Selecting conditions that require single objects
75  if (MuonCondition->condType() == Type1s && MuonCondition->nrObjects() == 1) {
76  SingleObjectCondition tCondition;
77 
78  tCondition.name = MuonCondition->condName();
79  tCondition.conditionCategory = MuonCondition->condCategory();
80  tCondition.conditionType = MuonCondition->condType();
81  tCondition.object = MuonCondition->objectType()[0];
82  tCondition.threshold = (*MuonCondition->objectParameter())[0].ptHighThreshold;
83  tCondition.quality = (*MuonCondition->objectParameter())[0].qualityRange;
84  tCondition.etaRange = (*MuonCondition->objectParameter())[0].etaRange;
85 
86  myConditions[MuonCondition->condName()] = tCondition;
87  }
88  }
89  }
90 
91  for (unsigned int a = 0; a < vCaloConditions->size(); a++) {
92  for (unsigned int b = 0; b < (*vCaloConditions)[a].size(); b++) {
93  const L1GtCaloTemplate* CaloCondition = &(*vCaloConditions)[a][b];
94 
95  if (CaloCondition->condType() == Type1s && CaloCondition->nrObjects() == 1) {
96  SingleObjectCondition tCondition;
97 
98  tCondition.name = CaloCondition->condName();
99  tCondition.conditionCategory = CaloCondition->condCategory();
100  tCondition.conditionType = CaloCondition->condType();
101  tCondition.object = CaloCondition->objectType()[0];
102  tCondition.threshold = (*CaloCondition->objectParameter())[0].etThreshold;
103  tCondition.quality = 0;
104  tCondition.etaRange = (*CaloCondition->objectParameter())[0].etaRange;
105 
106  myConditions[CaloCondition->condName()] = tCondition;
107  }
108  }
109  }
110 
111  for (unsigned int a = 0; a < vEnergySumConditions->size(); a++) {
112  for (unsigned int b = 0; b < (*vEnergySumConditions)[a].size(); b++) {
113  const L1GtEnergySumTemplate* EnergySumCondition = &(*vEnergySumConditions)[a][b];
114 
115  if ((EnergySumCondition->condType() == TypeETT || EnergySumCondition->condType() == TypeETM ||
116  EnergySumCondition->condType() == TypeHTT || EnergySumCondition->condType() == TypeHTM) &&
117  EnergySumCondition->nrObjects() == 1) {
118  SingleObjectCondition tCondition;
119 
120  tCondition.name = EnergySumCondition->condName();
121  tCondition.conditionCategory = EnergySumCondition->condCategory();
122  tCondition.conditionType = EnergySumCondition->condType();
123  tCondition.object = EnergySumCondition->objectType()[0];
124  tCondition.threshold = (*EnergySumCondition->objectParameter())[0].etThreshold;
125  tCondition.quality = 0;
126  tCondition.etaRange = 0;
127 
128  myConditions[EnergySumCondition->condName()] = tCondition;
129  }
130  }
131  }
132 
133  for (CItAlgo iAlgo = theAlgoMap->begin(); iAlgo != theAlgoMap->end(); ++iAlgo) {
134  int error;
135 
136  bool algoIsValid = true;
137  unsigned int maxThreshold = 0;
138  int tAlgoMask = myUtils.triggerMask(iAlgo->first, error);
139  L1GtObject tObject = Mu; // Initial dummy value
140  unsigned int tQuality = 0; // Only aplicable to Muons
141  unsigned int tEtaRange = 0;
142 
143  // Objects associated
144  bool isMu = false;
145  bool isNoIsoEG = false;
146  bool isIsoEG = false;
147  bool isCenJet = false;
148  bool isForJet = false;
149  bool isTauJet = false;
150  bool isETM = false;
151  bool isETT = false;
152  bool isHTT = false;
153  bool isHTM = false;
154 
155  // Check if the trigger is masked
156  if (tAlgoMask != 0) {
157  algoIsValid = false;
158  } else {
159  const L1GtAlgorithm* pAlgo = &(iAlgo->second);
160 
161  for (unsigned int i = 0; i < pAlgo->algoRpnVector().size(); i++) {
162  // Algorithm cannot be single algo if it requires 2 simultaneous conditions
163  // FIXME: Should be improved to be sure one of the conditions is not technical (ex: BPTX)
164  if (pAlgo->algoRpnVector()[i].operation == L1GtLogicParser::OP_AND) {
165  algoIsValid = false;
166  break;
167  } else if (pAlgo->algoRpnVector()[i].operation == L1GtLogicParser::OP_OPERAND) {
168  string AlgoCondition = pAlgo->algoRpnVector()[i].operand;
169  map<string, SingleObjectCondition>::const_iterator ciCond = myConditions.find(AlgoCondition);
170 
171  // If there is no matching condition (i.e. its not a single object or energy sum condition)
172  // ignore this this L1 algo
173  if (ciCond == myConditions.end()) {
174  algoIsValid = false;
175  break;
176  }
177  // If trigger was not invalidated by this condition we register its objects and threshold
178  else {
179  // Updating value for the object with the maximum threshold for this triger
180  if (maxThreshold < (*ciCond).second.threshold) {
181  maxThreshold = (*ciCond).second.threshold;
182  tObject = (*ciCond).second.object;
183  tQuality = (*ciCond).second.quality;
184  tEtaRange = (*ciCond).second.etaRange;
185  }
186 
187  if ((*ciCond).second.object == Mu) {
188  isMu = true;
189  } else if ((*ciCond).second.object == NoIsoEG) {
190  isNoIsoEG = true;
191  } else if ((*ciCond).second.object == IsoEG) {
192  isIsoEG = true;
193  } else if ((*ciCond).second.object == CenJet) {
194  isCenJet = true;
195  } else if ((*ciCond).second.object == ForJet) {
196  isForJet = true;
197  } else if ((*ciCond).second.object == TauJet) {
198  isTauJet = true;
199  } else if ((*ciCond).second.object == ETM) {
200  isETM = true;
201  } else if ((*ciCond).second.object == ETT) {
202  isETT = true;
203  } else if ((*ciCond).second.object == HTT) {
204  isHTT = true;
205  } else if ((*ciCond).second.object == HTM) {
206  isHTM = true;
207  }
208  }
209  }
210  }
211  }
212 
213  if (algoIsValid) {
214  SingleObjectTrigger tTrigger;
215  tTrigger.alias = iAlgo->first;
216  tTrigger.bit = (iAlgo->second).algoBitNumber();
217  tTrigger.prescale = refPrescaleFactors[tTrigger.bit];
218  tTrigger.threshold = maxThreshold;
219  tTrigger.object = tObject;
220  tTrigger.quality = tQuality; // Only aplicable to Muons
221  tTrigger.etaRange = tEtaRange; // Only aplicable to EG and Muons
222 
223  // Counting the number of different trigger conditions
224  int nCond = 0;
225  if (isMu) {
226  nCond++;
227  }
228  if (isNoIsoEG) {
229  nCond++;
230  }
231  if (isIsoEG) {
232  nCond++;
233  }
234  if (isCenJet) {
235  nCond++;
236  }
237  if (isForJet) {
238  nCond++;
239  }
240  if (isTauJet) {
241  nCond++;
242  }
243  if (isETM) {
244  nCond++;
245  }
246  if (isETT) {
247  nCond++;
248  }
249  if (isHTT) {
250  nCond++;
251  }
252  if (isHTM) {
253  nCond++;
254  }
255 
256  // If the trigger matched one of the pre-defined categories it is added to
257  // the corresponding trigger vector
258  if (nCond == 1 && isMu == true) {
259  //TODO: tTrigger.etaRange
260  m_vTrigMu.push_back(tTrigger);
261  } else if (nCond == 2 && isNoIsoEG == true && isIsoEG == true) {
262  m_vTrigEG.push_back(tTrigger);
263  } else if (nCond == 1 && isIsoEG == true) {
264  m_vTrigIsoEG.push_back(tTrigger);
265  } else if (nCond == 3 && isCenJet == true && isForJet == true && isTauJet == true) {
266  m_vTrigJet.push_back(tTrigger);
267  } else if (nCond == 1 && isCenJet == true) {
268  m_vTrigCenJet.push_back(tTrigger);
269  } else if (nCond == 1 && isForJet == true) {
270  m_vTrigForJet.push_back(tTrigger);
271  } else if (nCond == 1 && isTauJet == true) {
272  m_vTrigTauJet.push_back(tTrigger);
273  } else if (nCond == 1 && isETT == true) {
274  m_vTrigETT.push_back(tTrigger);
275  } else if (nCond == 1 && isETM == true) {
276  m_vTrigETM.push_back(tTrigger);
277  } else if (nCond == 1 && isHTT == true) {
278  m_vTrigHTT.push_back(tTrigger);
279  } else if (nCond == 1 && isHTM == true) {
280  m_vTrigHTM.push_back(tTrigger);
281  }
282  }
283  }
284 
285  //--------------------------------------------------------------------------------------
286  // Now that we have built vectors of SingleObjectTrigger by category we can select for
287  // each category the lowest unprescaled single object trigger.
288  // NOTE: Since it is not guaranteed that all categories will have at least one unprescaled
289  // trigger this method will return in that case the lowest prescale trigger available
290  //--------------------------------------------------------------------------------------
291 
292  string selTrigMu = "Undefined";
293  string selTrigEG = "Undefined";
294  string selTrigIsoEG = "Undefined";
295  string selTrigJet = "Undefined";
296  string selTrigCenJet = "Undefined";
297  string selTrigForJet = "Undefined";
298  string selTrigTauJet = "Undefined";
299  string selTrigETT = "Undefined";
300  string selTrigETM = "Undefined";
301  string selTrigHTT = "Undefined";
302  string selTrigHTM = "Undefined";
303 
304  if (!m_vTrigMu.empty()) {
305  sort(m_vTrigMu.begin(), m_vTrigMu.end());
306  selTrigMu = m_vTrigMu[0].alias;
307  }
308  if (!m_vTrigEG.empty()) {
309  sort(m_vTrigEG.begin(), m_vTrigEG.end());
310  selTrigEG = m_vTrigEG[0].alias;
311  }
312  if (!m_vTrigIsoEG.empty()) {
313  sort(m_vTrigIsoEG.begin(), m_vTrigIsoEG.end());
314  selTrigIsoEG = m_vTrigIsoEG[0].alias;
315  }
316  if (!m_vTrigJet.empty()) {
317  sort(m_vTrigJet.begin(), m_vTrigJet.end());
318  selTrigJet = m_vTrigJet[0].alias;
319  }
320  if (!m_vTrigCenJet.empty()) {
321  sort(m_vTrigCenJet.begin(), m_vTrigCenJet.end());
322  selTrigCenJet = m_vTrigCenJet[0].alias;
323  }
324  if (!m_vTrigForJet.empty()) {
325  sort(m_vTrigForJet.begin(), m_vTrigForJet.end());
326  selTrigForJet = m_vTrigForJet[0].alias;
327  }
328  if (!m_vTrigTauJet.empty()) {
329  sort(m_vTrigTauJet.begin(), m_vTrigTauJet.end());
330  selTrigTauJet = m_vTrigTauJet[0].alias;
331  }
332  if (!m_vTrigETT.empty()) {
333  sort(m_vTrigETT.begin(), m_vTrigETT.end());
334  selTrigETT = m_vTrigETT[0].alias;
335  }
336  if (!m_vTrigETM.empty()) {
337  sort(m_vTrigETM.begin(), m_vTrigETM.end());
338  selTrigETM = m_vTrigETM[0].alias;
339  }
340  if (!m_vTrigHTT.empty()) {
341  sort(m_vTrigHTT.begin(), m_vTrigHTT.end());
342  selTrigHTT = m_vTrigHTT[0].alias;
343  }
344  if (!m_vTrigHTM.empty()) {
345  sort(m_vTrigHTM.begin(), m_vTrigHTM.end());
346  selTrigHTM = m_vTrigHTM[0].alias;
347  }
348 
349  auto check = [](const map<string, bool>& cats, const char* key) -> bool {
350  auto it = cats.find(key);
351  if (it != cats.end())
352  return it->second;
353 
354  return false;
355  };
356 
357  if (check(iCategories, "Mu")) {
358  out["Mu"] = selTrigMu;
359  }
360  if (check(iCategories, "EG")) {
361  out["EG"] = selTrigEG;
362  }
363  if (check(iCategories, "IsoEG")) {
364  out["IsoEG"] = selTrigIsoEG;
365  }
366  if (check(iCategories, "Jet")) {
367  out["Jet"] = selTrigJet;
368  }
369  if (check(iCategories, "CenJet")) {
370  out["CenJet"] = selTrigCenJet;
371  }
372  if (check(iCategories, "ForJet")) {
373  out["ForJet"] = selTrigForJet;
374  }
375  if (check(iCategories, "TauJet")) {
376  out["TauJet"] = selTrigTauJet;
377  }
378  if (check(iCategories, "ETT")) {
379  out["ETT"] = selTrigETT;
380  }
381  if (check(iCategories, "ETM")) {
382  out["ETM"] = selTrigETM;
383  }
384  if (check(iCategories, "HTT")) {
385  out["HTT"] = selTrigHTT;
386  }
387  if (check(iCategories, "HTM")) {
388  out["HTM"] = selTrigHTM;
389  }
390 
391  return out;
392 }
393 
394 map<string, string> L1TMenuHelper::testAlgos(const map<string, string>& _iAlgos) {
395  map<string, string> iAlgos = _iAlgos;
396  // Getting information from the menu
397  const AlgorithmMap* theAlgoMap = &m_l1GtMenu->gtAlgorithmAliasMap();
398 
399  for (map<string, string>::const_iterator i = iAlgos.begin(); iAlgos.end() != i; i++) {
400  string tCategory = (*i).first;
401  string tTrigger = (*i).second;
402 
403  if (tTrigger.empty()) {
404  iAlgos[tCategory] = "Undefined";
405  } else {
406  if (theAlgoMap->find(tTrigger) == theAlgoMap->end()) {
407  iAlgos[tCategory] = "Undefined (Wrong Name)";
408  }
409  }
410  }
411 
412  return iAlgos;
413 }
414 
415 //-------------------------------------------------------------------------------------
416 // Method: enumToStringL1GtObject
417 // * Converts L1GtObject (enum) to string
418 //-------------------------------------------------------------------------------------
420  string out;
421 
422  switch (iObject) {
423  case Mu:
424  out = "Mu";
425  break;
426  case NoIsoEG:
427  out = "NoIsoEG";
428  break;
429  case IsoEG:
430  out = "IsoEG";
431  break;
432  case CenJet:
433  out = "CenJet";
434  break;
435  case ForJet:
436  out = "ForJet";
437  break;
438  case TauJet:
439  out = "TauJet";
440  break;
441  case ETM:
442  out = "ETM";
443  break;
444  case ETT:
445  out = "ETT";
446  break;
447  case HTT:
448  out = "HTT";
449  break;
450  case HTM:
451  out = "HTM";
452  break;
453  case JetCounts:
454  out = "JetCounts";
455  break;
456  case HfBitCounts:
457  out = "HfBitCounts";
458  break;
459  case HfRingEtSums:
460  out = "HfRingEtSums";
461  break;
462  case TechTrig:
463  out = "TechTrig";
464  break;
465  case Castor:
466  out = "Castor";
467  break;
468  case BPTX:
469  out = "BPTX";
470  break;
471  case GtExternal:
472  out = "GtExternal";
473  break;
474  default:
475  out = "Unknown";
476  break;
477  };
478 
479  return out;
480 }
481 
482 //-------------------------------------------------------------------------------------
483 // Method: enumToStringL1GtConditionType
484 // * Converts L1GtConditionType (enum) to string
485 //-------------------------------------------------------------------------------------
487  string out;
488 
489  switch (iConditionType) {
490  case TypeNull:
491  out = "TypeNull";
492  break;
493  case Type1s:
494  out = "Type1s";
495  break;
496  case Type2s:
497  out = "Type2s";
498  break;
499  case Type2wsc:
500  out = "Type2wsc";
501  break;
502  case Type2cor:
503  out = "Type2cor";
504  break;
505  case Type3s:
506  out = "Type3s";
507  break;
508  case Type4s:
509  out = "Type4s";
510  break;
511  case TypeETM:
512  out = "TypeETM";
513  break;
514  case TypeETT:
515  out = "TypeETT";
516  break;
517  case TypeHTT:
518  out = "TypeHTT";
519  break;
520  case TypeHTM:
521  out = "TypeHTM";
522  break;
523  case TypeJetCounts:
524  out = "TypeJetCounts";
525  break;
526  case TypeCastor:
527  out = "TypeCastor";
528  break;
529  case TypeHfBitCounts:
530  out = "TypeHfBitCounts";
531  break;
532  case TypeHfRingEtSums:
533  out = "TypeHfRingEtSums";
534  break;
535  case TypeBptx:
536  out = "TypeBptx";
537  break;
538  case TypeExternal:
539  out = "TypeExternal";
540  break;
541  default:
542  out = "Unknown";
543  break;
544  };
545 
546  return out;
547 }
548 
549 //__________________________________________________________________
550 // Method: enumToStringL1GtConditionCategory
551 // * Converts L1GtConditionCategory (enum) to string
552 //__________________________________________________________________
554  string out;
555 
556  switch (iConditionCategory) {
557  case CondNull:
558  out = "CondNull";
559  break;
560  case CondMuon:
561  out = "CondMuon";
562  break;
563  case CondCalo:
564  out = "CondCalo";
565  break;
566  case CondEnergySum:
567  out = "CondEnergySum";
568  break;
569  case CondJetCounts:
570  out = "CondJetCounts";
571  break;
572  case CondCorrelation:
573  out = "CondCorrelation";
574  break;
575  case CondCastor:
576  out = "CondCastor";
577  break;
578  case CondHfBitCounts:
579  out = "CondHfBitCounts";
580  break;
581  case CondHfRingEtSums:
582  out = "CondHfRingEtSums";
583  break;
584  case CondBptx:
585  out = "CondBptx";
586  break;
587  case CondExternal:
588  out = "CondExternal";
589  break;
590  default:
591  out = "Unknown";
592  break;
593  };
594 
595  return out;
596 }
597 
598 //__________________________________________________________________
599 int L1TMenuHelper::getPrescaleByAlias(const TString& iCategory, const TString& iAlias) {
600  int out = -1;
601 
602  if (iCategory == "Mu") {
603  for (unsigned int i = 0; i < m_vTrigMu.size(); i++) {
604  if (m_vTrigMu[i].alias == iAlias) {
605  return m_vTrigMu[i].prescale;
606  }
607  }
608  } else if (iCategory == "EG") {
609  for (unsigned int i = 0; i < m_vTrigEG.size(); i++) {
610  if (m_vTrigEG[i].alias == iAlias) {
611  return m_vTrigEG[i].prescale;
612  }
613  }
614  } else if (iCategory == "IsoEG") {
615  for (unsigned int i = 0; i < m_vTrigIsoEG.size(); i++) {
616  if (m_vTrigIsoEG[i].alias == iAlias) {
617  return m_vTrigIsoEG[i].prescale;
618  }
619  }
620  } else if (iCategory == "Jet") {
621  for (unsigned int i = 0; i < m_vTrigJet.size(); i++) {
622  if (m_vTrigJet[i].alias == iAlias) {
623  return m_vTrigJet[i].prescale;
624  }
625  }
626  } else if (iCategory == "CenJet") {
627  for (unsigned int i = 0; i < m_vTrigCenJet.size(); i++) {
628  if (m_vTrigCenJet[i].alias == iAlias) {
629  return m_vTrigCenJet[i].prescale;
630  }
631  }
632  } else if (iCategory == "ForJet") {
633  for (unsigned int i = 0; i < m_vTrigForJet.size(); i++) {
634  if (m_vTrigForJet[i].alias == iAlias) {
635  return m_vTrigForJet[i].prescale;
636  }
637  }
638  } else if (iCategory == "TauJet") {
639  for (unsigned int i = 0; i < m_vTrigTauJet.size(); i++) {
640  if (m_vTrigTauJet[i].alias == iAlias) {
641  return m_vTrigTauJet[i].prescale;
642  }
643  }
644  } else if (iCategory == "ETT") {
645  for (unsigned int i = 0; i < m_vTrigETT.size(); i++) {
646  if (m_vTrigETT[i].alias == iAlias) {
647  return m_vTrigETT[i].prescale;
648  }
649  }
650  } else if (iCategory == "ETM") {
651  for (unsigned int i = 0; i < m_vTrigETM.size(); i++) {
652  if (m_vTrigETM[i].alias == iAlias) {
653  return m_vTrigETM[i].prescale;
654  }
655  }
656  } else if (iCategory == "HTT") {
657  for (unsigned int i = 0; i < m_vTrigHTT.size(); i++) {
658  if (m_vTrigHTT[i].alias == iAlias) {
659  return m_vTrigHTT[i].prescale;
660  }
661  }
662  } else if (iCategory == "HTM") {
663  for (unsigned int i = 0; i < m_vTrigHTM.size(); i++) {
664  if (m_vTrigHTM[i].alias == iAlias) {
665  return m_vTrigHTM[i].prescale;
666  }
667  }
668  }
669 
670  return out;
671 }
672 
673 //__________________________________________________________________
674 unsigned int L1TMenuHelper::getEtaRangeByAlias(const TString& iCategory, const TString& iAlias) {
675  unsigned int out = -1;
676 
677  if (iCategory == "Mu") {
678  for (unsigned int i = 0; i < m_vTrigMu.size(); i++) {
679  if (m_vTrigMu[i].alias == iAlias) {
680  return m_vTrigMu[i].etaRange;
681  }
682  }
683  } else if (iCategory == "EG") {
684  for (unsigned int i = 0; i < m_vTrigEG.size(); i++) {
685  if (m_vTrigEG[i].alias == iAlias) {
686  return m_vTrigEG[i].etaRange;
687  }
688  }
689  } else if (iCategory == "IsoEG") {
690  for (unsigned int i = 0; i < m_vTrigIsoEG.size(); i++) {
691  if (m_vTrigIsoEG[i].alias == iAlias) {
692  return m_vTrigIsoEG[i].etaRange;
693  }
694  }
695  } else if (iCategory == "Jet") {
696  for (unsigned int i = 0; i < m_vTrigJet.size(); i++) {
697  if (m_vTrigJet[i].alias == iAlias) {
698  return m_vTrigJet[i].etaRange;
699  }
700  }
701  } else if (iCategory == "CenJet") {
702  for (unsigned int i = 0; i < m_vTrigCenJet.size(); i++) {
703  if (m_vTrigCenJet[i].alias == iAlias) {
704  return m_vTrigCenJet[i].etaRange;
705  }
706  }
707  } else if (iCategory == "ForJet") {
708  for (unsigned int i = 0; i < m_vTrigForJet.size(); i++) {
709  if (m_vTrigForJet[i].alias == iAlias) {
710  return m_vTrigForJet[i].etaRange;
711  }
712  }
713  } else if (iCategory == "TauJet") {
714  for (unsigned int i = 0; i < m_vTrigTauJet.size(); i++) {
715  if (m_vTrigTauJet[i].alias == iAlias) {
716  return m_vTrigTauJet[i].etaRange;
717  }
718  }
719  } else if (iCategory == "ETT") {
720  for (unsigned int i = 0; i < m_vTrigETT.size(); i++) {
721  if (m_vTrigETT[i].alias == iAlias) {
722  return m_vTrigETT[i].etaRange;
723  }
724  }
725  } else if (iCategory == "ETM") {
726  for (unsigned int i = 0; i < m_vTrigETM.size(); i++) {
727  if (m_vTrigETM[i].alias == iAlias) {
728  return m_vTrigETM[i].etaRange;
729  }
730  }
731  } else if (iCategory == "HTT") {
732  for (unsigned int i = 0; i < m_vTrigHTT.size(); i++) {
733  if (m_vTrigHTT[i].alias == iAlias) {
734  return m_vTrigHTT[i].etaRange;
735  }
736  }
737  } else if (iCategory == "HTM") {
738  for (unsigned int i = 0; i < m_vTrigHTM.size(); i++) {
739  if (m_vTrigHTM[i].alias == iAlias) {
740  return m_vTrigHTM[i].etaRange;
741  }
742  }
743  }
744 
745  return out;
746 }
747 
748 //__________________________________________________________________
749 unsigned int L1TMenuHelper::getQualityAlias(const TString& iCategory, const TString& iAlias) {
750  unsigned int out = -1;
751 
752  if (iCategory == "Mu") {
753  for (unsigned int i = 0; i < m_vTrigMu.size(); i++) {
754  if (m_vTrigMu[i].alias == iAlias) {
755  return m_vTrigMu[i].quality;
756  }
757  }
758  } else if (iCategory == "EG") {
759  for (unsigned int i = 0; i < m_vTrigEG.size(); i++) {
760  if (m_vTrigEG[i].alias == iAlias) {
761  return m_vTrigEG[i].quality;
762  }
763  }
764  } else if (iCategory == "IsoEG") {
765  for (unsigned int i = 0; i < m_vTrigIsoEG.size(); i++) {
766  if (m_vTrigIsoEG[i].alias == iAlias) {
767  return m_vTrigIsoEG[i].quality;
768  }
769  }
770  } else if (iCategory == "Jet") {
771  for (unsigned int i = 0; i < m_vTrigJet.size(); i++) {
772  if (m_vTrigJet[i].alias == iAlias) {
773  return m_vTrigJet[i].quality;
774  }
775  }
776  } else if (iCategory == "CenJet") {
777  for (unsigned int i = 0; i < m_vTrigCenJet.size(); i++) {
778  if (m_vTrigCenJet[i].alias == iAlias) {
779  return m_vTrigCenJet[i].quality;
780  }
781  }
782  } else if (iCategory == "ForJet") {
783  for (unsigned int i = 0; i < m_vTrigForJet.size(); i++) {
784  if (m_vTrigForJet[i].alias == iAlias) {
785  return m_vTrigForJet[i].quality;
786  }
787  }
788  } else if (iCategory == "TauJet") {
789  for (unsigned int i = 0; i < m_vTrigTauJet.size(); i++) {
790  if (m_vTrigTauJet[i].alias == iAlias) {
791  return m_vTrigTauJet[i].quality;
792  }
793  }
794  } else if (iCategory == "ETT") {
795  for (unsigned int i = 0; i < m_vTrigETT.size(); i++) {
796  if (m_vTrigETT[i].alias == iAlias) {
797  return m_vTrigETT[i].quality;
798  }
799  }
800  } else if (iCategory == "ETM") {
801  for (unsigned int i = 0; i < m_vTrigETM.size(); i++) {
802  if (m_vTrigETM[i].alias == iAlias) {
803  return m_vTrigETM[i].quality;
804  }
805  }
806  } else if (iCategory == "HTT") {
807  for (unsigned int i = 0; i < m_vTrigHTT.size(); i++) {
808  if (m_vTrigHTT[i].alias == iAlias) {
809  return m_vTrigHTT[i].quality;
810  }
811  }
812  } else if (iCategory == "HTM") {
813  for (unsigned int i = 0; i < m_vTrigHTM.size(); i++) {
814  if (m_vTrigHTM[i].alias == iAlias) {
815  return m_vTrigHTM[i].quality;
816  }
817  }
818  }
819 
820  return out;
821 }
edm::ESGetToken< L1GtTriggerMenu, L1GtTriggerMenuRcd > menu
Definition: L1TMenuHelper.h:80
L1GtConditionCategory conditionCategory
Definition: L1TMenuHelper.h:36
unsigned int quality
Definition: L1TMenuHelper.h:51
std::string enumToStringL1GtObject(L1GtObject iObject)
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
Definition: L1GtObject.h:38
unsigned int etaRange
Definition: L1TMenuHelper.h:40
Definition: L1GtObject.h:35
std::map< std::string, L1GtAlgorithm > AlgorithmMap
map containing the algorithms
L1GtConditionType
const L1GtConditionCategory & condCategory() const
get / set the category of the condition
Definition: L1GtCondition.h:57
L1GtConditionType conditionType
Definition: L1TMenuHelper.h:37
unsigned int threshold
Definition: L1TMenuHelper.h:50
unsigned int threshold
Definition: L1TMenuHelper.h:41
AlgorithmMap::const_iterator CItAlgo
iterators through map containing the algorithms
unsigned int quality
Definition: L1TMenuHelper.h:39
Definition: L1GtObject.h:37
const std::vector< L1GtLogicParser::TokenRPN > & algoRpnVector() const
return the RPN vector
Definition: L1GtAlgorithm.h:69
const std::string & condName() const
get / set condition name
Definition: L1GtCondition.h:52
unsigned int bit
Definition: L1TMenuHelper.h:48
unsigned int getQualityAlias(const TString &iCategory, const TString &iAlias)
unsigned int etaRange
Definition: L1TMenuHelper.h:52
std::map< std::string, std::string > testAlgos(const std::map< std::string, std::string > &)
const std::vector< L1GtObject > & objectType() const
get / set the trigger object type(s) in the condition
Definition: L1GtCondition.h:67
const std::vector< ObjectParameter > * objectParameter() const
Definition: L1GtObject.h:29
double b
Definition: hdecay.h:120
const int triggerMask(const edm::Event &iEvent, const std::string &nameAlgoTechTrig, int &errorCode) const
return trigger mask for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1092
static void check(T const &p, std::string const &id, SelectedProducts const &iProducts, bool iVerbose)
Definition: L1GtObject.h:36
HLT enums.
const L1GtConditionType & condType() const
get / set the type of the condition (1s, etc)
Definition: L1GtCondition.h:62
double a
Definition: hdecay.h:121
std::string enumToStringL1GtConditionType(L1GtConditionType iConditionType)
edm::ESGetToken< L1GtPrescaleFactors, L1GtPrescaleFactorsAlgoTrigRcd > l1GtPfAlgo
Definition: L1TMenuHelper.h:81
const int nrObjects() const
get number of trigger objects
std::string enumToStringL1GtConditionCategory(L1GtConditionCategory iConditionCategory)
unsigned int getEtaRangeByAlias(const TString &iCategory, const TString &iAlias)
L1GtConditionCategory
condition categories
int getPrescaleByAlias(const TString &iCategory, const TString &iAlias)
L1TMenuHelper(const edm::EventSetup &iSetup, const Tokens &tokens)
std::map< std::string, std::string > getLUSOTrigger(const std::map< std::string, bool > &iCategories, int IndexRefPrescaleFactors, L1GtUtils const &myUtils)