8 #pragma GCC diagnostic push
9 #pragma GCC diagnostic ignored "-Woverloaded-virtual"
11 #pragma GCC diagnostic pop
23 std::cout <<
"DB Name: " <<
dbname << std::endl;
24 std::cout <<
"DB Owner: " <<
dbowner << std::endl;
25 std::cout <<
"DB Pwd: " <<
dbpasswd << std::endl;
36 std::ostringstream
cmd;
38 if (runnoinput == 221)
48 std::cout << __PRETTY_FUNCTION__
49 <<
" Exception caught during DriverManager::getConnection" << std::endl;
50 std::cout <<
"Message: " << e.
getMessage() << std::endl;
55 cmd <<
"SELECT runtype,runstate,eventsinrun,brunixtime,erunixtime FROM RUN WHERE RUNNUMBER = "
59 std::cout <<
"command: " << cmd.str() << std::endl;
67 std::cout <<
"Exception caught" << std::endl;
68 std::cout <<
"Message: " << e.
getMessage() << std::endl;
73 if (runtype ==
"PHYSICS")
76 unsigned int brunixtime = rs->
getInt(
"brunixtime");
77 unsigned int erunixtime = rs->
getInt(
"erunixtime");
78 if (erunixtime - brunixtime < 300 && runstate ==
"ENDED")
80 runtype =
"PREJECTED";
84 int eventsinrun = rs->
getInt(
"eventsinrun");
85 if (eventsinrun <= 100 && runstate !=
"ENDED")
89 std::cout <<
"Run not ended and eventsinrun : " << eventsinrun << std::endl;
92 cmd <<
"SELECT sum(scalerupdatescaled) FROM trigger WHERE RUNNUMBER = "
104 std::cout <<
"Exception caught" << std::endl;
105 std::cout <<
"Message: " << e.
getMessage() << std::endl;
107 if (rs1 && rs1->
next())
113 std::cout <<
"Run not ended and eventsinrun < 500000, sum of scaled triggers: "
114 << eventsinrun << std::endl;
117 if (eventsinrun <= 100)
119 runtype =
"PREJECTED";
128 if (runtype ==
"UNKNOWN")
132 std::cout <<
"Run unknown in DB trying from file" << std::endl;
139 std::cout <<
"Run Type is " << runtype << std::endl;
150 std::ostringstream
cmd;
158 std::cout << __PRETTY_FUNCTION__
159 <<
" Exception caught during DriverManager::getConnection" << std::endl;
160 std::cout <<
"Message: " << e.
getMessage() << std::endl;
165 cmd <<
"SELECT runnumber FROM RUN WHERE eventsinrun > 100000 and runtype = '"
166 << type <<
"' and runnumber < "
168 <<
" order by runnumber desc limit " << nruns;
171 std::cout <<
"command: " << cmd.str() << std::endl;
179 std::cout <<
"Exception caught" << std::endl;
180 std::cout <<
"Message: " << e.
getMessage() << std::endl;
186 result.insert(runnumber);
189 std::cout <<
"Choosing " << runnumber << std::endl;