#include <OnlineDB/EcalCondDB/interface/RunH4TablePositionDat.h>
Public Member Functions | |
int | getNumEvents () const |
int | getNumSpills () const |
std::string | getTable () |
int | getTableX () const |
int | getTableY () const |
RunH4TablePositionDat () | |
void | setNumEvents (int num) |
void | setNumSpills (int num) |
void | setTableX (int num) |
void | setTableY (int num) |
~RunH4TablePositionDat () | |
Private Member Functions | |
void | fetchData (std::map< EcalLogicID, RunH4TablePositionDat > *fillMap, RunIOV *iov) throw (std::runtime_error) |
void | prepareWrite () throw (std::runtime_error) |
void | writeDB (const EcalLogicID *ecid, const RunH4TablePositionDat *item, RunIOV *iov) throw (std::runtime_error) |
Private Attributes | |
int | m_numEvents |
int | m_numSpills |
int | m_table_x |
int | m_table_y |
Friends | |
class | EcalCondDBInterface |
Definition at line 11 of file RunH4TablePositionDat.h.
RunH4TablePositionDat::RunH4TablePositionDat | ( | ) |
Definition at line 11 of file RunH4TablePositionDat.cc.
References IDBObject::m_conn, IDBObject::m_env, m_numEvents, m_numSpills, IDataItem::m_readStmt, m_table_x, m_table_y, IDataItem::m_writeStmt, and NULL.
00012 { 00013 m_env = NULL; 00014 m_conn = NULL; 00015 m_writeStmt = NULL; 00016 m_readStmt = NULL; 00017 00018 m_table_x = 0; 00019 m_table_y = 0; 00020 m_numSpills = 0; 00021 m_numEvents = 0; 00022 }
RunH4TablePositionDat::~RunH4TablePositionDat | ( | ) |
void RunH4TablePositionDat::fetchData | ( | std::map< EcalLogicID, RunH4TablePositionDat > * | fillMap, | |
RunIOV * | iov | |||
) | throw (std::runtime_error) [private] |
int RunH4TablePositionDat::getNumEvents | ( | ) | const [inline] |
Definition at line 30 of file RunH4TablePositionDat.h.
References m_numEvents.
00030 { return m_numEvents; }
int RunH4TablePositionDat::getNumSpills | ( | ) | const [inline] |
Definition at line 27 of file RunH4TablePositionDat.h.
References m_numSpills.
00027 { return m_numSpills; }
std::string RunH4TablePositionDat::getTable | ( | ) | [inline, virtual] |
int RunH4TablePositionDat::getTableX | ( | ) | const [inline] |
Definition at line 21 of file RunH4TablePositionDat.h.
References m_table_x.
00021 { return m_table_x; }
int RunH4TablePositionDat::getTableY | ( | ) | const [inline] |
Definition at line 24 of file RunH4TablePositionDat.h.
References m_table_y.
00024 { return m_table_y; }
void RunH4TablePositionDat::prepareWrite | ( | ) | throw (std::runtime_error) [private, virtual] |
Implements IDataItem.
Definition at line 32 of file RunH4TablePositionDat.cc.
References IDBObject::checkConnection(), e, IDBObject::m_conn, and IDataItem::m_writeStmt.
00034 { 00035 this->checkConnection(); 00036 00037 try { 00038 m_writeStmt = m_conn->createStatement(); 00039 m_writeStmt->setSQL("INSERT INTO run_h4_table_position_dat (iov_id, logic_id, " 00040 "table_x, table_y, number_of_spills, number_of_events ) " 00041 "VALUES (:iov_id, :logic_id, " 00042 ":table_x, :table_y, :number_of_spills, :number_of_events)"); 00043 } catch (SQLException &e) { 00044 throw(runtime_error("RunH4TablePositionDat::prepareWrite(): "+e.getMessage())); 00045 } 00046 }
Definition at line 29 of file RunH4TablePositionDat.h.
References m_numEvents.
00029 { m_numEvents = num; }
Definition at line 26 of file RunH4TablePositionDat.h.
References m_numSpills.
00026 { m_numSpills = num; }
void RunH4TablePositionDat::writeDB | ( | const EcalLogicID * | ecid, | |
const RunH4TablePositionDat * | item, | |||
RunIOV * | iov | |||
) | throw (std::runtime_error) [private] |
Definition at line 50 of file RunH4TablePositionDat.cc.
References IDBObject::checkConnection(), IDataItem::checkPrepare(), e, and IDataItem::m_writeStmt.
00052 { 00053 this->checkConnection(); 00054 this->checkPrepare(); 00055 00056 int iovID = iov->fetchID(); 00057 if (!iovID) { throw(runtime_error("RunH4TablePositionDat::writeDB: IOV not in DB")); } 00058 00059 int logicID = ecid->getLogicID(); 00060 if (!logicID) { throw(runtime_error("RunH4TablePositionDat::writeDB: Bad EcalLogicID")); } 00061 00062 try { 00063 m_writeStmt->setInt(1, iovID); 00064 m_writeStmt->setInt(2, logicID); 00065 m_writeStmt->setInt(3, item->getTableX()); 00066 m_writeStmt->setInt(4, item->getTableY()); 00067 m_writeStmt->setInt(5, item->getNumSpills()); 00068 m_writeStmt->setInt(6, item->getNumEvents()); 00069 00070 m_writeStmt->executeUpdate(); 00071 } catch (SQLException &e) { 00072 throw(runtime_error("RunH4TablePositionDat::writeDB(): "+e.getMessage())); 00073 } 00074 }
friend class EcalCondDBInterface [friend] |
int RunH4TablePositionDat::m_numEvents [private] |
Definition at line 46 of file RunH4TablePositionDat.h.
Referenced by getNumEvents(), RunH4TablePositionDat(), and setNumEvents().
int RunH4TablePositionDat::m_numSpills [private] |
Definition at line 45 of file RunH4TablePositionDat.h.
Referenced by getNumSpills(), RunH4TablePositionDat(), and setNumSpills().
int RunH4TablePositionDat::m_table_x [private] |
Definition at line 43 of file RunH4TablePositionDat.h.
Referenced by getTableX(), RunH4TablePositionDat(), and setTableX().
int RunH4TablePositionDat::m_table_y [private] |
Definition at line 44 of file RunH4TablePositionDat.h.
Referenced by getTableY(), RunH4TablePositionDat(), and setTableY().