CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes | Friends
LMFRunIOV Class Reference

#include <LMFRunIOV.h>

Inheritance diagram for LMFRunIOV:
LMFUnique IUniqueDBObject IDBObject

Public Member Functions

virtual void dump () const
 
std::list< LMFRunIOVfetchBySequence (const LMFSeqDat &s)
 
std::list< LMFRunIOVfetchBySequence (const LMFSeqDat &s, int lmr)
 
std::list< LMFRunIOVfetchBySequence (const LMFSeqDat &s, int lmr, int type, int color)
 
std::string fetchIdSql (Statement *stmt)
 
std::list< LMFRunIOVfetchLastBeforeSequence (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 ()
 
 LMFRunIOV (oracle::occi::Environment *env, oracle::occi::Connection *conn)
 
 LMFRunIOV (EcalDBConnection *c)
 
 LMFRunIOV (const LMFRunIOV &r)
 
bool operator!= (const LMFRunIOV &m) const
 
virtual LMFRunIOVoperator= (const LMFRunIOV &r)
 
bool operator== (const LMFRunIOV &m) const
 
std::string setByIDSql (Statement *stmt, int id)
 
LMFRunIOVsetColor (const LMFColor &c)
 
LMFRunIOVsetColor (std::string name)
 
LMFRunIOVsetColor (int color_id)
 
LMFRunIOVsetColorIndex (int color_index)
 
LMFRunIOVsetLMFRunTag (const LMFRunTag &tag)
 
LMFRunIOVsetLMFRunTag (int tag_id)
 
LMFRunIOVsetLmr (int n)
 
LMFRunIOVsetSequence (LMFSeqDat &seq)
 
LMFRunIOVsetSequence (LMFSeqDat *seq)
 
LMFRunIOVsetSubRunEnd (const Tm &end)
 
LMFRunIOVsetSubRunStart (const Tm &start)
 
LMFRunIOVsetSubRunType (const std::string &x)
 
LMFRunIOVsetTriggerType (LMFTrigType &tt)
 
LMFRunIOVsetTriggerType (int trigType_id)
 
LMFRunIOVsetTriggerType (std::string trigShortName)
 
std::string writeDBSql (Statement *stmt)
 
 ~LMFRunIOV ()
 
- Public Member Functions inherited from LMFUnique
void attach (std::string name, LMFUnique *u)
 
void debug ()
 
virtual void dump (int n) const
 
virtual bool exists ()
 
virtual boost::ptr_list
< LMFUnique
fetchAll () const throw (std::runtime_error)
 
int fetchID () throw (std::runtime_error)
 
std::string getClassName ()
 
std::string getClassName () const
 
int getID () const
 
int getInt (std::string fieldname) const
 
std::string getString (std::string fieldname) const
 
virtual bool isValid () const
 
 LMFUnique ()
 
 LMFUnique (oracle::occi::Environment *env, oracle::occi::Connection *conn)
 
 LMFUnique (EcalDBConnection *c)
 
void nodebug ()
 
virtual bool operator< (const LMFUnique &r)
 
virtual bool operator<= (const LMFUnique &r)
 
std::string sequencePostfix (const Tm &t)
 
void setByID (int id) throw (std::runtime_error)
 
LMFUniquesetInt (std::string key, int value)
 
LMFUniquesetString (std::string key, std::string value)
 
void startProfiling ()
 
void stopProfiling ()
 
virtual ~LMFUnique ()
 
- Public Member Functions inherited from IDBObject
oracle::occi::Connection * getConn () const
 
oracle::occi::Environment * getEnv () const
 
void setConnection (oracle::occi::Environment *env, oracle::occi::Connection *conn)
 
virtual ~IDBObject ()
 

Private Member Functions

void checkFabric ()
 
std::list< LMFRunIOVfetchBySequence (const 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
 

Additional Inherited Members

- Public Types inherited from LMFUnique
typedef oracle::occi::ResultSet ResultSet
 
typedef oracle::occi::Statement Statement
 
- Static Public Attributes inherited from IDBObject
static int const ECALDB_NROWS =1024
 
- Protected Member Functions inherited from LMFUnique
virtual void setClassName (std::string s)
 
virtual int writeDB () throw (std::runtime_error)
 
virtual int writeForeignKeys () throw (std::runtime_error)
 
- Protected Member Functions inherited from IDBObject
void checkConnection () const throw (std::runtime_error)
 
- Protected Attributes inherited from LMFUnique
bool _profiling
 
std::string m_className
 
char m_debug
 
std::map< std::string,
LMFUnique * > 
m_foreignKeys
 
std::map< std::string, int > m_intFields
 
std::map< std::string,
std::string > 
m_stringFields
 
- Protected Attributes inherited from IUniqueDBObject
int m_ID
 
- Protected Attributes inherited from IDBObject
oracle::occi::Connection * m_conn
 
oracle::occi::Environment * m_env
 

Detailed Description

Definition at line 19 of file LMFRunIOV.h.

Constructor & Destructor Documentation

LMFRunIOV::LMFRunIOV ( )

Definition at line 26 of file LMFRunIOV.cc.

References initialize().

26  : LMFUnique()
27 {
28  initialize();
29 }
LMFUnique()
Definition: LMFUnique.h:23
void initialize()
Definition: LMFRunIOV.cc:8
LMFRunIOV::LMFRunIOV ( oracle::occi::Environment *  env,
oracle::occi::Connection *  conn 
)

Definition at line 31 of file LMFRunIOV.cc.

References initialize().

32  : LMFUnique(env, conn)
33 {
34  initialize();
35 }
LMFUnique()
Definition: LMFUnique.h:23
void initialize()
Definition: LMFRunIOV.cc:8
tuple conn
Definition: results_mgr.py:53
LMFRunIOV::LMFRunIOV ( EcalDBConnection c)

Definition at line 37 of file LMFRunIOV.cc.

References initialize().

37  : LMFUnique(c)
38 {
39  initialize();
40 }
LMFUnique()
Definition: LMFUnique.h:23
void initialize()
Definition: LMFRunIOV.cc:8
LMFRunIOV::LMFRunIOV ( const LMFRunIOV r)

Definition at line 42 of file LMFRunIOV.cc.

References initialize(), and alignCSCRings::r.

42  {
43  initialize();
44  *this = r;
45 }
void initialize()
Definition: LMFRunIOV.cc:8
LMFRunIOV::~LMFRunIOV ( )

Definition at line 47 of file LMFRunIOV.cc.

References _fabric, and NULL.

48 {
49  if (_fabric != NULL) {
50  delete _fabric;
51  }
52 }
#define NULL
Definition: scimark2.h:8
LMFDefFabric * _fabric
Definition: LMFRunIOV.h:99

Member Function Documentation

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().

85  {
86  if (_fabric == NULL) {
88  }
89 }
oracle::occi::Environment * m_env
Definition: IDBObject.h:38
oracle::occi::Connection * m_conn
Definition: IDBObject.h:39
#define NULL
Definition: scimark2.h:8
LMFDefFabric * _fabric
Definition: LMFRunIOV.h:99
void LMFRunIOV::dump ( void  ) const
virtual

Reimplemented from LMFUnique.

Definition at line 209 of file LMFRunIOV.cc.

References _fabric, gather_cfg::cout, LMFDefFabric::dump(), LMFUnique::dump(), and LMFUnique::m_debug.

209  {
210  LMFUnique::dump();
211  std::cout << "# Fabric Address: " << _fabric << std::endl;
212  if (m_debug) {
213  _fabric->dump();
214  }
215 }
virtual void dump() const
Definition: LMFUnique.cc:112
LMFDefFabric * _fabric
Definition: LMFRunIOV.h:99
tuple cout
Definition: gather_cfg.py:121
char m_debug
Definition: LMFUnique.h:100
std::list< LMFRunIOV > LMFRunIOV::fetchBySequence ( const LMFSeqDat s)

Definition at line 347 of file LMFRunIOV.cc.

References LMFUnique::getID(), and Parameters::parameters.

Referenced by fetchBySequence(), fetchLastBeforeSequence(), and EcalCondDBInterface::fetchLMFRunIOV().

347  {
348  int seq_id = s.getID();
349  vector<int> parameters;
350  parameters.push_back(seq_id);
351  return fetchBySequence(parameters, "SELECT LMF_IOV_ID FROM "
352  "CMS_ECAL_LASER_COND.LMF_RUN_IOV "
353  "WHERE SEQ_ID = :1", "fetchBySequence");
354 }
dictionary parameters
Definition: Parameters.py:2
int getID() const
Definition: LMFUnique.h:52
std::list< LMFRunIOV > fetchBySequence(const LMFSeqDat &s)
Definition: LMFRunIOV.cc:347
std::list< LMFRunIOV > LMFRunIOV::fetchBySequence ( const LMFSeqDat s,
int  lmr 
)

Definition at line 356 of file LMFRunIOV.cc.

References fetchBySequence(), LMFUnique::getID(), and Parameters::parameters.

356  {
357  int seq_id = s.getID();
358  vector<int> parameters;
359  parameters.push_back(seq_id);
360  parameters.push_back(lmr);
361  return fetchBySequence(parameters, "SELECT LMF_IOV_ID FROM "
362  "CMS_ECAL_LASER_COND.LMF_RUN_IOV "
363  "WHERE SEQ_ID = :1 AND LMR = :2",
364  "fetchBySequence");
365 }
dictionary parameters
Definition: Parameters.py:2
int getID() const
Definition: LMFUnique.h:52
std::list< LMFRunIOV > fetchBySequence(const LMFSeqDat &s)
Definition: LMFRunIOV.cc:347
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.

368  {
369  int seq_id = s.getID();
370  vector<int> parameters;
371  parameters.push_back(seq_id);
372  parameters.push_back(lmr);
373  parameters.push_back(color);
374  parameters.push_back(type);
375  return fetchBySequence(parameters, "SELECT LMF_IOV_ID FROM "
376  "CMS_ECAL_LASER_COND.LMF_RUN_IOV "
377  "WHERE SEQ_ID = :1 AND LMR = :2 AND COLOR_ID = :3 "
378  "AND TRIG_TYPE = :4",
379  "fetchBySequence");
380 }
type
Definition: HCALResponse.h:21
dictionary parameters
Definition: Parameters.py:2
int getID() const
Definition: LMFUnique.h:52
std::list< LMFRunIOV > fetchBySequence(const LMFSeqDat &s)
Definition: LMFRunIOV.cc:347
std::list< LMFRunIOV > LMFRunIOV::fetchBySequence ( const std::vector< int > &  par,
const std::string &  sql,
const std::string &  method 
)
throw (std::runtime_error
)
private

Definition at line 318 of file LMFRunIOV.cc.

References alignCSCRings::e, i, o2o::iov, prof2calltree::l, PFRecoTauDiscriminationAgainstElectronMVA3GBR_cfi::method, LMFUnique::setByID(), and IDBObject::setConnection().

322 {
323  std::list<LMFRunIOV> l;
324  this->checkConnection();
325  try {
326  Statement *stmt = m_conn->createStatement();
327  stmt->setSQL(sql);
328  for (unsigned int i = 0; i < par.size(); i++) {
329  stmt->setInt(i + 1, par[i]);
330  }
331  ResultSet *rset = stmt->executeQuery();
332  while (rset->next() != 0) {
333  int lmf_iov_id = rset->getInt(1);
334  LMFRunIOV iov;
335  iov.setConnection(m_env, m_conn);
336  iov.setByID(lmf_iov_id);
337  l.push_back(iov);
338  }
339  m_conn->terminateStatement(stmt);
340  } catch (SQLException &e) {
341  throw(std::runtime_error(m_className + "::" + method + ": " +
342  e.getMessage()));
343  }
344  return l;
345 }
std::string m_className
Definition: LMFUnique.h:99
int i
Definition: DBlmapReader.cc:9
oracle::occi::Environment * m_env
Definition: IDBObject.h:38
oracle::occi::Connection * m_conn
Definition: IDBObject.h:39
oracle::occi::SQLException SQLException
Definition: HcalDbOmds.cc:27
void setByID(int id)
Definition: LMFUnique.cc:286
tuple iov
Definition: o2o.py:307
oracle::occi::Statement Statement
Definition: LMFUnique.h:20
oracle::occi::ResultSet ResultSet
Definition: HcalDbOmds.cc:26
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
Definition: IDBObject.h:23
void checkConnection() const
Definition: IDBObject.h:41
std::string LMFRunIOV::fetchIdSql ( Statement stmt)
virtual

Reimplemented from LMFUnique.

Definition at line 217 of file LMFRunIOV.cc.

References LMFUnique::m_intFields, and AlCaHLTBitMon_QueryRunRegistry::string.

218 {
219  std::string sql = "";
220 
221  sql = "SELECT LMF_IOV_ID FROM CMS_ECAL_LASER_COND.LMF_RUN_IOV WHERE "
222  "SEQ_ID = :1 "
223  "AND LMR = :2 ";
224  if (m_intFields["tag_id"] > 0) {
225  sql += "AND TAG_ID = :3";
226  }
227  stmt->setSQL(sql);
228  stmt->setInt(1, m_intFields["seq_id"]);
229  stmt->setInt(2, m_intFields["lmr"]);
230  if (m_intFields["tag_id"] > 0) {
231  stmt->setInt(3, m_intFields["tag_id"]);
232  }
233  return sql;
234 }
std::map< std::string, int > m_intFields
Definition: LMFUnique.h:104
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().

384  {
385  int seq_id = s.getID();
386  vector<int> parameters;
387  parameters.push_back(seq_id);
388  parameters.push_back(lmr);
389  parameters.push_back(color);
390  parameters.push_back(type);
391  return fetchBySequence(parameters, "SELECT LMF_IOV_ID FROM (SELECT "
392  "SEQ_ID, LMF_IOV_ID FROM "
393  "CMS_ECAL_LASER_COND.LMF_RUN_IOV "
394  "WHERE SEQ_ID < :1 AND LMR = :2 AND COLOR_ID = :3 "
395  "AND TRIG_TYPE = :4 ORDER BY SEQ_ID DESC) WHERE "
396  "ROWNUM <= 1",
397  "fetchBySequence");
398 }
type
Definition: HCALResponse.h:21
dictionary parameters
Definition: Parameters.py:2
int getID() const
Definition: LMFUnique.h:52
std::list< LMFRunIOV > fetchBySequence(const LMFSeqDat &s)
Definition: LMFRunIOV.cc:347
LMFColor LMFRunIOV::getColor ( ) const
inline

Definition at line 56 of file LMFRunIOV.h.

References getLMFColor().

56 { return getLMFColor(); }
LMFColor getLMFColor() const
Definition: LMFRunIOV.cc:105
std::string LMFRunIOV::getColorLongName ( ) const

Definition at line 117 of file LMFRunIOV.cc.

References getLMFColor(), and LMFColor::getLongName().

117  {
118  LMFColor rcol = getLMFColor();
119  return rcol.getLongName();
120 }
LMFColor getLMFColor() const
Definition: LMFRunIOV.cc:105
std::string getLongName() const
Definition: LMFColor.h:45
std::string LMFRunIOV::getColorShortName ( ) const

Definition at line 112 of file LMFRunIOV.cc.

References getLMFColor(), and LMFColor::getShortName().

112  {
113  LMFColor rcol = getLMFColor();
114  return rcol.getShortName();
115 }
LMFColor getLMFColor() const
Definition: LMFRunIOV.cc:105
std::string getShortName() const
Definition: LMFColor.h:44
Tm LMFRunIOV::getDBInsertionTime ( ) const

Definition at line 178 of file LMFRunIOV.cc.

References LMFUnique::getString(), Tm::setToString(), and edmStreamStallGrapher::t.

178  {
179  Tm t;
180  t.setToString(getString("db_timestamp"));
181  return t;
182 }
void setToString(const std::string s)
Definition: Tm.cc:193
std::string getString(std::string fieldname) const
Definition: LMFUnique.cc:194
Definition: Tm.h:13
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==().

106 {
107  LMFColor rcol = LMFColor(m_env, m_conn);
108  rcol.setByID(getInt("color_id"));
109  return rcol;
110 }
oracle::occi::Environment * m_env
Definition: IDBObject.h:38
oracle::occi::Connection * m_conn
Definition: IDBObject.h:39
int getInt(std::string fieldname) const
Definition: LMFUnique.cc:203
void setByID(int id)
Definition: LMFUnique.cc:286
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==().

67 {
69  rtag.setByID(getInt("tag_id"));
70  return rtag;
71 }
oracle::occi::Environment * m_env
Definition: IDBObject.h:38
oracle::occi::Connection * m_conn
Definition: IDBObject.h:39
int getInt(std::string fieldname) const
Definition: LMFUnique.cc:203
void setByID(int id)
Definition: LMFUnique.cc:286
int LMFRunIOV::getLmr ( ) const

Definition at line 152 of file LMFRunIOV.cc.

References LMFUnique::getInt().

Referenced by isValid(), and operator==().

152  {
153  return getInt("lmr");
154 }
int getInt(std::string fieldname) const
Definition: LMFUnique.cc:203
void LMFRunIOV::getParameters ( ResultSet rset)
virtual

Reimplemented from LMFUnique.

Definition at line 248 of file LMFRunIOV.cc.

References DateHandler::dateToTm(), cuy::dh, IDBObject::m_conn, IDBObject::m_env, LMFUnique::m_foreignKeys, setColor(), IDBObject::setConnection(), LMFUnique::setInt(), setLMFRunTag(), LMFUnique::setString(), setTriggerType(), dqm_diff::start, and Tm::str().

248  {
250  setLMFRunTag(rset->getInt(1));
251  LMFSeqDat *seq;
252  if (m_foreignKeys.find("sequence") != m_foreignKeys.end()) {
253  seq = (LMFSeqDat*)m_foreignKeys["sequence"];
254  setInt("seq_id", seq->getID());
255  } else {
256  seq = new LMFSeqDat;
257  seq->setConnection(m_env, m_conn);
258  seq->setByID(rset->getInt(2));
259  setInt("seq_id", seq->getID());
260  delete seq;
261  }
262  setInt("lmr", rset->getInt(3));
263  setColor(rset->getInt(4));
264  setTriggerType(rset->getInt(5));
265  Date start = rset->getDate(6);
266  setString("subrun_start", dh.dateToTm(start).str());
267  Date stop = rset->getDate(7);
268  setString("subrun_end", dh.dateToTm(stop).str());
269  setString("subrun_type", rset->getString(8));
270  setString("db_timestamp", rset->getTimestamp(9).toText("YYYY-MM-DD HH24:MI:SS", 0));
271 }
LMFUnique & setInt(std::string key, int value)
Definition: LMFUnique.cc:33
oracle::occi::Environment * m_env
Definition: IDBObject.h:38
oracle::occi::Connection * m_conn
Definition: IDBObject.h:39
tuple start
Check for commandline option errors.
Definition: dqm_diff.py:58
LMFRunIOV & setLMFRunTag(const LMFRunTag &tag)
Definition: LMFRunIOV.cc:54
LMFRunIOV & setTriggerType(LMFTrigType &tt)
Definition: LMFRunIOV.cc:122
std::map< std::string, LMFUnique * > m_foreignKeys
Definition: LMFUnique.h:106
LMFUnique & setString(std::string key, std::string value)
Definition: LMFUnique.cc:15
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
Definition: IDBObject.h:23
LMFRunIOV & setColor(const LMFColor &c)
Definition: LMFRunIOV.cc:73
tuple dh
Definition: cuy.py:353
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==().

203 {
205  rs.setByID(getInt("seq_id"));
206  return rs;
207 }
oracle::occi::Environment * m_env
Definition: IDBObject.h:38
oracle::occi::Connection * m_conn
Definition: IDBObject.h:39
int getInt(std::string fieldname) const
Definition: LMFUnique.cc:203
void setByID(int id)
Definition: LMFUnique.cc:286
Tm LMFRunIOV::getSubRunEnd ( ) const

Definition at line 172 of file LMFRunIOV.cc.

References LMFUnique::getString(), Tm::setToString(), and edmStreamStallGrapher::t.

Referenced by operator==(), and writeDBSql().

172  {
173  Tm t;
174  t.setToString(getString("subrun_end"));
175  return t;
176 }
void setToString(const std::string s)
Definition: Tm.cc:193
std::string getString(std::string fieldname) const
Definition: LMFUnique.cc:194
Definition: Tm.h:13
Tm LMFRunIOV::getSubRunStart ( ) const

Definition at line 161 of file LMFRunIOV.cc.

References LMFUnique::getString(), Tm::setToString(), and edmStreamStallGrapher::t.

Referenced by LMFDat::getSubrunStart(), operator==(), and writeDBSql().

161  {
162  Tm t;
163  t.setToString(getString("subrun_start"));
164  return t;
165 }
void setToString(const std::string s)
Definition: Tm.cc:193
std::string getString(std::string fieldname) const
Definition: LMFUnique.cc:194
Definition: Tm.h:13
std::string LMFRunIOV::getSubRunType ( ) const

Definition at line 189 of file LMFRunIOV.cc.

References LMFUnique::getString().

Referenced by operator==(), and writeDBSql().

189  {
190  return getString("subrun_type");
191 }
std::string getString(std::string fieldname) const
Definition: LMFUnique.cc:194
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==().

141 {
143  rt.setByID(getInt("trigType_id"));
144  return rt;
145 }
oracle::occi::Environment * m_env
Definition: IDBObject.h:38
oracle::occi::Connection * m_conn
Definition: IDBObject.h:39
int getInt(std::string fieldname) const
Definition: LMFUnique.cc:203
void setByID(int id)
Definition: LMFUnique.cc:286
void LMFRunIOV::initialize ( )
private

Definition at line 8 of file LMFRunIOV.cc.

References NULL, Tm::setToCurrentGMTime(), and Tm::str().

Referenced by LMFRunIOV().

8  {
9  Tm tm;
10  tm.setToCurrentGMTime();
11 
12  m_intFields["lmr"] = 0;
13  m_intFields["tag_id"] = 0;
14  m_intFields["seq_id"] = 0;
15  m_intFields["color_id"] = 0;
16  m_intFields["trigType_id"] = 0;
17  m_stringFields["subrun_start"] = tm.str();
18  m_stringFields["subrun_end"] = tm.str();
19  m_stringFields["db_timestamp"] = tm.str();
20  m_stringFields["subrun_type"] = "none";
21  m_className = "LMFRunIOV";
22 
23  _fabric = NULL;
24 }
std::string m_className
Definition: LMFUnique.h:99
#define NULL
Definition: scimark2.h:8
void setToCurrentGMTime()
Definition: Tm.cc:177
std::map< std::string, std::string > m_stringFields
Definition: LMFUnique.h:102
LMFDefFabric * _fabric
Definition: LMFRunIOV.h:99
std::string str() const
Definition: Tm.cc:89
Definition: Tm.h:13
std::map< std::string, int > m_intFields
Definition: LMFUnique.h:104
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.

Referenced by core.AutoHandle.AutoHandle::ReallyLoad().

273  {
274  bool ret = true;
275  if (!getLMFRunTag().isValid()) {
276  ret = false;
277  }
278  if (!getSequence().isValid()) {
279  ret = false;
280  }
281  if (!getTriggerType().isValid()) {
282  ret = false;
283  }
284  if ((getLmr() < 0) || (getLmr() > 92)) {
285  ret = false;
286  }
287  if (!getLMFColor().isValid()) {
288  ret = false;
289  }
290  // subrun start and end are by definition valid
291  return ret;
292 }
LMFColor getLMFColor() const
Definition: LMFRunIOV.cc:105
bool isValid()
Definition: LMFRunIOV.cc:273
LMFSeqDat getSequence() const
Definition: LMFRunIOV.cc:202
int getLmr() const
Definition: LMFRunIOV.cc:152
LMFTrigType getTriggerType() const
Definition: LMFRunIOV.cc:140
LMFRunTag getLMFRunTag() const
Definition: LMFRunIOV.cc:66
bool LMFRunIOV::operator!= ( const LMFRunIOV m) const
inline

Definition at line 84 of file LMFRunIOV.h.

References contentValuesFiles::m.

84 { return !(*this == m); }
LMFRunIOV & LMFRunIOV::operator= ( const LMFRunIOV r)
virtual

Definition at line 400 of file LMFRunIOV.cc.

References _fabric, checkFabric(), gather_cfg::cout, LMFDefFabric::debug(), LMFUnique::m_debug, and NULL.

400  {
401  if (this != &r) {
402  LMFUnique::operator=(r);
403  if (r._fabric != NULL) {
404  checkFabric();// _fabric = new LMFDefFabric;
405  if (m_debug) {
406  _fabric->debug();
407  std::cout << "COPYING INTO " << _fabric << std::endl;
408  }
409  *_fabric = *(r._fabric);
410  }
411  }
412  return *this;
413 }
#define NULL
Definition: scimark2.h:8
void checkFabric()
Definition: LMFRunIOV.cc:85
LMFDefFabric * _fabric
Definition: LMFRunIOV.h:99
tuple cout
Definition: gather_cfg.py:121
char m_debug
Definition: LMFUnique.h:100
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().

73  {
74  return ( getLMFRunTag() == m.getLMFRunTag() &&
75  getSequence() == m.getSequence() &&
76  getLmr() == m.getLmr() &&
77  getLMFColor() == m.getLMFColor() &&
78  getTriggerType() == m.getTriggerType() &&
79  getSubRunType() == m.getSubRunType() &&
80  getSubRunStart() == m.getSubRunStart() &&
81  getSubRunEnd() == m.getSubRunEnd() );
82  }
std::string getSubRunType() const
Definition: LMFRunIOV.cc:189
Tm getSubRunStart() const
Definition: LMFRunIOV.cc:161
LMFColor getLMFColor() const
Definition: LMFRunIOV.cc:105
LMFSeqDat getSequence() const
Definition: LMFRunIOV.cc:202
int getLmr() const
Definition: LMFRunIOV.cc:152
LMFTrigType getTriggerType() const
Definition: LMFRunIOV.cc:140
Tm getSubRunEnd() const
Definition: LMFRunIOV.cc:172
LMFRunTag getLMFRunTag() const
Definition: LMFRunIOV.cc:66
std::string LMFRunIOV::setByIDSql ( Statement stmt,
int  id 
)
virtual

Reimplemented from LMFUnique.

Definition at line 236 of file LMFRunIOV.cc.

References cuy::dh, IDBObject::m_conn, IDBObject::m_env, and AlCaHLTBitMon_QueryRunRegistry::string.

237 {
239  std::string sql = "SELECT TAG_ID, SEQ_ID, LMR, COLOR_ID, TRIG_TYPE, "
240  "SUBRUN_START, SUBRUN_END, SUBRUN_TYPE, DB_TIMESTAMP FROM "
241  "CMS_ECAL_LASER_COND.LMF_RUN_IOV "
242  "WHERE LMF_IOV_ID = :1";
243  stmt->setSQL(sql);
244  stmt->setInt(1, id);
245  return sql;
246 }
oracle::occi::Environment * m_env
Definition: IDBObject.h:38
oracle::occi::Connection * m_conn
Definition: IDBObject.h:39
tuple dh
Definition: cuy.py:353
LMFRunIOV & LMFRunIOV::setColor ( const LMFColor c)

Definition at line 73 of file LMFRunIOV.cc.

References LMFUnique::getID(), and LMFUnique::setInt().

Referenced by getParameters().

74 {
75  setInt("color_id", color.getID());
76  return *this;
77 }
LMFUnique & setInt(std::string key, int value)
Definition: LMFUnique.cc:33
LMFRunIOV & LMFRunIOV::setColor ( std::string  name)

Definition at line 98 of file LMFRunIOV.cc.

References _fabric, checkFabric(), LMFDefFabric::getColorID(), and LMFUnique::setInt().

99 {
100  checkFabric();
101  setInt("color_id", _fabric->getColorID(name));
102  return *this;
103 }
LMFUnique & setInt(std::string key, int value)
Definition: LMFUnique.cc:33
int getColorID(std::string name) const
Definition: LMFDefFabric.cc:95
void checkFabric()
Definition: LMFRunIOV.cc:85
LMFDefFabric * _fabric
Definition: LMFRunIOV.h:99
LMFRunIOV & LMFRunIOV::setColor ( int  color_id)

Definition at line 79 of file LMFRunIOV.cc.

References LMFUnique::setInt().

80 {
81  setInt("color_id", color_id);
82  return *this;
83 }
LMFUnique & setInt(std::string key, int value)
Definition: LMFUnique.cc:33
LMFRunIOV & LMFRunIOV::setColorIndex ( int  color_index)

Definition at line 91 of file LMFRunIOV.cc.

References _fabric, checkFabric(), LMFDefFabric::getColorID(), and LMFUnique::setInt().

92 {
93  checkFabric();
94  setInt("color_id", _fabric->getColorID(color_index));
95  return *this;
96 }
LMFUnique & setInt(std::string key, int value)
Definition: LMFUnique.cc:33
int getColorID(std::string name) const
Definition: LMFDefFabric.cc:95
void checkFabric()
Definition: LMFRunIOV.cc:85
LMFDefFabric * _fabric
Definition: LMFRunIOV.h:99
LMFRunIOV & LMFRunIOV::setLMFRunTag ( const LMFRunTag tag)

Definition at line 54 of file LMFRunIOV.cc.

References LMFUnique::getID(), and LMFUnique::setInt().

Referenced by getParameters().

55 {
56  setInt("tag_id", tag.getID());
57  return *this;
58 }
LMFUnique & setInt(std::string key, int value)
Definition: LMFUnique.cc:33
int getID() const
Definition: LMFUnique.h:52
LMFRunIOV & LMFRunIOV::setLMFRunTag ( int  tag_id)

Definition at line 60 of file LMFRunIOV.cc.

References LMFUnique::setInt().

61 {
62  setInt("tag_id", tag_id);
63  return *this;
64 }
LMFUnique & setInt(std::string key, int value)
Definition: LMFUnique.cc:33
LMFRunIOV & LMFRunIOV::setLmr ( int  n)

Definition at line 147 of file LMFRunIOV.cc.

References LMFUnique::setInt().

147  {
148  setInt("lmr", n);
149  return *this;
150 }
LMFUnique & setInt(std::string key, int value)
Definition: LMFUnique.cc:33
LMFRunIOV & LMFRunIOV::setSequence ( LMFSeqDat seq)

Definition at line 193 of file LMFRunIOV.cc.

References LMFUnique::attach(), LMFUnique::getID(), and LMFUnique::setInt().

194 {
195  LMFSeqDat *seqdat = new LMFSeqDat();
196  *seqdat = seq;
197  attach("sequence", seqdat);
198  setInt("seq_id", seqdat->getID());
199  return *this;
200 }
LMFUnique & setInt(std::string key, int value)
Definition: LMFUnique.cc:33
int getID() const
Definition: LMFUnique.h:52
void attach(std::string name, LMFUnique *u)
Definition: LMFUnique.cc:50
LMFRunIOV& LMFRunIOV::setSequence ( LMFSeqDat seq)
LMFRunIOV & LMFRunIOV::setSubRunEnd ( const Tm end)

Definition at line 167 of file LMFRunIOV.cc.

References LMFUnique::setString(), and Tm::str().

167  {
168  setString("subrun_end", stop.str());
169  return *this;
170 }
LMFUnique & setString(std::string key, std::string value)
Definition: LMFUnique.cc:15
LMFRunIOV & LMFRunIOV::setSubRunStart ( const Tm start)

Definition at line 156 of file LMFRunIOV.cc.

References LMFUnique::setString(), and Tm::str().

156  {
157  setString("subrun_start", start.str());
158  return *this;
159 }
LMFUnique & setString(std::string key, std::string value)
Definition: LMFUnique.cc:15
std::string str() const
Definition: Tm.cc:89
LMFRunIOV & LMFRunIOV::setSubRunType ( const std::string &  x)

Definition at line 184 of file LMFRunIOV.cc.

References LMFUnique::setString().

184  {
185  setString("subrun_type", s);
186  return *this;
187 }
LMFUnique & setString(std::string key, std::string value)
Definition: LMFUnique.cc:15
LMFRunIOV & LMFRunIOV::setTriggerType ( LMFTrigType tt)

Definition at line 122 of file LMFRunIOV.cc.

References LMFUnique::getID(), and LMFUnique::setInt().

Referenced by getParameters().

123 {
124  setInt("trigType_id", trigType.getID());
125  return *this;
126 }
LMFUnique & setInt(std::string key, int value)
Definition: LMFUnique.cc:33
LMFRunIOV & LMFRunIOV::setTriggerType ( int  trigType_id)

Definition at line 135 of file LMFRunIOV.cc.

References LMFUnique::setInt().

135  {
136  setInt("trigType_id", id);
137  return *this;
138 }
LMFUnique & setInt(std::string key, int value)
Definition: LMFUnique.cc:33
LMFRunIOV & LMFRunIOV::setTriggerType ( std::string  trigShortName)

Definition at line 128 of file LMFRunIOV.cc.

References _fabric, checkFabric(), LMFDefFabric::getTrigTypeID(), and LMFUnique::setInt().

129 {
130  checkFabric();
131  setInt("trigType_id", _fabric->getTrigTypeID(sname));
132  return *this;
133 }
LMFUnique & setInt(std::string key, int value)
Definition: LMFUnique.cc:33
void checkFabric()
Definition: LMFRunIOV.cc:85
int getTrigTypeID(std::string sname) const
LMFDefFabric * _fabric
Definition: LMFRunIOV.h:99
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(), AlCaHLTBitMon_QueryRunRegistry::string, DateHandler::tmToDate(), and groupFilesInBlocks::tt.

295 {
296  // check that everything has been setup
297  int tag_id = getInt("tag_id");
298  int seq_id = getInt("seq_id");
299  int color_id = getInt("color_id");
300  int tt = getInt("trigType_id");
302  std::string sql = "INSERT INTO LMF_RUN_IOV (LMF_IOV_ID, TAG_ID, SEQ_ID, "
303  "LMR, COLOR_ID, TRIG_TYPE, SUBRUN_START, SUBRUN_END, SUBRUN_TYPE) VALUES "
304  "(lmf_run_iov_" + sp + "_sq.NextVal, :1, :2, :3, :4, :5, :6, :7, :8)";
305  stmt->setSQL(sql);
306  DateHandler dm(m_env, m_conn);
307  stmt->setInt(1, tag_id);
308  stmt->setInt(2, seq_id);
309  stmt->setInt(3, getInt("lmr"));
310  stmt->setInt(4, color_id);
311  stmt->setInt(5, tt);
312  stmt->setDate(6, dm.tmToDate(getSubRunStart()));
313  stmt->setDate(7, dm.tmToDate(getSubRunEnd()));
314  stmt->setString(8, getSubRunType());
315  return sql;
316 }
std::string getSubRunType() const
Definition: LMFRunIOV.cc:189
oracle::occi::Environment * m_env
Definition: IDBObject.h:38
oracle::occi::Connection * m_conn
Definition: IDBObject.h:39
Tm getSubRunStart() const
Definition: LMFRunIOV.cc:161
std::string sequencePostfix(const Tm &t)
Definition: LMFUnique.cc:10
int getInt(std::string fieldname) const
Definition: LMFUnique.cc:203
Tm getSubRunEnd() const
Definition: LMFRunIOV.cc:172

Friends And Related Function Documentation

friend class EcalCondDBInterface
friend

Definition at line 21 of file LMFRunIOV.h.

Member Data Documentation

LMFDefFabric* LMFRunIOV::_fabric
private