#include <ODRunConfigInfo.h>
Definition at line 12 of file ODRunConfigInfo.h.
◆ ODRunConfigInfo()
ODRunConfigInfo::ODRunConfigInfo |
( |
| ) |
|
Definition at line 11 of file ODRunConfigInfo.cc.
std::string m_trigger_mode
oracle::occi::Environment * m_env
oracle::occi::Connection * m_conn
◆ ~ODRunConfigInfo()
ODRunConfigInfo::~ODRunConfigInfo |
( |
| ) |
|
|
override |
◆ clear()
void ODRunConfigInfo::clear |
( |
void |
| ) |
|
|
private |
◆ fetchData()
Definition at line 269 of file ODRunConfigInfo.cc.
References gather_cfg::cout, cuy::dh, MillePedeFileConverter_cfg::e, and mps_fire::result.
274 if (
result->getId() == 0) {
280 "SELECT config_id, tag, version, run_type_def_id, run_mode_def_id, \ 281 num_of_sequences, description, defaults, trg_mode, num_of_events, db_timestamp, usage_status \ 282 FROM ECAL_RUN_CONFIGURATION_DAT WHERE config_id = :1 ");
288 result->setId(rset->getInt(1));
289 result->setTag(rset->getString(2));
290 result->setVersion(rset->getInt(3));
295 result->setNumberOfSequences(rset->getInt(6));
296 result->setDescription(rset->getString(7));
297 result->setDefaults(rset->getInt(8));
298 result->setTriggerMode(rset->getString(9));
299 result->setNumberOfEvents(rset->getInt(10));
300 Date dbdate = rset->getDate(11);
301 result->setDBTime(
dh.dateToTm(dbdate));
302 result->setUsageStatus(rset->getString(12));
305 cout <<
" ODRunConfigInfo::fetchData(): " <<
e.getMessage() << endl;
306 throw(std::runtime_error(
"ODRunConfigInfo::fetchData(): " +
e.getMessage()));
oracle::occi::Environment * m_env
oracle::occi::Connection * m_conn
void checkConnection() const noexcept(false)
oracle::occi::SQLException SQLException
◆ fetchID()
int ODRunConfigInfo::fetchID |
( |
| ) |
|
|
privatenoexcept |
Definition at line 65 of file ODRunConfigInfo.cc.
References cuy::dh, and MillePedeFileConverter_cfg::e.
78 "SELECT config_id from ECAL_RUN_CONFIGURATION_DAT " 80 " and version = :version ");
81 stmt->setString(1,
m_tag);
84 ResultSet* rset = stmt->executeQuery();
86 m_ID = rset->getInt(1);
90 m_conn->terminateStatement(stmt);
92 throw(std::runtime_error(
"ODRunConfigInfo::fetchID: " +
e.getMessage()));
oracle::occi::Environment * m_env
oracle::occi::Connection * m_conn
void checkConnection() const noexcept(false)
void setByID(int id) noexcept(false)
oracle::occi::Statement Statement
oracle::occi::SQLException SQLException
◆ fetchIDFromTagAndVersion()
int ODRunConfigInfo::fetchIDFromTagAndVersion |
( |
| ) |
|
|
privatenoexcept |
◆ fetchIDLast()
int ODRunConfigInfo::fetchIDLast |
( |
| ) |
|
|
privatenoexcept |
Definition at line 98 of file ODRunConfigInfo.cc.
References cuy::dh, and MillePedeFileConverter_cfg::e.
105 stmt->setSQL(
"SELECT max(config_id) FROM ecal_run_configuration_dat ");
106 ResultSet* rset = stmt->executeQuery();
109 m_ID = rset->getInt(1);
113 m_conn->terminateStatement(stmt);
115 throw(std::runtime_error(
"ODRunConfigInfo::fetchIDLast: " +
e.getMessage()));
oracle::occi::Environment * m_env
oracle::occi::Connection * m_conn
void checkConnection() const noexcept(false)
void setByID(int id) noexcept(false)
oracle::occi::Statement Statement
oracle::occi::SQLException SQLException
◆ fetchNextId()
int ODRunConfigInfo::fetchNextId |
( |
| ) |
|
|
privatenoexcept |
Definition at line 46 of file ODRunConfigInfo.cc.
References MillePedeFileConverter_cfg::e, and mps_fire::result.
52 m_readStmt->setSQL(
"select ecal_run_sq.NextVal from dual");
54 while (rset->next()) {
61 throw(std::runtime_error(
"ODDCCConfig::fetchNextId(): " +
e.getMessage()));
oracle::occi::Connection * m_conn
void checkConnection() const noexcept(false)
oracle::occi::SQLException SQLException
◆ getDBTime()
Tm ODRunConfigInfo::getDBTime |
( |
| ) |
const |
|
inline |
◆ getDefaults()
int ODRunConfigInfo::getDefaults |
( |
| ) |
const |
|
inline |
◆ getDescription()
std::string ODRunConfigInfo::getDescription |
( |
| ) |
const |
|
inline |
◆ getId()
int ODRunConfigInfo::getId |
( |
void |
| ) |
const |
|
inline |
◆ getNumberOfEvents()
int ODRunConfigInfo::getNumberOfEvents |
( |
| ) |
const |
|
inline |
◆ getNumberOfSequences()
int ODRunConfigInfo::getNumberOfSequences |
( |
| ) |
const |
|
inline |
◆ getRunModeDef()
RunModeDef ODRunConfigInfo::getRunModeDef |
( |
| ) |
const |
◆ getRunTypeDef()
RunTypeDef ODRunConfigInfo::getRunTypeDef |
( |
| ) |
const |
◆ getTable()
std::string ODRunConfigInfo::getTable |
( |
| ) |
|
|
inlineoverridevirtual |
◆ getTag()
std::string ODRunConfigInfo::getTag |
( |
| ) |
const |
|
inline |
◆ getTriggerMode()
std::string ODRunConfigInfo::getTriggerMode |
( |
| ) |
const |
|
inline |
◆ getUsageStatus()
std::string ODRunConfigInfo::getUsageStatus |
( |
| ) |
const |
|
inline |
◆ getVersion()
int ODRunConfigInfo::getVersion |
( |
| ) |
const |
|
inline |
◆ operator!=()
◆ operator==()
◆ prepareWrite()
void ODRunConfigInfo::prepareWrite |
( |
| ) |
|
|
overrideprivatevirtualnoexcept |
Implements IODConfig.
Definition at line 170 of file ODRunConfigInfo.cc.
References MillePedeFileConverter_cfg::e.
178 "INSERT INTO ECAL_RUN_CONFIGURATION_DAT (CONFIG_ID, tag, version, run_type_def_id, " 179 " run_mode_def_id, num_of_sequences, defaults, trg_mode, num_of_events, description, usage_status ) " 180 " VALUES (:1, :2, :3 , :4, :5, :6 ,:7, :8, :9, :10 , :11)");
186 throw(std::runtime_error(
"ODRunConfigInfo::prepareWrite(): " +
e.getMessage()));
oracle::occi::Connection * m_conn
void checkConnection() const noexcept(false)
int fetchNextId() noexcept(false)
oracle::occi::SQLException SQLException
◆ setByID()
void ODRunConfigInfo::setByID |
( |
int |
id | ) |
|
|
privatenoexcept |
Definition at line 128 of file ODRunConfigInfo.cc.
References cuy::dh, MillePedeFileConverter_cfg::e, and triggerObjects_cff::id.
137 "SELECT tag, version, run_type_def_id, run_mode_def_id, num_of_sequences, description, defaults," 138 " trg_mode,num_of_events, db_timestamp, usage_status" 139 " FROM ECAL_RUN_CONFIGURATION_DAT WHERE config_id = :1");
142 ResultSet* rset = stmt->executeQuery();
144 m_tag = rset->getString(1);
146 int run_type_id = rset->getInt(3);
147 int run_mode_id = rset->getInt(4);
153 Date dbdate = rset->getDate(10);
162 throw(std::runtime_error(
"ODRunConfigInfo::setByID: Given config_id is not in the database"));
164 m_conn->terminateStatement(stmt);
166 throw(std::runtime_error(
"ODRunConfigInfo::setByID: " +
e.getMessage()));
std::string m_trigger_mode
oracle::occi::Environment * m_env
oracle::occi::Connection * m_conn
void checkConnection() const noexcept(false)
std::string m_description
std::string m_usage_status
void setByID(int id) noexcept(false) override
oracle::occi::Statement Statement
void setByID(int id) noexcept(false) override
oracle::occi::SQLException SQLException
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
◆ setDBTime()
void ODRunConfigInfo::setDBTime |
( |
const Tm & |
x | ) |
|
|
inline |
◆ setDefaults()
void ODRunConfigInfo::setDefaults |
( |
int |
x | ) |
|
|
inline |
◆ setDescription()
void ODRunConfigInfo::setDescription |
( |
std::string |
x | ) |
|
|
inline |
◆ setId()
void ODRunConfigInfo::setId |
( |
int |
id | ) |
|
|
inline |
◆ setNumberOfEvents()
void ODRunConfigInfo::setNumberOfEvents |
( |
int |
x | ) |
|
|
inline |
◆ setNumberOfSequences()
void ODRunConfigInfo::setNumberOfSequences |
( |
int |
n | ) |
|
|
inline |
◆ setRunModeDef()
void ODRunConfigInfo::setRunModeDef |
( |
const RunModeDef & |
runModeDef | ) |
|
◆ setRunTypeDef()
void ODRunConfigInfo::setRunTypeDef |
( |
const RunTypeDef & |
runTypeDef | ) |
|
◆ setTag()
void ODRunConfigInfo::setTag |
( |
std::string |
x | ) |
|
|
inline |
◆ setTriggerMode()
void ODRunConfigInfo::setTriggerMode |
( |
std::string |
x | ) |
|
|
inline |
◆ setUsageStatus()
void ODRunConfigInfo::setUsageStatus |
( |
std::string |
x | ) |
|
|
inline |
◆ setVersion()
void ODRunConfigInfo::setVersion |
( |
int |
x | ) |
|
|
inline |
◆ updateDefaultCycle()
int ODRunConfigInfo::updateDefaultCycle |
( |
| ) |
|
|
privatenoexcept |
Definition at line 234 of file ODRunConfigInfo.cc.
References MillePedeFileConverter_cfg::e, and dtFineDelayCorr_cfi::writeDB.
245 stmt->setSQL(
"UPDATE ecal_run_configuration_dat set defaults=:1 where config_id=:2 ");
248 stmt->setInt(2,
m_ID);
250 stmt->executeUpdate();
252 m_conn->terminateStatement(stmt);
254 throw(std::runtime_error(
"ODRunConfigInfo::writeDB: " +
e.getMessage()));
oracle::occi::Connection * m_conn
void checkConnection() const noexcept(false)
void writeDB() noexcept(false)
int fetchID() noexcept(false)
oracle::occi::Statement Statement
oracle::occi::SQLException SQLException
◆ writeDB()
void ODRunConfigInfo::writeDB |
( |
| ) |
|
|
privatenoexcept |
Definition at line 190 of file ODRunConfigInfo.cc.
References gather_cfg::cout, cuy::dh, and MillePedeFileConverter_cfg::e.
222 throw(std::runtime_error(
"ODRunConfigInfo::writeDB: " +
e.getMessage()));
226 throw(std::runtime_error(
"ODRunConfigInfo::writeDB Failed to write"));
231 cout <<
"ODRunConfigInfo::writeDB>> done inserting ODRunConfigInfo with id=" <<
m_ID << endl;
oracle::occi::Environment * m_env
oracle::occi::Connection * m_conn
void checkConnection() const noexcept(false)
std::string getDescription() const
int fetchID() noexcept(false)
std::string getUsageStatus() const
std::string getTriggerMode() const
int fetchID() noexcept(false) override
int getNumberOfEvents() const
std::string getTag() const
void setByID(int id) noexcept(false)
int fetchID() noexcept(false) override
oracle::occi::SQLException SQLException
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
void checkPrepare() noexcept(false)
int getNumberOfSequences() const
◆ EcalCondDBInterface
◆ m_db_time
Tm ODRunConfigInfo::m_db_time |
|
private |
◆ m_defaults
int ODRunConfigInfo::m_defaults |
|
private |
◆ m_description
std::string ODRunConfigInfo::m_description |
|
private |
◆ m_ID
int ODRunConfigInfo::m_ID |
|
private |
◆ m_num_events
int ODRunConfigInfo::m_num_events |
|
private |
◆ m_num_seq
int ODRunConfigInfo::m_num_seq |
|
private |
◆ m_runModeDef
◆ m_runTypeDef
◆ m_tag
std::string ODRunConfigInfo::m_tag |
|
private |
◆ m_trigger_mode
std::string ODRunConfigInfo::m_trigger_mode |
|
private |
◆ m_usage_status
std::string ODRunConfigInfo::m_usage_status |
|
private |
◆ m_version
int ODRunConfigInfo::m_version |
|
private |