#include <OnlineDB/EcalCondDB/interface/LMFLaserIRedNormDat.h>
Public Member Functions | |
float | getAPDOverPNAMean () const |
float | getAPDOverPNARMS () const |
float | getAPDOverPNBMean () const |
float | getAPDOverPNBRMS () const |
float | getAPDOverPNMean () const |
float | getAPDOverPNRMS () const |
std::string | getTable () |
LMFLaserIRedNormDat () | |
void | setAPDOverPNAMean (float mean) |
void | setAPDOverPNARMS (float RMS) |
void | setAPDOverPNBMean (float mean) |
void | setAPDOverPNBRMS (float RMS) |
void | setAPDOverPNMean (float mean) |
void | setAPDOverPNRMS (float RMS) |
~LMFLaserIRedNormDat () | |
Private Member Functions | |
void | fetchData (std::map< EcalLogicID, LMFLaserIRedNormDat > *fillVec, LMFRunIOV *iov) throw (std::runtime_error) |
void | prepareWrite () throw (std::runtime_error) |
void | writeDB (const EcalLogicID *ecid, const LMFLaserIRedNormDat *item, LMFRunIOV *iov) throw (std::runtime_error) |
Private Attributes | |
float | m_apdOverPNAMean |
float | m_apdOverPNARMS |
float | m_apdOverPNBMean |
float | m_apdOverPNBRMS |
float | m_apdOverPNMean |
float | m_apdOverPNRMS |
Friends | |
class | EcalCondDBInterface |
Definition at line 12 of file LMFLaserIRedNormDat.h.
LMFLaserIRedNormDat::LMFLaserIRedNormDat | ( | ) |
Definition at line 12 of file LMFLaserIRedNormDat.cc.
References m_apdOverPNAMean, m_apdOverPNARMS, m_apdOverPNBMean, m_apdOverPNMean, m_apdOverPNRMS, IDBObject::m_conn, IDBObject::m_env, IDataItem::m_readStmt, IDataItem::m_writeStmt, and NULL.
00013 { 00014 m_env = NULL; 00015 m_conn = NULL; 00016 m_writeStmt = NULL; 00017 m_readStmt = NULL; 00018 00019 m_apdOverPNAMean = 0; 00020 m_apdOverPNARMS = 0; 00021 m_apdOverPNBMean = 0; 00022 m_apdOverPNMean = 0; 00023 m_apdOverPNRMS = 0; 00024 }
LMFLaserIRedNormDat::~LMFLaserIRedNormDat | ( | ) |
void LMFLaserIRedNormDat::fetchData | ( | std::map< EcalLogicID, LMFLaserIRedNormDat > * | fillVec, | |
LMFRunIOV * | iov | |||
) | throw (std::runtime_error) [private] |
Definition at line 84 of file LMFLaserIRedNormDat.cc.
References IDBObject::checkConnection(), e, IDBObject::m_conn, IDBObject::m_env, IDataItem::m_readStmt, p, setAPDOverPNAMean(), setAPDOverPNARMS(), setAPDOverPNBMean(), setAPDOverPNBRMS(), setAPDOverPNMean(), and setAPDOverPNRMS().
00086 { 00087 this->checkConnection(); 00088 fillMap->clear(); 00089 00090 iov->setConnection(m_env, m_conn); 00091 int iovID = iov->fetchID(); 00092 if (!iovID) { 00093 // throw(runtime_error("LMFLaserIRedNormDat::writeDB: IOV not in DB")); 00094 return; 00095 } 00096 00097 try { 00098 00099 m_readStmt->setSQL("SELECT cv.name, cv.logic_id, cv.id1, cv.id2, cv.id3, cv.maps_to, " 00100 "d.apd_over_pnA_mean, d.apd_over_pnA_rms, d.apd_over_pnB_mean, d.apd_over_pnB_rms, d.apd_over_pn_mean, d.apd_over_pn_rms " 00101 "FROM channelview cv JOIN lmf_laser_ired_norm_dat d " 00102 "ON cv.logic_id = d.logic_id AND cv.name = cv.maps_to " 00103 "WHERE d.iov_id = :iov_id"); 00104 m_readStmt->setInt(1, iovID); 00105 ResultSet* rset = m_readStmt->executeQuery(); 00106 00107 std::pair< EcalLogicID, LMFLaserIRedNormDat > p; 00108 LMFLaserIRedNormDat dat; 00109 while(rset->next()) { 00110 p.first = EcalLogicID( rset->getString(1), // name 00111 rset->getInt(2), // logic_id 00112 rset->getInt(3), // id1 00113 rset->getInt(4), // id2 00114 rset->getInt(5), // id3 00115 rset->getString(6)); // maps_to 00116 00117 dat.setAPDOverPNAMean( rset->getFloat(7) ); 00118 dat.setAPDOverPNARMS( rset->getFloat(8) ); 00119 dat.setAPDOverPNBMean( rset->getFloat(9) ); 00120 dat.setAPDOverPNBRMS( rset->getFloat(10) ); 00121 dat.setAPDOverPNMean( rset->getFloat(11) ); 00122 dat.setAPDOverPNRMS( rset->getFloat(12) ); 00123 00124 00125 p.second = dat; 00126 fillMap->insert(p); 00127 } 00128 00129 } catch (SQLException &e) { 00130 throw(runtime_error("LMFLaserIRedNormDat::fetchData(): "+e.getMessage())); 00131 } 00132 }
float LMFLaserIRedNormDat::getAPDOverPNAMean | ( | ) | const [inline] |
Definition at line 22 of file LMFLaserIRedNormDat.h.
References m_apdOverPNAMean.
00022 { return m_apdOverPNAMean; }
float LMFLaserIRedNormDat::getAPDOverPNARMS | ( | ) | const [inline] |
Definition at line 25 of file LMFLaserIRedNormDat.h.
References m_apdOverPNARMS.
00025 { return m_apdOverPNARMS; }
float LMFLaserIRedNormDat::getAPDOverPNBMean | ( | ) | const [inline] |
Definition at line 28 of file LMFLaserIRedNormDat.h.
References m_apdOverPNBMean.
00028 { return m_apdOverPNBMean; }
float LMFLaserIRedNormDat::getAPDOverPNBRMS | ( | ) | const [inline] |
Definition at line 31 of file LMFLaserIRedNormDat.h.
References m_apdOverPNBRMS.
00031 { return m_apdOverPNBRMS; }
float LMFLaserIRedNormDat::getAPDOverPNMean | ( | ) | const [inline] |
Definition at line 34 of file LMFLaserIRedNormDat.h.
References m_apdOverPNMean.
00034 { return m_apdOverPNMean; }
float LMFLaserIRedNormDat::getAPDOverPNRMS | ( | ) | const [inline] |
Definition at line 37 of file LMFLaserIRedNormDat.h.
References m_apdOverPNRMS.
00037 { return m_apdOverPNRMS; }
std::string LMFLaserIRedNormDat::getTable | ( | ) | [inline, virtual] |
void LMFLaserIRedNormDat::prepareWrite | ( | ) | throw (std::runtime_error) [private, virtual] |
Implements IDataItem.
Definition at line 34 of file LMFLaserIRedNormDat.cc.
References IDBObject::checkConnection(), e, IDBObject::m_conn, and IDataItem::m_writeStmt.
00036 { 00037 this->checkConnection(); 00038 00039 try { 00040 m_writeStmt = m_conn->createStatement(); 00041 m_writeStmt->setSQL("INSERT INTO lmf_laser_ired_norm_dat (iov_id, logic_id, " 00042 "apd_over_pnA_mean, apd_over_pnA_rms, apd_over_pnB_mean, apd_over_pnB_rms, apd_over_pn_mean, apd_over_pn_rms) " 00043 "VALUES (:iov_id, :logic_id, " 00044 ":3, :4, :5, :6, :7, :8)"); 00045 } catch (SQLException &e) { 00046 throw(runtime_error("LMFLaserIRedNormDat::prepareWrite(): "+e.getMessage())); 00047 } 00048 }
void LMFLaserIRedNormDat::setAPDOverPNAMean | ( | float | mean | ) | [inline] |
Definition at line 21 of file LMFLaserIRedNormDat.h.
References m_apdOverPNAMean.
Referenced by fetchData().
00021 { m_apdOverPNAMean = mean; }
void LMFLaserIRedNormDat::setAPDOverPNARMS | ( | float | RMS | ) | [inline] |
Definition at line 24 of file LMFLaserIRedNormDat.h.
References m_apdOverPNARMS.
Referenced by fetchData().
00024 { m_apdOverPNARMS = RMS; }
void LMFLaserIRedNormDat::setAPDOverPNBMean | ( | float | mean | ) | [inline] |
Definition at line 27 of file LMFLaserIRedNormDat.h.
References m_apdOverPNBMean.
Referenced by fetchData().
00027 { m_apdOverPNBMean = mean; }
void LMFLaserIRedNormDat::setAPDOverPNBRMS | ( | float | RMS | ) | [inline] |
Definition at line 30 of file LMFLaserIRedNormDat.h.
References m_apdOverPNBRMS.
Referenced by fetchData().
00030 { m_apdOverPNBRMS = RMS; }
void LMFLaserIRedNormDat::setAPDOverPNMean | ( | float | mean | ) | [inline] |
Definition at line 33 of file LMFLaserIRedNormDat.h.
References m_apdOverPNMean.
Referenced by fetchData().
00033 { m_apdOverPNMean = mean; }
void LMFLaserIRedNormDat::setAPDOverPNRMS | ( | float | RMS | ) | [inline] |
Definition at line 36 of file LMFLaserIRedNormDat.h.
References m_apdOverPNRMS.
Referenced by fetchData().
00036 { m_apdOverPNRMS = RMS; }
void LMFLaserIRedNormDat::writeDB | ( | const EcalLogicID * | ecid, | |
const LMFLaserIRedNormDat * | item, | |||
LMFRunIOV * | iov | |||
) | throw (std::runtime_error) [private] |
Definition at line 52 of file LMFLaserIRedNormDat.cc.
References IDBObject::checkConnection(), IDataItem::checkPrepare(), e, and IDataItem::m_writeStmt.
00054 { 00055 this->checkConnection(); 00056 this->checkPrepare(); 00057 00058 int iovID = iov->fetchID(); 00059 if (!iovID) { throw(runtime_error("LMFLaserIRedNormDat::writeDB: IOV not in DB")); } 00060 00061 int logicID = ecid->getLogicID(); 00062 if (!logicID) { throw(runtime_error("LMFLaserIRedNormDat::writeDB: Bad EcalLogicID")); } 00063 00064 try { 00065 m_writeStmt->setInt(1, iovID); 00066 m_writeStmt->setInt(2, logicID); 00067 00068 m_writeStmt->setFloat(3, item->getAPDOverPNAMean() ); 00069 m_writeStmt->setFloat(4, item->getAPDOverPNARMS() ); 00070 m_writeStmt->setFloat(5, item->getAPDOverPNBMean() ); 00071 m_writeStmt->setFloat(6, item->getAPDOverPNBRMS() ); 00072 m_writeStmt->setFloat(7, item->getAPDOverPNMean() ); 00073 m_writeStmt->setFloat(8, item->getAPDOverPNRMS() ); 00074 00075 00076 m_writeStmt->executeUpdate(); 00077 } catch (SQLException &e) { 00078 throw(runtime_error("LMFLaserIRedNormDat::writeDB(): "+e.getMessage())); 00079 } 00080 }
friend class EcalCondDBInterface [friend] |
float LMFLaserIRedNormDat::m_apdOverPNAMean [private] |
Definition at line 51 of file LMFLaserIRedNormDat.h.
Referenced by getAPDOverPNAMean(), LMFLaserIRedNormDat(), and setAPDOverPNAMean().
float LMFLaserIRedNormDat::m_apdOverPNARMS [private] |
Definition at line 52 of file LMFLaserIRedNormDat.h.
Referenced by getAPDOverPNARMS(), LMFLaserIRedNormDat(), and setAPDOverPNARMS().
float LMFLaserIRedNormDat::m_apdOverPNBMean [private] |
Definition at line 53 of file LMFLaserIRedNormDat.h.
Referenced by getAPDOverPNBMean(), LMFLaserIRedNormDat(), and setAPDOverPNBMean().
float LMFLaserIRedNormDat::m_apdOverPNBRMS [private] |
Definition at line 54 of file LMFLaserIRedNormDat.h.
Referenced by getAPDOverPNBRMS(), and setAPDOverPNBRMS().
float LMFLaserIRedNormDat::m_apdOverPNMean [private] |
Definition at line 55 of file LMFLaserIRedNormDat.h.
Referenced by getAPDOverPNMean(), LMFLaserIRedNormDat(), and setAPDOverPNMean().
float LMFLaserIRedNormDat::m_apdOverPNRMS [private] |
Definition at line 56 of file LMFLaserIRedNormDat.h.
Referenced by getAPDOverPNRMS(), LMFLaserIRedNormDat(), and setAPDOverPNRMS().