CMS 3D CMS Logo

LMFRunIOV.h
Go to the documentation of this file.
1 #ifndef LMFRUNIOV_H
2 #define LMFRUNIOV_H
3 
11 
12 #include <string>
13 
14 /*
15  Last updated by Giovanni.Organtini@roma1.infn.it 2010
16 */
17 
18 
19 class LMFRunIOV : public LMFUnique {
20  public:
21  friend class EcalCondDBInterface;
22 
23  LMFRunIOV();
24  LMFRunIOV(oracle::occi::Environment* env,
25  oracle::occi::Connection* conn);
27  LMFRunIOV(const LMFRunIOV &r);
28  ~LMFRunIOV() override;
29 
30  // Methods for user data
32  LMFRunIOV& setLMFRunTag(int tag_id);
36  LMFRunIOV& setTriggerType(int trigType_id);
37  LMFRunIOV& setTriggerType(std::string trigShortName);
38  LMFRunIOV& setLmr(int n);
39  LMFRunIOV& setColor(const LMFColor &c);
41  LMFRunIOV& setColor(int color_id);
42  LMFRunIOV& setColorIndex(int color_index);
44  LMFRunIOV& setSubRunEnd(const Tm& end);
46 
47  LMFRunTag getLMFRunTag() const;
48  LMFSeqDat getSequence() const;
50 
51  int getLmr() const;
52  std::string getSubRunType() const;
55  LMFColor getLMFColor() const;
56  LMFColor getColor() const { return getLMFColor(); }
57  Tm getSubRunStart() const;
58  Tm getSubRunEnd() const;
59  Tm getDBInsertionTime() const;
60  bool isValid() override;
61 
62  void dump() const override;
63  virtual LMFRunIOV& operator=(const LMFRunIOV &r);
64  std::list<LMFRunIOV> fetchBySequence(const LMFSeqDat &s);
65  std::list<LMFRunIOV> fetchBySequence(const LMFSeqDat &s, int lmr);
66  std::list<LMFRunIOV> fetchBySequence(const LMFSeqDat &s, int lmr, int type,
67  int color);
68  std::list<LMFRunIOV> fetchLastBeforeSequence(const LMFSeqDat &s, int lmr,
69  int type, int color);
70 
71  // Operators
72  bool operator==(const LMFRunIOV &m) const
73  {
74  return ( getLMFRunTag() == m.getLMFRunTag() &&
75  getSequence() == m.getSequence() &&
76  getLmr() == m.getLmr() &&
77  getLMFColor() == m.getLMFColor() &&
78  getTriggerType() == m.getTriggerType() &&
79  getSubRunType() == m.getSubRunType() &&
80  getSubRunStart() == m.getSubRunStart() &&
81  getSubRunEnd() == m.getSubRunEnd() );
82  }
83 
84  bool operator!=(const LMFRunIOV &m) const { return !(*this == m); }
85 
87  std::string setByIDSql(Statement *stmt, int id) override;
88  std::string writeDBSql(Statement *stmt) override;
89  void getParameters(ResultSet *rset) override;
90 
91  private:
92  void checkFabric();
93  void initialize();
94  std::list<LMFRunIOV> fetchBySequence(const std::vector<int>& par,
95  const std::string &sql,
96  const std::string &method)
97  noexcept(false);
98 
100 };
101 
102 #endif
~LMFRunIOV() override
Definition: LMFRunIOV.cc:49
Definition: start.py:1
std::string getSubRunType() const
Definition: LMFRunIOV.cc:192
type
Definition: HCALResponse.h:21
LMFColor getColor() const
Definition: LMFRunIOV.h:56
LMFRunIOV & setSubRunStart(const Tm &start)
Definition: LMFRunIOV.cc:158
void dump() const override
Definition: LMFRunIOV.cc:212
std::list< LMFRunIOV > fetchBySequence(const LMFSeqDat &s)
Definition: LMFRunIOV.cc:377
LMFRunIOV & setLMFRunTag(const LMFRunTag &tag)
Definition: LMFRunIOV.cc:56
virtual LMFRunIOV & operator=(const LMFRunIOV &r)
Definition: LMFRunIOV.cc:430
LMFRunIOV & setSubRunType(const std::string &x)
Definition: LMFRunIOV.cc:187
Tm getDBInsertionTime() const
Definition: LMFRunIOV.cc:181
bool operator!=(const LMFRunIOV &m) const
Definition: LMFRunIOV.h:84
Tm getSubRunStart() const
Definition: LMFRunIOV.cc:163
LMFColor getLMFColor() const
Definition: LMFRunIOV.cc:107
std::string fetchIdSql(Statement *stmt) override
Definition: LMFRunIOV.cc:220
oracle::occi::ResultSet ResultSet
Definition: LMFUnique.h:19
std::string getColorShortName() const
Definition: LMFRunIOV.cc:114
bool operator==(const LMFRunIOV &m) const
Definition: LMFRunIOV.h:72
LMFRunIOV & setSubRunEnd(const Tm &end)
Definition: LMFRunIOV.cc:169
LMFRunIOV & setSequence(LMFSeqDat &seq)
Definition: LMFRunIOV.cc:196
oracle::occi::Connection * conn
void checkFabric()
Definition: LMFRunIOV.cc:87
LMFSeqDat getSequence() const
Definition: LMFRunIOV.cc:205
LMFRunIOV & setTriggerType(LMFTrigType &tt)
Definition: LMFRunIOV.cc:124
int getLmr() const
Definition: LMFRunIOV.cc:154
oracle::occi::Statement Statement
Definition: LMFUnique.h:20
LMFTrigType getTriggerType() const
Definition: LMFRunIOV.cc:142
void initialize()
Definition: LMFRunIOV.cc:10
#define end
Definition: vmac.h:39
std::string setByIDSql(Statement *stmt, int id) override
Definition: LMFRunIOV.cc:239
#define noexcept
LMFRunIOV & setColorIndex(int color_index)
Definition: LMFRunIOV.cc:93
Tm getSubRunEnd() const
Definition: LMFRunIOV.cc:174
LMFDefFabric * _fabric
Definition: LMFRunIOV.h:99
std::string getColorLongName() const
Definition: LMFRunIOV.cc:119
LMFRunIOV & setLmr(int n)
Definition: LMFRunIOV.cc:149
oracle::occi::Statement * stmt
bool isValid() override
Definition: LMFRunIOV.cc:303
std::list< LMFRunIOV > fetchLastBeforeSequence(const LMFSeqDat &s, int lmr, int type, int color)
Definition: LMFRunIOV.cc:412
LMFRunIOV & setColor(const LMFColor &c)
Definition: LMFRunIOV.cc:75
LMFRunTag getLMFRunTag() const
Definition: LMFRunIOV.cc:68
std::string writeDBSql(Statement *stmt) override
Definition: LMFRunIOV.cc:324
Definition: Tm.h:13
void getParameters(ResultSet *rset) override
Definition: LMFRunIOV.cc:251