CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch1/src/DQM/L1TMonitor/interface/L1TMenuHelper.h

Go to the documentation of this file.
00001 #ifndef DQM_L1TMONITOR_L1TMENUHELPER_H
00002 #define DQM_L1TMONITOR_L1TMENUHELPER_H
00003 
00004 /*
00005  * \file L1TMenuHelper.h
00006  *
00007  * $Date: 2011/11/15 10:41:00 $
00008  * $Revision: 1.6 $
00009  * \author J. Pela
00010  *
00011 */
00012 
00013 // system include files
00014 #include <iostream>
00015 #include <fstream>
00016 #include <vector>
00017 #include <memory>
00018 #include <unistd.h>
00019 
00020 // user include files
00021 #include "FWCore/Framework/interface/Frameworkfwd.h"
00022 #include "FWCore/Framework/interface/Event.h"
00023 #include "FWCore/Framework/interface/MakerMacros.h"
00024 
00025 #include "FWCore/ServiceRegistry/interface/Service.h"
00026 
00027 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutSetupFwd.h"
00028 
00029 #include "CondFormats/L1TObjects/interface/L1GtTriggerMenu.h"
00030 #include "CondFormats/L1TObjects/interface/L1GtTriggerMenuFwd.h"
00031 
00032 #include "L1Trigger/GlobalTriggerAnalyzer/interface/L1GtUtils.h"
00033 
00034 #include "TString.h"
00035 
00036 // Simplified structure for single object conditions information
00037 struct SingleObjectCondition{
00038 
00039   std::string           name;
00040   L1GtConditionCategory conditionCategory;
00041   L1GtConditionType     conditionType;
00042   L1GtObject            object;
00043   unsigned int                  quality;
00044   unsigned int                  etaRange;
00045   unsigned int                  threshold;
00046 
00047 };
00048 
00049 // Simplified structure for single object conditions information
00050 struct SingleObjectTrigger{
00051 
00052   L1GtObject  object;
00053   std::string alias;
00054   unsigned int        bit;
00055   int         prescale;
00056   unsigned int        threshold; //
00057   unsigned int        quality;   // Only aplicable to Muons
00058   unsigned int        etaRange;  // Only aplicable to Muons
00059 
00060   bool operator< (const SingleObjectTrigger &iSOT) const{
00061      
00062     if     (this->etaRange > iSOT.etaRange){return true;}
00063     else if(this->etaRange < iSOT.etaRange){return false;}
00064 
00065     if     (this->prescale < iSOT.prescale){return true;}
00066     else if(this->prescale > iSOT.prescale){return false;}
00067     
00068     if     (this->quality >  iSOT.quality){return true;}
00069     else if(this->quality <  iSOT.quality){return false;}
00070     
00071     return this->threshold < iSOT.threshold;
00072 
00073   }
00074 
00075 };
00076 
00077 class L1TMenuHelper {
00078 
00079   public:
00080 
00081     L1TMenuHelper(const edm::EventSetup& iSetup); // Constructor
00082     ~L1TMenuHelper();                             // Destructor
00083 
00084     // Get Lowest Unprescaled Single Object Triggers
00085     std::map<std::string,std::string> getLUSOTrigger(std::map<std::string,bool> iCategories, int IndexRefPrescaleFactors);
00086     std::map<std::string,std::string> testAlgos     (std::map<std::string,std::string>);
00087     
00088 
00089     // To convert enum to strings
00090     std::string enumToStringL1GtObject           (L1GtObject            iObject);
00091     std::string enumToStringL1GtConditionType    (L1GtConditionType     iConditionType);
00092     std::string enumToStringL1GtConditionCategory(L1GtConditionCategory iConditionCategory);
00093 
00094     // Getters
00095     int  getPrescaleByAlias(TString iCategory, TString iAlias);
00096     unsigned int getEtaRangeByAlias(TString iCategory, TString iAlias);    
00097     unsigned int getQualityAlias   (TString iCategory, TString iAlias);
00098 
00099   private:
00100 
00101     edm::ESHandle<L1GtTriggerMenu>     menuRcd;
00102     edm::ESHandle<L1GtPrescaleFactors> l1GtPfAlgo;
00103 
00104     L1GtUtils myUtils;
00105 
00106     const L1GtTriggerMenu*                m_l1GtMenu;
00107     const std::vector<std::vector<int> >* m_prescaleFactorsAlgoTrig;
00108 
00109     // Vectors to hold significant information about single object triggers
00110     std::vector<SingleObjectTrigger> m_vTrigMu;
00111     std::vector<SingleObjectTrigger> m_vTrigEG ;  
00112     std::vector<SingleObjectTrigger> m_vTrigIsoEG;
00113     std::vector<SingleObjectTrigger> m_vTrigJet  ;
00114     std::vector<SingleObjectTrigger> m_vTrigCenJet;
00115     std::vector<SingleObjectTrigger> m_vTrigForJet;
00116     std::vector<SingleObjectTrigger> m_vTrigTauJet;
00117     std::vector<SingleObjectTrigger> m_vTrigETM;   
00118     std::vector<SingleObjectTrigger> m_vTrigETT;   
00119     std::vector<SingleObjectTrigger> m_vTrigHTT;   
00120     std::vector<SingleObjectTrigger> m_vTrigHTM; 
00121 
00122 };
00123 
00124 #endif