8 using namespace oracle::occi;
13 m_writeStmt =
nullptr;
18 m_laserWavelength = 0;
25 this->checkConnection();
28 m_writeStmt = m_conn->createStatement();
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, "
34 }
catch (SQLException&
e) {
35 throw(std::runtime_error(
"MonLaserStatusDat::prepareWrite(): " + e.getMessage()));
42 this->checkConnection();
45 int iovID = iov->fetchID();
47 throw(std::runtime_error(
"MonLaserStatusDat::writeDB: IOV not in DB"));
50 int logicID = ecid->getLogicID();
52 throw(std::runtime_error(
"MonLaserStatusDat::writeDB: Bad EcalLogicID"));
56 m_writeStmt->setInt(1, iovID);
57 m_writeStmt->setInt(2, logicID);
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());
64 m_writeStmt->executeUpdate();
65 }
catch (SQLException&
e) {
66 throw(std::runtime_error(
"MonLaserStatusDat::writeDB(): " + e.getMessage()));
71 this->checkConnection();
74 iov->setConnection(m_env, m_conn);
75 int iovID = iov->fetchID();
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();
91 std::pair<EcalLogicID, MonLaserStatusDat>
p;
93 while (rset->next()) {
109 }
catch (SQLException&
e) {
110 throw(std::runtime_error(
"MonLaserStatusDat::fetchData(): " + e.getMessage()));
void setLaserFanout(float p)
void setLaserFilter(float p)
void setLaserPower(float p)
void setLaserWavelength(float p)
~MonLaserStatusDat() override
void prepareWrite() noexcept(false) override
static std::vector< std::string > checklist dat
void fetchData(std::map< EcalLogicID, MonLaserStatusDat > *fillMap, MonRunIOV *iov) noexcept(false)
void writeDB(const EcalLogicID *ecid, const MonLaserStatusDat *item, MonRunIOV *iov) noexcept(false)