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 (const oracle::occi::Environment *env, const oracle::occi::Connection *conn)
 
 LMFIOV (EcalDBConnection *c)
 
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 ()
 
virtual bool isValid () const
 
 LMFUnique ()
 
 LMFUnique (EcalDBConnection *c)
 
 LMFUnique (oracle::occi::Environment *env, oracle::occi::Connection *conn)
 
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 const int 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 }

◆ LMFIOV() [2/3]

LMFIOV::LMFIOV ( EcalDBConnection c)

Definition at line 19 of file LMFIOV.cc.

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 }

References HltBtagPostValidation_cff::c.

◆ 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.

105  {
106  LMFIOV *t = new LMFIOV;
107  t->setConnection(m_env, m_conn);
108  return t;
109 }

References submitPVValidationJobs::t.

◆ dump()

void LMFIOV::dump ( void  ) const
overridevirtual

Reimplemented from LMFUnique.

Definition at line 111 of file LMFIOV.cc.

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 }

References gather_cfg::cout.

◆ fetchIdSql()

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

Reimplemented from LMFUnique.

Definition at line 71 of file LMFIOV.cc.

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 }

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

◆ 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.

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 }

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

◆ getStart()

Tm LMFIOV::getStart ( ) const

Definition at line 63 of file LMFIOV.cc.

63 { return m_iov_start; }

◆ getStop()

Tm LMFIOV::getStop ( ) const

Definition at line 65 of file LMFIOV.cc.

65 { return m_iov_stop; }

◆ getVmax()

int LMFIOV::getVmax ( ) const

Definition at line 69 of file LMFIOV.cc.

69 { return m_vmax; }

◆ getVmin()

int LMFIOV::getVmin ( ) const

Definition at line 67 of file LMFIOV.cc.

67 { return m_vmin; }

◆ setByIDSql()

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

Reimplemented from LMFUnique.

Definition at line 85 of file LMFIOV.cc.

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 }

References AlCaHLTBitMon_QueryRunRegistry::string.

◆ 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 }

◆ setStart()

LMFIOV & LMFIOV::setStart ( const Tm start)

Definition at line 33 of file LMFIOV.cc.

33  {
35  return *this;
36 }

References command_line::start.

◆ 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 }

◆ 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 }

◆ setVmax()

LMFIOV & LMFIOV::setVmax ( int  vmax)

Definition at line 53 of file LMFIOV.cc.

53  {
54  m_vmax = vmax;
55  return *this;
56 }

◆ setVmin()

LMFIOV & LMFIOV::setVmin ( int  vmin)

Definition at line 48 of file LMFIOV.cc.

48  {
49  m_vmin = vmin;
50  return *this;
51 }

◆ writeDBSql()

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

Reimplemented from LMFUnique.

Definition at line 120 of file LMFIOV.cc.

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 }

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

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.

Tm::str
std::string str() const
Definition: Tm.cc:66
start
Definition: start.py:1
IUniqueDBObject::m_ID
int m_ID
Definition: IUniqueDBObject.h:18
gather_cfg.cout
cout
Definition: gather_cfg.py:144
LMFUnique::m_className
std::string m_className
Definition: LMFUnique.h:99
LMFUnique::m_debug
char m_debug
Definition: LMFUnique.h:100
LMFIOV::setVmax
LMFIOV & setVmax(int vmax)
Definition: LMFIOV.cc:53
LMFIOV::setVmin
LMFIOV & setVmin(int vmin)
Definition: LMFIOV.cc:48
IDBObject::m_conn
oracle::occi::Connection * m_conn
Definition: IDBObject.h:34
LMFIOV
Definition: LMFIOV.h:17
Tm
Definition: Tm.h:13
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
LMFIOV::LMFIOV
LMFIOV()
Definition: LMFIOV.cc:6
LMFIOV::m_vmax
int m_vmax
Definition: LMFIOV.h:54
symbols.dm
dm
Definition: symbols.py:66
LMFIOV::setStart
LMFIOV & setStart(const Tm &start)
Definition: LMFIOV.cc:33
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
IDBObject::setConnection
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
Definition: IDBObject.h:23
LMFIOV::m_vmin
int m_vmin
Definition: LMFIOV.h:53
LMFIOV::setStop
LMFIOV & setStop(const Tm &stop)
Definition: LMFIOV.cc:38
LMFIOV::m_iov_stop
Tm m_iov_stop
Definition: LMFIOV.h:52
ztail.d
d
Definition: ztail.py:151
IDBObject::m_env
oracle::occi::Environment * m_env
Definition: IDBObject.h:33
LMFUnique::sequencePostfix
std::string sequencePostfix(const Tm &t)
Definition: LMFUnique.cc:9
command_line.start
start
Definition: command_line.py:167
LMFIOV::m_iov_start
Tm m_iov_start
Definition: LMFIOV.h:51
LMFIOV::dump
void dump() const override
Definition: LMFIOV.cc:111
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
DateHandler
Definition: DateHandler.h:7
cuy.dh
dh
Definition: cuy.py:355