CMS 3D CMS Logo

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

void dump () const override
 
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) override
 
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) override
 
LMFSeqDat getSequence () const
 
Tm getSubRunEnd () const
 
Tm getSubRunStart () const
 
std::string getSubRunType () const
 
LMFTrigType getTriggerType () const
 
bool isValid () override
 
 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) override
 
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) override
 
 ~LMFRunIOV () override
 
- 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 std::list< std::unique_ptr< LMFUnique > > fetchAll () const noexcept(false)
 
int fetchID () noexcept(false) override
 
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) noexcept(false) override
 
LMFUniquesetInt (std::string key, int value)
 
LMFUniquesetString (std::string key, std::string value)
 
void startProfiling ()
 
void stopProfiling ()
 
 ~LMFUnique () override
 
- 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) noexcept(false)
 
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 () noexcept(false)
 
virtual int writeForeignKeys () noexcept(false)
 
- Protected Member Functions inherited from IDBObject
void checkConnection () const noexcept(false)
 
- 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 18 of file LMFRunIOV.h.

Constructor & Destructor Documentation

◆ LMFRunIOV() [1/4]

LMFRunIOV::LMFRunIOV ( )

Definition at line 28 of file LMFRunIOV.cc.

References initialize().

28 : LMFUnique() { initialize(); }
LMFUnique()
Definition: LMFUnique.h:27
void initialize()
Definition: LMFRunIOV.cc:10

◆ LMFRunIOV() [2/4]

LMFRunIOV::LMFRunIOV ( oracle::occi::Environment *  env,
oracle::occi::Connection *  conn 
)

Definition at line 30 of file LMFRunIOV.cc.

References initialize().

30  : LMFUnique(env, conn) {
31  initialize();
32 }
LMFUnique()
Definition: LMFUnique.h:27
void initialize()
Definition: LMFRunIOV.cc:10
conn
Definition: getInfo.py:9

◆ LMFRunIOV() [3/4]

LMFRunIOV::LMFRunIOV ( EcalDBConnection c)

Definition at line 34 of file LMFRunIOV.cc.

References initialize().

◆ LMFRunIOV() [4/4]

LMFRunIOV::LMFRunIOV ( const LMFRunIOV r)

Definition at line 36 of file LMFRunIOV.cc.

References initialize(), and alignCSCRings::r.

37  initialize();
38  *this = r;
39 }
LMFUnique()
Definition: LMFUnique.h:27
void initialize()
Definition: LMFRunIOV.cc:10

◆ ~LMFRunIOV()

LMFRunIOV::~LMFRunIOV ( )
override

Definition at line 41 of file LMFRunIOV.cc.

References _fabric.

41  {
42  if (_fabric != nullptr) {
43  delete _fabric;
44  }
45 }
LMFDefFabric * _fabric
Definition: LMFRunIOV.h:89

Member Function Documentation

◆ checkFabric()

void LMFRunIOV::checkFabric ( )
private

Definition at line 73 of file LMFRunIOV.cc.

References _fabric, IDBObject::m_conn, and IDBObject::m_env.

Referenced by operator=(), setColor(), setColorIndex(), and setTriggerType().

73  {
74  if (_fabric == nullptr) {
76  }
77 }
oracle::occi::Environment * m_env
Definition: IDBObject.h:33
oracle::occi::Connection * m_conn
Definition: IDBObject.h:34
LMFDefFabric * _fabric
Definition: LMFRunIOV.h:89

◆ dump()

void LMFRunIOV::dump ( void  ) const
overridevirtual

Reimplemented from LMFUnique.

Definition at line 186 of file LMFRunIOV.cc.

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

186  {
187  LMFUnique::dump();
188  std::cout << "# Fabric Address: " << _fabric << std::endl;
189  if (m_debug) {
190  _fabric->dump();
191  }
192 }
virtual void dump() const
Definition: LMFUnique.cc:104
LMFDefFabric * _fabric
Definition: LMFRunIOV.h:89
char m_debug
Definition: LMFUnique.h:100

◆ fetchBySequence() [1/4]

std::list< LMFRunIOV > LMFRunIOV::fetchBySequence ( const LMFSeqDat s)

Definition at line 353 of file LMFRunIOV.cc.

References alignCSCRings::s.

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

353  {
354  int seq_id = s.getID();
355  vector<int> parameters;
356  parameters.push_back(seq_id);
358  "SELECT LMF_IOV_ID FROM "
359  "CMS_ECAL_LASER_COND.LMF_RUN_IOV "
360  "WHERE SEQ_ID = :1",
361  "fetchBySequence");
362 }
std::list< LMFRunIOV > fetchBySequence(const LMFSeqDat &s)
Definition: LMFRunIOV.cc:353

◆ fetchBySequence() [2/4]

std::list< LMFRunIOV > LMFRunIOV::fetchBySequence ( const LMFSeqDat s,
int  lmr 
)

Definition at line 364 of file LMFRunIOV.cc.

References fetchBySequence(), and alignCSCRings::s.

364  {
365  int seq_id = s.getID();
366  vector<int> parameters;
367  parameters.push_back(seq_id);
368  parameters.push_back(lmr);
370  "SELECT LMF_IOV_ID FROM "
371  "CMS_ECAL_LASER_COND.LMF_RUN_IOV "
372  "WHERE SEQ_ID = :1 AND LMR = :2",
373  "fetchBySequence");
374 }
std::list< LMFRunIOV > fetchBySequence(const LMFSeqDat &s)
Definition: LMFRunIOV.cc:353

◆ fetchBySequence() [3/4]

std::list< LMFRunIOV > LMFRunIOV::fetchBySequence ( const LMFSeqDat s,
int  lmr,
int  type,
int  color 
)

Definition at line 376 of file LMFRunIOV.cc.

References fetchBySequence(), and alignCSCRings::s.

376  {
377  int seq_id = s.getID();
378  vector<int> parameters;
379  parameters.push_back(seq_id);
380  parameters.push_back(lmr);
381  parameters.push_back(color);
382  parameters.push_back(type);
384  "SELECT LMF_IOV_ID FROM "
385  "CMS_ECAL_LASER_COND.LMF_RUN_IOV "
386  "WHERE SEQ_ID = :1 AND LMR = :2 AND COLOR_ID = :3 "
387  "AND TRIG_TYPE = :4",
388  "fetchBySequence");
389 }
std::list< LMFRunIOV > fetchBySequence(const LMFSeqDat &s)
Definition: LMFRunIOV.cc:353

◆ fetchBySequence() [4/4]

std::list< LMFRunIOV > LMFRunIOV::fetchBySequence ( const std::vector< int > &  par,
const std::string &  sql,
const std::string &  method 
)
privatenoexcept

Definition at line 327 of file LMFRunIOV.cc.

References MillePedeFileConverter_cfg::e, mps_fire::i, cmsLHEtoEOSManager::l, AlcaSiPixelAliHarvester0T_cff::method, LMFUnique::setByID(), and IDBObject::setConnection().

329  {
330  std::list<LMFRunIOV> l;
331  this->checkConnection();
332  try {
333  Statement *stmt = m_conn->createStatement();
334  stmt->setSQL(sql);
335  for (unsigned int i = 0; i < par.size(); i++) {
336  stmt->setInt(i + 1, par[i]);
337  }
338  ResultSet *rset = stmt->executeQuery();
339  while (rset->next() != 0) {
340  int lmf_iov_id = rset->getInt(1);
341  LMFRunIOV iov;
342  iov.setConnection(m_env, m_conn);
343  iov.setByID(lmf_iov_id);
344  l.push_back(iov);
345  }
346  m_conn->terminateStatement(stmt);
347  } catch (SQLException &e) {
348  throw(std::runtime_error(m_className + "::" + method + ": " + e.getMessage()));
349  }
350  return l;
351 }
std::string m_className
Definition: LMFUnique.h:99
oracle::occi::Environment * m_env
Definition: IDBObject.h:33
oracle::occi::Connection * m_conn
Definition: IDBObject.h:34
void checkConnection() const noexcept(false)
Definition: IDBObject.h:36
oracle::occi::ResultSet ResultSet
Definition: LMFUnique.h:23
void setByID(int id) noexcept(false) override
Definition: LMFUnique.cc:267
oracle::occi::Statement Statement
Definition: LMFUnique.h:24
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
Definition: IDBObject.h:23

◆ fetchIdSql()

std::string LMFRunIOV::fetchIdSql ( Statement stmt)
overridevirtual

Reimplemented from LMFUnique.

Definition at line 194 of file LMFRunIOV.cc.

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

194  {
195  std::string sql = "";
196 
197  sql =
198  "SELECT LMF_IOV_ID FROM CMS_ECAL_LASER_COND.LMF_RUN_IOV WHERE "
199  "SEQ_ID = :1 "
200  "AND LMR = :2 ";
201  if (m_intFields["tag_id"] > 0) {
202  sql += "AND TAG_ID = :3";
203  }
204  stmt->setSQL(sql);
205  stmt->setInt(1, m_intFields["seq_id"]);
206  stmt->setInt(2, m_intFields["lmr"]);
207  if (m_intFields["tag_id"] > 0) {
208  stmt->setInt(3, m_intFields["tag_id"]);
209  }
210  return sql;
211 }
std::map< std::string, int > m_intFields
Definition: LMFUnique.h:104

◆ fetchLastBeforeSequence()

std::list< LMFRunIOV > LMFRunIOV::fetchLastBeforeSequence ( const LMFSeqDat s,
int  lmr,
int  type,
int  color 
)

Definition at line 391 of file LMFRunIOV.cc.

References fetchBySequence(), and alignCSCRings::s.

Referenced by EcalCondDBInterface::fetchLMFRunIOV().

391  {
392  int seq_id = s.getID();
393  vector<int> parameters;
394  parameters.push_back(seq_id);
395  parameters.push_back(lmr);
396  parameters.push_back(color);
397  parameters.push_back(type);
399  "SELECT LMF_IOV_ID FROM (SELECT "
400  "SEQ_ID, LMF_IOV_ID FROM "
401  "CMS_ECAL_LASER_COND.LMF_RUN_IOV "
402  "WHERE SEQ_ID < :1 AND LMR = :2 AND COLOR_ID = :3 "
403  "AND TRIG_TYPE = :4 ORDER BY SEQ_ID DESC) WHERE "
404  "ROWNUM <= 1",
405  "fetchBySequence");
406 }
std::list< LMFRunIOV > fetchBySequence(const LMFSeqDat &s)
Definition: LMFRunIOV.cc:353

◆ getColor()

LMFColor LMFRunIOV::getColor ( ) const
inline

Definition at line 54 of file LMFRunIOV.h.

References getLMFColor().

54 { return getLMFColor(); }
LMFColor getLMFColor() const
Definition: LMFRunIOV.cc:91

◆ getColorLongName()

std::string LMFRunIOV::getColorLongName ( ) const

Definition at line 102 of file LMFRunIOV.cc.

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

102  {
103  LMFColor rcol = getLMFColor();
104  return rcol.getLongName();
105 }
std::string getLongName() const
Definition: LMFColor.h:44
LMFColor getLMFColor() const
Definition: LMFRunIOV.cc:91

◆ getColorShortName()

std::string LMFRunIOV::getColorShortName ( ) const

Definition at line 97 of file LMFRunIOV.cc.

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

97  {
98  LMFColor rcol = getLMFColor();
99  return rcol.getShortName();
100 }
std::string getShortName() const
Definition: LMFColor.h:43
LMFColor getLMFColor() const
Definition: LMFRunIOV.cc:91

◆ getDBInsertionTime()

Tm LMFRunIOV::getDBInsertionTime ( ) const

Definition at line 159 of file LMFRunIOV.cc.

References LMFUnique::getString(), and submitPVValidationJobs::t.

159  {
160  Tm t;
161  t.setToString(getString("db_timestamp"));
162  return t;
163 }
std::string getString(std::string fieldname) const
Definition: LMFUnique.cc:178
Definition: Tm.h:13

◆ getLMFColor()

LMFColor LMFRunIOV::getLMFColor ( ) const

Definition at line 91 of file LMFRunIOV.cc.

References LMFUnique::getInt(), IDBObject::m_conn, IDBObject::m_env, and LMFUnique::setByID().

Referenced by getColor(), getColorLongName(), getColorShortName(), isValid(), and operator==().

91  {
92  LMFColor rcol = LMFColor(m_env, m_conn);
93  rcol.setByID(getInt("color_id"));
94  return rcol;
95 }
oracle::occi::Environment * m_env
Definition: IDBObject.h:33
oracle::occi::Connection * m_conn
Definition: IDBObject.h:34
void setByID(int id) noexcept(false) override
Definition: LMFUnique.cc:267
int getInt(std::string fieldname) const
Definition: LMFUnique.cc:187

◆ getLMFRunTag()

LMFRunTag LMFRunIOV::getLMFRunTag ( ) const

Definition at line 57 of file LMFRunIOV.cc.

References LMFUnique::getInt(), IDBObject::m_conn, IDBObject::m_env, and LMFUnique::setByID().

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

57  {
59  rtag.setByID(getInt("tag_id"));
60  return rtag;
61 }
oracle::occi::Environment * m_env
Definition: IDBObject.h:33
oracle::occi::Connection * m_conn
Definition: IDBObject.h:34
void setByID(int id) noexcept(false) override
Definition: LMFUnique.cc:267
int getInt(std::string fieldname) const
Definition: LMFUnique.cc:187

◆ getLmr()

int LMFRunIOV::getLmr ( ) const

Definition at line 134 of file LMFRunIOV.cc.

References LMFUnique::getInt().

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

134 { return getInt("lmr"); }
int getInt(std::string fieldname) const
Definition: LMFUnique.cc:187

◆ getParameters()

void LMFRunIOV::getParameters ( ResultSet rset)
overridevirtualnoexcept

Reimplemented from LMFUnique.

Definition at line 225 of file LMFRunIOV.cc.

References util.getRunInfo::day(), cuy::dh, compareTotals::fs, edm::second(), cmsswSequenceInfo::seq, AlCaHLTBitMon_QueryRunRegistry::string, groupFilesInBlocks::tt, and HLT_2022v15_cff::year.

225  {
227  setLMFRunTag(rset->getInt(1));
228  LMFSeqDat *seq;
229  if (m_foreignKeys.find("sequence") != m_foreignKeys.end()) {
230  seq = (LMFSeqDat *)m_foreignKeys["sequence"];
231  setInt("seq_id", seq->getID());
232  } else {
233  seq = new LMFSeqDat;
234  seq->setConnection(m_env, m_conn);
235  seq->setByID(rset->getInt(2));
236  setInt("seq_id", seq->getID());
237  delete seq;
238  }
239  setInt("lmr", rset->getInt(3));
240  setColor(rset->getInt(4));
241  setTriggerType(rset->getInt(5));
242  Date start = rset->getDate(6);
243  setString("subrun_start", dh.dateToTm(start).str());
244  Date stop = rset->getDate(7);
245  setString("subrun_end", dh.dateToTm(stop).str());
246  setString("subrun_type", rset->getString(8));
247 #if defined(_GLIBCXX_USE_CXX11_ABI) && (_GLIBCXX_USE_CXX11_ABI == 0)
248  setString("db_timestamp", rset->getTimestamp(9).toText("YYYY-MM-DD HH24:MI:SS", 0));
249 #else
250  int year = 0;
251  unsigned int month = 0;
252  unsigned int day = 0;
253  unsigned int hour = 0;
254  unsigned int minute = 0;
255  unsigned int second = 0;
256  unsigned int fs = 0;
257  rset->getTimestamp(9).getDate(year, month, day);
258  rset->getTimestamp(9).getTime(hour, minute, second, fs);
259  const std::tm tt = {// Different max(second) is defined by C99 and Oracle Timestamp.
260  .tm_sec = static_cast<int>(second),
261  .tm_min = static_cast<int>(minute),
262  .tm_hour = static_cast<int>(hour),
263  .tm_mday = static_cast<int>(day),
264  .tm_mon = static_cast<int>(month),
265  .tm_year = year - 1900,
266  .tm_wday = 0,
267  .tm_yday = 0,
268  .tm_isdst = 0,
269  .tm_gmtoff = 0,
270  .tm_zone = nullptr};
271  char tt_str[30] = {0};
272  if (std::strftime(tt_str, sizeof(tt_str), "%F %T", &tt)) {
273  setString("db_timestamp", std::string(tt_str));
274  } else {
275  throw std::runtime_error(
276  "LMFRunIOV::getParameters: failed to generate the date string for 'db_timestamp' parameter");
277  }
278 #endif
279 }
Definition: start.py:1
LMFUnique & setInt(std::string key, int value)
Definition: LMFUnique.cc:31
oracle::occi::Environment * m_env
Definition: IDBObject.h:33
oracle::occi::Connection * m_conn
Definition: IDBObject.h:34
LMFRunIOV & setLMFRunTag(const LMFRunTag &tag)
Definition: LMFRunIOV.cc:47
std::map< std::string, LMFUnique * > m_foreignKeys
Definition: LMFUnique.h:106
U second(std::pair< T, U > const &p)
Definition: TTTypes.h:54
LMFRunIOV & setTriggerType(LMFTrigType &tt)
Definition: LMFRunIOV.cc:107
LMFUnique & setString(std::string key, std::string value)
Definition: LMFUnique.cc:14
def day(string)
Definition: getRunInfo.py:11
LMFRunIOV & setColor(const LMFColor &c)
Definition: LMFRunIOV.cc:63
dh
Definition: cuy.py:354

◆ getSequence()

LMFSeqDat LMFRunIOV::getSequence ( ) const

Definition at line 180 of file LMFRunIOV.cc.

References LMFUnique::getInt(), IDBObject::m_conn, IDBObject::m_env, and LMFUnique::setByID().

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

180  {
182  rs.setByID(getInt("seq_id"));
183  return rs;
184 }
oracle::occi::Environment * m_env
Definition: IDBObject.h:33
oracle::occi::Connection * m_conn
Definition: IDBObject.h:34
void setByID(int id) noexcept(false) override
Definition: LMFUnique.cc:267
int getInt(std::string fieldname) const
Definition: LMFUnique.cc:187

◆ getSubRunEnd()

Tm LMFRunIOV::getSubRunEnd ( ) const

Definition at line 152 of file LMFRunIOV.cc.

References LMFUnique::getString(), and submitPVValidationJobs::t.

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

152  {
153  Tm t;
154  t.setToString(getString("subrun_end"));
155  return t;
156 }
std::string getString(std::string fieldname) const
Definition: LMFUnique.cc:178
Definition: Tm.h:13

◆ getSubRunStart()

Tm LMFRunIOV::getSubRunStart ( ) const

Definition at line 141 of file LMFRunIOV.cc.

References LMFUnique::getString(), and submitPVValidationJobs::t.

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

141  {
142  Tm t;
143  t.setToString(getString("subrun_start"));
144  return t;
145 }
std::string getString(std::string fieldname) const
Definition: LMFUnique.cc:178
Definition: Tm.h:13

◆ getSubRunType()

std::string LMFRunIOV::getSubRunType ( ) const

Definition at line 170 of file LMFRunIOV.cc.

References LMFUnique::getString().

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

170 { return getString("subrun_type"); }
std::string getString(std::string fieldname) const
Definition: LMFUnique.cc:178

◆ getTriggerType()

LMFTrigType LMFRunIOV::getTriggerType ( ) const

Definition at line 123 of file LMFRunIOV.cc.

References LMFUnique::getInt(), IDBObject::m_conn, IDBObject::m_env, and hcal_runs::rt.

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

123  {
125  rt.setByID(getInt("trigType_id"));
126  return rt;
127 }
oracle::occi::Environment * m_env
Definition: IDBObject.h:33
oracle::occi::Connection * m_conn
Definition: IDBObject.h:34
int getInt(std::string fieldname) const
Definition: LMFUnique.cc:187

◆ initialize()

void LMFRunIOV::initialize ( void  )
private

Definition at line 10 of file LMFRunIOV.cc.

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

Referenced by LMFRunIOV().

10  {
11  Tm tm;
12  tm.setToCurrentGMTime();
13 
14  m_intFields["lmr"] = 0;
15  m_intFields["tag_id"] = 0;
16  m_intFields["seq_id"] = 0;
17  m_intFields["color_id"] = 0;
18  m_intFields["trigType_id"] = 0;
19  m_stringFields["subrun_start"] = tm.str();
20  m_stringFields["subrun_end"] = tm.str();
21  m_stringFields["db_timestamp"] = tm.str();
22  m_stringFields["subrun_type"] = "none";
23  m_className = "LMFRunIOV";
24 
25  _fabric = nullptr;
26 }
std::string m_className
Definition: LMFUnique.h:99
void setToCurrentGMTime()
Definition: Tm.cc:141
std::map< std::string, std::string > m_stringFields
Definition: LMFUnique.h:102
LMFDefFabric * _fabric
Definition: LMFRunIOV.h:89
std::string str() const
Definition: Tm.cc:66
Definition: Tm.h:13
std::map< std::string, int > m_intFields
Definition: LMFUnique.h:104

◆ isValid()

bool LMFRunIOV::isValid ( void  )
overridevirtual

Reimplemented from LMFUnique.

Definition at line 281 of file LMFRunIOV.cc.

References getLMFColor(), getLMFRunTag(), getLmr(), getSequence(), getTriggerType(), and runTheMatrix::ret.

Referenced by ntupleDataFormat._Object::_checkIsValid(), and core.AutoHandle.AutoHandle::ReallyLoad().

281  {
282  bool ret = true;
283  if (!getLMFRunTag().isValid()) {
284  ret = false;
285  }
286  if (!getSequence().isValid()) {
287  ret = false;
288  }
289  if (!getTriggerType().isValid()) {
290  ret = false;
291  }
292  if ((getLmr() < 0) || (getLmr() > 92)) {
293  ret = false;
294  }
295  if (!getLMFColor().isValid()) {
296  ret = false;
297  }
298  // subrun start and end are by definition valid
299  return ret;
300 }
LMFSeqDat getSequence() const
Definition: LMFRunIOV.cc:180
ret
prodAgent to be discontinued
LMFRunTag getLMFRunTag() const
Definition: LMFRunIOV.cc:57
int getLmr() const
Definition: LMFRunIOV.cc:134
bool isValid() override
Definition: LMFRunIOV.cc:281
LMFTrigType getTriggerType() const
Definition: LMFRunIOV.cc:123
LMFColor getLMFColor() const
Definition: LMFRunIOV.cc:91

◆ operator!=()

bool LMFRunIOV::operator!= ( const LMFRunIOV m) const
inline

◆ operator=()

LMFRunIOV & LMFRunIOV::operator= ( const LMFRunIOV r)
virtual

Definition at line 408 of file LMFRunIOV.cc.

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

408  {
409  if (this != &r) {
410  LMFUnique::operator=(r);
411  if (r._fabric != nullptr) {
412  checkFabric(); // _fabric = new LMFDefFabric;
413  if (m_debug) {
414  _fabric->debug();
415  std::cout << "COPYING INTO " << _fabric << std::endl;
416  }
417  *_fabric = *(r._fabric);
418  }
419  }
420  return *this;
421 }
void checkFabric()
Definition: LMFRunIOV.cc:73
LMFDefFabric * _fabric
Definition: LMFRunIOV.h:89
char m_debug
Definition: LMFUnique.h:100

◆ operator==()

bool LMFRunIOV::operator== ( const LMFRunIOV m) const
inline

Definition at line 68 of file LMFRunIOV.h.

References getLMFColor(), getLMFRunTag(), getLmr(), getSequence(), getSubRunEnd(), getSubRunStart(), getSubRunType(), getTriggerType(), and visualization-live-secondInstance_cfg::m.

68  {
69  return (getLMFRunTag() == m.getLMFRunTag() && getSequence() == m.getSequence() && getLmr() == m.getLmr() &&
70  getLMFColor() == m.getLMFColor() && getTriggerType() == m.getTriggerType() &&
71  getSubRunType() == m.getSubRunType() && getSubRunStart() == m.getSubRunStart() &&
72  getSubRunEnd() == m.getSubRunEnd());
73  }
Tm getSubRunStart() const
Definition: LMFRunIOV.cc:141
LMFSeqDat getSequence() const
Definition: LMFRunIOV.cc:180
LMFRunTag getLMFRunTag() const
Definition: LMFRunIOV.cc:57
Tm getSubRunEnd() const
Definition: LMFRunIOV.cc:152
int getLmr() const
Definition: LMFRunIOV.cc:134
std::string getSubRunType() const
Definition: LMFRunIOV.cc:170
LMFTrigType getTriggerType() const
Definition: LMFRunIOV.cc:123
LMFColor getLMFColor() const
Definition: LMFRunIOV.cc:91

◆ setByIDSql()

std::string LMFRunIOV::setByIDSql ( Statement stmt,
int  id 
)
overridevirtual

Reimplemented from LMFUnique.

Definition at line 213 of file LMFRunIOV.cc.

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

213  {
215  std::string sql =
216  "SELECT TAG_ID, SEQ_ID, LMR, COLOR_ID, TRIG_TYPE, "
217  "SUBRUN_START, SUBRUN_END, SUBRUN_TYPE, DB_TIMESTAMP FROM "
218  "CMS_ECAL_LASER_COND.LMF_RUN_IOV "
219  "WHERE LMF_IOV_ID = :1";
220  stmt->setSQL(sql);
221  stmt->setInt(1, id);
222  return sql;
223 }
oracle::occi::Environment * m_env
Definition: IDBObject.h:33
oracle::occi::Connection * m_conn
Definition: IDBObject.h:34
dh
Definition: cuy.py:354

◆ setColor() [1/3]

LMFRunIOV & LMFRunIOV::setColor ( const LMFColor c)

Definition at line 63 of file LMFRunIOV.cc.

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

63  {
64  setInt("color_id", color.getID());
65  return *this;
66 }
LMFUnique & setInt(std::string key, int value)
Definition: LMFUnique.cc:31

◆ setColor() [2/3]

LMFRunIOV & LMFRunIOV::setColor ( std::string  name)

Definition at line 85 of file LMFRunIOV.cc.

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

85  {
86  checkFabric();
87  setInt("color_id", _fabric->getColorID(name));
88  return *this;
89 }
LMFUnique & setInt(std::string key, int value)
Definition: LMFUnique.cc:31
void checkFabric()
Definition: LMFRunIOV.cc:73
int getColorID(std::string name) const
Definition: LMFDefFabric.cc:81
LMFDefFabric * _fabric
Definition: LMFRunIOV.h:89

◆ setColor() [3/3]

LMFRunIOV & LMFRunIOV::setColor ( int  color_id)

Definition at line 68 of file LMFRunIOV.cc.

References LMFUnique::setInt().

68  {
69  setInt("color_id", color_id);
70  return *this;
71 }
LMFUnique & setInt(std::string key, int value)
Definition: LMFUnique.cc:31

◆ setColorIndex()

LMFRunIOV & LMFRunIOV::setColorIndex ( int  color_index)

Definition at line 79 of file LMFRunIOV.cc.

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

79  {
80  checkFabric();
81  setInt("color_id", _fabric->getColorID(color_index));
82  return *this;
83 }
LMFUnique & setInt(std::string key, int value)
Definition: LMFUnique.cc:31
void checkFabric()
Definition: LMFRunIOV.cc:73
int getColorID(std::string name) const
Definition: LMFDefFabric.cc:81
LMFDefFabric * _fabric
Definition: LMFRunIOV.h:89

◆ setLMFRunTag() [1/2]

LMFRunIOV & LMFRunIOV::setLMFRunTag ( const LMFRunTag tag)

Definition at line 47 of file LMFRunIOV.cc.

References LMFUnique::setInt(), and makeGlobalPositionRcd_cfg::tag.

47  {
48  setInt("tag_id", tag.getID());
49  return *this;
50 }
LMFUnique & setInt(std::string key, int value)
Definition: LMFUnique.cc:31

◆ setLMFRunTag() [2/2]

LMFRunIOV & LMFRunIOV::setLMFRunTag ( int  tag_id)

Definition at line 52 of file LMFRunIOV.cc.

References LMFUnique::setInt().

52  {
53  setInt("tag_id", tag_id);
54  return *this;
55 }
LMFUnique & setInt(std::string key, int value)
Definition: LMFUnique.cc:31

◆ setLmr()

LMFRunIOV & LMFRunIOV::setLmr ( int  n)

Definition at line 129 of file LMFRunIOV.cc.

References dqmiodumpmetadata::n, and LMFUnique::setInt().

129  {
130  setInt("lmr", n);
131  return *this;
132 }
LMFUnique & setInt(std::string key, int value)
Definition: LMFUnique.cc:31

◆ setSequence() [1/2]

LMFRunIOV & LMFRunIOV::setSequence ( LMFSeqDat seq)

Definition at line 172 of file LMFRunIOV.cc.

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

172  {
173  LMFSeqDat *seqdat = new LMFSeqDat();
174  *seqdat = seq;
175  attach("sequence", seqdat);
176  setInt("seq_id", seqdat->getID());
177  return *this;
178 }
LMFUnique & setInt(std::string key, int value)
Definition: LMFUnique.cc:31
int getID() const
Definition: LMFUnique.h:58
void attach(std::string name, LMFUnique *u)
Definition: LMFUnique.cc:48

◆ setSequence() [2/2]

LMFRunIOV& LMFRunIOV::setSequence ( LMFSeqDat seq)

◆ setSubRunEnd()

LMFRunIOV & LMFRunIOV::setSubRunEnd ( const Tm end)

Definition at line 147 of file LMFRunIOV.cc.

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

147  {
148  setString("subrun_end", stop.str());
149  return *this;
150 }
LMFUnique & setString(std::string key, std::string value)
Definition: LMFUnique.cc:14

◆ setSubRunStart()

LMFRunIOV & LMFRunIOV::setSubRunStart ( const Tm start)

Definition at line 136 of file LMFRunIOV.cc.

References LMFUnique::setString().

136  {
137  setString("subrun_start", start.str());
138  return *this;
139 }
Definition: start.py:1
LMFUnique & setString(std::string key, std::string value)
Definition: LMFUnique.cc:14

◆ setSubRunType()

LMFRunIOV & LMFRunIOV::setSubRunType ( const std::string &  x)

Definition at line 165 of file LMFRunIOV.cc.

References alignCSCRings::s, and LMFUnique::setString().

165  {
166  setString("subrun_type", s);
167  return *this;
168 }
LMFUnique & setString(std::string key, std::string value)
Definition: LMFUnique.cc:14

◆ setTriggerType() [1/3]

LMFRunIOV & LMFRunIOV::setTriggerType ( LMFTrigType tt)

Definition at line 107 of file LMFRunIOV.cc.

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

107  {
108  setInt("trigType_id", trigType.getID());
109  return *this;
110 }
LMFUnique & setInt(std::string key, int value)
Definition: LMFUnique.cc:31

◆ setTriggerType() [2/3]

LMFRunIOV & LMFRunIOV::setTriggerType ( int  trigType_id)

Definition at line 118 of file LMFRunIOV.cc.

References LMFUnique::setInt().

118  {
119  setInt("trigType_id", id);
120  return *this;
121 }
LMFUnique & setInt(std::string key, int value)
Definition: LMFUnique.cc:31

◆ setTriggerType() [3/3]

LMFRunIOV & LMFRunIOV::setTriggerType ( std::string  trigShortName)

Definition at line 112 of file LMFRunIOV.cc.

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

112  {
113  checkFabric();
114  setInt("trigType_id", _fabric->getTrigTypeID(sname));
115  return *this;
116 }
LMFUnique & setInt(std::string key, int value)
Definition: LMFUnique.cc:31
void checkFabric()
Definition: LMFRunIOV.cc:73
LMFDefFabric * _fabric
Definition: LMFRunIOV.h:89
int getTrigTypeID(std::string sname) const
Definition: LMFDefFabric.cc:85

◆ writeDBSql()

std::string LMFRunIOV::writeDBSql ( Statement stmt)
overridevirtual

Reimplemented from LMFUnique.

Definition at line 302 of file LMFRunIOV.cc.

References symbols::dm, LMFUnique::getInt(), getSubRunEnd(), getSubRunStart(), getSubRunType(), IDBObject::m_conn, IDBObject::m_env, LMFUnique::sequencePostfix(), and AlCaHLTBitMon_QueryRunRegistry::string.

302  {
303  // check that everything has been setup
304  int tag_id = getInt("tag_id");
305  int seq_id = getInt("seq_id");
306  int color_id = getInt("color_id");
307  int tt = getInt("trigType_id");
309  std::string sql =
310  "INSERT INTO LMF_RUN_IOV (LMF_IOV_ID, TAG_ID, SEQ_ID, "
311  "LMR, COLOR_ID, TRIG_TYPE, SUBRUN_START, SUBRUN_END, SUBRUN_TYPE) VALUES "
312  "(lmf_run_iov_" +
313  sp + "_sq.NextVal, :1, :2, :3, :4, :5, :6, :7, :8)";
314  stmt->setSQL(sql);
316  stmt->setInt(1, tag_id);
317  stmt->setInt(2, seq_id);
318  stmt->setInt(3, getInt("lmr"));
319  stmt->setInt(4, color_id);
320  stmt->setInt(5, tt);
321  stmt->setDate(6, dm.tmToDate(getSubRunStart()));
322  stmt->setDate(7, dm.tmToDate(getSubRunEnd()));
323  stmt->setString(8, getSubRunType());
324  return sql;
325 }
Tm getSubRunStart() const
Definition: LMFRunIOV.cc:141
oracle::occi::Environment * m_env
Definition: IDBObject.h:33
oracle::occi::Connection * m_conn
Definition: IDBObject.h:34
std::string sequencePostfix(const Tm &t)
Definition: LMFUnique.cc:9
Tm getSubRunEnd() const
Definition: LMFRunIOV.cc:152
Definition: TTTypes.h:54
std::string getSubRunType() const
Definition: LMFRunIOV.cc:170
int getInt(std::string fieldname) const
Definition: LMFUnique.cc:187

Friends And Related Function Documentation

◆ EcalCondDBInterface

friend class EcalCondDBInterface
friend

Definition at line 20 of file LMFRunIOV.h.

Member Data Documentation

◆ _fabric

LMFDefFabric* LMFRunIOV::_fabric
private