#include <MonRunDat.h>
Public Member Functions | |
MonRunOutcomeDef | getMonRunOutcomeDef () const |
int | getNumEvents () const |
std::string | getRootfileName () const |
std::string | getTable () |
int | getTaskList () const |
int | getTaskOutcome () const |
MonRunDat () | |
void | setMonRunOutcomeDef (MonRunOutcomeDef outcomeDef) |
void | setNumEvents (int num) |
void | setRootfileName (std::string name) |
void | setTaskList (int list) |
void | setTaskOutcome (int outcome) |
~MonRunDat () | |
Private Member Functions | |
void | fetchData (std::map< EcalLogicID, MonRunDat > *fillMap, MonRunIOV *iov) throw (std::runtime_error) |
void | prepareWrite () throw (std::runtime_error) |
void | writeDB (const EcalLogicID *ecid, const MonRunDat *item, MonRunIOV *iov) throw (std::runtime_error) |
Private Attributes | |
int | m_numEvents |
MonRunOutcomeDef | m_outcomeDef |
std::string | m_rootfileName |
int | m_taskList |
int | m_taskOutcome |
Friends | |
class | EcalCondDBInterface |
Definition at line 12 of file MonRunDat.h.
MonRunDat::MonRunDat | ( | ) |
Definition at line 12 of file MonRunDat.cc.
References NULL.
{ m_env = NULL; m_conn = NULL; m_writeStmt = NULL; m_readStmt = NULL; m_numEvents = 0; m_outcomeDef = MonRunOutcomeDef(); m_rootfileName = ""; m_taskList = 0; m_taskOutcome = 0; }
MonRunDat::~MonRunDat | ( | ) |
Definition at line 28 of file MonRunDat.cc.
{ }
void MonRunDat::fetchData | ( | std::map< EcalLogicID, MonRunDat > * | fillMap, |
MonRunIOV * | iov | ||
) | throw (std::runtime_error) [private] |
MonRunOutcomeDef MonRunDat::getMonRunOutcomeDef | ( | ) | const [inline] |
int MonRunDat::getNumEvents | ( | ) | const [inline] |
std::string MonRunDat::getRootfileName | ( | ) | const [inline] |
std::string MonRunDat::getTable | ( | ) | [inline, virtual] |
int MonRunDat::getTaskList | ( | ) | const [inline] |
int MonRunDat::getTaskOutcome | ( | ) | const [inline] |
void MonRunDat::prepareWrite | ( | ) | throw (std::runtime_error) [private, virtual] |
Implements IDataItem.
Definition at line 34 of file MonRunDat.cc.
{ this->checkConnection(); try { m_writeStmt = m_conn->createStatement(); m_writeStmt->setSQL("INSERT INTO mon_run_dat (iov_id, logic_id, " "num_events, run_outcome_id, rootfile_name, task_list, task_outcome) " "VALUES (:iov_id, :logic_id, " ":num_events, :run_outcome_id, :rootfile_name, :task_list, :task_outcome) "); } catch (SQLException &e) { throw(std::runtime_error("MonRunDat::prepareWrite(): "+e.getMessage())); } }
void MonRunDat::setMonRunOutcomeDef | ( | MonRunOutcomeDef | outcomeDef | ) | [inline] |
Definition at line 24 of file MonRunDat.h.
References m_outcomeDef.
Referenced by EcalEndcapMonitorClient::writeDb(), and EcalBarrelMonitorClient::writeDb().
{ m_outcomeDef = outcomeDef; }
void MonRunDat::setNumEvents | ( | int | num | ) | [inline] |
Definition at line 21 of file MonRunDat.h.
References m_numEvents.
Referenced by EcalEndcapMonitorClient::writeDb(), and EcalBarrelMonitorClient::writeDb().
{ m_numEvents = num; }
void MonRunDat::setRootfileName | ( | std::string | name | ) | [inline] |
Definition at line 27 of file MonRunDat.h.
References m_rootfileName, and mergeVDriftHistosByStation::name.
{ m_rootfileName = name; }
void MonRunDat::setTaskList | ( | int | list | ) | [inline] |
Definition at line 30 of file MonRunDat.h.
References list(), and m_taskList.
Referenced by EcalEndcapMonitorClient::writeDb(), and EcalBarrelMonitorClient::writeDb().
{ m_taskList = list; }
void MonRunDat::setTaskOutcome | ( | int | outcome | ) | [inline] |
Definition at line 33 of file MonRunDat.h.
References m_taskOutcome.
Referenced by EcalEndcapMonitorClient::writeDb(), and EcalBarrelMonitorClient::writeDb().
{ m_taskOutcome = outcome; }
void MonRunDat::writeDB | ( | const EcalLogicID * | ecid, |
const MonRunDat * | item, | ||
MonRunIOV * | iov | ||
) | throw (std::runtime_error) [private] |
Definition at line 52 of file MonRunDat.cc.
References MonRunOutcomeDef::fetchID(), o2o::iov, and IDBObject::setConnection().
{ this->checkConnection(); this->checkPrepare(); int iovID = iov->fetchID(); if (!iovID) { throw(std::runtime_error("MonRunDat::writeDB: IOV not in DB")); } MonRunOutcomeDef monRunOutcomeDef = item->getMonRunOutcomeDef(); // XXX object copy every row! monRunOutcomeDef.setConnection(m_env, m_conn); int outcomeID = monRunOutcomeDef.fetchID(); if (!outcomeID) { throw(std::runtime_error("MonRunDat::writeDB: Outcome Definition not in DB")); } int logicID = ecid->getLogicID(); if (!logicID) { throw(std::runtime_error("MonRunDat::writeDB: Bad EcalLogicID")); } try { m_writeStmt->setInt(1, iovID); m_writeStmt->setInt(2, logicID); m_writeStmt->setInt(3, item->getNumEvents()); m_writeStmt->setInt(4, outcomeID); m_writeStmt->setString(5, item->getRootfileName()); m_writeStmt->setInt(6, item->getTaskList()); m_writeStmt->setInt(7, item->getTaskOutcome()); m_writeStmt->executeUpdate(); } catch (SQLException &e) { throw(std::runtime_error("MonRunDat::writeDB(): "+e.getMessage())); } }
friend class EcalCondDBInterface [friend] |
Reimplemented from IDBObject.
Definition at line 14 of file MonRunDat.h.
int MonRunDat::m_numEvents [private] |
Definition at line 47 of file MonRunDat.h.
Referenced by getNumEvents(), and setNumEvents().
MonRunOutcomeDef MonRunDat::m_outcomeDef [private] |
Definition at line 48 of file MonRunDat.h.
Referenced by getMonRunOutcomeDef(), and setMonRunOutcomeDef().
std::string MonRunDat::m_rootfileName [private] |
Definition at line 49 of file MonRunDat.h.
Referenced by getRootfileName(), and setRootfileName().
int MonRunDat::m_taskList [private] |
Definition at line 50 of file MonRunDat.h.
Referenced by getTaskList(), and setTaskList().
int MonRunDat::m_taskOutcome [private] |
Definition at line 51 of file MonRunDat.h.
Referenced by getTaskOutcome(), and setTaskOutcome().