CMS 3D CMS Logo

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

#include <MonLaserStatusDat.h>

Inheritance diagram for MonLaserStatusDat:
IDataItem IDBObject

Public Member Functions

float getLaserFanout () const
 
float getLaserFilter () const
 
float getLaserPower () const
 
float getLaserWavelength () const
 
std::string getTable () override
 
 MonLaserStatusDat ()
 
void setLaserFanout (float p)
 
void setLaserFilter (float p)
 
void setLaserPower (float p)
 
void setLaserWavelength (float p)
 
 ~MonLaserStatusDat () override
 
- Public Member Functions inherited from IDataItem
 IDataItem ()
 
- 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

void fetchData (std::map< EcalLogicID, MonLaserStatusDat > *fillMap, MonRunIOV *iov) noexcept(false)
 
void prepareWrite () noexcept(false) override
 
void writeArrayDB (const std::map< EcalLogicID, MonLaserStatusDat > *data, MonRunIOV *iov) noexcept(false)
 
void writeDB (const EcalLogicID *ecid, const MonLaserStatusDat *item, MonRunIOV *iov) noexcept(false)
 

Private Attributes

float m_laserFanout
 
float m_laserFilter
 
float m_laserPower
 
float m_laserWavelength
 

Friends

class EcalCondDBInterface
 

Additional Inherited Members

- Static Public Attributes inherited from IDBObject
static const int ECALDB_NROWS = 1024
 
- Protected Member Functions inherited from IDataItem
void checkPrepare () noexcept(false)
 
void createReadStatement () noexcept(false)
 
void setPrefetchRowCount (int ncount) noexcept(false)
 
void terminateReadStatement () noexcept(false)
 
void terminateWriteStatement () noexcept(false)
 
- Protected Member Functions inherited from IDBObject
void checkConnection () const noexcept(false)
 
- Protected Attributes inherited from IDataItem
oracle::occi::Statement * m_readStmt
 
oracle::occi::Statement * m_writeStmt
 
- Protected Attributes inherited from IDBObject
oracle::occi::Connection * m_conn
 
oracle::occi::Environment * m_env
 

Detailed Description

Definition at line 11 of file MonLaserStatusDat.h.

Constructor & Destructor Documentation

◆ MonLaserStatusDat()

MonLaserStatusDat::MonLaserStatusDat ( )

Definition at line 10 of file MonLaserStatusDat.cc.

10  {
11  m_env = nullptr;
12  m_conn = nullptr;
13  m_writeStmt = nullptr;
14  m_readStmt = nullptr;
15 
16  m_laserPower = 0;
17  m_laserFilter = 0;
19  m_laserFanout = 0;
20 }

◆ ~MonLaserStatusDat()

MonLaserStatusDat::~MonLaserStatusDat ( )
override

Definition at line 22 of file MonLaserStatusDat.cc.

22 {}

Member Function Documentation

◆ fetchData()

void MonLaserStatusDat::fetchData ( std::map< EcalLogicID, MonLaserStatusDat > *  fillMap,
MonRunIOV iov 
)
privatenoexcept

Definition at line 70 of file MonLaserStatusDat.cc.

70  {
71  this->checkConnection();
72  fillMap->clear();
73 
74  iov->setConnection(m_env, m_conn);
75  int iovID = iov->fetchID();
76  if (!iovID) {
77  // throw(std::runtime_error("MonLaserStatusDat::writeDB: IOV not in DB"));
78  return;
79  }
80 
81  try {
82  m_readStmt->setSQL(
83  "SELECT cv.name, cv.logic_id, cv.id1, cv.id2, cv.id3, cv.maps_to, "
84  "d.laser_power, d.laser_filter, d.laser_wavelength, d.laser_fanout "
85  "FROM channelview cv JOIN mon_laser_status_dat d "
86  "ON cv.logic_id = d.logic_id AND cv.name = cv.maps_to "
87  "WHERE d.iov_id = :iov_id");
88  m_readStmt->setInt(1, iovID);
89  ResultSet* rset = m_readStmt->executeQuery();
90 
91  std::pair<EcalLogicID, MonLaserStatusDat> p;
93  while (rset->next()) {
94  p.first = EcalLogicID(rset->getString(1), // name
95  rset->getInt(2), // logic_id
96  rset->getInt(3), // id1
97  rset->getInt(4), // id2
98  rset->getInt(5), // id3
99  rset->getString(6)); // maps_to
100 
101  dat.setLaserPower(rset->getFloat(7));
102  dat.setLaserFilter(rset->getFloat(8));
103  dat.setLaserWavelength(rset->getFloat(9));
104  dat.setLaserFanout(rset->getFloat(10));
105 
106  p.second = dat;
107  fillMap->insert(p);
108  }
109  } catch (SQLException& e) {
110  throw(std::runtime_error("MonLaserStatusDat::fetchData(): " + e.getMessage()));
111  }
112 }

References MillePedeFileConverter_cfg::e, AlCaHLTBitMon_ParallelJobs::p, setLaserFanout(), setLaserFilter(), setLaserPower(), and setLaserWavelength().

◆ getLaserFanout()

float MonLaserStatusDat::getLaserFanout ( ) const
inline

Definition at line 29 of file MonLaserStatusDat.h.

29 { return m_laserFanout; }

References m_laserFanout.

◆ getLaserFilter()

float MonLaserStatusDat::getLaserFilter ( ) const
inline

Definition at line 23 of file MonLaserStatusDat.h.

23 { return m_laserFilter; }

References m_laserFilter.

◆ getLaserPower()

float MonLaserStatusDat::getLaserPower ( ) const
inline

Definition at line 20 of file MonLaserStatusDat.h.

20 { return m_laserPower; }

References m_laserPower.

◆ getLaserWavelength()

float MonLaserStatusDat::getLaserWavelength ( ) const
inline

Definition at line 26 of file MonLaserStatusDat.h.

26 { return m_laserWavelength; }

References m_laserWavelength.

◆ getTable()

std::string MonLaserStatusDat::getTable ( )
inlineoverridevirtual

Implements IDataItem.

Definition at line 18 of file MonLaserStatusDat.h.

18 { return "MON_LASER_STATUS_DAT"; }

◆ prepareWrite()

void MonLaserStatusDat::prepareWrite ( )
overrideprivatevirtualnoexcept

Implements IDataItem.

Definition at line 24 of file MonLaserStatusDat.cc.

24  {
25  this->checkConnection();
26 
27  try {
28  m_writeStmt = m_conn->createStatement();
29  m_writeStmt->setSQL(
30  "INSERT INTO mon_laser_status_dat (iov_id, logic_id, "
31  "laser_power, laser_filter, laser_wavelength, laser_fanout) "
32  "VALUES (:iov_id, :logic_id, "
33  ":3, :4, :5, :6)");
34  } catch (SQLException& e) {
35  throw(std::runtime_error("MonLaserStatusDat::prepareWrite(): " + e.getMessage()));
36  }
37 }

References MillePedeFileConverter_cfg::e.

◆ setLaserFanout()

void MonLaserStatusDat::setLaserFanout ( float  p)
inline

Definition at line 28 of file MonLaserStatusDat.h.

28 { m_laserFanout = p; }

References m_laserFanout, and AlCaHLTBitMon_ParallelJobs::p.

Referenced by fetchData().

◆ setLaserFilter()

void MonLaserStatusDat::setLaserFilter ( float  p)
inline

Definition at line 22 of file MonLaserStatusDat.h.

22 { m_laserFilter = p; }

References m_laserFilter, and AlCaHLTBitMon_ParallelJobs::p.

Referenced by fetchData().

◆ setLaserPower()

void MonLaserStatusDat::setLaserPower ( float  p)
inline

Definition at line 19 of file MonLaserStatusDat.h.

19 { m_laserPower = p; }

References m_laserPower, and AlCaHLTBitMon_ParallelJobs::p.

Referenced by fetchData().

◆ setLaserWavelength()

void MonLaserStatusDat::setLaserWavelength ( float  p)
inline

Definition at line 25 of file MonLaserStatusDat.h.

25 { m_laserWavelength = p; }

References m_laserWavelength, and AlCaHLTBitMon_ParallelJobs::p.

Referenced by fetchData().

◆ writeArrayDB()

void MonLaserStatusDat::writeArrayDB ( const std::map< EcalLogicID, MonLaserStatusDat > *  data,
MonRunIOV iov 
)
privatenoexcept

◆ writeDB()

void MonLaserStatusDat::writeDB ( const EcalLogicID ecid,
const MonLaserStatusDat item,
MonRunIOV iov 
)
privatenoexcept

Definition at line 39 of file MonLaserStatusDat.cc.

41  {
42  this->checkConnection();
43  this->checkPrepare();
44 
45  int iovID = iov->fetchID();
46  if (!iovID) {
47  throw(std::runtime_error("MonLaserStatusDat::writeDB: IOV not in DB"));
48  }
49 
50  int logicID = ecid->getLogicID();
51  if (!logicID) {
52  throw(std::runtime_error("MonLaserStatusDat::writeDB: Bad EcalLogicID"));
53  }
54 
55  try {
56  m_writeStmt->setInt(1, iovID);
57  m_writeStmt->setInt(2, logicID);
58 
59  m_writeStmt->setFloat(3, item->getLaserPower());
60  m_writeStmt->setFloat(4, item->getLaserFilter());
61  m_writeStmt->setFloat(5, item->getLaserWavelength());
62  m_writeStmt->setFloat(6, item->getLaserFanout());
63 
64  m_writeStmt->executeUpdate();
65  } catch (SQLException& e) {
66  throw(std::runtime_error("MonLaserStatusDat::writeDB(): " + e.getMessage()));
67  }
68 }

References MillePedeFileConverter_cfg::e, and B2GTnPMonitor_cfi::item.

Friends And Related Function Documentation

◆ EcalCondDBInterface

friend class EcalCondDBInterface
friend

Definition at line 13 of file MonLaserStatusDat.h.

Member Data Documentation

◆ m_laserFanout

float MonLaserStatusDat::m_laserFanout
private

Definition at line 44 of file MonLaserStatusDat.h.

Referenced by getLaserFanout(), and setLaserFanout().

◆ m_laserFilter

float MonLaserStatusDat::m_laserFilter
private

Definition at line 42 of file MonLaserStatusDat.h.

Referenced by getLaserFilter(), and setLaserFilter().

◆ m_laserPower

float MonLaserStatusDat::m_laserPower
private

Definition at line 41 of file MonLaserStatusDat.h.

Referenced by getLaserPower(), and setLaserPower().

◆ m_laserWavelength

float MonLaserStatusDat::m_laserWavelength
private

Definition at line 43 of file MonLaserStatusDat.h.

Referenced by getLaserWavelength(), and setLaserWavelength().

MonLaserStatusDat::setLaserPower
void setLaserPower(float p)
Definition: MonLaserStatusDat.h:19
MonLaserStatusDat::m_laserFanout
float m_laserFanout
Definition: MonLaserStatusDat.h:44
MonRunIOV::fetchID
int fetchID() noexcept(false) override
Definition: MonRunIOV.cc:72
MonLaserStatusDat::setLaserWavelength
void setLaserWavelength(float p)
Definition: MonLaserStatusDat.h:25
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
MonLaserStatusDat::setLaserFanout
void setLaserFanout(float p)
Definition: MonLaserStatusDat.h:28
IDataItem::checkPrepare
void checkPrepare() noexcept(false)
Definition: IDataItem.h:26
MonLaserStatusDat
Definition: MonLaserStatusDat.h:11
EcalLogicID::getLogicID
int getLogicID() const
Definition: EcalLogicID.cc:28
IDataItem::m_readStmt
oracle::occi::Statement * m_readStmt
Definition: IDataItem.h:24
IDataItem::m_writeStmt
oracle::occi::Statement * m_writeStmt
Definition: IDataItem.h:23
IDBObject::m_conn
oracle::occi::Connection * m_conn
Definition: IDBObject.h:34
MonLaserStatusDat::m_laserWavelength
float m_laserWavelength
Definition: MonLaserStatusDat.h:43
EcalLogicID
Definition: EcalLogicID.h:7
IDBObject::checkConnection
void checkConnection() const noexcept(false)
Definition: IDBObject.h:36
B2GTnPMonitor_cfi.item
item
Definition: B2GTnPMonitor_cfi.py:147
MonLaserStatusDat::m_laserPower
float m_laserPower
Definition: MonLaserStatusDat.h:41
IDBObject::setConnection
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
Definition: IDBObject.h:23
IDBObject::m_env
oracle::occi::Environment * m_env
Definition: IDBObject.h:33
MonLaserStatusDat::m_laserFilter
float m_laserFilter
Definition: MonLaserStatusDat.h:42
MonLaserStatusDat::setLaserFilter
void setLaserFilter(float p)
Definition: MonLaserStatusDat.h:22
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37