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 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 () 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::LMFIOV ( )

Definition at line 6 of file LMFIOV.cc.

7 {
8  //standard
9  m_env = nullptr;
10  m_conn = nullptr;
11  m_className = "LMFIOV";
12  m_ID = 0;
13  // custom
14  m_iov_start = Tm();
15  m_iov_stop = Tm();
16  m_vmin = 0;
17  m_vmax = 0;
18 }
std::string m_className
Definition: LMFUnique.h:98
oracle::occi::Environment * m_env
Definition: IDBObject.h:38
oracle::occi::Connection * m_conn
Definition: IDBObject.h:39
int m_vmax
Definition: LMFIOV.h:56
Tm m_iov_start
Definition: LMFIOV.h:53
Tm m_iov_stop
Definition: LMFIOV.h:54
Definition: Tm.h:13
int m_vmin
Definition: LMFIOV.h:55
LMFIOV::LMFIOV ( EcalDBConnection c)

Definition at line 20 of file LMFIOV.cc.

References EcalDBConnection::getConn(), and EcalDBConnection::getEnv().

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

Definition at line 33 of file LMFIOV.cc.

34 {
35 }

Member Function Documentation

LMFUnique * LMFIOV::createObject ( ) const
overrideprivatevirtual

Reimplemented from LMFUnique.

Definition at line 116 of file LMFIOV.cc.

References IDBObject::setConnection(), and lumiQTWidget::t.

Referenced by fetchParentIDs().

116  {
117  LMFIOV *t = new LMFIOV;
119  return t;
120 }
oracle::occi::Environment * m_env
Definition: IDBObject.h:38
oracle::occi::Connection * m_conn
Definition: IDBObject.h:39
Definition: LMFIOV.h:17
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
Definition: IDBObject.h:23
LMFIOV()
Definition: LMFIOV.cc:6
void LMFIOV::dump ( void  ) const
overridevirtual

Reimplemented from LMFUnique.

Definition at line 122 of file LMFIOV.cc.

References gather_cfg::cout.

122  {
123  cout << "################# LMFIOV ######################" << endl;
124  cout << "id : " << m_ID << endl;
125  cout << "Start: " << m_iov_start.str() << endl;
126  cout << "Stop : " << m_iov_stop.str() << endl;
127  cout << "Vers.: " << m_vmin << " - " << m_vmax << endl;
128  cout << "################# LMFIOV ######################" << endl;
129 }
int m_vmax
Definition: LMFIOV.h:56
Tm m_iov_start
Definition: LMFIOV.h:53
std::string str() const
Definition: Tm.cc:89
Tm m_iov_stop
Definition: LMFIOV.h:54
int m_vmin
Definition: LMFIOV.h:55
std::string LMFIOV::fetchIdSql ( Statement stmt)
overrideprivatevirtual

Reimplemented from LMFUnique.

Definition at line 83 of file LMFIOV.cc.

References symbols::dm, AlCaHLTBitMon_QueryRunRegistry::string, and DateHandler::tmToDate().

83  {
84  std::string sql = "SELECT IOV_ID FROM CMS_ECAL_LASER_COND.LMF_IOV "
85  "WHERE IOV_START = :1 AND IOV_STOP = :2 AND "
86  "VMIN = :3 AND VMIN = :4";
88  stmt->setSQL(sql);
89  stmt->setDate(1, dm.tmToDate(m_iov_start));
90  stmt->setDate(2, dm.tmToDate(m_iov_stop));
91  stmt->setInt(3, m_vmin);
92  stmt->setInt(4, m_vmax);
93  return sql;
94 }
oracle::occi::Environment * m_env
Definition: IDBObject.h:38
oracle::occi::Connection * m_conn
Definition: IDBObject.h:39
int m_vmax
Definition: LMFIOV.h:56
Tm m_iov_start
Definition: LMFIOV.h:53
Tm m_iov_stop
Definition: LMFIOV.h:54
int m_vmin
Definition: LMFIOV.h:55
void LMFIOV::fetchParentIDs ( )
inlineoverrideprivatevirtual

Reimplemented from LMFUnique.

Definition at line 50 of file LMFIOV.h.

References createObject().

50 {}
void LMFIOV::getParameters ( ResultSet rset)
overrideprivatevirtual

Reimplemented from LMFUnique.

Definition at line 106 of file LMFIOV.cc.

References edmIntegrityCheck::d, DateHandler::dateToTm(), and cuy::dh.

106  {
107  Date d = rset->getDate(1);
109  m_iov_start = dh.dateToTm(d);
110  d = rset->getDate(2);
111  m_iov_stop = dh.dateToTm(d);
112  m_vmin = rset->getInt(3);
113  m_vmax = rset->getInt(4);
114 }
oracle::occi::Environment * m_env
Definition: IDBObject.h:38
oracle::occi::Connection * m_conn
Definition: IDBObject.h:39
int m_vmax
Definition: LMFIOV.h:56
Tm m_iov_start
Definition: LMFIOV.h:53
Tm m_iov_stop
Definition: LMFIOV.h:54
dh
Definition: cuy.py:354
int m_vmin
Definition: LMFIOV.h:55
Tm LMFIOV::getStart ( ) const

Definition at line 67 of file LMFIOV.cc.

67  {
68  return m_iov_start;
69 }
Tm m_iov_start
Definition: LMFIOV.h:53
Tm LMFIOV::getStop ( ) const

Definition at line 71 of file LMFIOV.cc.

71  {
72  return m_iov_stop;
73 }
Tm m_iov_stop
Definition: LMFIOV.h:54
int LMFIOV::getVmax ( ) const

Definition at line 79 of file LMFIOV.cc.

79  {
80  return m_vmax;
81 }
int m_vmax
Definition: LMFIOV.h:56
int LMFIOV::getVmin ( ) const

Definition at line 75 of file LMFIOV.cc.

75  {
76  return m_vmin;
77 }
int m_vmin
Definition: LMFIOV.h:55
std::string LMFIOV::setByIDSql ( Statement stmt,
int  id 
)
overrideprivatevirtual

Reimplemented from LMFUnique.

Definition at line 96 of file LMFIOV.cc.

References AlCaHLTBitMon_QueryRunRegistry::string.

97 {
98  std::string sql = "SELECT IOV_START, IOV_STOP, VMIN, VMAX FROM "
99  "CMS_ECAL_LASER_COND.LMF_IOV "
100  "WHERE IOV_ID = :1";
101  stmt->setSQL(sql);
102  stmt->setInt(1, id);
103  return sql;
104 }
LMFIOV & LMFIOV::setIOV ( const Tm start,
const Tm stop 
)

Definition at line 47 of file LMFIOV.cc.

47  {
48  setStart(start);
49  return setStop(stop);
50 }
LMFIOV & setStop(const Tm &stop)
Definition: LMFIOV.cc:42
LMFIOV & setStart(const Tm &start)
Definition: LMFIOV.cc:37
LMFIOV & LMFIOV::setStart ( const Tm start)

Definition at line 37 of file LMFIOV.cc.

References command_line::start.

37  {
38  m_iov_start = start;
39  return *this;
40 }
Tm m_iov_start
Definition: LMFIOV.h:53
LMFIOV & LMFIOV::setStop ( const Tm stop)

Definition at line 42 of file LMFIOV.cc.

42  {
43  m_iov_stop = stop;
44  return *this;
45 }
Tm m_iov_stop
Definition: LMFIOV.h:54
LMFIOV & LMFIOV::setVersions ( int  vmin,
int  vmax 
)

Definition at line 62 of file LMFIOV.cc.

62  {
63  setVmin(vmin);
64  return setVmax(vmax);
65 }
LMFIOV & setVmin(int vmin)
Definition: LMFIOV.cc:52
LMFIOV & setVmax(int vmax)
Definition: LMFIOV.cc:57
LMFIOV & LMFIOV::setVmax ( int  vmax)

Definition at line 57 of file LMFIOV.cc.

57  {
58  m_vmax = vmax;
59  return *this;
60 }
int m_vmax
Definition: LMFIOV.h:56
LMFIOV & LMFIOV::setVmin ( int  vmin)

Definition at line 52 of file LMFIOV.cc.

52  {
53  m_vmin = vmin;
54  return *this;
55 }
int m_vmin
Definition: LMFIOV.h:55
std::string LMFIOV::writeDBSql ( Statement stmt)
overrideprivatevirtual

Reimplemented from LMFUnique.

Definition at line 131 of file LMFIOV.cc.

References symbols::dm, FrontierConditions_GlobalTag_cff::dump, AlCaHLTBitMon_QueryRunRegistry::string, and DateHandler::tmToDate().

132 {
133  // check that everything has been setup
135  std::string sql = "INSERT INTO LMF_IOV (IOV_ID, IOV_START, IOV_STOP, "
136  "VMIN, VMAX) VALUES "
137  "(lmf_iov_" + seqName + "_sq.NextVal, :1, :2, :3, :4)";
138  stmt->setSQL(sql);
140  stmt->setDate(1, dm.tmToDate(m_iov_start));
141  stmt->setDate(2, dm.tmToDate(m_iov_stop));
142  stmt->setInt(3, m_vmin);
143  stmt->setInt(4, m_vmax);
144  if (m_debug) {
145  dump();
146  }
147  return sql;
148 }
oracle::occi::Environment * m_env
Definition: IDBObject.h:38
oracle::occi::Connection * m_conn
Definition: IDBObject.h:39
int m_vmax
Definition: LMFIOV.h:56
std::string sequencePostfix(const Tm &t)
Definition: LMFUnique.cc:10
void dump() const override
Definition: LMFIOV.cc:122
Tm m_iov_start
Definition: LMFIOV.h:53
Tm m_iov_stop
Definition: LMFIOV.h:54
char m_debug
Definition: LMFUnique.h:99
int m_vmin
Definition: LMFIOV.h:55

Friends And Related Function Documentation

friend class EcalCondDBInterface
friend

Definition at line 19 of file LMFIOV.h.

Member Data Documentation

Tm LMFIOV::m_iov_start
private

Definition at line 53 of file LMFIOV.h.

Tm LMFIOV::m_iov_stop
private

Definition at line 54 of file LMFIOV.h.

int LMFIOV::m_vmax
private

Definition at line 56 of file LMFIOV.h.

int LMFIOV::m_vmin
private

Definition at line 55 of file LMFIOV.h.