CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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,
20  oracle::occi::Connection* conn);
22  ~LMFSeqDat();
23 
24  // Methods for user data
25  LMFSeqDat& setRunIOV(const RunIOV &iov);
26  LMFSeqDat& setSequenceNumber(int n) { setInt("seq_num", n); return *this; }
28  setString("seq_start", start.str());
29  return *this;
30  }
32  setString("seq_stop", end.str());
33  return *this;
34  }
35  LMFSeqDat& setVersions(int vmin, int vmax) {
36  setVmin(vmin) ; setVmax(vmax);
37  return *this;
38  }
39 
40  RunIOV getRunIOV() const;
41  int getSequenceNumber() const { return getInt("seq_num"); }
42  Tm getSequenceStart() const {
43  Tm t;
44  t.setToString(getString("seq_start"));
45  return t;
46  }
47  Tm getSequenceStop() const;
48  int getVmin() const { return getInt("vmin"); }
49  int getVmax() const { return getInt("vmax"); }
50 
51  bool isValid() const ;
52  // Operators
53  bool operator==(const LMFSeqDat &m) const
54  {
55  return ( getSequenceNumber() == m.getSequenceNumber() &&
56  getRunIOV() == m.getRunIOV() &&
59  getVmin() == m.getVmin() &&
60  getVmax() == m.getVmax());
61  }
62 
63  bool operator!=(const LMFSeqDat &m) const { return !(*this == m); }
64  std::map<int, LMFSeqDat> fetchByRunIOV(RunIOV &iov);
65  std::map<int, LMFSeqDat> fetchByRunIOV(RunIOV &iov, const LMFColor &col);
66  LMFSeqDat fetchByRunIOV(RunIOV &iov, int seq_num) {
67  return fetchByRunIOV(iov)[seq_num];
68  }
69  std::map<int, LMFSeqDat> fetchByRunNumber(int runno);
70  LMFSeqDat fetchByRunNumber(int runno, int seq_num) {
71  return fetchByRunNumber(runno)[seq_num];
72  }
73  LMFSeqDat fetchByRunNumber(int runno, Tm taken_at);
77 
78  private:
80 
81  void setVmin(int v) {
82  setInt("vmin", v);
83  }
84  void setVmax(int v) {
85  setInt("vmax", v);
86  }
90  void getParameters(ResultSet *rset);
91 
92  void fetchParentIDs() throw(std::runtime_error);
93  std::map<int, LMFSeqDat> fetchByRunIOV(std::vector<std::string> par,
94  std::string sql,
95  std::string method)
96  throw(std::runtime_error);
97  std::map<int, LMFSeqDat> fetchByRunIOV(int par, std::string sql,
98  std::string method)
99  throw(std::runtime_error);
100  std::map<int, LMFSeqDat> fetchByRunIOV(std::string sql,
101  std::string method)
102  throw(std::runtime_error);
103 
104 };
105 
106 #endif
LMFUnique & setInt(std::string key, int value)
Definition: LMFUnique.cc:33
std::map< int, LMFSeqDat > fetchByRunNumber(int runno)
Definition: LMFSeqDat.cc:295
Tm getSequenceStop() const
Definition: LMFSeqDat.cc:55
LMFSeqDat & setRunIOV(const RunIOV &iov)
Definition: LMFSeqDat.cc:66
tuple start
Check for commandline option errors.
Definition: dqm_diff.py:58
void fetchParentIDs()
Definition: LMFSeqDat.cc:181
bool operator!=(const LMFSeqDat &m) const
Definition: LMFSeqDat.h:63
std::string fetchIdSql(Statement *stmt)
Definition: LMFSeqDat.cc:75
std::map< int, LMFSeqDat > fetchByRunIOV(RunIOV &iov)
Definition: LMFSeqDat.cc:268
std::string writeDBSql(Statement *stmt)
Definition: LMFSeqDat.cc:149
LMFSeqDat fetchLast()
Definition: LMFSeqDat.cc:251
int getVmax() const
Definition: LMFSeqDat.h:49
int getSequenceNumber() const
Definition: LMFSeqDat.h:41
LMFSeqDat & setSequenceNumber(int n)
Definition: LMFSeqDat.h:26
LMFSeqDat & setSequenceStart(Tm start)
Definition: LMFSeqDat.h:27
dictionary map
Definition: Association.py:205
int getInt(std::string fieldname) const
Definition: LMFUnique.cc:203
LMFSeqDat fetchByRunIOV(RunIOV &iov, int seq_num)
Definition: LMFSeqDat.h:66
LMFSeqDat & setSequenceStop(Tm end)
Definition: LMFSeqDat.h:31
RunIOV m_runIOV
Definition: LMFSeqDat.h:79
tuple iov
Definition: o2o.py:307
void setVmax(int v)
Definition: LMFSeqDat.h:84
oracle::occi::Statement Statement
Definition: LMFUnique.h:20
void setToString(const std::string s)
Definition: Tm.cc:193
Tm getSequenceStart() const
Definition: LMFSeqDat.h:42
#define end
Definition: vmac.h:38
void setVmin(int v)
Definition: LMFSeqDat.h:81
bool operator==(const LMFSeqDat &m) const
Definition: LMFSeqDat.h:53
LMFUnique & setString(std::string key, std::string value)
Definition: LMFUnique.cc:15
RunIOV getRunIOV() const
Definition: LMFSeqDat.cc:61
LMFSeqDat fetchByRunNumber(int runno, int seq_num)
Definition: LMFSeqDat.h:70
RunIOV fetchLastRun()
Definition: LMFSeqDat.cc:264
oracle::occi::ResultSet ResultSet
Definition: HcalDbOmds.cc:21
void getParameters(ResultSet *rset)
Definition: LMFSeqDat.cc:118
LMFSeqDat & setVersions(int vmin, int vmax)
Definition: LMFSeqDat.h:35
std::string str() const
Definition: Tm.cc:89
oracle::occi::Statement * stmt
std::string getString(std::string fieldname) const
Definition: LMFUnique.cc:194
int col
Definition: cuy.py:1008
Definition: RunIOV.h:13
~LMFSeqDat()
Definition: LMFSeqDat.cc:51
bool isValid() const
Definition: LMFSeqDat.cc:134
Definition: Tm.h:14
std::string setByIDSql(Statement *stmt, int id)
Definition: LMFSeqDat.cc:110
tuple conn
Definition: results_mgr.py:53
int getVmin() const
Definition: LMFSeqDat.h:48