CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10/src/DQM/L1TMonitor/interface/L1TOMDSHelper.h

Go to the documentation of this file.
00001 #ifndef DQM_L1TMONITOR_L1TOMDSHELPER_H
00002 #define DQM_L1TMONITOR_L1TOMDSHELPER_H
00003 
00004 #include "FWCore/Framework/interface/Frameworkfwd.h"
00005 
00006 #include "CondTools/L1Trigger/interface/OMDSReader.h"
00007 
00008 // ROOT includes
00009 #include "TString.h"
00010 
00011 // System includes
00012 #include <memory>
00013 #include <iostream>
00014 #include <string>
00015 #include <vector>
00016 #include <map>
00017 
00018 // Simplified structure for single object conditions information
00019 class BeamConfiguration{
00020 
00021   public:
00022 
00023     BeamConfiguration(){m_valid = false;}
00024 
00025     bool bxConfig(int iBx){
00026       if(beam1[iBx] && beam2[iBx]){return true;}
00027       else                        {return false;}
00028     }
00029     
00030     bool isValid(){return m_valid;}
00031 
00032     bool m_valid;           // Bit Name for which the fit refers to
00033     std::vector<bool> beam1;
00034     std::vector<bool> beam2;
00035 
00036 };
00037 
00038 // Simplified structure for single object conditions information
00039 struct WbMTriggerXSecFit{
00040 
00041   TString bitName;         // Bit Name for which the fit refers to
00042   TString fitFunction;     // Fitting function (hard coded for now...)
00043   float   bitNumber;       // Bit Number for which the fit refers to
00044   float   pm1, p0, p1, p2; // Fit parameters f(x)=pm1*x^(-1)+p0+p1*x+p2*x^2
00045  
00046 };
00047 
00048 class L1TOMDSHelper {
00049 
00050   public:
00051 
00052     enum Error{
00053       NO_ERROR=0,
00054       WARNING_DB_CONN_FAILED,
00055       WARNING_DB_QUERY_FAILED,
00056       WARNING_DB_INCORRECT_NBUNCHES
00057     };
00058 
00059   public:
00060 
00061     L1TOMDSHelper(); 
00062     ~L1TOMDSHelper(); // Destructor
00063 
00064     bool                                    connect              (std::string iOracleDB,std::string iPathCondDB,int &error);
00065     std::map<std::string,WbMTriggerXSecFit> getWbMTriggerXsecFits(std::string iTable,int &error);
00066     std::map<std::string,WbMTriggerXSecFit> getWbMAlgoXsecFits       (int &error);
00067     std::map<std::string,WbMTriggerXSecFit> getWbMTechXsecFits       (int &error);
00068     int                                     getNumberCollidingBunches(int lhcFillNumber,int &error);
00069     BeamConfiguration                       getBeamConfiguration     (int lhcFillNumber,int &error);
00070     std::vector<bool>                       getBunchStructure        (int lhcFillNumber,int &error);
00071     std::vector<float>                      getInitBunchLumi         (int lhcFillNumber,int &error);
00072     std::vector<double>                     getRelativeBunchLumi     (int lhcFillNumber,int &error);
00073 
00074     std::string                             enumToStringError(int);
00075 
00076   private:
00077 
00078 
00079     std::string m_oracleDB;
00080     std::string m_pathCondDB;
00081 
00082     l1t::OMDSReader *m_omdsReader;
00083 
00084 };
00085 
00086 #endif