CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_8_patch3/src/DQM/L1TMonitor/src/L1TMenuHelper.cc

Go to the documentation of this file.
00001 
00002 /*
00003  * \file L1TMenuHelper.cc
00004  *
00005  * $Date: 2011/11/15 10:41:00 $
00006  * $Revision: 1.6 $
00007  * \author J. Pela, P. Musella
00008  *
00009 */
00010 
00011 #include "TString.h"
00012 
00013 #include "FWCore/Framework/interface/EDAnalyzer.h"
00014 #include "FWCore/Framework/interface/ESHandle.h"
00015 #include "FWCore/Framework/interface/Event.h"
00016 
00017 //#include "DataFormats/L1GlobalTrigger/interface/L1GtLogicParser.h"
00018 #include "HLTrigger/HLTanalyzers/test/RateEff/L1GtLogicParser.h"
00019 
00020 // L1Gt - Trigger Menu
00021 #include "CondFormats/L1TObjects/interface/L1GtTriggerMenu.h"
00022 #include "CondFormats/L1TObjects/interface/L1GtTriggerMenuFwd.h"
00023 #include "CondFormats/DataRecord/interface/L1GtTriggerMenuRcd.h"
00024 
00025 // L1Gt - Prescales
00026 #include "CondFormats/L1TObjects/interface/L1GtPrescaleFactors.h"
00027 #include "CondFormats/DataRecord/interface/L1GtPrescaleFactorsAlgoTrigRcd.h"
00028 
00029 // L1Gt - Masks
00030 #include "CondFormats/L1TObjects/interface/L1GtTriggerMask.h"
00031 #include "CondFormats/DataRecord/interface/L1GtTriggerMaskAlgoTrigRcd.h"
00032 
00033 
00034 
00035 #include "DQM/L1TMonitor/interface/L1TMenuHelper.h"
00036 
00037 using namespace edm;
00038 using namespace std;
00039 
00040 //-------------------------------------------------------------------------------------
00041 //
00042 //-------------------------------------------------------------------------------------
00043 L1TMenuHelper::L1TMenuHelper(const edm::EventSetup& iSetup){
00044 
00045   iSetup.get<L1GtTriggerMenuRcd>()            .get(menuRcd);
00046   iSetup.get<L1GtPrescaleFactorsAlgoTrigRcd>().get(l1GtPfAlgo);
00047 
00048   const L1GtPrescaleFactors* m_l1GtPfAlgo = l1GtPfAlgo.product();
00049 
00050   m_l1GtMenu                = menuRcd   .product();                 // Getting the menu
00051   m_prescaleFactorsAlgoTrig = &(m_l1GtPfAlgo->gtPrescaleFactors()); // Retriving the list of prescale sets
00052 
00053   myUtils.retrieveL1EventSetup(iSetup);
00054 
00055 }
00056 
00057 
00058 //-------------------------------------------------------------------------------------
00059 //
00060 //-------------------------------------------------------------------------------------
00061 L1TMenuHelper::~L1TMenuHelper(){}                      
00062 
00063 //-------------------------------------------------------------------------------------
00064 // Method: fetLUSOTrigger
00065 //   * Get Lowest Unprescaled Single Object Triggers and Energy Sums
00066 //-------------------------------------------------------------------------------------
00067 map<string,string> L1TMenuHelper::getLUSOTrigger(map<string,bool> iCategories, int IndexRefPrescaleFactors){
00068 
00069   map<string,string> out;
00070 
00071   // Getting information from the menu
00072   const AlgorithmMap                            *theAlgoMap           = &m_l1GtMenu->gtAlgorithmAliasMap();
00073   const vector< vector<L1GtMuonTemplate> >      *vMuonConditions      = &m_l1GtMenu->vecMuonTemplate();
00074   const vector< vector<L1GtCaloTemplate> >      *vCaloConditions      = &m_l1GtMenu->vecCaloTemplate();
00075   const vector< vector<L1GtEnergySumTemplate> > *vEnergySumConditions = &m_l1GtMenu->vecEnergySumTemplate();
00076 
00077   // Getting reference prescales
00078   const vector<int>& refPrescaleFactors = (*m_prescaleFactorsAlgoTrig).at(IndexRefPrescaleFactors); 
00079 
00080   AlgorithmMap MyAlgos;
00081 
00082   map<string,SingleObjectCondition> myConditions;
00083 
00084   for(unsigned int a=0 ; a<vMuonConditions->size() ; a++){
00085     for(unsigned int b=0 ; b<(*vMuonConditions)[a].size() ; b++){
00086 
00087       const L1GtMuonTemplate* MuonCondition = &(*vMuonConditions)[a][b];
00088 
00089       // Selecting conditions that require single objects
00090       if(MuonCondition->condType() == Type1s && MuonCondition->nrObjects() == 1){
00091 
00092         SingleObjectCondition tCondition;
00093  
00094         tCondition.name              = MuonCondition->condName();
00095         tCondition.conditionCategory = MuonCondition->condCategory();
00096         tCondition.conditionType     = MuonCondition->condType();
00097         tCondition.object            = MuonCondition->objectType()[0];
00098         tCondition.threshold         = (*MuonCondition->objectParameter())[0].ptHighThreshold;
00099         tCondition.quality           = (*MuonCondition->objectParameter())[0].qualityRange;
00100         tCondition.etaRange          = (*MuonCondition->objectParameter())[0].etaRange;
00101 
00102         myConditions[MuonCondition->condName()] = tCondition;
00103 
00104       }
00105     }
00106   }
00107 
00108   for(unsigned int a=0 ; a<vCaloConditions->size() ; a++){
00109     for(unsigned int b=0 ; b<(*vCaloConditions)[a].size() ; b++){
00110 
00111       const L1GtCaloTemplate* CaloCondition = &(*vCaloConditions)[a][b];
00112 
00113       if(CaloCondition->condType() == Type1s && CaloCondition->nrObjects() == 1){
00114 
00115         SingleObjectCondition tCondition;
00116  
00117         tCondition.name              = CaloCondition->condName();
00118         tCondition.conditionCategory = CaloCondition->condCategory();
00119         tCondition.conditionType     = CaloCondition->condType();
00120         tCondition.object            = CaloCondition->objectType()[0];
00121         tCondition.threshold         = (*CaloCondition->objectParameter())[0].etThreshold;
00122         tCondition.quality           = 0;
00123         tCondition.etaRange          = (*CaloCondition->objectParameter())[0].etaRange;
00124 
00125         myConditions[CaloCondition->condName()] = tCondition;
00126 
00127       }
00128     }
00129   }
00130 
00131   for(unsigned int a=0 ; a<vEnergySumConditions->size() ; a++){
00132     for(unsigned int b=0 ; b<(*vEnergySumConditions)[a].size() ; b++){
00133 
00134       const L1GtEnergySumTemplate* EnergySumCondition = &(*vEnergySumConditions)[a][b];
00135 
00136       if((EnergySumCondition->condType() == TypeETT || 
00137           EnergySumCondition->condType() == TypeETM ||
00138           EnergySumCondition->condType() == TypeHTT ||
00139           EnergySumCondition->condType() == TypeHTM
00140         ) && EnergySumCondition->nrObjects() == 1){
00141 
00142         SingleObjectCondition tCondition;
00143  
00144         tCondition.name              = EnergySumCondition->condName();
00145         tCondition.conditionCategory = EnergySumCondition->condCategory();
00146         tCondition.conditionType     = EnergySumCondition->condType();
00147         tCondition.object            = EnergySumCondition->objectType()[0];
00148         tCondition.threshold         = (*EnergySumCondition->objectParameter())[0].etThreshold;
00149         tCondition.quality           = 0;
00150         tCondition.etaRange          = 0;
00151 
00152         myConditions[EnergySumCondition->condName()] = tCondition;
00153 
00154       }
00155     }
00156   }
00157 
00158   for (CItAlgo iAlgo = theAlgoMap->begin(); iAlgo!=theAlgoMap->end(); ++iAlgo){
00159 
00160     int error;
00161 
00162     bool         algoIsValid  = true;
00163     unsigned int maxThreshold = 0;
00164     int          tAlgoMask    = myUtils.triggerMask(iAlgo->first,error);
00165     L1GtObject   tObject      = Mu;  // Initial dummy value
00166     unsigned int tQuality     = 0;   // Only aplicable to Muons
00167     unsigned int tEtaRange    = 0;
00168 
00169     // Objects associated
00170     bool isMu      = false;
00171     bool isNoIsoEG = false;
00172     bool isIsoEG   = false;
00173     bool isCenJet  = false;
00174     bool isForJet  = false;
00175     bool isTauJet  = false;
00176     bool isETM     = false;
00177     bool isETT     = false;
00178     bool isHTT     = false;
00179     bool isHTM     = false;
00180 
00181     // Check if the trigger is masked
00182     if(tAlgoMask != 0){
00183       algoIsValid = false;
00184     }
00185     else{
00186 
00187       const L1GtAlgorithm *pAlgo = &(iAlgo->second);
00188 
00189       for(unsigned int i=0; i<pAlgo->algoRpnVector().size() ; i++){
00190 
00191         // Algorithm cannot be single algo if it requires 2 simultaneous conditions
00192         // FIXME: Should be improved to be sure one of the conditions is not technical (ex: BPTX)
00193         if(pAlgo->algoRpnVector()[i].operation == L1GtLogicParser::OP_AND){
00194           algoIsValid = false;
00195           break;
00196         }
00197         else if(pAlgo->algoRpnVector()[i].operation == L1GtLogicParser::OP_OPERAND){
00198 
00199           string AlgoCondition                                     = pAlgo->algoRpnVector()[i].operand;
00200           map<string,SingleObjectCondition>::const_iterator ciCond = myConditions.find(AlgoCondition);
00201 
00202           // If there is no matching condition (i.e. its not a single object or energy sum condition)
00203           // ignore this this L1 algo
00204           if(ciCond == myConditions.end()){
00205             algoIsValid = false;
00206             break;
00207           }
00208           // If trigger was not invalidated by this condition we register its objects and threshold
00209           else{
00210 
00211             // Updating value for the object with the maximum threshold for this triger          
00212             if(maxThreshold < (*ciCond).second.threshold){
00213                maxThreshold = (*ciCond).second.threshold;
00214                tObject      = (*ciCond).second.object;
00215                tQuality     = (*ciCond).second.quality;
00216                tEtaRange    = (*ciCond).second.etaRange;
00217             }
00218 
00219             if     ((*ciCond).second.object == Mu)     {isMu      = true;}
00220             else if((*ciCond).second.object == NoIsoEG){isNoIsoEG = true;}
00221             else if((*ciCond).second.object == IsoEG)  {isIsoEG   = true;}        
00222             else if((*ciCond).second.object == CenJet) {isCenJet  = true;}
00223             else if((*ciCond).second.object == ForJet) {isForJet  = true;}
00224             else if((*ciCond).second.object == TauJet) {isTauJet  = true;}
00225             else if((*ciCond).second.object == ETM)    {isETM     = true;}
00226             else if((*ciCond).second.object == ETT)    {isETT     = true;}
00227             else if((*ciCond).second.object == HTT)    {isHTT     = true;}
00228             else if((*ciCond).second.object == HTM)    {isHTM     = true;}
00229             
00230           }
00231         }
00232       }
00233     }    
00234 
00235     if(algoIsValid){
00236   
00237       SingleObjectTrigger tTrigger;
00238       tTrigger.alias     = iAlgo->first;
00239       tTrigger.bit       = (iAlgo->second).algoBitNumber();
00240       tTrigger.prescale  = refPrescaleFactors[tTrigger.bit];
00241       tTrigger.threshold = maxThreshold;
00242       tTrigger.object    = tObject;
00243       tTrigger.quality   = tQuality;   // Only aplicable to Muons
00244       tTrigger.etaRange  = tEtaRange;  // Only aplicable to EG and Muons 
00245 
00246       // Counting the number of different trigger conditions
00247       int nCond = 0;
00248       if(isMu)     {nCond++;}
00249       if(isNoIsoEG){nCond++;}
00250       if(isIsoEG)  {nCond++;}
00251       if(isCenJet) {nCond++;}
00252       if(isForJet) {nCond++;}
00253       if(isTauJet) {nCond++;}
00254       if(isETM)    {nCond++;}
00255       if(isETT)    {nCond++;}
00256       if(isHTT)    {nCond++;}
00257       if(isHTM)    {nCond++;}
00258 
00259       // If the trigger matched one of the pre-defined categories it is added to
00260       // the corresponding trigger vector
00261       if     (nCond==1 && isMu     ==true){
00262         //TODO: tTrigger.etaRange
00263         m_vTrigMu    .push_back(tTrigger);
00264       }
00265       else if(nCond==2 && isNoIsoEG==true && isIsoEG ==true)                  {m_vTrigEG    .push_back(tTrigger);}
00266       else if(nCond==1 && isIsoEG  ==true)                                    {m_vTrigIsoEG .push_back(tTrigger);}
00267       else if(nCond==3 && isCenJet ==true && isForJet==true && isTauJet==true){m_vTrigJet   .push_back(tTrigger);}
00268       else if(nCond==1 && isCenJet ==true)                                    {m_vTrigCenJet.push_back(tTrigger);}
00269       else if(nCond==1 && isForJet ==true)                                    {m_vTrigForJet.push_back(tTrigger);}
00270       else if(nCond==1 && isTauJet ==true)                                    {m_vTrigTauJet.push_back(tTrigger);}
00271       else if(nCond==1 && isETT    ==true)                                    {m_vTrigETT   .push_back(tTrigger);}
00272       else if(nCond==1 && isETM    ==true)                                    {m_vTrigETM   .push_back(tTrigger);}
00273       else if(nCond==1 && isHTT    ==true)                                    {m_vTrigHTT   .push_back(tTrigger);}
00274       else if(nCond==1 && isHTM    ==true)                                    {m_vTrigHTM   .push_back(tTrigger);}
00275     }
00276 
00277   }
00278 
00279   //--------------------------------------------------------------------------------------
00280   // Now that we have built vectors of SingleObjectTrigger by category we can select for
00281   // each category the lowest unprescaled single object trigger.
00282   // NOTE: Since it is not guaranteed that all categories will have at least one unprescaled
00283   //       trigger this method will return in that case the lowest prescale trigger available
00284   //--------------------------------------------------------------------------------------
00285 
00286   string selTrigMu     = "Undefined";
00287   string selTrigEG     = "Undefined";
00288   string selTrigIsoEG  = "Undefined";
00289   string selTrigJet    = "Undefined";
00290   string selTrigCenJet = "Undefined";
00291   string selTrigForJet = "Undefined";
00292   string selTrigTauJet = "Undefined";
00293   string selTrigETT    = "Undefined";
00294   string selTrigETM    = "Undefined";
00295   string selTrigHTT    = "Undefined";
00296   string selTrigHTM    = "Undefined";
00297  
00298   if(m_vTrigMu    .size() > 0){sort(m_vTrigMu    .begin(),m_vTrigMu    .end()); selTrigMu     = m_vTrigMu    [0].alias;}
00299   if(m_vTrigEG    .size() > 0){sort(m_vTrigEG    .begin(),m_vTrigEG    .end()); selTrigEG     = m_vTrigEG    [0].alias;}
00300   if(m_vTrigIsoEG .size() > 0){sort(m_vTrigIsoEG .begin(),m_vTrigIsoEG .end()); selTrigIsoEG  = m_vTrigIsoEG [0].alias;}
00301   if(m_vTrigJet   .size() > 0){sort(m_vTrigJet   .begin(),m_vTrigJet   .end()); selTrigJet    = m_vTrigJet   [0].alias;}
00302   if(m_vTrigCenJet.size() > 0){sort(m_vTrigCenJet.begin(),m_vTrigCenJet.end()); selTrigCenJet = m_vTrigCenJet[0].alias;}
00303   if(m_vTrigForJet.size() > 0){sort(m_vTrigForJet.begin(),m_vTrigForJet.end()); selTrigForJet = m_vTrigForJet[0].alias;}
00304   if(m_vTrigTauJet.size() > 0){sort(m_vTrigTauJet.begin(),m_vTrigTauJet.end()); selTrigTauJet = m_vTrigTauJet[0].alias;}
00305   if(m_vTrigETT   .size() > 0){sort(m_vTrigETT   .begin(),m_vTrigETT   .end()); selTrigETT    = m_vTrigETT   [0].alias;}
00306   if(m_vTrigETM   .size() > 0){sort(m_vTrigETM   .begin(),m_vTrigETM   .end()); selTrigETM    = m_vTrigETM   [0].alias;}
00307   if(m_vTrigHTT   .size() > 0){sort(m_vTrigHTT   .begin(),m_vTrigHTT   .end()); selTrigHTT    = m_vTrigHTT   [0].alias;}
00308   if(m_vTrigHTM   .size() > 0){sort(m_vTrigHTM   .begin(),m_vTrigHTM   .end()); selTrigHTM    = m_vTrigHTM   [0].alias;}
00309 
00310   if(iCategories["Mu"])    {out["Mu"]     = selTrigMu;}
00311   if(iCategories["EG"])    {out["EG"]     = selTrigEG;}
00312   if(iCategories["IsoEG"]) {out["IsoEG"]  = selTrigIsoEG;}
00313   if(iCategories["Jet"])   {out["Jet"]    = selTrigJet;}
00314   if(iCategories["CenJet"]){out["CenJet"] = selTrigCenJet;}
00315   if(iCategories["ForJet"]){out["ForJet"] = selTrigForJet;}
00316   if(iCategories["TauJet"]){out["TauJet"] = selTrigTauJet;}
00317   if(iCategories["ETT"])   {out["ETT"]    = selTrigETT;}
00318   if(iCategories["ETM"])   {out["ETM"]    = selTrigETM;}
00319   if(iCategories["HTT"])   {out["HTT"]    = selTrigHTT;}
00320   if(iCategories["HTM"])   {out["HTM"]    = selTrigHTM;}
00321 
00322   return out;
00323 
00324 }
00325 
00326 map<string,string> L1TMenuHelper::testAlgos(map<string,string> iAlgos){
00327 
00328   // Getting information from the menu
00329   const AlgorithmMap *theAlgoMap = &m_l1GtMenu->gtAlgorithmAliasMap();
00330 
00331   for(map<string,string>::const_iterator i = iAlgos.begin() ; iAlgos.end() != i ; i++){
00332 
00333     string tCategory = (*i).first;
00334     string tTrigger  = (*i).second;
00335 
00336     if(tTrigger == "" ){iAlgos[tCategory] = "Undefined";}
00337     else{
00338       if(theAlgoMap->find(tTrigger) == theAlgoMap->end()){iAlgos[tCategory] = "Undefined (Wrong Name)";}
00339     }
00340 
00341   }
00342 
00343   return iAlgos;
00344 
00345 }
00346 
00347 //-------------------------------------------------------------------------------------
00348 // Method: enumToStringL1GtObject
00349 //   * Converts L1GtObject (enum) to string
00350 //-------------------------------------------------------------------------------------
00351 string L1TMenuHelper::enumToStringL1GtObject(L1GtObject iObject){
00352 
00353   string out;
00354 
00355   switch(iObject){
00356     case Mu:           out = "Mu";           break;
00357     case NoIsoEG:      out = "NoIsoEG";      break;
00358     case IsoEG:        out = "IsoEG";        break;
00359     case CenJet:       out = "CenJet";       break;
00360     case ForJet:       out = "ForJet";       break;
00361     case TauJet:       out = "TauJet";       break;
00362     case ETM:          out = "ETM";          break;
00363     case ETT:          out = "ETT";          break;
00364     case HTT:          out = "HTT";          break;
00365     case HTM:          out = "HTM";          break;
00366     case JetCounts:    out = "JetCounts";    break;
00367     case HfBitCounts:  out = "HfBitCounts";  break;
00368     case HfRingEtSums: out = "HfRingEtSums"; break;
00369     case TechTrig:     out = "TechTrig";     break;
00370     case Castor:       out = "Castor";       break;
00371     case BPTX:         out = "BPTX";         break;
00372     case GtExternal:   out = "GtExternal";   break;
00373     default:           out = "Unknown";      break;
00374   };
00375 
00376   return out;
00377 
00378 }
00379 
00380 //-------------------------------------------------------------------------------------
00381 // Method: enumToStringL1GtConditionType
00382 //   * Converts L1GtConditionType (enum) to string
00383 //-------------------------------------------------------------------------------------
00384 string L1TMenuHelper::enumToStringL1GtConditionType(L1GtConditionType iConditionType){
00385 
00386   string out;
00387 
00388   switch(iConditionType){
00389     case TypeNull:         out = "TypeNull";         break;
00390     case Type1s:           out = "Type1s";           break;
00391     case Type2s:           out = "Type2s";           break;
00392     case Type2wsc:         out = "Type2wsc";         break;
00393     case Type2cor:         out = "Type2cor";         break;
00394     case Type3s:           out = "Type3s";           break;
00395     case Type4s:           out = "Type4s";           break;
00396     case TypeETM:          out = "TypeETM";          break;
00397     case TypeETT:          out = "TypeETT";          break;
00398     case TypeHTT:          out = "TypeHTT";          break;
00399     case TypeHTM:          out = "TypeHTM";          break;
00400     case TypeJetCounts:    out = "TypeJetCounts";    break;
00401     case TypeCastor:       out = "TypeCastor";       break;
00402     case TypeHfBitCounts:  out = "TypeHfBitCounts";  break;
00403     case TypeHfRingEtSums: out = "TypeHfRingEtSums"; break;
00404     case TypeBptx:         out = "TypeBptx";         break;
00405     case TypeExternal:     out = "TypeExternal";     break;
00406     default:               out = "Unknown";          break;
00407   };
00408 
00409   return out;
00410 
00411 } 
00412 
00413 //__________________________________________________________________
00414 // Method: enumToStringL1GtConditionCategory
00415 //   * Converts L1GtConditionCategory (enum) to string
00416 //__________________________________________________________________
00417 string L1TMenuHelper::enumToStringL1GtConditionCategory(L1GtConditionCategory iConditionCategory){
00418 
00419   string out;
00420 
00421   switch(iConditionCategory){
00422     case CondNull:         out = "CondNull";         break;
00423     case CondMuon:         out = "CondMuon";         break;
00424     case CondCalo:         out = "CondCalo";         break;
00425     case CondEnergySum:    out = "CondEnergySum";    break;
00426     case CondJetCounts:    out = "CondJetCounts";    break;
00427     case CondCorrelation:  out = "CondCorrelation";  break;
00428     case CondCastor:       out = "CondCastor";       break;
00429     case CondHfBitCounts:  out = "CondHfBitCounts";  break;
00430     case CondHfRingEtSums: out = "CondHfRingEtSums"; break;
00431     case CondBptx:         out = "CondBptx";         break;
00432     case CondExternal:     out = "CondExternal";     break;
00433     default:               out = "Unknown";          break;
00434   };
00435 
00436   return out;
00437 
00438 }
00439 
00440 //__________________________________________________________________
00441 int L1TMenuHelper::getPrescaleByAlias(TString iCategory,TString iAlias){
00442 
00443     int out = -1;
00444 
00445     if(iCategory == "Mu"){ 
00446       for(unsigned int i=0 ; i<m_vTrigMu.size() ; i++){if(m_vTrigMu[i].alias==iAlias)        {return m_vTrigMu[i].prescale;}} 
00447     }else if(iCategory == "EG"){ 
00448       for(unsigned int i=0 ; i<m_vTrigEG.size() ; i++){if(m_vTrigEG[i].alias==iAlias)        {return m_vTrigEG[i].prescale;}} 
00449     }else if(iCategory == "IsoEG"){ 
00450       for(unsigned int i=0 ; i<m_vTrigIsoEG.size()  ; i++){if(m_vTrigIsoEG[i].alias==iAlias) {return m_vTrigIsoEG[i].prescale;}} 
00451     }else if(iCategory == "Jet"){
00452       for(unsigned int i=0 ; i<m_vTrigJet.size()    ; i++){if(m_vTrigJet[i].alias==iAlias)   {return m_vTrigJet[i].prescale;}} 
00453     }else if(iCategory == "CenJet"){ 
00454       for(unsigned int i=0 ; i<m_vTrigCenJet.size() ; i++){if(m_vTrigCenJet[i].alias==iAlias){return m_vTrigCenJet[i].prescale;}}
00455     }else if(iCategory == "ForJet"){ 
00456       for(unsigned int i=0 ; i<m_vTrigForJet.size() ; i++){if(m_vTrigForJet[i].alias==iAlias){return m_vTrigForJet[i].prescale;}}
00457     }else if(iCategory == "TauJet"){ 
00458       for(unsigned int i=0 ; i<m_vTrigTauJet.size() ; i++){if(m_vTrigTauJet[i].alias==iAlias){return m_vTrigTauJet[i].prescale;}}
00459     }else if(iCategory == "ETT"){ 
00460       for(unsigned int i=0 ; i<m_vTrigETT.size()    ; i++){if(m_vTrigETT[i].alias==iAlias)   {return m_vTrigETT[i].prescale;}}
00461     }else if(iCategory == "ETM"){ 
00462       for(unsigned int i=0 ; i<m_vTrigETM.size()    ; i++){if(m_vTrigETM[i].alias==iAlias)   {return m_vTrigETM[i].prescale;}}
00463     }else if(iCategory == "HTT"){ 
00464       for(unsigned int i=0 ; i<m_vTrigHTT.size()    ; i++){if(m_vTrigHTT[i].alias==iAlias)   {return m_vTrigHTT[i].prescale;}}
00465     }else if(iCategory == "HTM"){ 
00466       for(unsigned int i=0 ; i<m_vTrigHTM.size()    ; i++){if(m_vTrigHTM[i].alias==iAlias)   {return m_vTrigHTM[i].prescale;}}
00467     }
00468 
00469   return out;
00470 
00471 }
00472 
00473 //__________________________________________________________________
00474 unsigned int L1TMenuHelper::getEtaRangeByAlias(TString iCategory,TString iAlias){
00475 
00476     unsigned int out = -1;
00477 
00478     if(iCategory == "Mu"){ 
00479       for(unsigned int i=0 ; i<m_vTrigMu.size() ; i++){if(m_vTrigMu[i].alias==iAlias)        {return m_vTrigMu[i].etaRange;}} 
00480     }else if(iCategory == "EG"){ 
00481       for(unsigned int i=0 ; i<m_vTrigEG.size() ; i++){if(m_vTrigEG[i].alias==iAlias)        {return m_vTrigEG[i].etaRange;}} 
00482     }else if(iCategory == "IsoEG"){ 
00483       for(unsigned int i=0 ; i<m_vTrigIsoEG.size()  ; i++){if(m_vTrigIsoEG[i].alias==iAlias) {return m_vTrigIsoEG[i].etaRange;}} 
00484     }else if(iCategory == "Jet"){
00485       for(unsigned int i=0 ; i<m_vTrigJet.size()    ; i++){if(m_vTrigJet[i].alias==iAlias)   {return m_vTrigJet[i].etaRange;}} 
00486     }else if(iCategory == "CenJet"){ 
00487       for(unsigned int i=0 ; i<m_vTrigCenJet.size() ; i++){if(m_vTrigCenJet[i].alias==iAlias){return m_vTrigCenJet[i].etaRange;}} 
00488     }else if(iCategory == "ForJet"){ 
00489       for(unsigned int i=0 ; i<m_vTrigForJet.size() ; i++){if(m_vTrigForJet[i].alias==iAlias){return m_vTrigForJet[i].etaRange;}} 
00490     }else if(iCategory == "TauJet"){ 
00491       for(unsigned int i=0 ; i<m_vTrigTauJet.size() ; i++){if(m_vTrigTauJet[i].alias==iAlias){return m_vTrigTauJet[i].etaRange;}} 
00492     }else if(iCategory == "ETT"){ 
00493       for(unsigned int i=0 ; i<m_vTrigETT.size()    ; i++){if(m_vTrigETT[i].alias==iAlias)   {return m_vTrigETT[i].etaRange;}} 
00494     }else if(iCategory == "ETM"){ 
00495       for(unsigned int i=0 ; i<m_vTrigETM.size()    ; i++){if(m_vTrigETM[i].alias==iAlias)   {return m_vTrigETM[i].etaRange;}} 
00496     }else if(iCategory == "HTT"){ 
00497       for(unsigned int i=0 ; i<m_vTrigHTT.size()    ; i++){if(m_vTrigHTT[i].alias==iAlias)   {return m_vTrigHTT[i].etaRange;}}  
00498     }else if(iCategory == "HTM"){ 
00499       for(unsigned int i=0 ; i<m_vTrigHTM.size()    ; i++){if(m_vTrigHTM[i].alias==iAlias)   {return m_vTrigHTM[i].etaRange;}} 
00500     }
00501 
00502   return out;
00503 
00504 }
00505 
00506 //__________________________________________________________________
00507 unsigned int L1TMenuHelper::getQualityAlias(TString iCategory,TString iAlias){
00508 
00509     unsigned int out = -1;
00510 
00511     if(iCategory == "Mu"){ 
00512       for(unsigned int i=0 ; i<m_vTrigMu.size() ; i++){if(m_vTrigMu[i].alias==iAlias)        {return m_vTrigMu[i].quality;}} 
00513     }else if(iCategory == "EG"){ 
00514       for(unsigned int i=0 ; i<m_vTrigEG.size() ; i++){if(m_vTrigEG[i].alias==iAlias)        {return m_vTrigEG[i].quality;}} 
00515     }else if(iCategory == "IsoEG"){ 
00516       for(unsigned int i=0 ; i<m_vTrigIsoEG.size()  ; i++){if(m_vTrigIsoEG[i].alias==iAlias) {return m_vTrigIsoEG[i].quality;}} 
00517     }else if(iCategory == "Jet"){
00518       for(unsigned int i=0 ; i<m_vTrigJet.size()    ; i++){if(m_vTrigJet[i].alias==iAlias)   {return m_vTrigJet[i].quality;}} 
00519     }else if(iCategory == "CenJet"){ 
00520       for(unsigned int i=0 ; i<m_vTrigCenJet.size() ; i++){if(m_vTrigCenJet[i].alias==iAlias){return m_vTrigCenJet[i].quality;}} 
00521     }else if(iCategory == "ForJet"){ 
00522       for(unsigned int i=0 ; i<m_vTrigForJet.size() ; i++){if(m_vTrigForJet[i].alias==iAlias){return m_vTrigForJet[i].quality;}} 
00523     }else if(iCategory == "TauJet"){ 
00524       for(unsigned int i=0 ; i<m_vTrigTauJet.size() ; i++){if(m_vTrigTauJet[i].alias==iAlias){return m_vTrigTauJet[i].quality;}} 
00525     }else if(iCategory == "ETT"){ 
00526       for(unsigned int i=0 ; i<m_vTrigETT.size()    ; i++){if(m_vTrigETT[i].alias==iAlias)   {return m_vTrigETT[i].quality;}} 
00527     }else if(iCategory == "ETM"){ 
00528       for(unsigned int i=0 ; i<m_vTrigETM.size()    ; i++){if(m_vTrigETM[i].alias==iAlias)   {return m_vTrigETM[i].quality;}} 
00529     }else if(iCategory == "HTT"){ 
00530       for(unsigned int i=0 ; i<m_vTrigHTT.size()    ; i++){if(m_vTrigHTT[i].alias==iAlias)   {return m_vTrigHTT[i].quality;}}  
00531     }else if(iCategory == "HTM"){ 
00532       for(unsigned int i=0 ; i<m_vTrigHTM.size()    ; i++){if(m_vTrigHTM[i].alias==iAlias)   {return m_vTrigHTM[i].quality;}} 
00533     }
00534 
00535   return out;
00536 
00537 }