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