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
00009 #include "TString.h"
00010
00011
00012 #include <memory>
00013 #include <iostream>
00014 #include <string>
00015 #include <vector>
00016 #include <map>
00017
00018
00019 class BeamConfiguration{
00020
00021 public:
00022
00023 BeamConfiguration(){
00024 m_valid = false;
00025 nCollidingBunches = 0;
00026 }
00027
00028 bool bxConfig(int iBx){
00029 if(beam1[iBx] && beam2[iBx]){return true;}
00030 else {return false;}
00031 }
00032
00033 bool isValid() {return m_valid;}
00034
00035 bool m_valid;
00036 int nCollidingBunches;
00037 std::vector<bool> beam1;
00038 std::vector<bool> beam2;
00039
00040 };
00041
00042
00043 struct WbMTriggerXSecFit{
00044
00045 TString bitName;
00046 TString fitFunction;
00047 float bitNumber;
00048 float pm1, p0, p1, p2;
00049
00050 };
00051
00052 class L1TOMDSHelper {
00053
00054 public:
00055
00056 enum Error{
00057 NO_ERROR=0,
00058 WARNING_DB_CONN_FAILED,
00059 WARNING_DB_QUERY_FAILED,
00060 WARNING_DB_INCORRECT_NBUNCHES
00061 };
00062
00063 public:
00064
00065 L1TOMDSHelper();
00066 ~L1TOMDSHelper();
00067
00068 bool connect (std::string iOracleDB,std::string iPathCondDB,int &error);
00069 std::map<std::string,WbMTriggerXSecFit> getWbMTriggerXsecFits(std::string iTable,int &error);
00070 std::map<std::string,WbMTriggerXSecFit> getWbMAlgoXsecFits (int &error);
00071 std::map<std::string,WbMTriggerXSecFit> getWbMTechXsecFits (int &error);
00072 int getNumberCollidingBunches(int lhcFillNumber,int &error);
00073 BeamConfiguration getBeamConfiguration (int lhcFillNumber,int &error);
00074 std::vector<bool> getBunchStructure (int lhcFillNumber,int &error);
00075 std::vector<float> getInitBunchLumi (int lhcFillNumber,int &error);
00076 std::vector<double> getRelativeBunchLumi (int lhcFillNumber,int &error);
00077
00078 std::string enumToStringError(int);
00079
00080 private:
00081
00082
00083 std::string m_oracleDB;
00084 std::string m_pathCondDB;
00085
00086 l1t::OMDSReader *m_omdsReader;
00087
00088 };
00089
00090 #endif