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 (const LMFRunIOV &r)
 
 LMFRunIOV (EcalDBConnection *c)
 
 LMFRunIOV (oracle::occi::Environment *env, oracle::occi::Connection *conn)
 
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 (int color_id)
 
LMFRunIOVsetColor (std::string name)
 
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 (int trigType_id)
 
LMFRunIOVsetTriggerType (LMFTrigType &tt)
 
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 (EcalDBConnection *c)
 
 LMFUnique (oracle::occi::Environment *env, oracle::occi::Connection *conn)
 
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 const int 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.

28 : LMFUnique() { initialize(); }

References initialize().

◆ LMFRunIOV() [2/4]

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

Definition at line 30 of file LMFRunIOV.cc.

30  : LMFUnique(env, conn) {
31  initialize();
32 }

References initialize().

◆ LMFRunIOV() [3/4]

LMFRunIOV::LMFRunIOV ( EcalDBConnection c)

Definition at line 34 of file LMFRunIOV.cc.

34 : LMFUnique(c) { initialize(); }

References initialize().

◆ LMFRunIOV() [4/4]

LMFRunIOV::LMFRunIOV ( const LMFRunIOV r)

Definition at line 36 of file LMFRunIOV.cc.

37  initialize();
38  *this = r;
39 }

References initialize(), and alignCSCRings::r.

◆ ~LMFRunIOV()

LMFRunIOV::~LMFRunIOV ( )
override

Definition at line 41 of file LMFRunIOV.cc.

41  {
42  if (_fabric != nullptr) {
43  delete _fabric;
44  }
45 }

References _fabric.

Member Function Documentation

◆ checkFabric()

void LMFRunIOV::checkFabric ( )
private

Definition at line 73 of file LMFRunIOV.cc.

73  {
74  if (_fabric == nullptr) {
76  }
77 }

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

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

◆ dump()

void LMFRunIOV::dump ( void  ) const
overridevirtual

Reimplemented from LMFUnique.

Definition at line 186 of file LMFRunIOV.cc.

186  {
187  LMFUnique::dump();
188  std::cout << "# Fabric Address: " << _fabric << std::endl;
189  if (m_debug) {
190  _fabric->dump();
191  }
192 }

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

◆ fetchBySequence() [1/4]

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

Definition at line 353 of file LMFRunIOV.cc.

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 }

References alignCSCRings::s.

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

◆ fetchBySequence() [2/4]

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

Definition at line 364 of file LMFRunIOV.cc.

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 }

References fetchBySequence(), and alignCSCRings::s.

◆ 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.

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 }

References fetchBySequence(), and alignCSCRings::s.

◆ 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.

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 }

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

◆ fetchIdSql()

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

Reimplemented from LMFUnique.

Definition at line 194 of file LMFRunIOV.cc.

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 }

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

◆ fetchLastBeforeSequence()

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

Definition at line 391 of file LMFRunIOV.cc.

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 }

References fetchBySequence(), and alignCSCRings::s.

Referenced by EcalCondDBInterface::fetchLMFRunIOV().

◆ getColor()

LMFColor LMFRunIOV::getColor ( ) const
inline

Definition at line 54 of file LMFRunIOV.h.

54 { return getLMFColor(); }

References getLMFColor().

◆ getColorLongName()

std::string LMFRunIOV::getColorLongName ( ) const

Definition at line 102 of file LMFRunIOV.cc.

102  {
103  LMFColor rcol = getLMFColor();
104  return rcol.getLongName();
105 }

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

◆ getColorShortName()

std::string LMFRunIOV::getColorShortName ( ) const

Definition at line 97 of file LMFRunIOV.cc.

97  {
98  LMFColor rcol = getLMFColor();
99  return rcol.getShortName();
100 }

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

◆ getDBInsertionTime()

Tm LMFRunIOV::getDBInsertionTime ( ) const

Definition at line 159 of file LMFRunIOV.cc.

159  {
160  Tm t;
161  t.setToString(getString("db_timestamp"));
162  return t;
163 }

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

◆ getLMFColor()

LMFColor LMFRunIOV::getLMFColor ( ) const

Definition at line 91 of file LMFRunIOV.cc.

91  {
92  LMFColor rcol = LMFColor(m_env, m_conn);
93  rcol.setByID(getInt("color_id"));
94  return rcol;
95 }

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

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

◆ getLMFRunTag()

LMFRunTag LMFRunIOV::getLMFRunTag ( ) const

Definition at line 57 of file LMFRunIOV.cc.

57  {
59  rtag.setByID(getInt("tag_id"));
60  return rtag;
61 }

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

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

◆ getLmr()

int LMFRunIOV::getLmr ( ) const

Definition at line 134 of file LMFRunIOV.cc.

134 { return getInt("lmr"); }

References LMFUnique::getInt().

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

◆ getParameters()

void LMFRunIOV::getParameters ( ResultSet rset)
overridevirtualnoexcept

Reimplemented from LMFUnique.

Definition at line 225 of file LMFRunIOV.cc.

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 }

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

◆ getSequence()

LMFSeqDat LMFRunIOV::getSequence ( ) const

Definition at line 180 of file LMFRunIOV.cc.

180  {
182  rs.setByID(getInt("seq_id"));
183  return rs;
184 }

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

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

◆ getSubRunEnd()

Tm LMFRunIOV::getSubRunEnd ( ) const

Definition at line 152 of file LMFRunIOV.cc.

152  {
153  Tm t;
154  t.setToString(getString("subrun_end"));
155  return t;
156 }

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

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

◆ getSubRunStart()

Tm LMFRunIOV::getSubRunStart ( ) const

Definition at line 141 of file LMFRunIOV.cc.

141  {
142  Tm t;
143  t.setToString(getString("subrun_start"));
144  return t;
145 }

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

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

◆ getSubRunType()

std::string LMFRunIOV::getSubRunType ( ) const

Definition at line 170 of file LMFRunIOV.cc.

170 { return getString("subrun_type"); }

References LMFUnique::getString().

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

◆ getTriggerType()

LMFTrigType LMFRunIOV::getTriggerType ( ) const

Definition at line 123 of file LMFRunIOV.cc.

123  {
125  rt.setByID(getInt("trigType_id"));
126  return rt;
127 }

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

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

◆ initialize()

void LMFRunIOV::initialize ( void  )
private

Definition at line 10 of file LMFRunIOV.cc.

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 }

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

Referenced by LMFRunIOV().

◆ isValid()

bool LMFRunIOV::isValid ( void  )
overridevirtual

Reimplemented from LMFUnique.

Definition at line 281 of file LMFRunIOV.cc.

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 }

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

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

◆ operator!=()

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

Definition at line 75 of file LMFRunIOV.h.

75 { return !(*this == m); }

References visualization-live-secondInstance_cfg::m.

◆ operator=()

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

Definition at line 408 of file LMFRunIOV.cc.

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 }

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

◆ operator==()

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

Definition at line 68 of file LMFRunIOV.h.

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  }

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

◆ setByIDSql()

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

Reimplemented from LMFUnique.

Definition at line 213 of file LMFRunIOV.cc.

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 }

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

◆ setColor() [1/3]

LMFRunIOV & LMFRunIOV::setColor ( const LMFColor c)

Definition at line 63 of file LMFRunIOV.cc.

63  {
64  setInt("color_id", color.getID());
65  return *this;
66 }

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

◆ setColor() [2/3]

LMFRunIOV & LMFRunIOV::setColor ( int  color_id)

Definition at line 68 of file LMFRunIOV.cc.

68  {
69  setInt("color_id", color_id);
70  return *this;
71 }

References LMFUnique::setInt().

◆ setColor() [3/3]

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

Definition at line 85 of file LMFRunIOV.cc.

85  {
86  checkFabric();
87  setInt("color_id", _fabric->getColorID(name));
88  return *this;
89 }

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

◆ setColorIndex()

LMFRunIOV & LMFRunIOV::setColorIndex ( int  color_index)

Definition at line 79 of file LMFRunIOV.cc.

79  {
80  checkFabric();
81  setInt("color_id", _fabric->getColorID(color_index));
82  return *this;
83 }

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

◆ setLMFRunTag() [1/2]

LMFRunIOV & LMFRunIOV::setLMFRunTag ( const LMFRunTag tag)

Definition at line 47 of file LMFRunIOV.cc.

47  {
48  setInt("tag_id", tag.getID());
49  return *this;
50 }

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

◆ setLMFRunTag() [2/2]

LMFRunIOV & LMFRunIOV::setLMFRunTag ( int  tag_id)

Definition at line 52 of file LMFRunIOV.cc.

52  {
53  setInt("tag_id", tag_id);
54  return *this;
55 }

References LMFUnique::setInt().

◆ setLmr()

LMFRunIOV & LMFRunIOV::setLmr ( int  n)

Definition at line 129 of file LMFRunIOV.cc.

129  {
130  setInt("lmr", n);
131  return *this;
132 }

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

◆ setSequence() [1/2]

LMFRunIOV & LMFRunIOV::setSequence ( LMFSeqDat seq)

Definition at line 172 of file LMFRunIOV.cc.

172  {
173  LMFSeqDat *seqdat = new LMFSeqDat();
174  *seqdat = seq;
175  attach("sequence", seqdat);
176  setInt("seq_id", seqdat->getID());
177  return *this;
178 }

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

◆ setSequence() [2/2]

LMFRunIOV& LMFRunIOV::setSequence ( LMFSeqDat seq)

◆ setSubRunEnd()

LMFRunIOV & LMFRunIOV::setSubRunEnd ( const Tm end)

Definition at line 147 of file LMFRunIOV.cc.

147  {
148  setString("subrun_end", stop.str());
149  return *this;
150 }

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

◆ setSubRunStart()

LMFRunIOV & LMFRunIOV::setSubRunStart ( const Tm start)

Definition at line 136 of file LMFRunIOV.cc.

136  {
137  setString("subrun_start", start.str());
138  return *this;
139 }

References LMFUnique::setString().

◆ setSubRunType()

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

Definition at line 165 of file LMFRunIOV.cc.

165  {
166  setString("subrun_type", s);
167  return *this;
168 }

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

◆ setTriggerType() [1/3]

LMFRunIOV & LMFRunIOV::setTriggerType ( int  trigType_id)

Definition at line 118 of file LMFRunIOV.cc.

118  {
119  setInt("trigType_id", id);
120  return *this;
121 }

References LMFUnique::setInt().

◆ setTriggerType() [2/3]

LMFRunIOV & LMFRunIOV::setTriggerType ( LMFTrigType tt)

Definition at line 107 of file LMFRunIOV.cc.

107  {
108  setInt("trigType_id", trigType.getID());
109  return *this;
110 }

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

◆ setTriggerType() [3/3]

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

Definition at line 112 of file LMFRunIOV.cc.

112  {
113  checkFabric();
114  setInt("trigType_id", _fabric->getTrigTypeID(sname));
115  return *this;
116 }

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

◆ writeDBSql()

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

Reimplemented from LMFUnique.

Definition at line 302 of file LMFRunIOV.cc.

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 }

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

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
Tm::str
std::string str() const
Definition: Tm.cc:66
runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:373
LMFUnique::m_foreignKeys
std::map< std::string, LMFUnique * > m_foreignKeys
Definition: LMFUnique.h:106
LMFTrigType
Definition: LMFTrigType.h:10
BeamSpotPI::parameters
parameters
Definition: BeamSpotPayloadInspectorHelper.h:29
LMFRunIOV::initialize
void initialize()
Definition: LMFRunIOV.cc:10
mps_fire.i
i
Definition: mps_fire.py:428
start
Definition: start.py:1
LMFRunIOV::checkFabric
void checkFabric()
Definition: LMFRunIOV.cc:73
LMFUnique::setByID
void setByID(int id) noexcept(false) override
Definition: LMFUnique.cc:267
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
cmsswSequenceInfo.seq
seq
Definition: cmsswSequenceInfo.py:539
groupFilesInBlocks.tt
int tt
Definition: groupFilesInBlocks.py:144
LMFRunTag
Definition: LMFRunTag.h:16
gather_cfg.cout
cout
Definition: gather_cfg.py:144
hcal_runs.rt
rt
Definition: hcal_runs.py:76
AlcaSiPixelAliHarvester0T_cff.method
method
Definition: AlcaSiPixelAliHarvester0T_cff.py:41
LMFColor::getLongName
std::string getLongName() const
Definition: LMFColor.h:44
SiStripCommissioningClient_cfg.conn
conn
Definition: SiStripCommissioningClient_cfg.py:5
LMFColor
Definition: LMFColor.h:12
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
LMFDefFabric::getTrigTypeID
int getTrigTypeID(std::string sname) const
Definition: LMFDefFabric.cc:85
LMFUnique::m_className
std::string m_className
Definition: LMFUnique.h:99
LMFColor::getShortName
std::string getShortName() const
Definition: LMFColor.h:43
LMFUnique::setInt
LMFUnique & setInt(std::string key, int value)
Definition: LMFUnique.cc:31
LMFUnique::getInt
int getInt(std::string fieldname) const
Definition: LMFUnique.cc:187
LMFUnique::m_debug
char m_debug
Definition: LMFUnique.h:100
LMFUnique::m_intFields
std::map< std::string, int > m_intFields
Definition: LMFUnique.h:104
alignCSCRings.s
s
Definition: alignCSCRings.py:92
LMFUnique::dump
virtual void dump() const
Definition: LMFUnique.cc:104
LMFDefFabric::getColorID
int getColorID(std::string name) const
Definition: LMFDefFabric.cc:81
LMFRunIOV::_fabric
LMFDefFabric * _fabric
Definition: LMFRunIOV.h:89
IDBObject::m_conn
oracle::occi::Connection * m_conn
Definition: IDBObject.h:34
LMFRunIOV::getLMFColor
LMFColor getLMFColor() const
Definition: LMFRunIOV.cc:91
LMFRunIOV
Definition: LMFRunIOV.h:18
LMFRunIOV::getSequence
LMFSeqDat getSequence() const
Definition: LMFRunIOV.cc:180
GlobalPosition_Frontier_DevDB_cff.tag
tag
Definition: GlobalPosition_Frontier_DevDB_cff.py:11
LMFRunIOV::getLmr
int getLmr() const
Definition: LMFRunIOV.cc:134
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
Tm::setToCurrentGMTime
void setToCurrentGMTime()
Definition: Tm.cc:141
Tm
Definition: Tm.h:13
LMFRunIOV::isValid
bool isValid() override
Definition: LMFRunIOV.cc:281
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
web.browse_db.env
env
Definition: browse_db.py:18
LMFRunIOV::setTriggerType
LMFRunIOV & setTriggerType(LMFTrigType &tt)
Definition: LMFRunIOV.cc:107
LMFRunIOV::getLMFRunTag
LMFRunTag getLMFRunTag() const
Definition: LMFRunIOV.cc:57
IDBObject::checkConnection
void checkConnection() const noexcept(false)
Definition: IDBObject.h:36
LMFDefFabric
Definition: LMFDefFabric.h:25
LMFUnique::attach
void attach(std::string name, LMFUnique *u)
Definition: LMFUnique.cc:48
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
LMFRunIOV::getSubRunType
std::string getSubRunType() const
Definition: LMFRunIOV.cc:170
LMFUnique::getString
std::string getString(std::string fieldname) const
Definition: LMFUnique.cc:178
symbols.dm
dm
Definition: symbols.py:66
LMFRunIOV::fetchBySequence
std::list< LMFRunIOV > fetchBySequence(const LMFSeqDat &s)
Definition: LMFRunIOV.cc:353
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
LMFSeqDat
Definition: LMFSeqDat.h:14
util.getRunInfo.day
def day(string)
Definition: getRunInfo.py:11
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:204
LMFUnique::LMFUnique
LMFUnique()
Definition: LMFUnique.h:27
alignCSCRings.r
r
Definition: alignCSCRings.py:93
LMFDefFabric::debug
void debug()
Definition: LMFDefFabric.cc:26
LMFRunIOV::getTriggerType
LMFTrigType getTriggerType() const
Definition: LMFRunIOV.cc:123
LMFUnique::getID
int getID() const
Definition: LMFUnique.h:58
IDBObject::setConnection
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
Definition: IDBObject.h:23
LMFDefFabric::dump
void dump()
Definition: LMFDefFabric.cc:228
LMFUnique::Statement
oracle::occi::Statement Statement
Definition: LMFUnique.h:24
LMFRunIOV::getSubRunStart
Tm getSubRunStart() const
Definition: LMFRunIOV.cc:141
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
LMFUnique::m_stringFields
std::map< std::string, std::string > m_stringFields
Definition: LMFUnique.h:102
LMFUnique::setString
LMFUnique & setString(std::string key, std::string value)
Definition: LMFUnique.cc:14
LMFRunIOV::setLMFRunTag
LMFRunIOV & setLMFRunTag(const LMFRunTag &tag)
Definition: LMFRunIOV.cc:47
IDBObject::m_env
oracle::occi::Environment * m_env
Definition: IDBObject.h:33
LMFUnique::sequencePostfix
std::string sequencePostfix(const Tm &t)
Definition: LMFUnique.cc:9
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
DateHandler
Definition: DateHandler.h:7
cuy.dh
dh
Definition: cuy.py:355
LMFRunIOV::getSubRunEnd
Tm getSubRunEnd() const
Definition: LMFRunIOV.cc:152
LMFRunIOV::setColor
LMFRunIOV & setColor(const LMFColor &c)
Definition: LMFRunIOV.cc:63
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
LMFUnique::ResultSet
oracle::occi::ResultSet ResultSet
Definition: LMFUnique.h:23