#include <OnlineDB/EcalCondDB/interface/LMFLaserBluePulseDat.h>
Public Member Functions | |
float | getAmplitude () const |
int | getFitMethod () const |
float | getFW20 () const |
float | getFW80 () const |
float | getFWHM () const |
float | getRise () const |
float | getSliding () const |
std::string | getTable () |
float | getTime () const |
LMFLaserBluePulseDat () | |
void | setAmplitude (float x) |
void | setFitMethod (int x) |
void | setFW20 (float x) |
void | setFW80 (float x) |
void | setFWHM (float x) |
void | setRise (float x) |
void | setSliding (float x) |
void | setTime (float x) |
~LMFLaserBluePulseDat () | |
Private Member Functions | |
void | fetchData (std::map< EcalLogicID, LMFLaserBluePulseDat > *fillVec, LMFRunIOV *iov) throw (std::runtime_error) |
void | prepareWrite () throw (std::runtime_error) |
void | writeDB (const EcalLogicID *ecid, const LMFLaserBluePulseDat *item, LMFRunIOV *iov) throw (std::runtime_error) |
Private Attributes | |
float | m_ampl |
int | m_fit_method |
float | m_fw20 |
float | m_fw80 |
float | m_fwhm |
float | m_rise |
float | m_sliding |
float | m_time |
Friends | |
class | EcalCondDBInterface |
Definition at line 12 of file LMFLaserBluePulseDat.h.
LMFLaserBluePulseDat::LMFLaserBluePulseDat | ( | ) |
Definition at line 12 of file LMFLaserBluePulseDat.cc.
References m_ampl, IDBObject::m_conn, IDBObject::m_env, m_fit_method, m_fw20, m_fw80, m_fwhm, IDataItem::m_readStmt, m_rise, m_sliding, m_time, 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_fit_method=""; 00020 m_fit_method = 0; 00021 m_ampl = 0; 00022 m_time = 0; 00023 m_rise = 0; 00024 m_fwhm = 0; 00025 m_fw20 = 0; 00026 m_fw80 = 0; 00027 m_sliding = 0; 00028 00029 }
LMFLaserBluePulseDat::~LMFLaserBluePulseDat | ( | ) |
void LMFLaserBluePulseDat::fetchData | ( | std::map< EcalLogicID, LMFLaserBluePulseDat > * | fillVec, | |
LMFRunIOV * | iov | |||
) | throw (std::runtime_error) [private] |
Definition at line 91 of file LMFLaserBluePulseDat.cc.
References IDBObject::checkConnection(), e, IDBObject::m_conn, IDBObject::m_env, IDataItem::m_readStmt, p, setAmplitude(), setFitMethod(), setFW20(), setFW80(), setFWHM(), setRise(), setSliding(), and setTime().
00093 { 00094 this->checkConnection(); 00095 fillMap->clear(); 00096 00097 iov->setConnection(m_env, m_conn); 00098 int iovID = iov->fetchID(); 00099 if (!iovID) { 00100 // throw(runtime_error("LMFLaserBluePulseDat::writeDB: IOV not in DB")); 00101 return; 00102 } 00103 00104 try { 00105 00106 m_readStmt->setSQL("SELECT cv.name, cv.logic_id, cv.id1, cv.id2, cv.id3, cv.maps_to, " 00107 "d.fit_method, d.mtq_ampl, d.mtq_time, d.mtq_rise, " 00108 "d.mtq_fwhm, d.mtq_fw20, d.mtq_fw80, d.mtq_sliding " 00109 "FROM channelview cv JOIN lmf_matacq_blue_dat d " 00110 "ON cv.logic_id = d.logic_id AND cv.name = cv.maps_to " 00111 "WHERE d.lmf_iov_id = :lmf_iov_id"); 00112 m_readStmt->setInt(1, iovID); 00113 ResultSet* rset = m_readStmt->executeQuery(); 00114 00115 std::pair< EcalLogicID, LMFLaserBluePulseDat > p; 00116 LMFLaserBluePulseDat dat; 00117 while(rset->next()) { 00118 p.first = EcalLogicID( rset->getString(1), // name 00119 rset->getInt(2), // logic_id 00120 rset->getInt(3), // id1 00121 rset->getInt(4), // id2 00122 rset->getInt(5), // id3 00123 rset->getString(6)); // maps_to 00124 00125 // dat.setFitMethod( rset->getString(7) ); 00126 dat.setFitMethod( rset->getInt(7) ); 00127 dat.setAmplitude( rset->getFloat(8) ); 00128 dat.setTime( rset->getFloat(9) ); 00129 dat.setRise( rset->getFloat(10) ); 00130 dat.setFWHM( rset->getFloat(11) ); 00131 dat.setFW20( rset->getFloat(12) ); 00132 dat.setFW80( rset->getFloat(13) ); 00133 dat.setSliding( rset->getFloat(14) ); 00134 00135 p.second = dat; 00136 fillMap->insert(p); 00137 } 00138 00139 } catch (SQLException &e) { 00140 throw(runtime_error("LMFLaserBluePulseDat::fetchData(): "+e.getMessage())); 00141 } 00142 }
float LMFLaserBluePulseDat::getAmplitude | ( | ) | const [inline] |
int LMFLaserBluePulseDat::getFitMethod | ( | ) | const [inline] |
Definition at line 38 of file LMFLaserBluePulseDat.h.
References m_fit_method.
00038 { return m_fit_method; }
float LMFLaserBluePulseDat::getFW20 | ( | ) | const [inline] |
float LMFLaserBluePulseDat::getFW80 | ( | ) | const [inline] |
float LMFLaserBluePulseDat::getFWHM | ( | ) | const [inline] |
float LMFLaserBluePulseDat::getRise | ( | ) | const [inline] |
float LMFLaserBluePulseDat::getSliding | ( | ) | const [inline] |
Definition at line 33 of file LMFLaserBluePulseDat.h.
References m_sliding.
00033 { return m_sliding; }
std::string LMFLaserBluePulseDat::getTable | ( | ) | [inline, virtual] |
float LMFLaserBluePulseDat::getTime | ( | void | ) | const [inline] |
void LMFLaserBluePulseDat::prepareWrite | ( | ) | throw (std::runtime_error) [private, virtual] |
Implements IDataItem.
Definition at line 39 of file LMFLaserBluePulseDat.cc.
References IDBObject::checkConnection(), e, IDBObject::m_conn, and IDataItem::m_writeStmt.
00041 { 00042 this->checkConnection(); 00043 00044 try { 00045 m_writeStmt = m_conn->createStatement(); 00046 m_writeStmt->setSQL("INSERT INTO lmf_laser_blue_pulse_dat (lmf_iov_id, logic_id, " 00047 "fit_method, mtq_ampl, mtq_time, mtq_rise, mtq_fwhm, mtq_fw20, mtq_fw80, mtq_sliding ) " 00048 "VALUES (:1, :2, " 00049 ":3, :4, :5, :6, :7, :8, :9, :10 )"); 00050 } catch (SQLException &e) { 00051 throw(runtime_error("LMFLaserBluePulseDat::prepareWrite(): "+e.getMessage())); 00052 } 00053 }
void LMFLaserBluePulseDat::setAmplitude | ( | float | x | ) | [inline] |
Definition at line 37 of file LMFLaserBluePulseDat.h.
References m_fit_method.
Referenced by fetchData().
00037 { m_fit_method = x; }
void LMFLaserBluePulseDat::setFW20 | ( | float | x | ) | [inline] |
void LMFLaserBluePulseDat::setFW80 | ( | float | x | ) | [inline] |
void LMFLaserBluePulseDat::setFWHM | ( | float | x | ) | [inline] |
void LMFLaserBluePulseDat::setRise | ( | float | x | ) | [inline] |
void LMFLaserBluePulseDat::setSliding | ( | float | x | ) | [inline] |
Definition at line 32 of file LMFLaserBluePulseDat.h.
References m_sliding.
Referenced by fetchData().
void LMFLaserBluePulseDat::setTime | ( | float | x | ) | [inline] |
void LMFLaserBluePulseDat::writeDB | ( | const EcalLogicID * | ecid, | |
const LMFLaserBluePulseDat * | item, | |||
LMFRunIOV * | iov | |||
) | throw (std::runtime_error) [private] |
Definition at line 57 of file LMFLaserBluePulseDat.cc.
References IDBObject::checkConnection(), IDataItem::checkPrepare(), e, and IDataItem::m_writeStmt.
00059 { 00060 this->checkConnection(); 00061 this->checkPrepare(); 00062 00063 int iovID = iov->fetchID(); 00064 if (!iovID) { throw(runtime_error("LMFLaserBluePulseDat::writeDB: IOV not in DB")); } 00065 00066 int logicID = ecid->getLogicID(); 00067 if (!logicID) { throw(runtime_error("LMFLaserBluePulseDat::writeDB: Bad EcalLogicID")); } 00068 00069 try { 00070 m_writeStmt->setInt(1, iovID); 00071 m_writeStmt->setInt(2, logicID); 00072 00073 // m_writeStmt->setString(3, item->getFitMethod() ); 00074 m_writeStmt->setInt(3, item->getFitMethod() ); 00075 m_writeStmt->setFloat(4, item->getAmplitude() ); 00076 m_writeStmt->setFloat(5, item->getTime() ); 00077 m_writeStmt->setFloat(6, item->getRise() ); 00078 m_writeStmt->setFloat(7, item->getFWHM() ); 00079 m_writeStmt->setFloat(8, item->getFW20() ); 00080 m_writeStmt->setFloat(9, item->getFW80() ); 00081 m_writeStmt->setFloat(10, item->getSliding() ); 00082 00083 m_writeStmt->executeUpdate(); 00084 } catch (SQLException &e) { 00085 throw(runtime_error("LMFLaserBluePulseDat::writeDB(): "+e.getMessage())); 00086 } 00087 }
friend class EcalCondDBInterface [friend] |
float LMFLaserBluePulseDat::m_ampl [private] |
Definition at line 53 of file LMFLaserBluePulseDat.h.
Referenced by getAmplitude(), LMFLaserBluePulseDat(), and setAmplitude().
int LMFLaserBluePulseDat::m_fit_method [private] |
Definition at line 52 of file LMFLaserBluePulseDat.h.
Referenced by getFitMethod(), LMFLaserBluePulseDat(), and setFitMethod().
float LMFLaserBluePulseDat::m_fw20 [private] |
Definition at line 57 of file LMFLaserBluePulseDat.h.
Referenced by getFW20(), LMFLaserBluePulseDat(), and setFW20().
float LMFLaserBluePulseDat::m_fw80 [private] |
Definition at line 58 of file LMFLaserBluePulseDat.h.
Referenced by getFW80(), LMFLaserBluePulseDat(), and setFW80().
float LMFLaserBluePulseDat::m_fwhm [private] |
Definition at line 56 of file LMFLaserBluePulseDat.h.
Referenced by getFWHM(), LMFLaserBluePulseDat(), and setFWHM().
float LMFLaserBluePulseDat::m_rise [private] |
Definition at line 55 of file LMFLaserBluePulseDat.h.
Referenced by getRise(), LMFLaserBluePulseDat(), and setRise().
float LMFLaserBluePulseDat::m_sliding [private] |
Definition at line 59 of file LMFLaserBluePulseDat.h.
Referenced by getSliding(), LMFLaserBluePulseDat(), and setSliding().
float LMFLaserBluePulseDat::m_time [private] |
Definition at line 54 of file LMFLaserBluePulseDat.h.
Referenced by getTime(), LMFLaserBluePulseDat(), and setTime().