#include <ODEcalCycle.h>
Public Member Functions | |
int | getCCSId () const |
std::string | getCycleDescription () const |
int | getCycleNum () const |
std::string | getCycleTag () const |
int | getDCCId () const |
int | getDCUId () const |
int | getId () const |
int | getJBH4Id () const |
int | getLaserId () const |
int | getLTCId () const |
int | getLTSId () const |
int | getMataqId () const |
int | getScanId () const |
int | getSeqNum () const |
int | getSequenceId () const |
int | getSRPId () const |
std::string | getTable () |
std::string | getTag () const |
int | getTCCEEId () const |
int | getTCCId () const |
int | getTTCCIId () const |
int | getTTCFId () const |
int | getVersion () const |
ODEcalCycle () | |
void | printout () |
void | setCCSId (int x) |
void | setCycleDescription (std::string x) |
void | setCycleNum (int x) |
void | setCycleTag (std::string x) |
void | setDCCId (int x) |
void | setDCUId (int x) |
void | setId (int id) |
void | setJBH4Id (int x) |
void | setLaserId (int x) |
void | setLTCId (int x) |
void | setLTSId (int x) |
void | setMataqId (int x) |
void | setScanId (int x) |
void | setSeqNum (int x) |
void | setSequenceId (int x) |
void | setSRPId (int x) |
void | setTag (std::string x) |
void | setTCCEEId (int x) |
void | setTCCId (int x) |
void | setTTCCIId (int x) |
void | setTTCFId (int x) |
void | setVersion (int x) |
~ODEcalCycle () | |
Private Member Functions | |
void | clear () |
void | fetchData (ODEcalCycle *result) throw (std::runtime_error) |
int | fetchID () throw (std::runtime_error) |
void | prepareWrite () throw (std::runtime_error) |
void | setByID (int id) throw (std::runtime_error) |
void | writeDB () throw (std::runtime_error) |
Private Attributes | |
int | m_ccs |
std::string | m_cycle_description |
int | m_cycle_num |
std::string | m_cycle_tag |
int | m_dcc |
int | m_dcu |
int | m_ID |
int | m_jbh4 |
int | m_laser |
int | m_ltc |
int | m_lts |
int | m_mataq |
int | m_scan |
int | m_seq_id |
int | m_seq_num |
int | m_srp |
std::string | m_tag |
int | m_tcc |
int | m_tcc_ee |
int | m_ttcci |
int | m_ttcf |
int | m_version |
Friends | |
class | EcalCondDBInterface |
Definition at line 9 of file ODEcalCycle.h.
ODEcalCycle::ODEcalCycle | ( | ) |
Definition at line 25 of file ODEcalCycle.cc.
References hitfit::clear(), and NULL.
{ m_env = NULL; m_conn = NULL; m_writeStmt = NULL; m_readStmt = NULL; m_ID=0; clear(); }
ODEcalCycle::~ODEcalCycle | ( | ) |
Definition at line 38 of file ODEcalCycle.cc.
{ }
void ODEcalCycle::clear | ( | void | ) | [private] |
void ODEcalCycle::fetchData | ( | ODEcalCycle * | result | ) | throw (std::runtime_error) [private] |
Definition at line 308 of file ODEcalCycle.cc.
References alignCSCRings::e, and query::result.
{ this->checkConnection(); // result->clear(); if(result->getId()==0){ // throw(std::runtime_error("ODEcalCycle::fetchData(): no Id defined for this ODEcalCycle ")); result->fetchID(); } try { m_readStmt->setSQL("SELECT tag, version, sequence_num, cycle_num, cycle_tag, description, " "ccs_configuration_id, dcc_configuration_id, laser_configuration_id, " "ltc_configuration_id, lts_configuration_id, tcc_configuration_id, " "\"TTCci_CONFIGURATION_ID\", jbh4_configuration_id, scan_id, TTCF_configuration_id, " "srp_configuration_id, dcu_configuration_id, tcc_ee_configuration_id " "FROM ECAL_CYCLE where cycle_id = :1 " ); m_readStmt->setInt(1, result->getId()); ResultSet* rset = m_readStmt->executeQuery(); rset->next(); result->setTag( rset->getString(1) ); result->setVersion( rset->getInt(2) ); result->setSeqNum( rset->getInt(3) ); result->setCycleNum( rset->getInt(4) ); result->setCycleTag( rset->getString(5) ); result->setCycleDescription( rset->getString(6) ); result->setCCSId( rset->getInt(7) ); result->setDCCId( rset->getInt(8) ); result->setLaserId( rset->getInt(9) ); result->setLTCId( rset->getInt(10) ); result->setLTSId( rset->getInt(11) ); result->setTCCId( rset->getInt(12) ); result->setTTCCIId( rset->getInt(13) ); result->setJBH4Id( rset->getInt(14) ); result->setScanId( rset->getInt(15) ); result->setTTCFId( rset->getInt(16) ); result->setSRPId( rset->getInt(17) ); result->setDCUId( rset->getInt(18) ); result->setTCCEEId( rset->getInt(19) ); } catch (SQLException &e) { throw(std::runtime_error("ODEcalCycle::fetchData(): "+e.getMessage())); } }
int ODEcalCycle::fetchID | ( | ) | throw (std::runtime_error) [private] |
Definition at line 202 of file ODEcalCycle.cc.
References alignCSCRings::e.
{ // Return from memory if available if (m_ID>0) { return m_ID; } this->checkConnection(); DateHandler dh(m_env, m_conn); try { Statement* stmt = m_conn->createStatement(); stmt->setSQL("SELECT cycle_id from ECAL_CYCLE_DAT " "WHERE sequence_id = :1 "); stmt->setInt(1, m_seq_id); ResultSet* rset = stmt->executeQuery(); if (rset->next()) { m_ID = rset->getInt(1); } else { m_ID = 0; } m_conn->terminateStatement(stmt); } catch (SQLException &e) { throw(std::runtime_error("ODEcalCycle::fetchID: "+e.getMessage())); } setByID(m_ID); return m_ID; }
int ODEcalCycle::getCCSId | ( | ) | const [inline] |
std::string ODEcalCycle::getCycleDescription | ( | ) | const [inline] |
Definition at line 36 of file ODEcalCycle.h.
References m_cycle_description.
{ return m_cycle_description; }
int ODEcalCycle::getCycleNum | ( | ) | const [inline] |
std::string ODEcalCycle::getCycleTag | ( | ) | const [inline] |
int ODEcalCycle::getDCCId | ( | ) | const [inline] |
Definition at line 40 of file ODEcalCycle.h.
References m_dcc.
Referenced by popcon::EcalSRPHandler::getNewObjects().
{ return m_dcc; }
int ODEcalCycle::getDCUId | ( | ) | const [inline] |
int ODEcalCycle::getId | ( | ) | const [inline] |
Definition at line 20 of file ODEcalCycle.h.
References m_ID.
Referenced by popcon::EcalSRPHandler::getNewObjects().
{ return m_ID; }
int ODEcalCycle::getJBH4Id | ( | ) | const [inline] |
int ODEcalCycle::getLaserId | ( | ) | const [inline] |
int ODEcalCycle::getLTCId | ( | ) | const [inline] |
int ODEcalCycle::getLTSId | ( | ) | const [inline] |
int ODEcalCycle::getMataqId | ( | ) | const [inline] |
int ODEcalCycle::getScanId | ( | ) | const [inline] |
int ODEcalCycle::getSeqNum | ( | ) | const [inline] |
int ODEcalCycle::getSequenceId | ( | ) | const [inline] |
int ODEcalCycle::getSRPId | ( | ) | const [inline] |
Definition at line 64 of file ODEcalCycle.h.
References m_srp.
Referenced by popcon::EcalSRPHandler::getNewObjects().
{ return m_srp; }
std::string ODEcalCycle::getTable | ( | ) | [inline, virtual] |
std::string ODEcalCycle::getTag | ( | void | ) | const [inline] |
int ODEcalCycle::getTCCEEId | ( | ) | const [inline] |
int ODEcalCycle::getTCCId | ( | ) | const [inline] |
int ODEcalCycle::getTTCCIId | ( | ) | const [inline] |
int ODEcalCycle::getTTCFId | ( | ) | const [inline] |
int ODEcalCycle::getVersion | ( | ) | const [inline] |
void ODEcalCycle::prepareWrite | ( | ) | throw (std::runtime_error) [private, virtual] |
Implements IODConfig.
Definition at line 44 of file ODEcalCycle.cc.
References gather_cfg::cout.
{ std::cout<< "ODEcalCycle::prepareWrite(): this is a view writing specific tables "<< endl; }
void ODEcalCycle::printout | ( | ) |
Definition at line 286 of file ODEcalCycle.cc.
References gather_cfg::cout.
{ std::cout << "**** ODEcalCycle ****"<< std::endl; std::cout << "**** id: "<< m_ID << std::endl; std::cout << "**** tag: "<< m_tag << std::endl; std::cout << "**** version: "<< m_version << std::endl; std::cout << "**** seq_num: "<< m_seq_num << std::endl; std::cout << "**** cycle num: "<< m_cycle_num << std::endl; std::cout << "**** cycle tag: "<< m_cycle_tag << std::endl; std::cout << "**** cycle description: "<< m_cycle_description<< std::endl; std::cout << "**** ccs_id: "<< m_ccs <<std::endl; std::cout << "**** dcc_id: "<< m_dcc <<std::endl; std::cout << "**** laser: "<< m_laser << std::endl; std::cout << "**** ttcf_id: "<< m_ttcf << std::endl; std::cout << "**** srp_id: "<< m_srp << std::endl; std::cout << "**** scan_id: "<< m_scan << std::endl; std::cout << "**** ODEcalCycle ****"<< std::endl; }
void ODEcalCycle::setByID | ( | int | id | ) | throw (std::runtime_error) [private] |
Definition at line 236 of file ODEcalCycle.cc.
References alignCSCRings::e.
{ this->checkConnection(); DateHandler dh(m_env, m_conn); try { Statement* stmt = m_conn->createStatement(); stmt->setSQL("SELECT tag, version, sequence_num, cycle_num, cycle_tag, description, " "ccs_configuration_id, dcc_configuration_id, laser_configuration_id, " "ltc_configuration_id, lts_configuration_id, tcc_configuration_id, " "\"TTCci_CONFIGURATION_ID\", jbh4_configuration_id, scan_id, TTCF_configuration_id, " "srp_configuration_id, dcu_configuration_id, tcc_ee_configuration_id " "FROM ECAL_CYCLE where cycle_id = :1 " ); stmt->setInt(1, id); ResultSet* rset = stmt->executeQuery(); if (rset->next()) { m_tag = rset->getString(1); m_version = rset->getInt(2); m_seq_num = rset->getInt(3); m_cycle_num = rset->getInt(4); m_cycle_tag = rset->getString(5); m_cycle_description = rset->getString(6); m_ccs = rset->getInt(7); m_dcc = rset->getInt(8); m_laser = rset->getInt(9); m_ltc = rset->getInt(10); m_lts = rset->getInt(11); m_tcc = rset->getInt(12); m_ttcci = rset->getInt(13); m_jbh4 = rset->getInt(14); m_scan = rset->getInt(15); m_ttcf = rset->getInt(16); m_srp = rset->getInt(17); m_dcu = rset->getInt(18); m_tcc_ee = rset->getInt(19); } else { throw(std::runtime_error("ODEcalCycle::setByID: Given config_id is not in the database")); } m_conn->terminateStatement(stmt); } catch (SQLException &e) { throw(std::runtime_error("ODEcalCycle::setByID: "+e.getMessage())); } }
void ODEcalCycle::setCCSId | ( | int | x | ) | [inline] |
void ODEcalCycle::setCycleDescription | ( | std::string | x | ) | [inline] |
Definition at line 35 of file ODEcalCycle.h.
References m_cycle_description, and x.
{ m_cycle_description = x; }
void ODEcalCycle::setCycleNum | ( | int | x | ) | [inline] |
void ODEcalCycle::setCycleTag | ( | std::string | x | ) | [inline] |
void ODEcalCycle::setDCCId | ( | int | x | ) | [inline] |
void ODEcalCycle::setDCUId | ( | int | x | ) | [inline] |
void ODEcalCycle::setId | ( | int | id | ) | [inline] |
void ODEcalCycle::setJBH4Id | ( | int | x | ) | [inline] |
void ODEcalCycle::setLaserId | ( | int | x | ) | [inline] |
void ODEcalCycle::setLTCId | ( | int | x | ) | [inline] |
void ODEcalCycle::setLTSId | ( | int | x | ) | [inline] |
void ODEcalCycle::setMataqId | ( | int | x | ) | [inline] |
void ODEcalCycle::setScanId | ( | int | x | ) | [inline] |
void ODEcalCycle::setSeqNum | ( | int | x | ) | [inline] |
void ODEcalCycle::setSequenceId | ( | int | x | ) | [inline] |
Definition at line 28 of file ODEcalCycle.h.
Referenced by popcon::EcalSRPHandler::getNewObjects().
void ODEcalCycle::setSRPId | ( | int | x | ) | [inline] |
void ODEcalCycle::setTag | ( | std::string | x | ) | [inline] |
void ODEcalCycle::setTCCEEId | ( | int | x | ) | [inline] |
void ODEcalCycle::setTCCId | ( | int | x | ) | [inline] |
void ODEcalCycle::setTTCCIId | ( | int | x | ) | [inline] |
void ODEcalCycle::setTTCFId | ( | int | x | ) | [inline] |
void ODEcalCycle::setVersion | ( | int | x | ) | [inline] |
void ODEcalCycle::writeDB | ( | ) | throw (std::runtime_error) [private] |
Definition at line 54 of file ODEcalCycle.cc.
References gather_cfg::cout, ODRunConfigCycleInfo::getId(), ODCCSCycle::insertConfig(), ODRunConfigCycleInfo::insertConfig(), ODDCCCycle::insertConfig(), ODTCCEECycle::insertConfig(), ODSRPCycle::insertConfig(), ODTCCCycle::insertConfig(), ODTTCciCycle::insertConfig(), ODLTSCycle::insertConfig(), ODDCUCycle::insertConfig(), ODLTCCycle::insertConfig(), ODTTCFCycle::insertConfig(), ODLaserCycle::insertConfig(), ODScanCycle::insertConfig(), ODJBH4Cycle::insertConfig(), ODCCSCycle::setCCSConfigurationID(), IDBObject::setConnection(), ODRunConfigCycleInfo::setCycleNumber(), ODDCCCycle::setDCCConfigurationID(), ODDCUCycle::setDCUConfigurationID(), ODRunConfigCycleInfo::setDescription(), ODTTCciCycle::setId(), ODScanCycle::setId(), ODTCCCycle::setId(), ODDCCCycle::setId(), ODSRPCycle::setId(), ODCCSCycle::setId(), ODLaserCycle::setId(), ODLTSCycle::setId(), ODDCUCycle::setId(), ODJBH4Cycle::setId(), ODLTCCycle::setId(), ODTCCEECycle::setId(), ODTTCFCycle::setId(), ODJBH4Cycle::setJBH4ConfigurationID(), ODLaserCycle::setLaserConfigurationID(), ODLTCCycle::setLTCConfigurationID(), ODLTSCycle::setLTSConfigurationID(), ODScanCycle::setScanConfigurationID(), ODRunConfigCycleInfo::setSequenceID(), ODSRPCycle::setSRPConfigurationID(), ODRunConfigCycleInfo::setTag(), ODTCCEECycle::setTCCConfigurationID(), ODTCCCycle::setTCCConfigurationID(), ODTTCciCycle::setTTCciConfigurationID(), and ODTTCFCycle::setTTCFConfigurationID().
{ ODRunConfigCycleInfo cyc; cyc.setTag(this->getCycleTag()); cyc.setDescription(this->getCycleDescription()); cyc.setCycleNumber(this->getCycleNum()); cyc.setSequenceID(this->getSequenceId()); // here we insert the cycle and get back the id cyc.setConnection(m_env, m_conn); cyc.insertConfig(); int cyc_id=cyc.getId(); cout << "Cycle inserted with ID "<< cyc_id<< endl; m_ID=cyc_id; if(getCCSId()!=0){ ODCCSCycle ccs_cycle; ccs_cycle.setId(cyc_id); ccs_cycle.setCCSConfigurationID(getCCSId()); ccs_cycle.setConnection(m_env, m_conn); ccs_cycle.insertConfig(); cout << "Inserting CCS-cycle in DB..." << flush; } if(getDCCId()!=0){ ODDCCCycle dcc_cycle; dcc_cycle.setId(cyc_id); dcc_cycle.setDCCConfigurationID(getDCCId()); dcc_cycle.setConnection(m_env, m_conn); dcc_cycle.insertConfig(); cout << "Inserting DCC-cycle in DB..." << flush; } if(getLaserId()!=0){ ODLaserCycle laser_cycle; laser_cycle.setId(cyc_id); laser_cycle.setLaserConfigurationID(getLaserId()); laser_cycle.setConnection(m_env, m_conn); laser_cycle.insertConfig(); cout << "Inserting LASER-cycle in DB..." << flush; } if(getLTCId()!=0){ ODLTCCycle ltc_cycle; ltc_cycle.setId(cyc_id); ltc_cycle.setLTCConfigurationID(getLTCId()); ltc_cycle.setConnection(m_env, m_conn); ltc_cycle.insertConfig(); cout << "Inserting LTC-cycle in DB..." << flush; } if(getLTSId()!=0){ ODLTSCycle lts_cycle; lts_cycle.setId(cyc_id); lts_cycle.setLTSConfigurationID(getLTSId()); lts_cycle.setConnection(m_env, m_conn); lts_cycle.insertConfig(); cout << "Inserting LTS-cycle in DB..." << flush; } if(getDCUId()!=0){ ODDCUCycle dcu_cycle; dcu_cycle.setId(cyc_id); dcu_cycle.setDCUConfigurationID(getDCUId()); dcu_cycle.setConnection(m_env, m_conn); dcu_cycle.insertConfig(); cout << "Inserting DCU-cycle in DB..." << flush; } if(getTCCId()!=0){ ODTCCCycle tcc_cycle; tcc_cycle.setId(cyc_id); tcc_cycle.setTCCConfigurationID(getTCCId()); tcc_cycle.setConnection(m_env, m_conn); tcc_cycle.insertConfig(); cout << "Inserting TCC-cycle in DB..." << flush; } if(getTCCEEId()!=0){ ODTCCEECycle tcc_ee_cycle; tcc_ee_cycle.setId(cyc_id); tcc_ee_cycle.setTCCConfigurationID(getTCCEEId()); tcc_ee_cycle.setConnection(m_env, m_conn); tcc_ee_cycle.insertConfig(); cout << "Inserting TCCEE-cycle in DB..." << flush; } if(getTTCCIId()!=0){ ODTTCciCycle ttcci_cycle; ttcci_cycle.setId(cyc_id); ttcci_cycle.setTTCciConfigurationID(getTTCCIId()); ttcci_cycle.setConnection(m_env, m_conn); ttcci_cycle.insertConfig(); cout << "Inserting TTCCI-cycle in DB..." << flush; } if(getTTCFId()!=0){ ODTTCFCycle ttcf_cycle; ttcf_cycle.setId(cyc_id); ttcf_cycle.setTTCFConfigurationID(getTTCFId()); ttcf_cycle.setConnection(m_env, m_conn); ttcf_cycle.insertConfig(); cout << "Inserting TTCF-cycle in DB..." << flush; } if(getSRPId()!=0){ ODSRPCycle srp_cycle; srp_cycle.setId(cyc_id); srp_cycle.setSRPConfigurationID(getSRPId()); srp_cycle.setConnection(m_env, m_conn); srp_cycle.insertConfig(); cout << "Inserting SRP-cycle in DB..." << flush; } if(getJBH4Id()!=0){ ODJBH4Cycle jbh4_cycle; jbh4_cycle.setId(cyc_id); jbh4_cycle.setJBH4ConfigurationID(getJBH4Id()); jbh4_cycle.setConnection(m_env, m_conn); jbh4_cycle.insertConfig(); cout << "Inserting JBH4-cycle in DB..." << flush; } if(getScanId()!=0){ ODScanCycle scan_cycle; scan_cycle.setId(cyc_id); scan_cycle.setScanConfigurationID(getScanId()); scan_cycle.setConnection(m_env, m_conn); scan_cycle.insertConfig(); cout << "Inserting SCAN-cycle in DB..." << flush; } }
friend class EcalCondDBInterface [friend] |
Reimplemented from IDBObject.
Definition at line 11 of file ODEcalCycle.h.
int ODEcalCycle::m_ccs [private] |
Definition at line 85 of file ODEcalCycle.h.
Referenced by getCCSId(), and setCCSId().
std::string ODEcalCycle::m_cycle_description [private] |
Definition at line 84 of file ODEcalCycle.h.
Referenced by getCycleDescription(), and setCycleDescription().
int ODEcalCycle::m_cycle_num [private] |
Definition at line 82 of file ODEcalCycle.h.
Referenced by getCycleNum(), and setCycleNum().
std::string ODEcalCycle::m_cycle_tag [private] |
Definition at line 83 of file ODEcalCycle.h.
Referenced by getCycleTag(), and setCycleTag().
int ODEcalCycle::m_dcc [private] |
Definition at line 86 of file ODEcalCycle.h.
Referenced by getDCCId(), and setDCCId().
int ODEcalCycle::m_dcu [private] |
Definition at line 90 of file ODEcalCycle.h.
Referenced by getDCUId(), and setDCUId().
int ODEcalCycle::m_ID [private] |
Definition at line 77 of file ODEcalCycle.h.
int ODEcalCycle::m_jbh4 [private] |
Definition at line 95 of file ODEcalCycle.h.
Referenced by getJBH4Id(), and setJBH4Id().
int ODEcalCycle::m_laser [private] |
Definition at line 87 of file ODEcalCycle.h.
Referenced by getLaserId(), and setLaserId().
int ODEcalCycle::m_ltc [private] |
Definition at line 88 of file ODEcalCycle.h.
Referenced by getLTCId(), and setLTCId().
int ODEcalCycle::m_lts [private] |
Definition at line 89 of file ODEcalCycle.h.
Referenced by getLTSId(), and setLTSId().
int ODEcalCycle::m_mataq [private] |
Definition at line 94 of file ODEcalCycle.h.
Referenced by getMataqId(), and setMataqId().
int ODEcalCycle::m_scan [private] |
Definition at line 96 of file ODEcalCycle.h.
Referenced by getScanId(), and setScanId().
int ODEcalCycle::m_seq_id [private] |
Definition at line 81 of file ODEcalCycle.h.
Referenced by getSequenceId(), and setSequenceId().
int ODEcalCycle::m_seq_num [private] |
Definition at line 80 of file ODEcalCycle.h.
Referenced by getSeqNum(), and setSeqNum().
int ODEcalCycle::m_srp [private] |
Definition at line 97 of file ODEcalCycle.h.
Referenced by getSRPId(), and setSRPId().
std::string ODEcalCycle::m_tag [private] |
Definition at line 78 of file ODEcalCycle.h.
int ODEcalCycle::m_tcc [private] |
Definition at line 91 of file ODEcalCycle.h.
Referenced by getTCCId(), and setTCCId().
int ODEcalCycle::m_tcc_ee [private] |
Definition at line 92 of file ODEcalCycle.h.
Referenced by getTCCEEId(), and setTCCEEId().
int ODEcalCycle::m_ttcci [private] |
Definition at line 93 of file ODEcalCycle.h.
Referenced by getTTCCIId(), and setTTCCIId().
int ODEcalCycle::m_ttcf [private] |
Definition at line 98 of file ODEcalCycle.h.
Referenced by getTTCFId(), and setTTCFId().
int ODEcalCycle::m_version [private] |
Definition at line 79 of file ODEcalCycle.h.
Referenced by getVersion(), and setVersion().