#include <RunPTMTempDat.h>
Public Member Functions | |
std::string | getTable () |
float | getTemperature () const |
RunPTMTempDat () | |
void | setTemperature (float t) |
~RunPTMTempDat () | |
Private Member Functions | |
void | fetchData (std::map< EcalLogicID, RunPTMTempDat > *fillMap, RunIOV *iov) throw (std::runtime_error) |
void | prepareWrite () throw (std::runtime_error) |
void | writeDB (const EcalLogicID *ecid, const RunPTMTempDat *item, RunIOV *iov) throw (std::runtime_error) |
Private Attributes | |
float | m_temperature |
Friends | |
class | EcalCondDBInterface |
Definition at line 11 of file RunPTMTempDat.h.
RunPTMTempDat::RunPTMTempDat | ( | ) |
Definition at line 11 of file RunPTMTempDat.cc.
References NULL.
{ m_env = NULL; m_conn = NULL; m_writeStmt = NULL; m_readStmt = NULL; m_temperature = 0; }
RunPTMTempDat::~RunPTMTempDat | ( | ) |
Definition at line 23 of file RunPTMTempDat.cc.
{ }
void RunPTMTempDat::fetchData | ( | std::map< EcalLogicID, RunPTMTempDat > * | fillMap, |
RunIOV * | iov | ||
) | throw (std::runtime_error) [private] |
std::string RunPTMTempDat::getTable | ( | ) | [inline, virtual] |
float RunPTMTempDat::getTemperature | ( | ) | const [inline] |
void RunPTMTempDat::prepareWrite | ( | ) | throw (std::runtime_error) [private, virtual] |
Implements IDataItem.
Definition at line 29 of file RunPTMTempDat.cc.
References ExpressReco_HICollisions_FallBack::e.
{ this->checkConnection(); try { m_writeStmt = m_conn->createStatement(); m_writeStmt->setSQL("INSERT INTO run_temperature_ptm_dat (iov_id, logic_id, " "temperature) " "VALUES (:iov_id, :logic_id, " ":temperature)"); } catch (SQLException &e) { throw(std::runtime_error("RunPTMTempDat::prepareWrite(): "+e.getMessage())); } }
void RunPTMTempDat::setTemperature | ( | float | t | ) | [inline] |
Definition at line 19 of file RunPTMTempDat.h.
References m_temperature, and matplotRender::t.
{ m_temperature = t; }
void RunPTMTempDat::writeDB | ( | const EcalLogicID * | ecid, |
const RunPTMTempDat * | item, | ||
RunIOV * | iov | ||
) | throw (std::runtime_error) [private] |
Definition at line 47 of file RunPTMTempDat.cc.
References ExpressReco_HICollisions_FallBack::e, and o2o::iov.
{ this->checkConnection(); this->checkPrepare(); int iovID = iov->fetchID(); if (!iovID) { throw(std::runtime_error("RunPTMTempDat::writeDB: IOV not in DB")); } int logicID = ecid->getLogicID(); if (!logicID) { throw(std::runtime_error("RunPTMTempDat::writeDB: Bad EcalLogicID")); } try { m_writeStmt->setInt(1, iovID); m_writeStmt->setInt(2, logicID); m_writeStmt->setFloat(3, item->getTemperature()); m_writeStmt->executeUpdate(); } catch (SQLException &e) { throw(std::runtime_error("RunPTMTempDat::writeDB(): "+e.getMessage())); } }
friend class EcalCondDBInterface [friend] |
Reimplemented from IDBObject.
Definition at line 13 of file RunPTMTempDat.h.
float RunPTMTempDat::m_temperature [private] |
Definition at line 33 of file RunPTMTempDat.h.
Referenced by getTemperature(), and setTemperature().