26 m_oracleDB = iOracleDB;
27 m_pathCondDB = iPathCondDB;
31 bool SessionOpen =
false;
35 m_omdsReader->connect(m_oracleDB,m_pathCondDB);
38 if(!m_omdsReader->dbSession().connectionString().empty()){SessionOpen =
true;}
41 if (SessionOpen){out =
true;}
42 else {error = WARNING_DB_CONN_FAILED;}
52 map<string,WbMTriggerXSecFit>
out;
57 string qSchema =
"CMS_WBM";
60 vector<string> qStrings;
61 qStrings.push_back(
"BIT");
62 qStrings.push_back(
"NAME");
63 qStrings.push_back(
"PM1");
64 qStrings.push_back(
"P0");
65 qStrings.push_back(
"P1");
66 qStrings.push_back(
"P2");
70 if(paramResults.
queryFailed()){error = WARNING_DB_QUERY_FAILED;}
100 return getWbMTriggerXsecFits(
"LEVEL1_ALGO_CROSS_SECTION",error);
105 return getWbMTriggerXsecFits(
"LEVEL1_TECH_CROSS_SECTION",error);
111 int nCollidingBunches = 0;
115 string rtlSchema =
"CMS_RUNTIME_LOGGER";
116 string table =
"FILL_INITLUMIPERBUNCH";
117 string atribute1 =
"LHCFILL";
120 vector<std::string> qStrings ;
121 qStrings.push_back(
"BUNCH");
122 qStrings.push_back(
"BEAM1CONFIG");
123 qStrings.push_back(
"BEAM2CONFIG");
125 l1t::OMDSReader::QueryResults qResults = m_omdsReader->basicQuery(qStrings,rtlSchema,table,atribute1,m_omdsReader->singleAttribute(lhcFillNumber));
128 if(qResults.
queryFailed()){error = WARNING_DB_QUERY_FAILED;}
131 if(qResults.
numberRows() != 3564){error = WARNING_DB_INCORRECT_NBUNCHES;}
137 bool beam1config,beam2config;
142 if(beam1config && beam2config){nCollidingBunches++;}
147 return nCollidingBunches;
158 string rtlSchema =
"CMS_RUNTIME_LOGGER";
159 string table =
"FILL_INITLUMIPERBUNCH";
160 string atribute1 =
"LHCFILL";
163 vector<std::string> qStrings ;
164 qStrings.push_back(
"BUNCH");
165 qStrings.push_back(
"BEAM1CONFIG");
166 qStrings.push_back(
"BEAM2CONFIG");
168 l1t::OMDSReader::QueryResults qResults = m_omdsReader->basicQuery(qStrings,rtlSchema,table,atribute1,m_omdsReader->singleAttribute(lhcFillNumber));
170 if(qResults.
queryFailed()){error = WARNING_DB_QUERY_FAILED;}
173 if(qResults.
numberRows() != 3564){error = WARNING_DB_INCORRECT_NBUNCHES;}
178 int nCollidingBunches = 0;
182 bool beam1config,beam2config;
187 if(beam1config){bConfig.
beam1.push_back(
true);}
188 else {bConfig.
beam1.push_back(
false);}
190 if(beam2config){bConfig.
beam2.push_back(
true);}
191 else {bConfig.
beam2.push_back(
false);}
193 if(beam1config && beam2config){nCollidingBunches++;}
209 vector<bool> BunchStructure;
213 string rtlSchema =
"CMS_RUNTIME_LOGGER";
214 string table =
"FILL_INITLUMIPERBUNCH";
215 string atribute1 =
"LHCFILL";
218 vector<std::string> qStrings ;
219 qStrings.push_back(
"BUNCH");
220 qStrings.push_back(
"BEAM1CONFIG");
221 qStrings.push_back(
"BEAM2CONFIG");
223 l1t::OMDSReader::QueryResults qResults = m_omdsReader->basicQuery(qStrings,rtlSchema,table,atribute1,m_omdsReader->singleAttribute(lhcFillNumber));
225 if(qResults.
queryFailed()){error = WARNING_DB_QUERY_FAILED;}
228 if(qResults.
numberRows() != 3564){error = WARNING_DB_INCORRECT_NBUNCHES;}
233 bool beam1config,beam2config;
238 if(beam1config && beam2config){BunchStructure.push_back(
true);}
239 else {BunchStructure.push_back(
false);}
245 return BunchStructure;
252 vector<float> InitBunchLumi;
256 string rtlSchema =
"CMS_RUNTIME_LOGGER";
257 string table =
"FILL_INITLUMIPERBUNCH";
258 string atribute1 =
"LHCFILL";
261 vector<std::string> qStrings ;
262 qStrings.push_back(
"BUNCH");
263 qStrings.push_back(
"INITBUNCHLUMI");
265 l1t::OMDSReader::QueryResults qResults = m_omdsReader->basicQuery(qStrings,rtlSchema,table,atribute1,m_omdsReader->singleAttribute(lhcFillNumber));
267 if(qResults.
queryFailed()){error = WARNING_DB_QUERY_FAILED;}
270 if(qResults.
numberRows() != 3564){error = WARNING_DB_INCORRECT_NBUNCHES;}
279 InitBunchLumi.push_back(initbunchlumi);
284 return InitBunchLumi;
291 vector<double> RelativeBunchLumi;
295 string rtlSchema =
"CMS_RUNTIME_LOGGER";
296 string table =
"FILL_INITLUMIPERBUNCH";
297 string atribute1 =
"LHCFILL";
300 vector<std::string> qStrings ;
301 qStrings.push_back(
"BUNCH");
302 qStrings.push_back(
"INITBUNCHLUMI");
304 l1t::OMDSReader::QueryResults qResults = m_omdsReader->basicQuery(qStrings,rtlSchema,table,atribute1,m_omdsReader->singleAttribute(lhcFillNumber));
306 if(qResults.
queryFailed()){error = WARNING_DB_QUERY_FAILED;}
309 if(qResults.
numberRows() != 3564){error = WARNING_DB_INCORRECT_NBUNCHES;}
313 double InitTotalLumi = 0;
314 vector<float> InitBunchLumi;
322 InitTotalLumi += initbunchlumi;
323 InitBunchLumi.push_back(initbunchlumi);
327 for(
unsigned int i=0 ;
i<InitBunchLumi.size() ;
i++){
328 RelativeBunchLumi.push_back(InitBunchLumi[
i]/InitTotalLumi);
333 return RelativeBunchLumi;
343 case NO_ERROR: out =
"NO_ERROR";
break;
344 case WARNING_DB_CONN_FAILED: out =
"WARNING_DB_CONN_FAILED";
break;
345 case WARNING_DB_QUERY_FAILED: out =
"WARNING_DB_QUERY_FAILED";
break;
346 case WARNING_DB_INCORRECT_NBUNCHES: out =
"WARNING_DB_INCORRECT_NBUNCHES";
break;
347 default: out =
"UNKNOWN";
break;
std::vector< float > getInitBunchLumi(int lhcFillNumber, int &error)
bool connect(std::string iOracleDB, std::string iPathCondDB, int &error)
std::vector< bool > getBunchStructure(int lhcFillNumber, int &error)
std::map< std::string, WbMTriggerXSecFit > getWbMTechXsecFits(int &error)
BeamConfiguration getBeamConfiguration(int lhcFillNumber, int &error)
std::map< std::string, WbMTriggerXSecFit > getWbMTriggerXsecFits(std::string iTable, int &error)
bool fillVariableFromRow(const std::string &columnName, int rowNumber, T &outputVariable) const
int getNumberCollidingBunches(int lhcFillNumber, int &error)
std::map< std::string, WbMTriggerXSecFit > getWbMAlgoXsecFits(int &error)
std::vector< bool > beam2
std::string enumToStringError(int)
std::vector< bool > beam1
std::vector< double > getRelativeBunchLumi(int lhcFillNumber, int &error)