CMS 3D CMS Logo

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

#include <LMFIOV.h>

Inheritance diagram for LMFIOV:
LMFUnique IUniqueDBObject IDBObject

Public Member Functions

void dump () const override
 
Tm getStart () const
 
Tm getStop () const
 
int getVmax () const
 
int getVmin () const
 
 LMFIOV ()
 
 LMFIOV (EcalDBConnection *c)
 
 LMFIOV (const oracle::occi::Environment *env, const oracle::occi::Connection *conn)
 
LMFIOVsetIOV (const Tm &start, const Tm &stop)
 
LMFIOVsetStart (const Tm &start)
 
LMFIOVsetStop (const Tm &stop)
 
LMFIOVsetVersions (int vmin, int vmax)
 
LMFIOVsetVmax (int vmax)
 
LMFIOVsetVmin (int vmin)
 
 ~LMFIOV () 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
 
virtual bool isValid ()
 
 LMFUnique ()
 
 LMFUnique (oracle::occi::Environment *env, oracle::occi::Connection *conn)
 
 LMFUnique (EcalDBConnection *c)
 
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

LMFUniquecreateObject () const override
 
std::string fetchIdSql (Statement *stmt) override
 
void fetchParentIDs () override
 
void getParameters (ResultSet *rset) override
 
std::string setByIDSql (Statement *stmt, int id) override
 
std::string writeDBSql (Statement *stmt) override
 

Private Attributes

Tm m_iov_start
 
Tm m_iov_stop
 
int m_vmax
 
int m_vmin
 

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 int const 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

LMF IOV

Definition at line 17 of file LMFIOV.h.

Constructor & Destructor Documentation

◆ LMFIOV() [1/3]

LMFIOV::LMFIOV ( )

Definition at line 6 of file LMFIOV.cc.

6  {
7  //standard
8  m_env = nullptr;
9  m_conn = nullptr;
10  m_className = "LMFIOV";
11  m_ID = 0;
12  // custom
13  m_iov_start = Tm();
14  m_iov_stop = Tm();
15  m_vmin = 0;
16  m_vmax = 0;
17 }
std::string m_className
Definition: LMFUnique.h:99
oracle::occi::Environment * m_env
Definition: IDBObject.h:33
oracle::occi::Connection * m_conn
Definition: IDBObject.h:34
int m_vmax
Definition: LMFIOV.h:54
Tm m_iov_start
Definition: LMFIOV.h:51
Tm m_iov_stop
Definition: LMFIOV.h:52
Definition: Tm.h:13
int m_vmin
Definition: LMFIOV.h:53

◆ LMFIOV() [2/3]

LMFIOV::LMFIOV ( EcalDBConnection c)

Definition at line 19 of file LMFIOV.cc.

References DummyCfis::c.

19  {
20  //standard
21  setConnection(c->getEnv(), c->getConn());
22  m_className = "LMFIOV";
23  m_ID = 0;
24  // custom
25  m_iov_start = Tm();
26  m_iov_stop = Tm();
27  m_vmin = 0;
28  m_vmax = 0;
29 }
std::string m_className
Definition: LMFUnique.h:99
int m_vmax
Definition: LMFIOV.h:54
Tm m_iov_start
Definition: LMFIOV.h:51
Tm m_iov_stop
Definition: LMFIOV.h:52
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
Definition: IDBObject.h:23
Definition: Tm.h:13
int m_vmin
Definition: LMFIOV.h:53

◆ LMFIOV() [3/3]

LMFIOV::LMFIOV ( const oracle::occi::Environment *  env,
const oracle::occi::Connection *  conn 
)

◆ ~LMFIOV()

LMFIOV::~LMFIOV ( )
override

Definition at line 31 of file LMFIOV.cc.

31 {}

Member Function Documentation

◆ createObject()

LMFUnique * LMFIOV::createObject ( ) const
overrideprivatevirtual

Reimplemented from LMFUnique.

Definition at line 105 of file LMFIOV.cc.

References submitPVValidationJobs::t.

105  {
106  LMFIOV *t = new LMFIOV;
107  t->setConnection(m_env, m_conn);
108  return t;
109 }
oracle::occi::Environment * m_env
Definition: IDBObject.h:33
oracle::occi::Connection * m_conn
Definition: IDBObject.h:34
Definition: LMFIOV.h:17
LMFIOV()
Definition: LMFIOV.cc:6

◆ dump()

void LMFIOV::dump ( void  ) const
overridevirtual

Reimplemented from LMFUnique.

Definition at line 111 of file LMFIOV.cc.

References gather_cfg::cout.

111  {
112  cout << "################# LMFIOV ######################" << endl;
113  cout << "id : " << m_ID << endl;
114  cout << "Start: " << m_iov_start.str() << endl;
115  cout << "Stop : " << m_iov_stop.str() << endl;
116  cout << "Vers.: " << m_vmin << " - " << m_vmax << endl;
117  cout << "################# LMFIOV ######################" << endl;
118 }
int m_vmax
Definition: LMFIOV.h:54
Tm m_iov_start
Definition: LMFIOV.h:51
Tm m_iov_stop
Definition: LMFIOV.h:52
std::string str() const
Definition: Tm.cc:64
int m_vmin
Definition: LMFIOV.h:53

◆ fetchIdSql()

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

Reimplemented from LMFUnique.

Definition at line 71 of file LMFIOV.cc.

References symbols::dm, and AlCaHLTBitMon_QueryRunRegistry::string.

71  {
72  std::string sql =
73  "SELECT IOV_ID FROM CMS_ECAL_LASER_COND.LMF_IOV "
74  "WHERE IOV_START = :1 AND IOV_STOP = :2 AND "
75  "VMIN = :3 AND VMIN = :4";
77  stmt->setSQL(sql);
78  stmt->setDate(1, dm.tmToDate(m_iov_start));
79  stmt->setDate(2, dm.tmToDate(m_iov_stop));
80  stmt->setInt(3, m_vmin);
81  stmt->setInt(4, m_vmax);
82  return sql;
83 }
oracle::occi::Environment * m_env
Definition: IDBObject.h:33
oracle::occi::Connection * m_conn
Definition: IDBObject.h:34
int m_vmax
Definition: LMFIOV.h:54
Tm m_iov_start
Definition: LMFIOV.h:51
Tm m_iov_stop
Definition: LMFIOV.h:52
int m_vmin
Definition: LMFIOV.h:53

◆ fetchParentIDs()

void LMFIOV::fetchParentIDs ( )
inlineoverrideprivatevirtual

Reimplemented from LMFUnique.

Definition at line 48 of file LMFIOV.h.

48 {}

◆ getParameters()

void LMFIOV::getParameters ( ResultSet rset)
overrideprivatevirtual

Reimplemented from LMFUnique.

Definition at line 95 of file LMFIOV.cc.

References ztail::d, and cuy::dh.

95  {
96  Date d = rset->getDate(1);
98  m_iov_start = dh.dateToTm(d);
99  d = rset->getDate(2);
100  m_iov_stop = dh.dateToTm(d);
101  m_vmin = rset->getInt(3);
102  m_vmax = rset->getInt(4);
103 }
oracle::occi::Environment * m_env
Definition: IDBObject.h:33
oracle::occi::Connection * m_conn
Definition: IDBObject.h:34
int m_vmax
Definition: LMFIOV.h:54
Tm m_iov_start
Definition: LMFIOV.h:51
d
Definition: ztail.py:151
Tm m_iov_stop
Definition: LMFIOV.h:52
dh
Definition: cuy.py:354
int m_vmin
Definition: LMFIOV.h:53

◆ getStart()

Tm LMFIOV::getStart ( ) const

Definition at line 63 of file LMFIOV.cc.

63 { return m_iov_start; }
Tm m_iov_start
Definition: LMFIOV.h:51

◆ getStop()

Tm LMFIOV::getStop ( ) const

Definition at line 65 of file LMFIOV.cc.

65 { return m_iov_stop; }
Tm m_iov_stop
Definition: LMFIOV.h:52

◆ getVmax()

int LMFIOV::getVmax ( ) const

Definition at line 69 of file LMFIOV.cc.

69 { return m_vmax; }
int m_vmax
Definition: LMFIOV.h:54

◆ getVmin()

int LMFIOV::getVmin ( ) const

Definition at line 67 of file LMFIOV.cc.

67 { return m_vmin; }
int m_vmin
Definition: LMFIOV.h:53

◆ setByIDSql()

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

Reimplemented from LMFUnique.

Definition at line 85 of file LMFIOV.cc.

References AlCaHLTBitMon_QueryRunRegistry::string.

85  {
86  std::string sql =
87  "SELECT IOV_START, IOV_STOP, VMIN, VMAX FROM "
88  "CMS_ECAL_LASER_COND.LMF_IOV "
89  "WHERE IOV_ID = :1";
90  stmt->setSQL(sql);
91  stmt->setInt(1, id);
92  return sql;
93 }

◆ setIOV()

LMFIOV & LMFIOV::setIOV ( const Tm start,
const Tm stop 
)

Definition at line 43 of file LMFIOV.cc.

43  {
44  setStart(start);
45  return setStop(stop);
46 }
Definition: start.py:1
LMFIOV & setStop(const Tm &stop)
Definition: LMFIOV.cc:38
LMFIOV & setStart(const Tm &start)
Definition: LMFIOV.cc:33

◆ setStart()

LMFIOV & LMFIOV::setStart ( const Tm start)

Definition at line 33 of file LMFIOV.cc.

References command_line::start.

33  {
35  return *this;
36 }
Tm m_iov_start
Definition: LMFIOV.h:51

◆ setStop()

LMFIOV & LMFIOV::setStop ( const Tm stop)

Definition at line 38 of file LMFIOV.cc.

38  {
39  m_iov_stop = stop;
40  return *this;
41 }
Tm m_iov_stop
Definition: LMFIOV.h:52

◆ setVersions()

LMFIOV & LMFIOV::setVersions ( int  vmin,
int  vmax 
)

Definition at line 58 of file LMFIOV.cc.

58  {
59  setVmin(vmin);
60  return setVmax(vmax);
61 }
LMFIOV & setVmin(int vmin)
Definition: LMFIOV.cc:48
LMFIOV & setVmax(int vmax)
Definition: LMFIOV.cc:53

◆ setVmax()

LMFIOV & LMFIOV::setVmax ( int  vmax)

Definition at line 53 of file LMFIOV.cc.

53  {
54  m_vmax = vmax;
55  return *this;
56 }
int m_vmax
Definition: LMFIOV.h:54

◆ setVmin()

LMFIOV & LMFIOV::setVmin ( int  vmin)

Definition at line 48 of file LMFIOV.cc.

48  {
49  m_vmin = vmin;
50  return *this;
51 }
int m_vmin
Definition: LMFIOV.h:53

◆ writeDBSql()

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

Reimplemented from LMFUnique.

Definition at line 120 of file LMFIOV.cc.

References symbols::dm, GCP_Ntuples_cfg::dump, and AlCaHLTBitMon_QueryRunRegistry::string.

120  {
121  // check that everything has been setup
123  std::string sql =
124  "INSERT INTO LMF_IOV (IOV_ID, IOV_START, IOV_STOP, "
125  "VMIN, VMAX) VALUES "
126  "(lmf_iov_" +
127  seqName + "_sq.NextVal, :1, :2, :3, :4)";
128  stmt->setSQL(sql);
130  stmt->setDate(1, dm.tmToDate(m_iov_start));
131  stmt->setDate(2, dm.tmToDate(m_iov_stop));
132  stmt->setInt(3, m_vmin);
133  stmt->setInt(4, m_vmax);
134  if (m_debug) {
135  dump();
136  }
137  return sql;
138 }
oracle::occi::Environment * m_env
Definition: IDBObject.h:33
oracle::occi::Connection * m_conn
Definition: IDBObject.h:34
int m_vmax
Definition: LMFIOV.h:54
std::string sequencePostfix(const Tm &t)
Definition: LMFUnique.cc:9
void dump() const override
Definition: LMFIOV.cc:111
Tm m_iov_start
Definition: LMFIOV.h:51
Tm m_iov_stop
Definition: LMFIOV.h:52
char m_debug
Definition: LMFUnique.h:100
int m_vmin
Definition: LMFIOV.h:53

Friends And Related Function Documentation

◆ EcalCondDBInterface

friend class EcalCondDBInterface
friend

Definition at line 19 of file LMFIOV.h.

Member Data Documentation

◆ m_iov_start

Tm LMFIOV::m_iov_start
private

Definition at line 51 of file LMFIOV.h.

◆ m_iov_stop

Tm LMFIOV::m_iov_stop
private

Definition at line 52 of file LMFIOV.h.

◆ m_vmax

int LMFIOV::m_vmax
private

Definition at line 54 of file LMFIOV.h.

◆ m_vmin

int LMFIOV::m_vmin
private

Definition at line 53 of file LMFIOV.h.