17 m_oracleDB = iOracleDB;
18 m_pathCondDB = iPathCondDB;
22 bool SessionOpen =
false;
26 m_omdsReader->connect(m_oracleDB, m_pathCondDB);
29 if (!m_omdsReader->dbSession().connectionString().empty()) {
37 error = WARNING_DB_CONN_FAILED;
45 map<string, WbMTriggerXSecFit>
out;
50 string qSchema =
"CMS_WBM";
53 vector<string> qStrings;
54 qStrings.push_back(
"BIT");
55 qStrings.push_back(
"NAME");
56 qStrings.push_back(
"PM1");
57 qStrings.push_back(
"P0");
58 qStrings.push_back(
"P1");
59 qStrings.push_back(
"P2");
64 error = WARNING_DB_QUERY_FAILED;
90 return getWbMTriggerXsecFits(
"LEVEL1_ALGO_CROSS_SECTION",
error);
95 return getWbMTriggerXsecFits(
"LEVEL1_TECH_CROSS_SECTION",
error);
100 int nCollidingBunches = 0;
104 string rtlSchema =
"CMS_RUNTIME_LOGGER";
105 string table =
"FILL_INITLUMIPERBUNCH";
106 string atribute1 =
"LHCFILL";
109 vector<std::string> qStrings;
110 qStrings.push_back(
"BUNCH");
111 qStrings.push_back(
"BEAM1CONFIG");
112 qStrings.push_back(
"BEAM2CONFIG");
115 m_omdsReader->basicQuery(qStrings, rtlSchema,
table, atribute1, m_omdsReader->singleAttribute(lhcFillNumber));
119 error = WARNING_DB_QUERY_FAILED;
122 error = WARNING_DB_INCORRECT_NBUNCHES;
127 bool beam1config, beam2config;
132 if (beam1config && beam2config) {
139 return nCollidingBunches;
148 string rtlSchema =
"CMS_RUNTIME_LOGGER";
149 string table =
"FILL_INITLUMIPERBUNCH";
150 string atribute1 =
"LHCFILL";
153 vector<std::string> qStrings;
154 qStrings.push_back(
"BUNCH");
155 qStrings.push_back(
"BEAM1CONFIG");
156 qStrings.push_back(
"BEAM2CONFIG");
159 m_omdsReader->basicQuery(qStrings, rtlSchema,
table, atribute1, m_omdsReader->singleAttribute(lhcFillNumber));
162 error = WARNING_DB_QUERY_FAILED;
165 error = WARNING_DB_INCORRECT_NBUNCHES;
169 int nCollidingBunches = 0;
173 bool beam1config, beam2config;
179 bConfig.
beam1.push_back(
true);
181 bConfig.
beam1.push_back(
false);
185 bConfig.
beam2.push_back(
true);
187 bConfig.
beam2.push_back(
false);
190 if (beam1config && beam2config) {
204 vector<bool> BunchStructure;
208 string rtlSchema =
"CMS_RUNTIME_LOGGER";
209 string table =
"FILL_INITLUMIPERBUNCH";
210 string atribute1 =
"LHCFILL";
213 vector<std::string> qStrings;
214 qStrings.push_back(
"BUNCH");
215 qStrings.push_back(
"BEAM1CONFIG");
216 qStrings.push_back(
"BEAM2CONFIG");
219 m_omdsReader->basicQuery(qStrings, rtlSchema,
table, atribute1, m_omdsReader->singleAttribute(lhcFillNumber));
222 error = WARNING_DB_QUERY_FAILED;
225 error = WARNING_DB_INCORRECT_NBUNCHES;
229 bool beam1config, beam2config;
234 if (beam1config && beam2config) {
235 BunchStructure.push_back(
true);
237 BunchStructure.push_back(
false);
243 return BunchStructure;
248 vector<float> InitBunchLumi;
252 string rtlSchema =
"CMS_RUNTIME_LOGGER";
253 string table =
"FILL_INITLUMIPERBUNCH";
254 string atribute1 =
"LHCFILL";
257 vector<std::string> qStrings;
258 qStrings.push_back(
"BUNCH");
259 qStrings.push_back(
"INITBUNCHLUMI");
262 m_omdsReader->basicQuery(qStrings, rtlSchema,
table, atribute1, m_omdsReader->singleAttribute(lhcFillNumber));
265 error = WARNING_DB_QUERY_FAILED;
268 error = WARNING_DB_INCORRECT_NBUNCHES;
276 InitBunchLumi.push_back(initbunchlumi);
281 return InitBunchLumi;
286 vector<double> RelativeBunchLumi;
290 string rtlSchema =
"CMS_RUNTIME_LOGGER";
291 string table =
"FILL_INITLUMIPERBUNCH";
292 string atribute1 =
"LHCFILL";
295 vector<std::string> qStrings;
296 qStrings.push_back(
"BUNCH");
297 qStrings.push_back(
"INITBUNCHLUMI");
300 m_omdsReader->basicQuery(qStrings, rtlSchema,
table, atribute1, m_omdsReader->singleAttribute(lhcFillNumber));
303 error = WARNING_DB_QUERY_FAILED;
306 error = WARNING_DB_INCORRECT_NBUNCHES;
309 double InitTotalLumi = 0;
310 vector<float> InitBunchLumi;
318 InitTotalLumi += initbunchlumi;
319 InitBunchLumi.push_back(initbunchlumi);
323 for (
unsigned int i = 0;
i < InitBunchLumi.size();
i++) {
324 RelativeBunchLumi.push_back(InitBunchLumi[
i] / InitTotalLumi);
329 return RelativeBunchLumi;
340 case WARNING_DB_CONN_FAILED:
341 out =
"WARNING_DB_CONN_FAILED";
343 case WARNING_DB_QUERY_FAILED:
344 out =
"WARNING_DB_QUERY_FAILED";
346 case WARNING_DB_INCORRECT_NBUNCHES:
347 out =
"WARNING_DB_INCORRECT_NBUNCHES";
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)