#include <LMFRunIOV.h>
Public Member Functions | |
virtual void | dump () const |
std::list< LMFRunIOV > | fetchBySequence (const LMFSeqDat &s) |
std::list< LMFRunIOV > | fetchBySequence (const LMFSeqDat &s, int lmr) |
std::list< LMFRunIOV > | fetchBySequence (const LMFSeqDat &s, int lmr, int type, int color) |
std::string | fetchIdSql (Statement *stmt) |
std::list< LMFRunIOV > | fetchLastBeforeSequence (const LMFSeqDat &s, int lmr, int type, int color) |
LMFColor | getColor () const |
std::string | getColorLongName () const |
std::string | getColorShortName () const |
Tm | getDBInsertionTime () const |
LMFColor | getLMFColor () const |
LMFRunTag | getLMFRunTag () const |
int | getLmr () const |
void | getParameters (ResultSet *rset) |
LMFSeqDat | getSequence () const |
Tm | getSubRunEnd () const |
Tm | getSubRunStart () const |
std::string | getSubRunType () const |
LMFTrigType | getTriggerType () const |
bool | isValid () |
LMFRunIOV (const LMFRunIOV &r) | |
LMFRunIOV () | |
LMFRunIOV (oracle::occi::Environment *env, oracle::occi::Connection *conn) | |
LMFRunIOV (EcalDBConnection *c) | |
bool | operator!= (const LMFRunIOV &m) const |
virtual LMFRunIOV & | operator= (const LMFRunIOV &r) |
bool | operator== (const LMFRunIOV &m) const |
std::string | setByIDSql (Statement *stmt, int id) |
LMFRunIOV & | setColor (int color_id) |
LMFRunIOV & | setColor (const LMFColor &c) |
LMFRunIOV & | setColor (std::string name) |
LMFRunIOV & | setColorIndex (int color_index) |
LMFRunIOV & | setLMFRunTag (const LMFRunTag &tag) |
LMFRunIOV & | setLMFRunTag (int tag_id) |
LMFRunIOV & | setLmr (int n) |
LMFRunIOV & | setSequence (LMFSeqDat *seq) |
LMFRunIOV & | setSequence (LMFSeqDat &seq) |
LMFRunIOV & | setSubRunEnd (Tm end) |
LMFRunIOV & | setSubRunStart (Tm start) |
LMFRunIOV & | setSubRunType (const std::string &x) |
LMFRunIOV & | setTriggerType (LMFTrigType &tt) |
LMFRunIOV & | setTriggerType (int trigType_id) |
LMFRunIOV & | setTriggerType (std::string trigShortName) |
std::string | writeDBSql (Statement *stmt) |
~LMFRunIOV () | |
Private Member Functions | |
void | checkFabric () |
std::list< LMFRunIOV > | fetchBySequence (std::vector< int > par, const std::string &sql, const std::string &method) throw (std::runtime_error) |
void | initialize () |
Private Attributes | |
LMFDefFabric * | _fabric |
Friends | |
class | EcalCondDBInterface |
Definition at line 19 of file LMFRunIOV.h.
LMFRunIOV::LMFRunIOV | ( | ) |
Definition at line 26 of file LMFRunIOV.cc.
References initialize().
: LMFUnique() { initialize(); }
LMFRunIOV::LMFRunIOV | ( | oracle::occi::Environment * | env, |
oracle::occi::Connection * | conn | ||
) |
Definition at line 31 of file LMFRunIOV.cc.
References initialize().
: LMFUnique(env, conn) { initialize(); }
LMFRunIOV::LMFRunIOV | ( | EcalDBConnection * | c | ) |
Definition at line 37 of file LMFRunIOV.cc.
References initialize().
: LMFUnique(c) { initialize(); }
LMFRunIOV::LMFRunIOV | ( | const LMFRunIOV & | r | ) |
Definition at line 42 of file LMFRunIOV.cc.
References initialize(), and alignCSCRings::r.
{ initialize(); *this = r; }
LMFRunIOV::~LMFRunIOV | ( | ) |
void LMFRunIOV::checkFabric | ( | ) | [private] |
Definition at line 85 of file LMFRunIOV.cc.
References _fabric, IDBObject::m_conn, IDBObject::m_env, and NULL.
Referenced by operator=(), setColor(), setColorIndex(), and setTriggerType().
void LMFRunIOV::dump | ( | void | ) | const [virtual] |
Reimplemented from LMFUnique.
Definition at line 209 of file LMFRunIOV.cc.
References _fabric, gather_cfg::cout, LMFDefFabric::dump(), and LMFUnique::m_debug.
std::list< LMFRunIOV > LMFRunIOV::fetchBySequence | ( | const LMFSeqDat & | s, |
int | lmr, | ||
int | type, | ||
int | color | ||
) |
Definition at line 367 of file LMFRunIOV.cc.
References fetchBySequence(), LMFUnique::getID(), and Parameters::parameters.
{ int seq_id = s.getID(); vector<int> parameters; parameters.push_back(seq_id); parameters.push_back(lmr); parameters.push_back(color); parameters.push_back(type); return fetchBySequence(parameters, "SELECT LMF_IOV_ID FROM " "CMS_ECAL_LASER_COND.LMF_RUN_IOV " "WHERE SEQ_ID = :1 AND LMR = :2 AND COLOR_ID = :3 " "AND TRIG_TYPE = :4", "fetchBySequence"); }
Definition at line 356 of file LMFRunIOV.cc.
References fetchBySequence(), LMFUnique::getID(), and Parameters::parameters.
{ int seq_id = s.getID(); vector<int> parameters; parameters.push_back(seq_id); parameters.push_back(lmr); return fetchBySequence(parameters, "SELECT LMF_IOV_ID FROM " "CMS_ECAL_LASER_COND.LMF_RUN_IOV " "WHERE SEQ_ID = :1 AND LMR = :2", "fetchBySequence"); }
std::list<LMFRunIOV> LMFRunIOV::fetchBySequence | ( | std::vector< int > | par, |
const std::string & | sql, | ||
const std::string & | method | ||
) | throw (std::runtime_error) [private] |
Definition at line 347 of file LMFRunIOV.cc.
References LMFUnique::getID(), and Parameters::parameters.
Referenced by fetchBySequence(), fetchLastBeforeSequence(), and EcalCondDBInterface::fetchLMFRunIOV().
{ int seq_id = s.getID(); vector<int> parameters; parameters.push_back(seq_id); return fetchBySequence(parameters, "SELECT LMF_IOV_ID FROM " "CMS_ECAL_LASER_COND.LMF_RUN_IOV " "WHERE SEQ_ID = :1", "fetchBySequence"); }
std::string LMFRunIOV::fetchIdSql | ( | Statement * | stmt | ) | [virtual] |
Reimplemented from LMFUnique.
Definition at line 217 of file LMFRunIOV.cc.
References LMFUnique::m_intFields.
{ std::string sql = ""; sql = "SELECT LMF_IOV_ID FROM CMS_ECAL_LASER_COND.LMF_RUN_IOV WHERE " "SEQ_ID = :1 " "AND LMR = :2 "; if (m_intFields["tag_id"] > 0) { sql += "AND TAG_ID = :3"; } stmt->setSQL(sql); stmt->setInt(1, m_intFields["seq_id"]); stmt->setInt(2, m_intFields["lmr"]); if (m_intFields["tag_id"] > 0) { stmt->setInt(3, m_intFields["tag_id"]); } return sql; }
std::list< LMFRunIOV > LMFRunIOV::fetchLastBeforeSequence | ( | const LMFSeqDat & | s, |
int | lmr, | ||
int | type, | ||
int | color | ||
) |
Definition at line 382 of file LMFRunIOV.cc.
References fetchBySequence(), LMFUnique::getID(), and Parameters::parameters.
Referenced by EcalCondDBInterface::fetchLMFRunIOV().
{ int seq_id = s.getID(); vector<int> parameters; parameters.push_back(seq_id); parameters.push_back(lmr); parameters.push_back(color); parameters.push_back(type); return fetchBySequence(parameters, "SELECT LMF_IOV_ID FROM (SELECT " "SEQ_ID, LMF_IOV_ID FROM " "CMS_ECAL_LASER_COND.LMF_RUN_IOV " "WHERE SEQ_ID < :1 AND LMR = :2 AND COLOR_ID = :3 " "AND TRIG_TYPE = :4 ORDER BY SEQ_ID DESC) WHERE " "ROWNUM <= 1", "fetchBySequence"); }
LMFColor LMFRunIOV::getColor | ( | ) | const [inline] |
std::string LMFRunIOV::getColorLongName | ( | ) | const |
Definition at line 117 of file LMFRunIOV.cc.
References getLMFColor(), and LMFColor::getLongName().
{ LMFColor rcol = getLMFColor(); return rcol.getLongName(); }
std::string LMFRunIOV::getColorShortName | ( | ) | const |
Definition at line 112 of file LMFRunIOV.cc.
References getLMFColor(), and LMFColor::getShortName().
{ LMFColor rcol = getLMFColor(); return rcol.getShortName(); }
Tm LMFRunIOV::getDBInsertionTime | ( | ) | const |
Definition at line 178 of file LMFRunIOV.cc.
References LMFUnique::getString(), Tm::setToString(), and lumiQTWidget::t.
{ Tm t; t.setToString(getString("db_timestamp")); return t; }
LMFColor LMFRunIOV::getLMFColor | ( | ) | const |
Definition at line 105 of file LMFRunIOV.cc.
References LMFUnique::getInt(), IDBObject::m_conn, IDBObject::m_env, and LMFUnique::setByID().
Referenced by getColor(), getColorLongName(), getColorShortName(), isValid(), and operator==().
LMFRunTag LMFRunIOV::getLMFRunTag | ( | ) | const |
Definition at line 66 of file LMFRunIOV.cc.
References LMFUnique::getInt(), IDBObject::m_conn, IDBObject::m_env, and LMFUnique::setByID().
Referenced by isValid(), and operator==().
int LMFRunIOV::getLmr | ( | ) | const |
Definition at line 152 of file LMFRunIOV.cc.
References LMFUnique::getInt().
Referenced by isValid(), and operator==().
{ return getInt("lmr"); }
void LMFRunIOV::getParameters | ( | ResultSet * | rset | ) | [virtual] |
Reimplemented from LMFUnique.
Definition at line 248 of file LMFRunIOV.cc.
References DateHandler::dateToTm(), IDBObject::m_conn, IDBObject::m_env, LMFUnique::m_foreignKeys, setColor(), IDBObject::setConnection(), LMFUnique::setInt(), setLMFRunTag(), LMFUnique::setString(), setTriggerType(), errorMatrix2Lands_multiChannel::start, and Tm::str().
{ DateHandler dh(m_env, m_conn); setLMFRunTag(rset->getInt(1)); LMFSeqDat *seq; if (m_foreignKeys.find("sequence") != m_foreignKeys.end()) { seq = (LMFSeqDat*)m_foreignKeys["sequence"]; setInt("seq_id", seq->getID()); } else { seq = new LMFSeqDat; seq->setConnection(m_env, m_conn); seq->setByID(rset->getInt(2)); setInt("seq_id", seq->getID()); delete seq; } setInt("lmr", rset->getInt(3)); setColor(rset->getInt(4)); setTriggerType(rset->getInt(5)); Date start = rset->getDate(6); setString("subrun_start", dh.dateToTm(start).str()); Date stop = rset->getDate(7); setString("subrun_end", dh.dateToTm(stop).str()); setString("subrun_type", rset->getString(8)); setString("db_timestamp", rset->getTimestamp(9).toText("YYYY-MM-DD HH24:MI:SS", 0)); }
LMFSeqDat LMFRunIOV::getSequence | ( | ) | const |
Definition at line 202 of file LMFRunIOV.cc.
References LMFUnique::getInt(), IDBObject::m_conn, IDBObject::m_env, and LMFUnique::setByID().
Referenced by isValid(), and operator==().
Tm LMFRunIOV::getSubRunEnd | ( | ) | const |
Definition at line 172 of file LMFRunIOV.cc.
References LMFUnique::getString(), Tm::setToString(), and lumiQTWidget::t.
Referenced by operator==(), and writeDBSql().
{ Tm t; t.setToString(getString("subrun_end")); return t; }
Tm LMFRunIOV::getSubRunStart | ( | ) | const |
Definition at line 161 of file LMFRunIOV.cc.
References LMFUnique::getString(), Tm::setToString(), and lumiQTWidget::t.
Referenced by LMFDat::getSubrunStart(), operator==(), and writeDBSql().
{ Tm t; t.setToString(getString("subrun_start")); return t; }
std::string LMFRunIOV::getSubRunType | ( | ) | const |
Definition at line 189 of file LMFRunIOV.cc.
References LMFUnique::getString().
Referenced by operator==(), and writeDBSql().
{ return getString("subrun_type"); }
LMFTrigType LMFRunIOV::getTriggerType | ( | void | ) | const |
Definition at line 140 of file LMFRunIOV.cc.
References LMFUnique::getInt(), IDBObject::m_conn, IDBObject::m_env, and LMFUnique::setByID().
Referenced by isValid(), and operator==().
{ LMFTrigType rt = LMFTrigType(m_env, m_conn); rt.setByID(getInt("trigType_id")); return rt; }
void LMFRunIOV::initialize | ( | ) | [private] |
Definition at line 8 of file LMFRunIOV.cc.
References NULL, Tm::setToCurrentGMTime(), and Tm::str().
Referenced by LMFRunIOV().
{ Tm tm; tm.setToCurrentGMTime(); m_intFields["lmr"] = 0; m_intFields["tag_id"] = 0; m_intFields["seq_id"] = 0; m_intFields["color_id"] = 0; m_intFields["trigType_id"] = 0; m_stringFields["subrun_start"] = tm.str(); m_stringFields["subrun_end"] = tm.str(); m_stringFields["db_timestamp"] = tm.str(); m_stringFields["subrun_type"] = "none"; m_className = "LMFRunIOV"; _fabric = NULL; }
bool LMFRunIOV::isValid | ( | void | ) | [virtual] |
Reimplemented from LMFUnique.
Definition at line 273 of file LMFRunIOV.cc.
References getLMFColor(), getLMFRunTag(), getLmr(), getSequence(), getTriggerType(), and run_regression::ret.
{ bool ret = true; if (!getLMFRunTag().isValid()) { ret = false; } if (!getSequence().isValid()) { ret = false; } if (!getTriggerType().isValid()) { ret = false; } if ((getLmr() < 0) || (getLmr() > 92)) { ret = false; } if (!getLMFColor().isValid()) { ret = false; } // subrun start and end are by definition valid return ret; }
bool LMFRunIOV::operator!= | ( | const LMFRunIOV & | m | ) | const [inline] |
Definition at line 400 of file LMFRunIOV.cc.
References _fabric, checkFabric(), gather_cfg::cout, LMFDefFabric::debug(), LMFUnique::m_debug, and NULL.
bool LMFRunIOV::operator== | ( | const LMFRunIOV & | m | ) | const [inline] |
Definition at line 72 of file LMFRunIOV.h.
References getLMFColor(), getLMFRunTag(), getLmr(), getSequence(), getSubRunEnd(), getSubRunStart(), getSubRunType(), and getTriggerType().
{ return ( getLMFRunTag() == m.getLMFRunTag() && getSequence() == m.getSequence() && getLmr() == m.getLmr() && getLMFColor() == m.getLMFColor() && getTriggerType() == m.getTriggerType() && getSubRunType() == m.getSubRunType() && getSubRunStart() == m.getSubRunStart() && getSubRunEnd() == m.getSubRunEnd() ); }
std::string LMFRunIOV::setByIDSql | ( | Statement * | stmt, |
int | id | ||
) | [virtual] |
Reimplemented from LMFUnique.
Definition at line 236 of file LMFRunIOV.cc.
References IDBObject::m_conn, and IDBObject::m_env.
{ DateHandler dh(m_env, m_conn); std::string sql = "SELECT TAG_ID, SEQ_ID, LMR, COLOR_ID, TRIG_TYPE, " "SUBRUN_START, SUBRUN_END, SUBRUN_TYPE, DB_TIMESTAMP FROM " "CMS_ECAL_LASER_COND.LMF_RUN_IOV " "WHERE LMF_IOV_ID = :1"; stmt->setSQL(sql); stmt->setInt(1, id); return sql; }
Definition at line 73 of file LMFRunIOV.cc.
References LMFUnique::getID(), and LMFUnique::setInt().
Referenced by getParameters().
LMFRunIOV & LMFRunIOV::setColor | ( | int | color_id | ) |
Definition at line 79 of file LMFRunIOV.cc.
References LMFUnique::setInt().
{ setInt("color_id", color_id); return *this; }
LMFRunIOV & LMFRunIOV::setColor | ( | std::string | name | ) |
Definition at line 98 of file LMFRunIOV.cc.
References _fabric, checkFabric(), LMFDefFabric::getColorID(), and LMFUnique::setInt().
{ checkFabric(); setInt("color_id", _fabric->getColorID(name)); return *this; }
LMFRunIOV & LMFRunIOV::setColorIndex | ( | int | color_index | ) |
Definition at line 91 of file LMFRunIOV.cc.
References _fabric, checkFabric(), LMFDefFabric::getColorID(), and LMFUnique::setInt().
{ checkFabric(); setInt("color_id", _fabric->getColorID(color_index)); return *this; }
LMFRunIOV & LMFRunIOV::setLMFRunTag | ( | int | tag_id | ) |
Definition at line 60 of file LMFRunIOV.cc.
References LMFUnique::setInt().
{ setInt("tag_id", tag_id); return *this; }
Definition at line 54 of file LMFRunIOV.cc.
References LMFUnique::getID(), and LMFUnique::setInt().
Referenced by getParameters().
LMFRunIOV & LMFRunIOV::setLmr | ( | int | n | ) |
Definition at line 147 of file LMFRunIOV.cc.
References LMFUnique::setInt().
Definition at line 193 of file LMFRunIOV.cc.
References LMFUnique::attach(), LMFUnique::getID(), and LMFUnique::setInt().
Definition at line 167 of file LMFRunIOV.cc.
References LMFUnique::setString(), and Tm::str().
{ setString("subrun_end", stop.str()); return *this; }
Definition at line 156 of file LMFRunIOV.cc.
References LMFUnique::setString(), and Tm::str().
LMFRunIOV & LMFRunIOV::setSubRunType | ( | const std::string & | x | ) |
Definition at line 184 of file LMFRunIOV.cc.
References LMFUnique::setString().
LMFRunIOV & LMFRunIOV::setTriggerType | ( | std::string | trigShortName | ) |
Definition at line 128 of file LMFRunIOV.cc.
References _fabric, checkFabric(), LMFDefFabric::getTrigTypeID(), and LMFUnique::setInt().
{ checkFabric(); setInt("trigType_id", _fabric->getTrigTypeID(sname)); return *this; }
LMFRunIOV & LMFRunIOV::setTriggerType | ( | LMFTrigType & | tt | ) |
Definition at line 122 of file LMFRunIOV.cc.
References LMFUnique::getID(), and LMFUnique::setInt().
Referenced by getParameters().
{ setInt("trigType_id", trigType.getID()); return *this; }
LMFRunIOV & LMFRunIOV::setTriggerType | ( | int | trigType_id | ) |
Definition at line 135 of file LMFRunIOV.cc.
References LMFUnique::setInt().
{ setInt("trigType_id", id); return *this; }
std::string LMFRunIOV::writeDBSql | ( | Statement * | stmt | ) | [virtual] |
Reimplemented from LMFUnique.
Definition at line 294 of file LMFRunIOV.cc.
References LMFUnique::getInt(), getSubRunEnd(), getSubRunStart(), getSubRunType(), IDBObject::m_conn, IDBObject::m_env, LMFUnique::sequencePostfix(), DateHandler::tmToDate(), and groupFilesInBlocks::tt.
{ // check that everything has been setup int tag_id = getInt("tag_id"); int seq_id = getInt("seq_id"); int color_id = getInt("color_id"); int tt = getInt("trigType_id"); std::string sp = sequencePostfix(getSubRunStart()); std::string sql = "INSERT INTO LMF_RUN_IOV (LMF_IOV_ID, TAG_ID, SEQ_ID, " "LMR, COLOR_ID, TRIG_TYPE, SUBRUN_START, SUBRUN_END, SUBRUN_TYPE) VALUES " "(lmf_run_iov_" + sp + "_sq.NextVal, :1, :2, :3, :4, :5, :6, :7, :8)"; stmt->setSQL(sql); DateHandler dm(m_env, m_conn); stmt->setInt(1, tag_id); stmt->setInt(2, seq_id); stmt->setInt(3, getInt("lmr")); stmt->setInt(4, color_id); stmt->setInt(5, tt); stmt->setDate(6, dm.tmToDate(getSubRunStart())); stmt->setDate(7, dm.tmToDate(getSubRunEnd())); stmt->setString(8, getSubRunType()); return sql; }
friend class EcalCondDBInterface [friend] |
Reimplemented from LMFUnique.
Definition at line 21 of file LMFRunIOV.h.
LMFDefFabric* LMFRunIOV::_fabric [private] |
Definition at line 99 of file LMFRunIOV.h.
Referenced by checkFabric(), dump(), operator=(), setColor(), setColorIndex(), setTriggerType(), and ~LMFRunIOV().