CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
15 //#include "DataFormats/L1GlobalTrigger/interface/L1GtLogicParser.h"
16 #include "HLTrigger/HLTanalyzers/test/RateEff/L1GtLogicParser.h"
17 
18 // L1Gt - Trigger Menu
22 
23 // L1Gt - Prescales
26 
27 // L1Gt - Masks
30 
31 
32 
34 
35 using namespace edm;
36 using namespace std;
37 
38 //-------------------------------------------------------------------------------------
39 //
40 //-------------------------------------------------------------------------------------
42 
43  iSetup.get<L1GtTriggerMenuRcd>() .get(menuRcd);
44  iSetup.get<L1GtPrescaleFactorsAlgoTrigRcd>().get(l1GtPfAlgo);
45 
46  const L1GtPrescaleFactors* m_l1GtPfAlgo = l1GtPfAlgo.product();
47 
48  m_l1GtMenu = menuRcd .product(); // Getting the menu
49  m_prescaleFactorsAlgoTrig = &(m_l1GtPfAlgo->gtPrescaleFactors()); // Retriving the list of prescale sets
50 
51  myUtils.retrieveL1EventSetup(iSetup);
52 
53 }
54 
55 
56 //-------------------------------------------------------------------------------------
57 //
58 //-------------------------------------------------------------------------------------
60 
61 //-------------------------------------------------------------------------------------
62 // Method: fetLUSOTrigger
63 // * Get Lowest Unprescaled Single Object Triggers and Energy Sums
64 //-------------------------------------------------------------------------------------
65 map<string,string> L1TMenuHelper::getLUSOTrigger(const map<string,bool>& iCategories, int IndexRefPrescaleFactors){
66  map<string,string> out;
67 
68  // Getting information from the menu
69  const AlgorithmMap *theAlgoMap = &m_l1GtMenu->gtAlgorithmAliasMap();
70  const vector< vector<L1GtMuonTemplate> > *vMuonConditions = &m_l1GtMenu->vecMuonTemplate();
71  const vector< vector<L1GtCaloTemplate> > *vCaloConditions = &m_l1GtMenu->vecCaloTemplate();
72  const vector< vector<L1GtEnergySumTemplate> > *vEnergySumConditions = &m_l1GtMenu->vecEnergySumTemplate();
73 
74  // Getting reference prescales
75  const vector<int>& refPrescaleFactors = (*m_prescaleFactorsAlgoTrig).at(IndexRefPrescaleFactors);
76 
77  AlgorithmMap MyAlgos;
78 
79  map<string,SingleObjectCondition> myConditions;
80 
81  for(unsigned int a=0 ; a<vMuonConditions->size() ; a++){
82  for(unsigned int b=0 ; b<(*vMuonConditions)[a].size() ; b++){
83 
84  const L1GtMuonTemplate* MuonCondition = &(*vMuonConditions)[a][b];
85 
86  // Selecting conditions that require single objects
87  if(MuonCondition->condType() == Type1s && MuonCondition->nrObjects() == 1){
88 
89  SingleObjectCondition tCondition;
90 
91  tCondition.name = MuonCondition->condName();
92  tCondition.conditionCategory = MuonCondition->condCategory();
93  tCondition.conditionType = MuonCondition->condType();
94  tCondition.object = MuonCondition->objectType()[0];
95  tCondition.threshold = (*MuonCondition->objectParameter())[0].ptHighThreshold;
96  tCondition.quality = (*MuonCondition->objectParameter())[0].qualityRange;
97  tCondition.etaRange = (*MuonCondition->objectParameter())[0].etaRange;
98 
99  myConditions[MuonCondition->condName()] = tCondition;
100 
101  }
102  }
103  }
104 
105  for(unsigned int a=0 ; a<vCaloConditions->size() ; a++){
106  for(unsigned int b=0 ; b<(*vCaloConditions)[a].size() ; b++){
107 
108  const L1GtCaloTemplate* CaloCondition = &(*vCaloConditions)[a][b];
109 
110  if(CaloCondition->condType() == Type1s && CaloCondition->nrObjects() == 1){
111 
112  SingleObjectCondition tCondition;
113 
114  tCondition.name = CaloCondition->condName();
115  tCondition.conditionCategory = CaloCondition->condCategory();
116  tCondition.conditionType = CaloCondition->condType();
117  tCondition.object = CaloCondition->objectType()[0];
118  tCondition.threshold = (*CaloCondition->objectParameter())[0].etThreshold;
119  tCondition.quality = 0;
120  tCondition.etaRange = (*CaloCondition->objectParameter())[0].etaRange;
121 
122  myConditions[CaloCondition->condName()] = tCondition;
123 
124  }
125  }
126  }
127 
128  for(unsigned int a=0 ; a<vEnergySumConditions->size() ; a++){
129  for(unsigned int b=0 ; b<(*vEnergySumConditions)[a].size() ; b++){
130 
131  const L1GtEnergySumTemplate* EnergySumCondition = &(*vEnergySumConditions)[a][b];
132 
133  if((EnergySumCondition->condType() == TypeETT ||
134  EnergySumCondition->condType() == TypeETM ||
135  EnergySumCondition->condType() == TypeHTT ||
136  EnergySumCondition->condType() == TypeHTM
137  ) && EnergySumCondition->nrObjects() == 1){
138 
139  SingleObjectCondition tCondition;
140 
141  tCondition.name = EnergySumCondition->condName();
142  tCondition.conditionCategory = EnergySumCondition->condCategory();
143  tCondition.conditionType = EnergySumCondition->condType();
144  tCondition.object = EnergySumCondition->objectType()[0];
145  tCondition.threshold = (*EnergySumCondition->objectParameter())[0].etThreshold;
146  tCondition.quality = 0;
147  tCondition.etaRange = 0;
148 
149  myConditions[EnergySumCondition->condName()] = tCondition;
150 
151  }
152  }
153  }
154 
155  for (CItAlgo iAlgo = theAlgoMap->begin(); iAlgo!=theAlgoMap->end(); ++iAlgo){
156 
157  int error;
158 
159  bool algoIsValid = true;
160  unsigned int maxThreshold = 0;
161  int tAlgoMask = myUtils.triggerMask(iAlgo->first,error);
162  L1GtObject tObject = Mu; // Initial dummy value
163  unsigned int tQuality = 0; // Only aplicable to Muons
164  unsigned int tEtaRange = 0;
165 
166  // Objects associated
167  bool isMu = false;
168  bool isNoIsoEG = false;
169  bool isIsoEG = false;
170  bool isCenJet = false;
171  bool isForJet = false;
172  bool isTauJet = false;
173  bool isETM = false;
174  bool isETT = false;
175  bool isHTT = false;
176  bool isHTM = false;
177 
178  // Check if the trigger is masked
179  if(tAlgoMask != 0){
180  algoIsValid = false;
181  }
182  else{
183 
184  const L1GtAlgorithm *pAlgo = &(iAlgo->second);
185 
186  for(unsigned int i=0; i<pAlgo->algoRpnVector().size() ; i++){
187 
188  // Algorithm cannot be single algo if it requires 2 simultaneous conditions
189  // FIXME: Should be improved to be sure one of the conditions is not technical (ex: BPTX)
190  if(pAlgo->algoRpnVector()[i].operation == L1GtLogicParser::OP_AND){
191  algoIsValid = false;
192  break;
193  }
194  else if(pAlgo->algoRpnVector()[i].operation == L1GtLogicParser::OP_OPERAND){
195 
196  string AlgoCondition = pAlgo->algoRpnVector()[i].operand;
197  map<string,SingleObjectCondition>::const_iterator ciCond = myConditions.find(AlgoCondition);
198 
199  // If there is no matching condition (i.e. its not a single object or energy sum condition)
200  // ignore this this L1 algo
201  if(ciCond == myConditions.end()){
202  algoIsValid = false;
203  break;
204  }
205  // If trigger was not invalidated by this condition we register its objects and threshold
206  else{
207 
208  // Updating value for the object with the maximum threshold for this triger
209  if(maxThreshold < (*ciCond).second.threshold){
210  maxThreshold = (*ciCond).second.threshold;
211  tObject = (*ciCond).second.object;
212  tQuality = (*ciCond).second.quality;
213  tEtaRange = (*ciCond).second.etaRange;
214  }
215 
216  if ((*ciCond).second.object == Mu) {isMu = true;}
217  else if((*ciCond).second.object == NoIsoEG){isNoIsoEG = true;}
218  else if((*ciCond).second.object == IsoEG) {isIsoEG = true;}
219  else if((*ciCond).second.object == CenJet) {isCenJet = true;}
220  else if((*ciCond).second.object == ForJet) {isForJet = true;}
221  else if((*ciCond).second.object == TauJet) {isTauJet = true;}
222  else if((*ciCond).second.object == ETM) {isETM = true;}
223  else if((*ciCond).second.object == ETT) {isETT = true;}
224  else if((*ciCond).second.object == HTT) {isHTT = true;}
225  else if((*ciCond).second.object == HTM) {isHTM = true;}
226 
227  }
228  }
229  }
230  }
231 
232  if(algoIsValid){
233 
234  SingleObjectTrigger tTrigger;
235  tTrigger.alias = iAlgo->first;
236  tTrigger.bit = (iAlgo->second).algoBitNumber();
237  tTrigger.prescale = refPrescaleFactors[tTrigger.bit];
238  tTrigger.threshold = maxThreshold;
239  tTrigger.object = tObject;
240  tTrigger.quality = tQuality; // Only aplicable to Muons
241  tTrigger.etaRange = tEtaRange; // Only aplicable to EG and Muons
242 
243  // Counting the number of different trigger conditions
244  int nCond = 0;
245  if(isMu) {nCond++;}
246  if(isNoIsoEG){nCond++;}
247  if(isIsoEG) {nCond++;}
248  if(isCenJet) {nCond++;}
249  if(isForJet) {nCond++;}
250  if(isTauJet) {nCond++;}
251  if(isETM) {nCond++;}
252  if(isETT) {nCond++;}
253  if(isHTT) {nCond++;}
254  if(isHTM) {nCond++;}
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  }
262  else if(nCond==2 && isNoIsoEG==true && isIsoEG ==true) {m_vTrigEG .push_back(tTrigger);}
263  else if(nCond==1 && isIsoEG ==true) {m_vTrigIsoEG .push_back(tTrigger);}
264  else if(nCond==3 && isCenJet ==true && isForJet==true && isTauJet==true){m_vTrigJet .push_back(tTrigger);}
265  else if(nCond==1 && isCenJet ==true) {m_vTrigCenJet.push_back(tTrigger);}
266  else if(nCond==1 && isForJet ==true) {m_vTrigForJet.push_back(tTrigger);}
267  else if(nCond==1 && isTauJet ==true) {m_vTrigTauJet.push_back(tTrigger);}
268  else if(nCond==1 && isETT ==true) {m_vTrigETT .push_back(tTrigger);}
269  else if(nCond==1 && isETM ==true) {m_vTrigETM .push_back(tTrigger);}
270  else if(nCond==1 && isHTT ==true) {m_vTrigHTT .push_back(tTrigger);}
271  else if(nCond==1 && isHTM ==true) {m_vTrigHTM .push_back(tTrigger);}
272  }
273 
274  }
275 
276  //--------------------------------------------------------------------------------------
277  // Now that we have built vectors of SingleObjectTrigger by category we can select for
278  // each category the lowest unprescaled single object trigger.
279  // NOTE: Since it is not guaranteed that all categories will have at least one unprescaled
280  // trigger this method will return in that case the lowest prescale trigger available
281  //--------------------------------------------------------------------------------------
282 
283  string selTrigMu = "Undefined";
284  string selTrigEG = "Undefined";
285  string selTrigIsoEG = "Undefined";
286  string selTrigJet = "Undefined";
287  string selTrigCenJet = "Undefined";
288  string selTrigForJet = "Undefined";
289  string selTrigTauJet = "Undefined";
290  string selTrigETT = "Undefined";
291  string selTrigETM = "Undefined";
292  string selTrigHTT = "Undefined";
293  string selTrigHTM = "Undefined";
294 
295  if(m_vTrigMu .size() > 0){sort(m_vTrigMu .begin(),m_vTrigMu .end()); selTrigMu = m_vTrigMu [0].alias;}
296  if(m_vTrigEG .size() > 0){sort(m_vTrigEG .begin(),m_vTrigEG .end()); selTrigEG = m_vTrigEG [0].alias;}
297  if(m_vTrigIsoEG .size() > 0){sort(m_vTrigIsoEG .begin(),m_vTrigIsoEG .end()); selTrigIsoEG = m_vTrigIsoEG [0].alias;}
298  if(m_vTrigJet .size() > 0){sort(m_vTrigJet .begin(),m_vTrigJet .end()); selTrigJet = m_vTrigJet [0].alias;}
299  if(m_vTrigCenJet.size() > 0){sort(m_vTrigCenJet.begin(),m_vTrigCenJet.end()); selTrigCenJet = m_vTrigCenJet[0].alias;}
300  if(m_vTrigForJet.size() > 0){sort(m_vTrigForJet.begin(),m_vTrigForJet.end()); selTrigForJet = m_vTrigForJet[0].alias;}
301  if(m_vTrigTauJet.size() > 0){sort(m_vTrigTauJet.begin(),m_vTrigTauJet.end()); selTrigTauJet = m_vTrigTauJet[0].alias;}
302  if(m_vTrigETT .size() > 0){sort(m_vTrigETT .begin(),m_vTrigETT .end()); selTrigETT = m_vTrigETT [0].alias;}
303  if(m_vTrigETM .size() > 0){sort(m_vTrigETM .begin(),m_vTrigETM .end()); selTrigETM = m_vTrigETM [0].alias;}
304  if(m_vTrigHTT .size() > 0){sort(m_vTrigHTT .begin(),m_vTrigHTT .end()); selTrigHTT = m_vTrigHTT [0].alias;}
305  if(m_vTrigHTM .size() > 0){sort(m_vTrigHTM .begin(),m_vTrigHTM .end()); selTrigHTM = m_vTrigHTM [0].alias;}
306 
307  auto check = [](const map<string,bool>& cats, const char* key) -> bool {
308  auto it = cats.find(key);
309  if (it != cats.end())
310  return it->second;
311 
312  return false;
313  };
314 
315  if (check(iCategories, "Mu" )) {out["Mu"] = selTrigMu;}
316  if (check(iCategories, "EG" )) {out["EG"] = selTrigEG;}
317  if (check(iCategories, "IsoEG" )) {out["IsoEG"] = selTrigIsoEG;}
318  if (check(iCategories, "Jet" )) {out["Jet"] = selTrigJet;}
319  if (check(iCategories, "CenJet")) {out["CenJet"] = selTrigCenJet;}
320  if (check(iCategories, "ForJet")) {out["ForJet"] = selTrigForJet;}
321  if (check(iCategories, "TauJet")) {out["TauJet"] = selTrigTauJet;}
322  if (check(iCategories, "ETT" )) {out["ETT"] = selTrigETT;}
323  if (check(iCategories, "ETM" )) {out["ETM"] = selTrigETM;}
324  if (check(iCategories, "HTT" )) {out["HTT"] = selTrigHTT;}
325  if (check(iCategories, "HTM" )) {out["HTM"] = selTrigHTM;}
326 
327  return out;
328 
329 }
330 
331 map<string,string> L1TMenuHelper::testAlgos(const map<string,string>& _iAlgos){
332  map<string,string> iAlgos = _iAlgos;
333  // Getting information from the menu
334  const AlgorithmMap *theAlgoMap = &m_l1GtMenu->gtAlgorithmAliasMap();
335 
336  for(map<string,string>::const_iterator i = iAlgos.begin() ; iAlgos.end() != i ; i++){
337 
338  string tCategory = (*i).first;
339  string tTrigger = (*i).second;
340 
341  if(tTrigger == "" ){iAlgos[tCategory] = "Undefined";}
342  else{
343  if(theAlgoMap->find(tTrigger) == theAlgoMap->end()){iAlgos[tCategory] = "Undefined (Wrong Name)";}
344  }
345 
346  }
347 
348  return iAlgos;
349 
350 }
351 
352 //-------------------------------------------------------------------------------------
353 // Method: enumToStringL1GtObject
354 // * Converts L1GtObject (enum) to string
355 //-------------------------------------------------------------------------------------
357 
358  string out;
359 
360  switch(iObject){
361  case Mu: out = "Mu"; break;
362  case NoIsoEG: out = "NoIsoEG"; break;
363  case IsoEG: out = "IsoEG"; break;
364  case CenJet: out = "CenJet"; break;
365  case ForJet: out = "ForJet"; break;
366  case TauJet: out = "TauJet"; break;
367  case ETM: out = "ETM"; break;
368  case ETT: out = "ETT"; break;
369  case HTT: out = "HTT"; break;
370  case HTM: out = "HTM"; break;
371  case JetCounts: out = "JetCounts"; break;
372  case HfBitCounts: out = "HfBitCounts"; break;
373  case HfRingEtSums: out = "HfRingEtSums"; break;
374  case TechTrig: out = "TechTrig"; break;
375  case Castor: out = "Castor"; break;
376  case BPTX: out = "BPTX"; break;
377  case GtExternal: out = "GtExternal"; break;
378  default: out = "Unknown"; break;
379  };
380 
381  return out;
382 
383 }
384 
385 //-------------------------------------------------------------------------------------
386 // Method: enumToStringL1GtConditionType
387 // * Converts L1GtConditionType (enum) to string
388 //-------------------------------------------------------------------------------------
390 
391  string out;
392 
393  switch(iConditionType){
394  case TypeNull: out = "TypeNull"; break;
395  case Type1s: out = "Type1s"; break;
396  case Type2s: out = "Type2s"; break;
397  case Type2wsc: out = "Type2wsc"; break;
398  case Type2cor: out = "Type2cor"; break;
399  case Type3s: out = "Type3s"; break;
400  case Type4s: out = "Type4s"; break;
401  case TypeETM: out = "TypeETM"; break;
402  case TypeETT: out = "TypeETT"; break;
403  case TypeHTT: out = "TypeHTT"; break;
404  case TypeHTM: out = "TypeHTM"; break;
405  case TypeJetCounts: out = "TypeJetCounts"; break;
406  case TypeCastor: out = "TypeCastor"; break;
407  case TypeHfBitCounts: out = "TypeHfBitCounts"; break;
408  case TypeHfRingEtSums: out = "TypeHfRingEtSums"; break;
409  case TypeBptx: out = "TypeBptx"; break;
410  case TypeExternal: out = "TypeExternal"; break;
411  default: out = "Unknown"; break;
412  };
413 
414  return out;
415 
416 }
417 
418 //__________________________________________________________________
419 // Method: enumToStringL1GtConditionCategory
420 // * Converts L1GtConditionCategory (enum) to string
421 //__________________________________________________________________
423 
424  string out;
425 
426  switch(iConditionCategory){
427  case CondNull: out = "CondNull"; break;
428  case CondMuon: out = "CondMuon"; break;
429  case CondCalo: out = "CondCalo"; break;
430  case CondEnergySum: out = "CondEnergySum"; break;
431  case CondJetCounts: out = "CondJetCounts"; break;
432  case CondCorrelation: out = "CondCorrelation"; break;
433  case CondCastor: out = "CondCastor"; break;
434  case CondHfBitCounts: out = "CondHfBitCounts"; break;
435  case CondHfRingEtSums: out = "CondHfRingEtSums"; break;
436  case CondBptx: out = "CondBptx"; break;
437  case CondExternal: out = "CondExternal"; break;
438  default: out = "Unknown"; break;
439  };
440 
441  return out;
442 
443 }
444 
445 //__________________________________________________________________
446 int L1TMenuHelper::getPrescaleByAlias(const TString& iCategory,const TString& iAlias){
447 
448  int out = -1;
449 
450  if(iCategory == "Mu"){
451  for(unsigned int i=0 ; i<m_vTrigMu.size() ; i++){if(m_vTrigMu[i].alias==iAlias) {return m_vTrigMu[i].prescale;}}
452  }else if(iCategory == "EG"){
453  for(unsigned int i=0 ; i<m_vTrigEG.size() ; i++){if(m_vTrigEG[i].alias==iAlias) {return m_vTrigEG[i].prescale;}}
454  }else if(iCategory == "IsoEG"){
455  for(unsigned int i=0 ; i<m_vTrigIsoEG.size() ; i++){if(m_vTrigIsoEG[i].alias==iAlias) {return m_vTrigIsoEG[i].prescale;}}
456  }else if(iCategory == "Jet"){
457  for(unsigned int i=0 ; i<m_vTrigJet.size() ; i++){if(m_vTrigJet[i].alias==iAlias) {return m_vTrigJet[i].prescale;}}
458  }else if(iCategory == "CenJet"){
459  for(unsigned int i=0 ; i<m_vTrigCenJet.size() ; i++){if(m_vTrigCenJet[i].alias==iAlias){return m_vTrigCenJet[i].prescale;}}
460  }else if(iCategory == "ForJet"){
461  for(unsigned int i=0 ; i<m_vTrigForJet.size() ; i++){if(m_vTrigForJet[i].alias==iAlias){return m_vTrigForJet[i].prescale;}}
462  }else if(iCategory == "TauJet"){
463  for(unsigned int i=0 ; i<m_vTrigTauJet.size() ; i++){if(m_vTrigTauJet[i].alias==iAlias){return m_vTrigTauJet[i].prescale;}}
464  }else if(iCategory == "ETT"){
465  for(unsigned int i=0 ; i<m_vTrigETT.size() ; i++){if(m_vTrigETT[i].alias==iAlias) {return m_vTrigETT[i].prescale;}}
466  }else if(iCategory == "ETM"){
467  for(unsigned int i=0 ; i<m_vTrigETM.size() ; i++){if(m_vTrigETM[i].alias==iAlias) {return m_vTrigETM[i].prescale;}}
468  }else if(iCategory == "HTT"){
469  for(unsigned int i=0 ; i<m_vTrigHTT.size() ; i++){if(m_vTrigHTT[i].alias==iAlias) {return m_vTrigHTT[i].prescale;}}
470  }else if(iCategory == "HTM"){
471  for(unsigned int i=0 ; i<m_vTrigHTM.size() ; i++){if(m_vTrigHTM[i].alias==iAlias) {return m_vTrigHTM[i].prescale;}}
472  }
473 
474  return out;
475 
476 }
477 
478 //__________________________________________________________________
479 unsigned int L1TMenuHelper::getEtaRangeByAlias(const TString& iCategory,const TString& iAlias){
480 
481  unsigned int out = -1;
482 
483  if(iCategory == "Mu"){
484  for(unsigned int i=0 ; i<m_vTrigMu.size() ; i++){if(m_vTrigMu[i].alias==iAlias) {return m_vTrigMu[i].etaRange;}}
485  }else if(iCategory == "EG"){
486  for(unsigned int i=0 ; i<m_vTrigEG.size() ; i++){if(m_vTrigEG[i].alias==iAlias) {return m_vTrigEG[i].etaRange;}}
487  }else if(iCategory == "IsoEG"){
488  for(unsigned int i=0 ; i<m_vTrigIsoEG.size() ; i++){if(m_vTrigIsoEG[i].alias==iAlias) {return m_vTrigIsoEG[i].etaRange;}}
489  }else if(iCategory == "Jet"){
490  for(unsigned int i=0 ; i<m_vTrigJet.size() ; i++){if(m_vTrigJet[i].alias==iAlias) {return m_vTrigJet[i].etaRange;}}
491  }else if(iCategory == "CenJet"){
492  for(unsigned int i=0 ; i<m_vTrigCenJet.size() ; i++){if(m_vTrigCenJet[i].alias==iAlias){return m_vTrigCenJet[i].etaRange;}}
493  }else if(iCategory == "ForJet"){
494  for(unsigned int i=0 ; i<m_vTrigForJet.size() ; i++){if(m_vTrigForJet[i].alias==iAlias){return m_vTrigForJet[i].etaRange;}}
495  }else if(iCategory == "TauJet"){
496  for(unsigned int i=0 ; i<m_vTrigTauJet.size() ; i++){if(m_vTrigTauJet[i].alias==iAlias){return m_vTrigTauJet[i].etaRange;}}
497  }else if(iCategory == "ETT"){
498  for(unsigned int i=0 ; i<m_vTrigETT.size() ; i++){if(m_vTrigETT[i].alias==iAlias) {return m_vTrigETT[i].etaRange;}}
499  }else if(iCategory == "ETM"){
500  for(unsigned int i=0 ; i<m_vTrigETM.size() ; i++){if(m_vTrigETM[i].alias==iAlias) {return m_vTrigETM[i].etaRange;}}
501  }else if(iCategory == "HTT"){
502  for(unsigned int i=0 ; i<m_vTrigHTT.size() ; i++){if(m_vTrigHTT[i].alias==iAlias) {return m_vTrigHTT[i].etaRange;}}
503  }else if(iCategory == "HTM"){
504  for(unsigned int i=0 ; i<m_vTrigHTM.size() ; i++){if(m_vTrigHTM[i].alias==iAlias) {return m_vTrigHTM[i].etaRange;}}
505  }
506 
507  return out;
508 
509 }
510 
511 //__________________________________________________________________
512 unsigned int L1TMenuHelper::getQualityAlias(const TString& iCategory,const TString& iAlias){
513 
514  unsigned int out = -1;
515 
516  if(iCategory == "Mu"){
517  for(unsigned int i=0 ; i<m_vTrigMu.size() ; i++){if(m_vTrigMu[i].alias==iAlias) {return m_vTrigMu[i].quality;}}
518  }else if(iCategory == "EG"){
519  for(unsigned int i=0 ; i<m_vTrigEG.size() ; i++){if(m_vTrigEG[i].alias==iAlias) {return m_vTrigEG[i].quality;}}
520  }else if(iCategory == "IsoEG"){
521  for(unsigned int i=0 ; i<m_vTrigIsoEG.size() ; i++){if(m_vTrigIsoEG[i].alias==iAlias) {return m_vTrigIsoEG[i].quality;}}
522  }else if(iCategory == "Jet"){
523  for(unsigned int i=0 ; i<m_vTrigJet.size() ; i++){if(m_vTrigJet[i].alias==iAlias) {return m_vTrigJet[i].quality;}}
524  }else if(iCategory == "CenJet"){
525  for(unsigned int i=0 ; i<m_vTrigCenJet.size() ; i++){if(m_vTrigCenJet[i].alias==iAlias){return m_vTrigCenJet[i].quality;}}
526  }else if(iCategory == "ForJet"){
527  for(unsigned int i=0 ; i<m_vTrigForJet.size() ; i++){if(m_vTrigForJet[i].alias==iAlias){return m_vTrigForJet[i].quality;}}
528  }else if(iCategory == "TauJet"){
529  for(unsigned int i=0 ; i<m_vTrigTauJet.size() ; i++){if(m_vTrigTauJet[i].alias==iAlias){return m_vTrigTauJet[i].quality;}}
530  }else if(iCategory == "ETT"){
531  for(unsigned int i=0 ; i<m_vTrigETT.size() ; i++){if(m_vTrigETT[i].alias==iAlias) {return m_vTrigETT[i].quality;}}
532  }else if(iCategory == "ETM"){
533  for(unsigned int i=0 ; i<m_vTrigETM.size() ; i++){if(m_vTrigETM[i].alias==iAlias) {return m_vTrigETM[i].quality;}}
534  }else if(iCategory == "HTT"){
535  for(unsigned int i=0 ; i<m_vTrigHTT.size() ; i++){if(m_vTrigHTT[i].alias==iAlias) {return m_vTrigHTT[i].quality;}}
536  }else if(iCategory == "HTM"){
537  for(unsigned int i=0 ; i<m_vTrigHTM.size() ; i++){if(m_vTrigHTM[i].alias==iAlias) {return m_vTrigHTM[i].quality;}}
538  }
539 
540  return out;
541 
542 }
int i
Definition: DBlmapReader.cc:9
L1GtConditionCategory conditionCategory
Definition: L1TMenuHelper.h:38
unsigned int quality
Definition: L1TMenuHelper.h:55
std::string enumToStringL1GtObject(L1GtObject iObject)
const int nrObjects() const
get number of trigger objects
Definition: L1GtObject.h:39
unsigned int etaRange
Definition: L1TMenuHelper.h:42
Definition: L1GtObject.h:36
std::map< std::string, L1GtAlgorithm > AlgorithmMap
map containing the algorithms
const std::string & condName() const
get / set condition name
Definition: L1GtCondition.h:57
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:90
L1GtConditionType
unsigned int threshold
Definition: L1TMenuHelper.h:54
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:38
const std::vector< L1GtLogicParser::TokenRPN > & algoRpnVector() const
return the RPN vector
Definition: L1GtAlgorithm.h:89
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:79
const std::vector< ObjectParameter > * objectParameter() const
L1GtConditionCategory
condition categories
unsigned int bit
Definition: L1TMenuHelper.h:52
#define end
Definition: vmac.h:37
unsigned int getQualityAlias(const TString &iCategory, const TString &iAlias)
const L1GtConditionCategory & condCategory() const
get / set the category of the condition
Definition: L1GtCondition.h:68
unsigned int etaRange
Definition: L1TMenuHelper.h:56
std::map< std::string, std::string > getLUSOTrigger(const std::map< std::string, bool > &iCategories, int IndexRefPrescaleFactors)
std::map< std::string, std::string > testAlgos(const std::map< std::string, std::string > &)
tuple out
Definition: dbtoconf.py:99
static void check(Principal const &p, std::string const &id, edm::ModuleCallingContext const *mcc)
const std::vector< std::vector< int > > & gtPrescaleFactors() const
get the prescale factors by reference
Definition: L1GtObject.h:30
const T & get() const
Definition: EventSetup.h:55
double b
Definition: hdecay.h:120
Definition: L1GtObject.h:37
#define begin
Definition: vmac.h:30
list key
Definition: combine.py:13
double a
Definition: hdecay.h:121
std::string enumToStringL1GtConditionType(L1GtConditionType iConditionType)
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)
tuple size
Write out results.