14 m_writeStmt =
nullptr;
19 m_laserWavelength = 0;
34 this->checkConnection();
37 m_writeStmt = m_conn->createStatement();
38 m_writeStmt->setSQL(
"INSERT INTO mon_laser_status_dat (iov_id, logic_id, " 39 "laser_power, laser_filter, laser_wavelength, laser_fanout) " 40 "VALUES (:iov_id, :logic_id, " 42 }
catch (SQLException &
e) {
43 throw(std::runtime_error(
std::string(
"MonLaserStatusDat::prepareWrite(): ")+e.getMessage()));
52 this->checkConnection();
55 int iovID = iov->fetchID();
56 if (!iovID) {
throw(std::runtime_error(
"MonLaserStatusDat::writeDB: IOV not in DB")); }
58 int logicID = ecid->getLogicID();
59 if (!logicID) {
throw(std::runtime_error(
"MonLaserStatusDat::writeDB: Bad EcalLogicID")); }
62 m_writeStmt->setInt(1, iovID);
63 m_writeStmt->setInt(2, logicID);
65 m_writeStmt->setFloat(3, item->getLaserPower() );
66 m_writeStmt->setFloat(4, item->getLaserFilter() );
67 m_writeStmt->setFloat(5, item->getLaserWavelength() );
68 m_writeStmt->setFloat(6, item->getLaserFanout() );
70 m_writeStmt->executeUpdate();
71 }
catch (SQLException &
e) {
72 throw(std::runtime_error(
std::string(
"MonLaserStatusDat::writeDB(): ")+e.getMessage()));
81 this->checkConnection();
84 iov->setConnection(m_env, m_conn);
85 int iovID = iov->fetchID();
93 m_readStmt->setSQL(
"SELECT cv.name, cv.logic_id, cv.id1, cv.id2, cv.id3, cv.maps_to, " 94 "d.laser_power, d.laser_filter, d.laser_wavelength, d.laser_fanout " 95 "FROM channelview cv JOIN mon_laser_status_dat d " 96 "ON cv.logic_id = d.logic_id AND cv.name = cv.maps_to " 97 "WHERE d.iov_id = :iov_id");
98 m_readStmt->setInt(1, iovID);
99 ResultSet* rset = m_readStmt->executeQuery();
101 std::pair< EcalLogicID, MonLaserStatusDat >
p;
103 while(rset->next()) {
119 }
catch (SQLException &
e) {
120 throw(std::runtime_error(
std::string(
"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
void fetchData(std::map< EcalLogicID, MonLaserStatusDat > *fillMap, MonRunIOV *iov) noexcept(false)
void writeDB(const EcalLogicID *ecid, const MonLaserStatusDat *item, MonRunIOV *iov) noexcept(false)