CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes | Friends
LMFSeqDat Class Reference

#include <LMFSeqDat.h>

Inheritance diagram for LMFSeqDat:
LMFUnique IUniqueDBObject IDBObject

Public Member Functions

std::map< int, LMFSeqDatfetchByRunIOV (RunIOV &iov)
 
std::map< int, LMFSeqDatfetchByRunIOV (RunIOV &iov, const LMFColor &col)
 
LMFSeqDat fetchByRunIOV (RunIOV &iov, int seq_num)
 
std::map< int, LMFSeqDatfetchByRunNumber (int runno)
 
LMFSeqDat fetchByRunNumber (int runno, const Tm &taken_at)
 
LMFSeqDat fetchByRunNumber (int runno, int seq_num)
 
LMFSeqDat fetchByRunNumber (int runno, std::string taken_at)
 
LMFSeqDat fetchLast ()
 
RunIOV fetchLastRun ()
 
RunIOV getRunIOV () const
 
int getSequenceNumber () const
 
Tm getSequenceStart () const
 
Tm getSequenceStop () const
 
int getVmax () const
 
int getVmin () const
 
bool isValid () const override
 
 LMFSeqDat ()
 
 LMFSeqDat (EcalDBConnection *c)
 
 LMFSeqDat (oracle::occi::Environment *env, oracle::occi::Connection *conn)
 
bool operator!= (const LMFSeqDat &m) const
 
bool operator== (const LMFSeqDat &m) const
 
LMFSeqDatsetRunIOV (const RunIOV &iov)
 
LMFSeqDatsetSequenceNumber (int n)
 
LMFSeqDatsetSequenceStart (const Tm &start)
 
LMFSeqDatsetSequenceStop (const Tm &end)
 
LMFSeqDatsetVersions (int vmin, int vmax)
 
 ~LMFSeqDat () override
 
- Public Member Functions inherited from LMFUnique
void attach (std::string name, LMFUnique *u)
 
void debug ()
 
virtual void dump () const
 
virtual void dump (int n) const
 
virtual bool exists ()
 
virtual boost::ptr_list< LMFUniquefetchAll () 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 ()
 
 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

std::map< int, LMFSeqDatfetchByRunIOV (const std::vector< std::string > &par, std::string sql, std::string method) noexcept(false)
 
std::map< int, LMFSeqDatfetchByRunIOV (int par, std::string sql, std::string method) noexcept(false)
 
std::map< int, LMFSeqDatfetchByRunIOV (std::string sql, std::string method) noexcept(false)
 
std::string fetchIdSql (Statement *stmt) override
 
void fetchParentIDs () noexcept(false) override
 
void getParameters (ResultSet *rset) override
 
std::string setByIDSql (Statement *stmt, int id) override
 
void setVmax (int v)
 
void setVmin (int v)
 
std::string writeDBSql (Statement *stmt) override
 

Private Attributes

RunIOV m_runIOV
 

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 14 of file LMFSeqDat.h.

Constructor & Destructor Documentation

◆ LMFSeqDat() [1/3]

LMFSeqDat::LMFSeqDat ( )

Definition at line 10 of file LMFSeqDat.cc.

10  : LMFUnique() {
11  setClassName("LMFSeqDat");
12 
13  m_runIOV = RunIOV();
14  m_intFields["seq_num"] = 0;
15  Tm t;
16  t = t.plusInfinity();
17  m_stringFields["seq_start"] = t.str();
18  m_stringFields["seq_stop"] = t.str();
19  m_intFields["vmin"] = 1;
20  m_intFields["vmax"] = 0;
21 }

References LMFUnique::m_intFields, m_runIOV, LMFUnique::m_stringFields, LMFUnique::setClassName(), and OrderedSet::t.

◆ LMFSeqDat() [2/3]

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

Definition at line 36 of file LMFSeqDat.cc.

36  : LMFUnique(env, conn) {
37  setClassName("LMFSeqDat");
38 
39  m_runIOV = RunIOV();
40  m_intFields["seq_num"] = 0;
41  Tm t;
42  t = t.plusInfinity();
43  m_stringFields["seq_start"] = t.str();
44  m_stringFields["seq_stop"] = t.str();
45  m_intFields["vmin"] = 1;
46  m_intFields["vmax"] = 0;
47 }

References LMFUnique::m_intFields, m_runIOV, LMFUnique::m_stringFields, LMFUnique::setClassName(), and OrderedSet::t.

◆ LMFSeqDat() [3/3]

LMFSeqDat::LMFSeqDat ( EcalDBConnection c)

Definition at line 23 of file LMFSeqDat.cc.

23  : LMFUnique(c) {
24  setClassName("LMFSeqDat");
25 
26  m_runIOV = RunIOV();
27  m_intFields["seq_num"] = 0;
28  Tm t;
29  t = t.plusInfinity();
30  m_stringFields["seq_start"] = t.str();
31  m_stringFields["seq_stop"] = t.str();
32  m_intFields["vmin"] = 1;
33  m_intFields["vmax"] = 0;
34 }

References LMFUnique::m_intFields, m_runIOV, LMFUnique::m_stringFields, LMFUnique::setClassName(), and OrderedSet::t.

◆ ~LMFSeqDat()

LMFSeqDat::~LMFSeqDat ( )
override

Definition at line 49 of file LMFSeqDat.cc.

49 {}

Member Function Documentation

◆ fetchByRunIOV() [1/6]

std::map< int, LMFSeqDat > LMFSeqDat::fetchByRunIOV ( const std::vector< std::string > &  par,
std::string  sql,
std::string  method 
)
privatenoexcept

Definition at line 198 of file LMFSeqDat.cc.

200  {
201  std::map<int, LMFSeqDat> l;
202  this->checkConnection();
203  try {
204  Statement *stmt = m_conn->createStatement();
205  stmt->setSQL(sql);
206  for (unsigned int i = 0; i < pars.size(); i++) {
207  if (pars[i][0] == 'I') {
208  stmt->setInt(i + 1, atoi(pars[i].c_str() + 1));
209  } else if (pars[i][0] == 'S') {
210  stmt->setString(i + 1, pars[i].c_str() + 1);
211  } else {
212  throw(std::runtime_error(m_className + "::" + method + ": " + "Invalid type"));
213  }
214  }
215  ResultSet *rset = stmt->executeQuery();
216  while (rset->next() != 0) {
217  int seq_id = rset->getInt(1);
218  LMFSeqDat s;
219  s.setConnection(m_env, m_conn);
220  s.setByID(seq_id);
221  l[s.getSequenceNumber()] = s;
222  }
223  m_conn->terminateStatement(stmt);
224  } catch (SQLException &e) {
225  throw(std::runtime_error(m_className + "::" + method + ": " + e.getMessage()));
226  }
227  return l;
228 }

References MillePedeFileConverter_cfg::e, mps_fire::i, cmsLHEtoEOSManager::l, AlcaSiPixelAliHarvester0T_cff::method, and alignCSCRings::s.

◆ fetchByRunIOV() [2/6]

std::map< int, LMFSeqDat > LMFSeqDat::fetchByRunIOV ( int  par,
std::string  sql,
std::string  method 
)
privatenoexcept

Definition at line 190 of file LMFSeqDat.cc.

190  {
191  std::vector<std::string> pars;
192  std::stringstream ss;
193  ss << "I" << par;
194  pars.push_back(ss.str());
195  return fetchByRunIOV(pars, sql, method);
196 }

References AlcaSiPixelAliHarvester0T_cff::method, and contentValuesCheck::ss.

◆ fetchByRunIOV() [3/6]

std::map< int, LMFSeqDat > LMFSeqDat::fetchByRunIOV ( RunIOV iov)

Definition at line 245 of file LMFSeqDat.cc.

245  {
246  int runIOVID = iov.getID();
247  return fetchByRunIOV(runIOVID,
248  "SELECT SEQ_ID FROM CMS_ECAL_LASER_COND.LMF_SEQ_DAT "
249  "WHERE RUN_IOV_ID = :1",
250  "fetchByRunIOV");
251 }

References RunIOV::getID().

Referenced by fetchByRunIOV(), fetchByRunNumber(), and fetchLast().

◆ fetchByRunIOV() [4/6]

std::map< int, LMFSeqDat > LMFSeqDat::fetchByRunIOV ( RunIOV iov,
const LMFColor col 
)

Definition at line 253 of file LMFSeqDat.cc.

253  {
254  int runIOVID = iov.getID();
255  int colorId = col.getID();
256  std::vector<std::string> pars;
257  std::stringstream ss;
258  ss << "I" << runIOVID;
259  pars.push_back(ss.str());
260  ss.str(std::string());
261  ss << "I" << colorId;
262  pars.push_back(ss.str());
263  return fetchByRunIOV(pars,
264  "SELECT S.SEQ_ID FROM CMS_ECAL_LASER_COND.LMF_SEQ_DAT "
265  "S JOIN CMS_ECAL_LASER_COND.LMF_RUN_IOV R"
266  " ON S.SEQ_ID = R.SEQ_ID WHERE RUN_IOV_ID = :1 AND "
267  " COLOR_ID = :2",
268  "fetchByRunIOVAndColor");
269 }

References cuy::col, fetchByRunIOV(), RunIOV::getID(), contentValuesCheck::ss, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ fetchByRunIOV() [5/6]

LMFSeqDat LMFSeqDat::fetchByRunIOV ( RunIOV iov,
int  seq_num 
)
inline

Definition at line 65 of file LMFSeqDat.h.

65 { return fetchByRunIOV(iov)[seq_num]; }

References fetchByRunIOV().

Referenced by fetchByRunIOV().

◆ fetchByRunIOV() [6/6]

std::map< int, LMFSeqDat > LMFSeqDat::fetchByRunIOV ( std::string  sql,
std::string  method 
)
privatenoexcept

Definition at line 185 of file LMFSeqDat.cc.

185  {
186  std::vector<std::string> pars;
187  return fetchByRunIOV(pars, sql, method);
188 }

References AlcaSiPixelAliHarvester0T_cff::method.

◆ fetchByRunNumber() [1/4]

std::map< int, LMFSeqDat > LMFSeqDat::fetchByRunNumber ( int  runno)

Definition at line 271 of file LMFSeqDat.cc.

271  {
272  return fetchByRunIOV(runno,
273  "SELECT SEQ_ID FROM CMS_ECAL_LASER_COND.LMF_SEQ_DAT D "
274  "JOIN CMS_ECAL_COND.RUN_IOV R ON "
275  "D.RUN_IOV_ID = R.IOV_ID WHERE RUN_NUM = :1",
276  "fetchByRunNumber");
277 }

References fetchByRunIOV(), and visualization-live-secondInstance_cfg::runno.

Referenced by fetchByRunNumber().

◆ fetchByRunNumber() [2/4]

LMFSeqDat LMFSeqDat::fetchByRunNumber ( int  runno,
const Tm taken_at 
)

Definition at line 279 of file LMFSeqDat.cc.

279 { return fetchByRunNumber(runno, taken_at.str()); }

References fetchByRunNumber(), visualization-live-secondInstance_cfg::runno, and Tm::str().

◆ fetchByRunNumber() [3/4]

LMFSeqDat LMFSeqDat::fetchByRunNumber ( int  runno,
int  seq_num 
)
inline

Definition at line 67 of file LMFSeqDat.h.

67 { return fetchByRunNumber(runno)[seq_num]; }

References fetchByRunNumber(), and visualization-live-secondInstance_cfg::runno.

Referenced by fetchByRunNumber().

◆ fetchByRunNumber() [4/4]

LMFSeqDat LMFSeqDat::fetchByRunNumber ( int  runno,
std::string  taken_at 
)

Definition at line 281 of file LMFSeqDat.cc.

281  {
282  std::map<int, LMFSeqDat> l;
283  std::vector<std::string> pars;
284  std::stringstream ss;
285  ss << "I" << runno;
286  pars.push_back(ss.str());
287  ss.str(std::string());
288  ss << "S" << taken_at;
289  pars.push_back(ss.str());
290  std::string q =
291  "SELECT SEQ_ID FROM CMS_ECAL_LASER_COND.LMF_SEQ_DAT D "
292  "JOIN CMS_ECAL_COND.RUN_IOV R ON "
293  "D.RUN_IOV_ID = R.IOV_ID WHERE RUN_NUM = :1 AND "
294  "SEQ_START >= TO_DATE(:2, 'YYYY-MM-DD HH24:MI:SS') "
295  "AND SEQ_STOP <= TO_DATE(:2, 'YYYY-MM-DD HH24:MI:SS')";
296  l = fetchByRunIOV(pars, q, "fetchByRunNumberAt");
297  LMFSeqDat ret;
298  if (l.size() == 1) {
299  std::map<int, LMFSeqDat>::const_iterator x = l.begin();
300  ret = x->second;
301  } else if (l.size() > 1) {
302  std::cout << "WARNING: Your query returned more than one result. " << std::endl;
303  std::cout << " This was not expected. Please check the DB!!!" << std::endl;
304  std::cout << "Your query: " << std::endl << q << std::endl;
305  std::cout << "Your parameters: " << std::endl;
306  for (unsigned int i = 0; i < pars.size(); i++) {
307  std::cout << i << ": " << pars[i] << std::endl;
308  }
309  }
310  return ret;
311 }

References gather_cfg::cout, fetchByRunIOV(), mps_fire::i, cmsLHEtoEOSManager::l, data-class-funcs::q, runTheMatrix::ret, visualization-live-secondInstance_cfg::runno, contentValuesCheck::ss, AlCaHLTBitMon_QueryRunRegistry::string, and x.

◆ fetchIdSql()

std::string LMFSeqDat::fetchIdSql ( Statement stmt)
overrideprivatevirtual

Reimplemented from LMFUnique.

Definition at line 67 of file LMFSeqDat.cc.

67  {
68  int runIOVID = m_runIOV.getID();
69  if (!runIOVID) {
70  if (m_debug) {
71  std::cout << m_className << ": RunIOV not set" << endl;
72  }
73  return "";
74  }
75 
76  if (m_debug) {
77  std::cout << "Run IOV ID: " << runIOVID << std::endl;
78  std::cout << "SEQ # : " << getSequenceNumber() << std::endl;
79  std::cout << "Versions : " << getVmin() << " - " << getVmax() << endl;
80  }
81  std::string sql =
82  "SELECT SEQ_ID FROM CMS_ECAL_LASER_COND.LMF_SEQ_DAT "
83  "WHERE "
84  "RUN_IOV_ID = :1 AND "
85  "SEQ_NUM = :2 AND "
86  "VMIN = :3 ";
87  if (getVmax() > 0) {
88  sql += "AND VMAX = :4";
89  } else {
90  sql += "ORDER BY VMAX DESC";
91  }
92  stmt->setSQL(sql);
93  stmt->setInt(1, runIOVID);
94  stmt->setInt(2, getSequenceNumber());
95  stmt->setInt(3, getVmin());
96  if (getVmax() > 0) {
97  stmt->setInt(4, getVmax());
98  }
99  return sql;
100 }

References gather_cfg::cout, RunIOV::getID(), getSequenceNumber(), getVmax(), getVmin(), LMFUnique::m_className, LMFUnique::m_debug, m_runIOV, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ fetchLast()

LMFSeqDat LMFSeqDat::fetchLast ( )

Definition at line 230 of file LMFSeqDat.cc.

230  {
231  LMFSeqDat ret;
232  std::map<int, LMFSeqDat> m = fetchByRunIOV(
233  "SELECT SEQ_ID FROM CMS_ECAL_LASER_COND.LMF_SEQ_DAT "
234  "WHERE SEQ_ID = "
235  "(SELECT MAX(SEQ_ID) FROM CMS_ECAL_LASER_COND.LMF_SEQ_DAT)",
236  "fetchLast");
237  if (!m.empty()) {
238  ret = m.begin()->second;
239  }
240  return ret;
241 }

References fetchByRunIOV(), visualization-live-secondInstance_cfg::m, and runTheMatrix::ret.

Referenced by fetchLastRun().

◆ fetchLastRun()

RunIOV LMFSeqDat::fetchLastRun ( )

Definition at line 243 of file LMFSeqDat.cc.

243 { return fetchLast().getRunIOV(); }

References fetchLast(), and getRunIOV().

◆ fetchParentIDs()

void LMFSeqDat::fetchParentIDs ( )
overrideprivatevirtualnoexcept

Reimplemented from LMFUnique.

Definition at line 174 of file LMFSeqDat.cc.

174  {
175  // get the RunIOV
177  int runIOVID = m_runIOV.getID();
178  m_runIOV.setByID(runIOVID);
179 
180  if (m_runIOV.getID() == 0) {
181  throw(std::runtime_error("LMFSeqDat: Given RunIOV does not exist in DB"));
182  }
183 }

References RunIOV::getID(), IDBObject::m_conn, IDBObject::m_env, m_runIOV, RunIOV::setByID(), and IDBObject::setConnection().

◆ getParameters()

void LMFSeqDat::getParameters ( ResultSet rset)
overrideprivatevirtual

Reimplemented from LMFUnique.

Definition at line 111 of file LMFSeqDat.cc.

111  {
113  int runIOVID = rset->getInt(1);
114  setInt("seq_num", rset->getInt(2));
115  Date startDate = rset->getDate(3);
116  Date endDate = rset->getDate(4);
117  setInt("vmin", rset->getInt(5));
118  setInt("vmax", rset->getInt(6));
119 
120  setString("seq_start", dh.dateToTm(startDate).str());
121  setString("seq_stop", dh.dateToTm(endDate).str());
122 
124  m_runIOV.setByID(runIOVID);
125 }

References cuy::dh, IDBObject::m_conn, IDBObject::m_env, m_runIOV, RunIOV::setByID(), IDBObject::setConnection(), LMFUnique::setInt(), and LMFUnique::setString().

◆ getRunIOV()

RunIOV LMFSeqDat::getRunIOV ( ) const

Definition at line 57 of file LMFSeqDat.cc.

57 { return m_runIOV; }

References m_runIOV.

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

◆ getSequenceNumber()

int LMFSeqDat::getSequenceNumber ( ) const
inline

Definition at line 44 of file LMFSeqDat.h.

44 { return getInt("seq_num"); }

References LMFUnique::getInt().

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

◆ getSequenceStart()

Tm LMFSeqDat::getSequenceStart ( ) const
inline

Definition at line 45 of file LMFSeqDat.h.

45  {
46  Tm t;
47  t.setToString(getString("seq_start"));
48  return t;
49  }

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

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

◆ getSequenceStop()

Tm LMFSeqDat::getSequenceStop ( ) const

Definition at line 51 of file LMFSeqDat.cc.

51  {
52  Tm t;
53  t.setToString(getString("seq_stop"));
54  return t;
55 }

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

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

◆ getVmax()

int LMFSeqDat::getVmax ( ) const
inline

Definition at line 52 of file LMFSeqDat.h.

52 { return getInt("vmax"); }

References LMFUnique::getInt().

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

◆ getVmin()

int LMFSeqDat::getVmin ( ) const
inline

Definition at line 51 of file LMFSeqDat.h.

51 { return getInt("vmin"); }

References LMFUnique::getInt().

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

◆ isValid()

bool LMFSeqDat::isValid ( void  ) const
overridevirtual

Reimplemented from LMFUnique.

Definition at line 127 of file LMFSeqDat.cc.

127  {
128  bool ret = true;
129  if (getSequenceStart().isNull()) {
130  ret = false;
131  }
132  if ((getSequenceStop().str().length() > 0) && (getSequenceStop().microsTime() < getSequenceStart().microsTime())) {
133  ret = false;
134  }
135  if (getSequenceStop() == Tm().plusInfinity()) {
136  ret = false;
137  }
138  return ret;
139 }

References getSequenceStart(), getSequenceStop(), runTheMatrix::ret, and str.

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

◆ operator!=()

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

Definition at line 62 of file LMFSeqDat.h.

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

References visualization-live-secondInstance_cfg::m.

◆ operator==()

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

Definition at line 56 of file LMFSeqDat.h.

56  {
57  return (getSequenceNumber() == m.getSequenceNumber() && getRunIOV() == m.getRunIOV() &&
58  getSequenceStart() == m.getSequenceStart() && getSequenceStop() == m.getSequenceStop() &&
59  getVmin() == m.getVmin() && getVmax() == m.getVmax());
60  }

References getRunIOV(), getSequenceNumber(), getSequenceStart(), getSequenceStop(), getVmax(), getVmin(), and visualization-live-secondInstance_cfg::m.

◆ setByIDSql()

std::string LMFSeqDat::setByIDSql ( Statement stmt,
int  id 
)
overrideprivatevirtual

Reimplemented from LMFUnique.

Definition at line 102 of file LMFSeqDat.cc.

102  {
103  std::string sql =
104  "SELECT RUN_IOV_ID, SEQ_NUM, SEQ_START, SEQ_STOP, "
105  "VMIN, VMAX FROM CMS_ECAL_LASER_COND.LMF_SEQ_DAT WHERE SEQ_ID = :1";
106  stmt->setSQL(sql);
107  stmt->setInt(1, id);
108  return sql;
109 }

References AlCaHLTBitMon_QueryRunRegistry::string.

◆ setRunIOV()

LMFSeqDat & LMFSeqDat::setRunIOV ( const RunIOV iov)

Definition at line 59 of file LMFSeqDat.cc.

59  {
60  if (iov != m_runIOV) {
61  m_ID = 0;
62  m_runIOV = iov;
63  }
64  return *this;
65 }

References IUniqueDBObject::m_ID, and m_runIOV.

◆ setSequenceNumber()

LMFSeqDat& LMFSeqDat::setSequenceNumber ( int  n)
inline

Definition at line 25 of file LMFSeqDat.h.

25  {
26  setInt("seq_num", n);
27  return *this;
28  }

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

◆ setSequenceStart()

LMFSeqDat& LMFSeqDat::setSequenceStart ( const Tm start)
inline

Definition at line 29 of file LMFSeqDat.h.

29  {
30  setString("seq_start", start.str());
31  return *this;
32  }

References LMFUnique::setString().

◆ setSequenceStop()

LMFSeqDat& LMFSeqDat::setSequenceStop ( const Tm end)
inline

Definition at line 33 of file LMFSeqDat.h.

33  {
34  setString("seq_stop", end.str());
35  return *this;
36  }

References end, and LMFUnique::setString().

Referenced by writeDBSql().

◆ setVersions()

LMFSeqDat& LMFSeqDat::setVersions ( int  vmin,
int  vmax 
)
inline

Definition at line 37 of file LMFSeqDat.h.

37  {
38  setVmin(vmin);
39  setVmax(vmax);
40  return *this;
41  }

References setVmax(), and setVmin().

◆ setVmax()

void LMFSeqDat::setVmax ( int  v)
inlineprivate

Definition at line 77 of file LMFSeqDat.h.

77 { setInt("vmax", v); }

References LMFUnique::setInt(), and findQualityFiles::v.

Referenced by setVersions().

◆ setVmin()

void LMFSeqDat::setVmin ( int  v)
inlineprivate

Definition at line 76 of file LMFSeqDat.h.

76 { setInt("vmin", v); }

References LMFUnique::setInt(), and findQualityFiles::v.

Referenced by setVersions().

◆ writeDBSql()

std::string LMFSeqDat::writeDBSql ( Statement stmt)
overrideprivatevirtual

Reimplemented from LMFUnique.

Definition at line 141 of file LMFSeqDat.cc.

141  {
142  // Validate the data, use infinity-till convention
144 
145  if (!isValid()) {
146  dump();
147  throw(std::runtime_error("LMFSeqDat::writeDB: not valid"));
148  }
149 
150  if (getSequenceStop().str().length() == 0) {
151  setSequenceStop(dh.getPlusInfTm());
152  }
153  int runIOVID = m_runIOV.getID();
154  if (runIOVID == 0) {
155  throw(std::runtime_error("LMFSeqDat::writeDB: RunIOV not set"));
156  }
158  std::string sql =
159  "INSERT INTO LMF_SEQ_DAT (SEQ_ID, RUN_IOV_ID, SEQ_NUM, "
160  "SEQ_START, SEQ_STOP, VMIN, VMAX) "
161  "VALUES (SEQ_ID_" +
162  sp + "_SQ.NextVal, :1, :2, :3, :4, :5, :6)";
163  cout << sql << endl;
164  stmt->setSQL(sql);
165  stmt->setInt(1, runIOVID);
166  stmt->setInt(2, getSequenceNumber());
167  stmt->setDate(3, dh.tmToDate(getSequenceStart()));
168  stmt->setDate(4, dh.tmToDate(getSequenceStop()));
169  stmt->setInt(5, getVmin());
170  stmt->setInt(6, getVmax());
171  return sql;
172 }

References gather_cfg::cout, cuy::dh, LMFUnique::dump(), RunIOV::getID(), getSequenceNumber(), getSequenceStart(), getSequenceStop(), getVmax(), getVmin(), isValid(), IDBObject::m_conn, IDBObject::m_env, m_runIOV, LMFUnique::sequencePostfix(), setSequenceStop(), str, and AlCaHLTBitMon_QueryRunRegistry::string.

Friends And Related Function Documentation

◆ EcalCondDBInterface

friend class EcalCondDBInterface
friend

Definition at line 16 of file LMFSeqDat.h.

Member Data Documentation

◆ m_runIOV

RunIOV LMFSeqDat::m_runIOV
private
Tm::str
std::string str() const
Definition: Tm.cc:66
LMFUnique::setClassName
virtual void setClassName(std::string s)
Definition: LMFUnique.h:93
LMFSeqDat::getVmin
int getVmin() const
Definition: LMFSeqDat.h:51
runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:355
RunIOV
Definition: RunIOV.h:13
RunIOV::getID
int getID()
Definition: RunIOV.h:35
mps_fire.i
i
Definition: mps_fire.py:355
start
Definition: start.py:1
IUniqueDBObject::m_ID
int m_ID
Definition: IUniqueDBObject.h:18
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
LMFSeqDat::setVmax
void setVmax(int v)
Definition: LMFSeqDat.h:77
LMFSeqDat::getRunIOV
RunIOV getRunIOV() const
Definition: LMFSeqDat.cc:57
cuy.col
col
Definition: cuy.py:1010
gather_cfg.cout
cout
Definition: gather_cfg.py:144
AlcaSiPixelAliHarvester0T_cff.method
method
Definition: AlcaSiPixelAliHarvester0T_cff.py:41
data-class-funcs.q
q
Definition: data-class-funcs.py:169
RunIOV::setByID
void setByID(int id) noexcept(false) override
Definition: RunIOV.cc:106
SiStripCommissioningClient_cfg.conn
conn
Definition: SiStripCommissioningClient_cfg.py:5
LMFUnique::m_className
std::string m_className
Definition: LMFUnique.h:95
DDAxes::x
LMFUnique::setInt
LMFUnique & setInt(std::string key, int value)
Definition: LMFUnique.cc:31
findQualityFiles.v
v
Definition: findQualityFiles.py:179
LMFUnique::getInt
int getInt(std::string fieldname) const
Definition: LMFUnique.cc:187
LMFUnique::m_debug
char m_debug
Definition: LMFUnique.h:96
end
#define end
Definition: vmac.h:39
LMFUnique::m_intFields
std::map< std::string, int > m_intFields
Definition: LMFUnique.h:100
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
LMFSeqDat::m_runIOV
RunIOV m_runIOV
Definition: LMFSeqDat.h:74
alignCSCRings.s
s
Definition: alignCSCRings.py:92
LMFUnique::dump
virtual void dump() const
Definition: LMFUnique.cc:104
IDBObject::m_conn
oracle::occi::Connection * m_conn
Definition: IDBObject.h:34
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
str
#define str(s)
Definition: TestProcessor.cc:48
LMFSeqDat::fetchByRunIOV
std::map< int, LMFSeqDat > fetchByRunIOV(RunIOV &iov)
Definition: LMFSeqDat.cc:245
OrderedSet.t
t
Definition: OrderedSet.py:90
Tm
Definition: Tm.h:13
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
web.browse_db.env
env
Definition: browse_db.py:18
LMFSeqDat::setVmin
void setVmin(int v)
Definition: LMFSeqDat.h:76
LMFSeqDat::getSequenceStop
Tm getSequenceStop() const
Definition: LMFSeqDat.cc:51
LMFSeqDat::fetchByRunNumber
std::map< int, LMFSeqDat > fetchByRunNumber(int runno)
Definition: LMFSeqDat.cc:271
IDBObject::checkConnection
void checkConnection() const noexcept(false)
Definition: IDBObject.h:36
LMFSeqDat::getSequenceNumber
int getSequenceNumber() const
Definition: LMFSeqDat.h:44
visualization-live-secondInstance_cfg.runno
runno
Definition: visualization-live-secondInstance_cfg.py:73
LMFUnique::getString
std::string getString(std::string fieldname) const
Definition: LMFUnique.cc:178
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
LMFSeqDat
Definition: LMFSeqDat.h:14
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:193
LMFUnique::LMFUnique
LMFUnique()
Definition: LMFUnique.h:23
LMFSeqDat::getSequenceStart
Tm getSequenceStart() const
Definition: LMFSeqDat.h:45
IDBObject::setConnection
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
Definition: IDBObject.h:23
LMFUnique::Statement
oracle::occi::Statement Statement
Definition: LMFUnique.h:20
LMFSeqDat::fetchLast
LMFSeqDat fetchLast()
Definition: LMFSeqDat.cc:230
LMFUnique::m_stringFields
std::map< std::string, std::string > m_stringFields
Definition: LMFUnique.h:98
LMFUnique::setString
LMFUnique & setString(std::string key, std::string value)
Definition: LMFUnique.cc:14
IDBObject::m_env
oracle::occi::Environment * m_env
Definition: IDBObject.h:33
LMFUnique::sequencePostfix
std::string sequencePostfix(const Tm &t)
Definition: LMFUnique.cc:9
LMFSeqDat::getVmax
int getVmax() const
Definition: LMFSeqDat.h:52
DateHandler
Definition: DateHandler.h:7
cuy.dh
dh
Definition: cuy.py:355
LMFSeqDat::isValid
bool isValid() const override
Definition: LMFSeqDat.cc:127
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
LMFSeqDat::setSequenceStop
LMFSeqDat & setSequenceStop(const Tm &end)
Definition: LMFSeqDat.h:33
LMFUnique::ResultSet
oracle::occi::ResultSet ResultSet
Definition: LMFUnique.h:19