#include <CaliIOV.h>
Definition at line 13 of file CaliIOV.h.
◆ CaliIOV()
◆ ~CaliIOV()
◆ fetchID()
Implements IUniqueDBObject.
Definition at line 48 of file CaliIOV.cc.
69 Statement* stmt =
m_conn->createStatement();
71 "SELECT iov_id FROM cali_iov "
72 "WHERE tag_id = :tag_id AND "
75 stmt->setInt(1, tagID);
77 stmt->setDate(3,
dh.tmToDate(
m_till));
79 ResultSet* rset = stmt->executeQuery();
82 m_ID = rset->getInt(1);
86 m_conn->terminateStatement(stmt);
87 }
catch (SQLException&
e) {
88 throw(std::runtime_error(
"CaliIOV::fetchID: " +
e.getMessage()));
References cuy::dh, and MillePedeFileConverter_cfg::e.
◆ getCaliTag()
CaliTag CaliIOV::getCaliTag |
( |
| ) |
const |
◆ getID()
◆ getSince()
Tm CaliIOV::getSince |
( |
| ) |
const |
◆ getTill()
Tm CaliIOV::getTill |
( |
| ) |
const |
◆ operator!=()
bool CaliIOV::operator!= |
( |
const CaliIOV & |
m | ) |
const |
|
inline |
◆ operator==()
bool CaliIOV::operator== |
( |
const CaliIOV & |
m | ) |
const |
|
inline |
◆ setByID()
void CaliIOV::setByID |
( |
int |
id | ) |
|
|
overridevirtualnoexcept |
◆ setByTm()
void CaliIOV::setByTm |
( |
CaliTag * |
tag, |
|
|
const Tm & |
time |
|
) |
| |
|
privatenoexcept |
Definition at line 174 of file CaliIOV.cc.
178 int tagID =
tag->fetchID();
181 throw(std::runtime_error(
"CaliIOV::setByTm: Given CaliTag does not exist in the DB"));
186 Date eventDate =
dh.tmToDate(eventTm);
189 Statement* stmt =
m_conn->createStatement();
192 "SELECT iov_id, since, till FROM cali_iov "
193 "WHERE tag_id = :1 AND since <= :2 AND till > :3");
194 stmt->setInt(1, tagID);
195 stmt->setDate(2, eventDate);
196 stmt->setDate(3, eventDate);
198 ResultSet* rset = stmt->executeQuery();
202 m_ID = rset->getInt(1);
203 Date sinceDate = rset->getDate(2);
204 Date tillDate = rset->getDate(3);
209 throw(std::runtime_error(
"CaliIOV::setByTm: Given subrun is not in the database"));
212 m_conn->terminateStatement(stmt);
213 }
catch (SQLException&
e) {
214 throw(std::runtime_error(
"CaliIOV::setByTm: " +
e.getMessage()));
References cuy::dh, MillePedeFileConverter_cfg::e, and GlobalPosition_Frontier_DevDB_cff::tag.
Referenced by EcalCondDBInterface::fetchCaliIOV().
◆ setCaliTag()
void CaliIOV::setCaliTag |
( |
const CaliTag & |
tag | ) |
|
◆ setSince()
void CaliIOV::setSince |
( |
const Tm & |
since | ) |
|
◆ setTill()
void CaliIOV::setTill |
( |
const Tm & |
till | ) |
|
◆ writeDB()
Definition at line 127 of file CaliIOV.cc.
142 throw(std::runtime_error(
"CaliIOV::writeDB: Must setSince before writing"));
150 Statement* stmt =
m_conn->createStatement();
153 "INSERT INTO cali_iov (iov_id, tag_id, since, till) "
154 "VALUES (cali_iov_sq.NextVal, :1, :2, :3)");
155 stmt->setInt(1, tagID);
157 stmt->setDate(3,
dh.tmToDate(
m_till));
159 stmt->executeUpdate();
161 m_conn->terminateStatement(stmt);
162 }
catch (SQLException&
e) {
163 throw(std::runtime_error(
"CaliIOV::writeDB: " +
e.getMessage()));
168 throw(std::runtime_error(
"CaliIOV::writeDB: Failed to write"));
References cuy::dh, and MillePedeFileConverter_cfg::e.
◆ EcalCondDBInterface
◆ m_caliTag
◆ m_since
◆ m_till