#include <MODRunIOV.h>
Definition at line 13 of file MODRunIOV.h.
◆ MODRunIOV()
◆ ~MODRunIOV()
MODRunIOV::~MODRunIOV |
( |
| ) |
|
|
override |
◆ fetchID()
int MODRunIOV::fetchID |
( |
| ) |
|
|
overridevirtualnoexcept |
Implements IUniqueDBObject.
Definition at line 61 of file MODRunIOV.cc.
84 Statement* stmt =
m_conn->createStatement();
86 "SELECT iov_id FROM OD_run_iov "
88 "run_iov_id = :1 AND "
89 "subrun_num = :2 AND "
90 "subrun_start = :3 AND "
93 stmt->setInt(1, runIOVID);
98 ResultSet* rset = stmt->executeQuery();
101 m_ID = rset->getInt(1);
105 m_conn->terminateStatement(stmt);
106 }
catch (SQLException&
e) {
107 throw(std::runtime_error(
"MODRunIOV::fetchID: " +
e.getMessage()));
References cuy::dh, and MillePedeFileConverter_cfg::e.
◆ fetchParentIDs()
void MODRunIOV::fetchParentIDs |
( |
int * |
runIOVID | ) |
|
|
privatenoexcept |
Definition at line 197 of file MODRunIOV.cc.
203 throw(std::runtime_error(
"MODRunIOV: Given RunIOV does not exist in DB"));
◆ getID()
◆ getRunIOV()
RunIOV MODRunIOV::getRunIOV |
( |
| ) |
|
◆ getSubRunEnd()
Tm MODRunIOV::getSubRunEnd |
( |
| ) |
const |
◆ getSubRunNumber()
run_t MODRunIOV::getSubRunNumber |
( |
| ) |
const |
◆ getSubRunStart()
Tm MODRunIOV::getSubRunStart |
( |
| ) |
const |
◆ operator!=()
bool MODRunIOV::operator!= |
( |
const MODRunIOV & |
m | ) |
const |
|
inline |
◆ operator==()
bool MODRunIOV::operator== |
( |
const MODRunIOV & |
m | ) |
const |
|
inline |
◆ setByID()
void MODRunIOV::setByID |
( |
int |
id | ) |
|
|
overridevirtualnoexcept |
Implements IUniqueDBObject.
Definition at line 113 of file MODRunIOV.cc.
119 Statement* stmt =
m_conn->createStatement();
121 stmt->setSQL(
"SELECT run_iov_id, subrun_num, subrun_start, subrun_end FROM OD_run_iov WHERE iov_id = :1");
124 ResultSet* rset = stmt->executeQuery();
126 int runIOVID = rset->getInt(1);
128 Date startDate = rset->getDate(3);
129 Date endDate = rset->getDate(4);
139 throw(std::runtime_error(
"MODRunIOV::setByID: Given id is not in the database"));
142 m_conn->terminateStatement(stmt);
143 }
catch (SQLException&
e) {
144 throw(std::runtime_error(
"MODRunIOV::setByID: " +
e.getMessage()));
References cuy::dh, MillePedeFileConverter_cfg::e, and triggerObjects_cff::id.
◆ setByRun()
Definition at line 207 of file MODRunIOV.cc.
211 int runIOVID = runiov->
fetchID();
214 throw(std::runtime_error(
"MODRunIOV::setByRun: Given RunIOV does not exist in DB"));
220 Statement* stmt =
m_conn->createStatement();
223 "SELECT iov_id, subrun_start, subrun_end FROM OD_run_iov "
224 "WHERE run_iov_id = :1 AND subrun_num = :2");
225 stmt->setInt(1, runIOVID);
226 stmt->setInt(2, subrun);
228 ResultSet* rset = stmt->executeQuery();
233 m_ID = rset->getInt(1);
234 Date startDate = rset->getDate(2);
235 Date endDate = rset->getDate(3);
240 throw(std::runtime_error(
"MODRunIOV::setByRun: Given subrun is not in the database"));
243 m_conn->terminateStatement(stmt);
244 }
catch (SQLException&
e) {
245 throw(std::runtime_error(
"MODRunIOV::setByRun: " +
e.getMessage()));
References cuy::dh, and MillePedeFileConverter_cfg::e.
◆ setID()
void MODRunIOV::setID |
( |
int |
id | ) |
|
◆ setRunIOV()
void MODRunIOV::setRunIOV |
( |
const RunIOV & |
iov | ) |
|
◆ setSubRunEnd()
void MODRunIOV::setSubRunEnd |
( |
const Tm & |
end | ) |
|
◆ setSubRunNumber()
void MODRunIOV::setSubRunNumber |
( |
subrun_t |
subrun | ) |
|
◆ setSubRunStart()
void MODRunIOV::setSubRunStart |
( |
const Tm & |
start | ) |
|
◆ writeDB()
int MODRunIOV::writeDB |
( |
| ) |
|
|
privatenoexcept |
Definition at line 148 of file MODRunIOV.cc.
164 throw(std::runtime_error(
"MODRunIOV::writeDB: Must setSubRunStart before writing"));
172 Statement* stmt =
m_conn->createStatement();
175 "INSERT INTO od_run_iov (iov_id, run_iov_id, subrun_num, subrun_start, subrun_end) "
176 "VALUES (OD_run_iov_sq.NextVal, :1, :2, :3, :4)");
177 stmt->setInt(1, runIOVID);
182 stmt->executeUpdate();
184 m_conn->terminateStatement(stmt);
185 }
catch (SQLException&
e) {
186 throw(std::runtime_error(
"MODRunIOV::writeDB: " +
e.getMessage()));
191 throw(std::runtime_error(
"MODRunIOV::writeDB: Failed to write"));
References cuy::dh, and MillePedeFileConverter_cfg::e.
◆ EcalCondDBInterface
◆ m_runIOV
◆ m_subRunEnd
Tm MODRunIOV::m_subRunEnd |
|
private |
◆ m_subRunNum
◆ m_subRunStart
Tm MODRunIOV::m_subRunStart |
|
private |