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 
14 
16 
17 // L1Gt - Trigger Menu
21 
22 // L1Gt - Prescales
25 
26 // L1Gt - Masks
29 
31 
32 using namespace edm;
33 using namespace std;
34 
35 //-------------------------------------------------------------------------------------
36 //
37 //-------------------------------------------------------------------------------------
39  iSetup.get<L1GtTriggerMenuRcd>().get(menuRcd);
40  iSetup.get<L1GtPrescaleFactorsAlgoTrigRcd>().get(l1GtPfAlgo);
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 }
47 
48 //-------------------------------------------------------------------------------------
49 //
50 //-------------------------------------------------------------------------------------
52 
53 //-------------------------------------------------------------------------------------
54 // Method: fetLUSOTrigger
55 // * Get Lowest Unprescaled Single Object Triggers and Energy Sums
56 //-------------------------------------------------------------------------------------
57 map<string, string> L1TMenuHelper::getLUSOTrigger(const map<string, bool>& iCategories,
58  int IndexRefPrescaleFactors,
59  L1GtUtils const& myUtils) {
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 }
398 
399 map<string, string> L1TMenuHelper::testAlgos(const map<string, string>& _iAlgos) {
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 }
419 
420 //-------------------------------------------------------------------------------------
421 // Method: enumToStringL1GtObject
422 // * Converts L1GtObject (enum) to string
423 //-------------------------------------------------------------------------------------
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 }
486 
487 //-------------------------------------------------------------------------------------
488 // Method: enumToStringL1GtConditionType
489 // * Converts L1GtConditionType (enum) to string
490 //-------------------------------------------------------------------------------------
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 }
553 
554 //__________________________________________________________________
555 // Method: enumToStringL1GtConditionCategory
556 // * Converts L1GtConditionCategory (enum) to string
557 //__________________________________________________________________
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 }
602 
603 //__________________________________________________________________
604 int L1TMenuHelper::getPrescaleByAlias(const TString& iCategory, const TString& iAlias) {
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 }
677 
678 //__________________________________________________________________
679 unsigned int L1TMenuHelper::getEtaRangeByAlias(const TString& iCategory, const TString& iAlias) {
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 }
752 
753 //__________________________________________________________________
754 unsigned int L1TMenuHelper::getQualityAlias(const TString& iCategory, const TString& iAlias) {
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 }
L1GtConditionCategory conditionCategory
Definition: L1TMenuHelper.h:38
unsigned int quality
Definition: L1TMenuHelper.h:53
std::string enumToStringL1GtObject(L1GtObject iObject)
const int nrObjects() const
get number of trigger objects
Definition: L1GtObject.h:38
unsigned int etaRange
Definition: L1TMenuHelper.h:42
Definition: L1GtObject.h:35
std::map< std::string, L1GtAlgorithm > AlgorithmMap
map containing the algorithms
const std::string & condName() const
get / set condition name
Definition: L1GtCondition.h:52
L1GtConditionType conditionType
Definition: L1TMenuHelper.h:39
const std::vector< L1GtObject > & objectType() const
get / set the trigger object type(s) in the condition
Definition: L1GtCondition.h:67
L1GtConditionType
unsigned int threshold
Definition: L1TMenuHelper.h:52
unsigned int threshold
Definition: L1TMenuHelper.h:43
AlgorithmMap::const_iterator CItAlgo
iterators through map containing the algorithms
unsigned int quality
Definition: L1TMenuHelper.h:41
Definition: L1GtObject.h:37
const std::vector< L1GtLogicParser::TokenRPN > & algoRpnVector() const
return the RPN vector
Definition: L1GtAlgorithm.h:69
L1TMenuHelper(const edm::EventSetup &iSetup)
const std::vector< ObjectParameter > * objectParameter() const
const L1GtConditionType & condType() const
get / set the type of the condition (1s, etc)
Definition: L1GtCondition.h:62
const std::vector< ObjectParameter > * objectParameter() const
L1GtConditionCategory
condition categories
unsigned int bit
Definition: L1TMenuHelper.h:50
unsigned int getQualityAlias(const TString &iCategory, const TString &iAlias)
const L1GtConditionCategory & condCategory() const
get / set the category of the condition
Definition: L1GtCondition.h:57
unsigned int etaRange
Definition: L1TMenuHelper.h:54
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:1050
std::map< std::string, std::string > testAlgos(const std::map< std::string, std::string > &)
const std::vector< std::vector< int > > & gtPrescaleFactors() const
get the prescale factors by reference
Definition: L1GtObject.h:29
double b
Definition: hdecay.h:118
Definition: L1GtObject.h:36
HLT enums.
double a
Definition: hdecay.h:119
std::string enumToStringL1GtConditionType(L1GtConditionType iConditionType)
T get() const
Definition: EventSetup.h:73
const std::vector< ObjectParameter > * objectParameter() const
std::string enumToStringL1GtConditionCategory(L1GtConditionCategory iConditionCategory)
unsigned int getEtaRangeByAlias(const TString &iCategory, const TString &iAlias)
int getPrescaleByAlias(const TString &iCategory, const TString &iAlias)
static void check(T const &p, std::string const &id, SelectedProducts const &iProducts)
std::map< std::string, std::string > getLUSOTrigger(const std::map< std::string, bool > &iCategories, int IndexRefPrescaleFactors, L1GtUtils const &myUtils)