CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
LMFSeqDat.h
Go to the documentation of this file.
1 #ifndef LMFSEQDAT_H
2 #define LMFSEQDAT_H
3 
4 /*
5  Last updated by Giovanni.Organtini@roma1.infn.it 2010
6  */
7 
8 #include <map>
9 
13 
14 class LMFSeqDat : public LMFUnique {
15 public:
16  friend class EcalCondDBInterface;
17 
18  LMFSeqDat();
19  LMFSeqDat(oracle::occi::Environment *env, oracle::occi::Connection *conn);
21  ~LMFSeqDat() override;
22 
23  // Methods for user data
24  LMFSeqDat &setRunIOV(const RunIOV &iov);
26  setInt("seq_num", n);
27  return *this;
28  }
30  setString("seq_start", start.str());
31  return *this;
32  }
34  setString("seq_stop", end.str());
35  return *this;
36  }
37  LMFSeqDat &setVersions(int vmin, int vmax) {
38  setVmin(vmin);
39  setVmax(vmax);
40  return *this;
41  }
42 
43  RunIOV getRunIOV() const;
44  int getSequenceNumber() const { return getInt("seq_num"); }
45  Tm getSequenceStart() const {
46  Tm t;
47  t.setToString(getString("seq_start"));
48  return t;
49  }
50  Tm getSequenceStop() const;
51  int getVmin() const { return getInt("vmin"); }
52  int getVmax() const { return getInt("vmax"); }
53 
54  bool isValid() const override;
55  // Operators
56  bool operator==(const LMFSeqDat &m) const {
57  return (getSequenceNumber() == m.getSequenceNumber() && getRunIOV() == m.getRunIOV() &&
59  getVmin() == m.getVmin() && getVmax() == m.getVmax());
60  }
61 
62  bool operator!=(const LMFSeqDat &m) const { return !(*this == m); }
63  std::map<int, LMFSeqDat> fetchByRunIOV(RunIOV &iov);
64  std::map<int, LMFSeqDat> fetchByRunIOV(RunIOV &iov, const LMFColor &col);
65  LMFSeqDat fetchByRunIOV(RunIOV &iov, int seq_num) { return fetchByRunIOV(iov)[seq_num]; }
66  std::map<int, LMFSeqDat> fetchByRunNumber(int runno);
67  LMFSeqDat fetchByRunNumber(int runno, int seq_num) { return fetchByRunNumber(runno)[seq_num]; }
68  LMFSeqDat fetchByRunNumber(int runno, const Tm &taken_at);
72 
73 private:
75 
76  void setVmin(int v) { setInt("vmin", v); }
77  void setVmax(int v) { setInt("vmax", v); }
79  std::string setByIDSql(Statement *stmt, int id) override;
81  void getParameters(ResultSet *rset) override;
82 
83  void fetchParentIDs() noexcept(false) override;
84  std::map<int, LMFSeqDat> fetchByRunIOV(const std::vector<std::string> &par,
85  std::string sql,
86  std::string method) noexcept(false);
87  std::map<int, LMFSeqDat> fetchByRunIOV(int par, std::string sql, std::string method) noexcept(false);
88  std::map<int, LMFSeqDat> fetchByRunIOV(std::string sql, std::string method) noexcept(false);
89 };
90 
91 #endif
LMFUnique & setInt(std::string key, int value)
Definition: LMFUnique.cc:31
std::map< int, LMFSeqDat > fetchByRunNumber(int runno)
Definition: LMFSeqDat.cc:271
Tm getSequenceStop() const
Definition: LMFSeqDat.cc:51
LMFSeqDat & setRunIOV(const RunIOV &iov)
Definition: LMFSeqDat.cc:59
LMFSeqDat & setSequenceStop(const Tm &end)
Definition: LMFSeqDat.h:33
const edm::EventSetup & c
bool operator!=(const LMFSeqDat &m) const
Definition: LMFSeqDat.h:62
std::map< int, LMFSeqDat > fetchByRunIOV(RunIOV &iov)
Definition: LMFSeqDat.cc:245
LMFSeqDat fetchLast()
Definition: LMFSeqDat.cc:230
int getVmax() const
Definition: LMFSeqDat.h:52
int getSequenceNumber() const
Definition: LMFSeqDat.h:44
oracle::occi::ResultSet ResultSet
Definition: LMFUnique.h:23
void fetchParentIDs() noexcept(false) override
Definition: LMFSeqDat.cc:174
LMFSeqDat & setSequenceNumber(int n)
Definition: LMFSeqDat.h:25
std::string setByIDSql(Statement *stmt, int id) override
Definition: LMFSeqDat.cc:102
int getInt(std::string fieldname) const
Definition: LMFUnique.cc:187
LMFSeqDat fetchByRunIOV(RunIOV &iov, int seq_num)
Definition: LMFSeqDat.h:65
bool isValid() const override
Definition: LMFSeqDat.cc:127
RunIOV m_runIOV
Definition: LMFSeqDat.h:74
void setVmax(int v)
Definition: LMFSeqDat.h:77
oracle::occi::Statement Statement
Definition: LMFUnique.h:24
Tm getSequenceStart() const
Definition: LMFSeqDat.h:45
void setVmin(int v)
Definition: LMFSeqDat.h:76
~LMFSeqDat() override
Definition: LMFSeqDat.cc:49
bool operator==(const LMFSeqDat &m) const
Definition: LMFSeqDat.h:56
LMFUnique & setString(std::string key, std::string value)
Definition: LMFUnique.cc:14
RunIOV getRunIOV() const
Definition: LMFSeqDat.cc:57
void getParameters(ResultSet *rset) override
Definition: LMFSeqDat.cc:111
void setToString(const std::string s) noexcept(false)
Definition: Tm.cc:150
LMFSeqDat fetchByRunNumber(int runno, int seq_num)
Definition: LMFSeqDat.h:67
std::string writeDBSql(Statement *stmt) override
Definition: LMFSeqDat.cc:141
RunIOV fetchLastRun()
Definition: LMFSeqDat.cc:243
LMFSeqDat & setVersions(int vmin, int vmax)
Definition: LMFSeqDat.h:37
std::string fetchIdSql(Statement *stmt) override
Definition: LMFSeqDat.cc:67
std::string str() const
Definition: Tm.cc:66
string end
Definition: dataset.py:937
tuple conn
Definition: getInfo.py:9
LMFSeqDat & setSequenceStart(const Tm &start)
Definition: LMFSeqDat.h:29
oracle::occi::Statement * stmt
std::string getString(std::string fieldname) const
Definition: LMFUnique.cc:178
int col
Definition: cuy.py:1009
Definition: RunIOV.h:13
Definition: Tm.h:13
int getVmin() const
Definition: LMFSeqDat.h:51