CMS 3D CMS Logo

LMFLaserIRedCorDat Class Reference

#include <OnlineDB/EcalCondDB/interface/LMFLaserIRedCorDat.h>

Inheritance diagram for LMFLaserIRedCorDat:

IDataItem IDBObject

List of all members.

Public Member Functions

float getAPDOverPNAMean () const
float getAPDOverPNARMS () const
float getAPDOverPNBMean () const
float getAPDOverPNBRMS () const
float getAPDOverPNMean () const
float getAPDOverPNRMS () const
std::string getTable ()
 LMFLaserIRedCorDat ()
void setAPDOverPNAMean (float mean)
void setAPDOverPNARMS (float RMS)
void setAPDOverPNBMean (float mean)
void setAPDOverPNBRMS (float RMS)
void setAPDOverPNMean (float mean)
void setAPDOverPNRMS (float RMS)
 ~LMFLaserIRedCorDat ()

Private Member Functions

void fetchData (std::map< EcalLogicID, LMFLaserIRedCorDat > *fillVec, LMFRunIOV *iov) throw (std::runtime_error)
void prepareWrite () throw (std::runtime_error)
void writeDB (const EcalLogicID *ecid, const LMFLaserIRedCorDat *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


Detailed Description

Definition at line 12 of file LMFLaserIRedCorDat.h.


Constructor & Destructor Documentation

LMFLaserIRedCorDat::LMFLaserIRedCorDat (  ) 

Definition at line 12 of file LMFLaserIRedCorDat.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 }

LMFLaserIRedCorDat::~LMFLaserIRedCorDat (  ) 

Definition at line 28 of file LMFLaserIRedCorDat.cc.

00029 {
00030 }


Member Function Documentation

void LMFLaserIRedCorDat::fetchData ( std::map< EcalLogicID, LMFLaserIRedCorDat > *  fillVec,
LMFRunIOV iov 
) throw (std::runtime_error) [private]

Definition at line 84 of file LMFLaserIRedCorDat.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("LMFLaserIRedCorDat::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_cor_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, LMFLaserIRedCorDat > p;
00108     LMFLaserIRedCorDat 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("LMFLaserIRedCorDat::fetchData():  "+e.getMessage()));
00131   }
00132 }

float LMFLaserIRedCorDat::getAPDOverPNAMean (  )  const [inline]

Definition at line 21 of file LMFLaserIRedCorDat.h.

References m_apdOverPNAMean.

00021 { return m_apdOverPNAMean; }

float LMFLaserIRedCorDat::getAPDOverPNARMS (  )  const [inline]

Definition at line 24 of file LMFLaserIRedCorDat.h.

References m_apdOverPNARMS.

00024 { return m_apdOverPNARMS; }

float LMFLaserIRedCorDat::getAPDOverPNBMean (  )  const [inline]

Definition at line 27 of file LMFLaserIRedCorDat.h.

References m_apdOverPNBMean.

00027 { return m_apdOverPNBMean; }

float LMFLaserIRedCorDat::getAPDOverPNBRMS (  )  const [inline]

Definition at line 30 of file LMFLaserIRedCorDat.h.

References m_apdOverPNBRMS.

00030 { return m_apdOverPNBRMS; }

float LMFLaserIRedCorDat::getAPDOverPNMean (  )  const [inline]

Definition at line 33 of file LMFLaserIRedCorDat.h.

References m_apdOverPNMean.

00033 { return m_apdOverPNMean; }

float LMFLaserIRedCorDat::getAPDOverPNRMS (  )  const [inline]

Definition at line 36 of file LMFLaserIRedCorDat.h.

References m_apdOverPNRMS.

00036 { return m_apdOverPNRMS; }

std::string LMFLaserIRedCorDat::getTable (  )  [inline, virtual]

Implements IDataItem.

Definition at line 19 of file LMFLaserIRedCorDat.h.

00019 { return "LMF_LASER_IRED_COR_DAT"; }

void LMFLaserIRedCorDat::prepareWrite (  )  throw (std::runtime_error) [private, virtual]

Implements IDataItem.

Definition at line 34 of file LMFLaserIRedCorDat.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_cor_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("LMFLaserIRedCorDat::prepareWrite():  "+e.getMessage()));
00047   }
00048 }

void LMFLaserIRedCorDat::setAPDOverPNAMean ( float  mean  )  [inline]

Definition at line 20 of file LMFLaserIRedCorDat.h.

References m_apdOverPNAMean.

Referenced by fetchData().

00020 { m_apdOverPNAMean = mean; }

void LMFLaserIRedCorDat::setAPDOverPNARMS ( float  RMS  )  [inline]

Definition at line 23 of file LMFLaserIRedCorDat.h.

References m_apdOverPNARMS.

Referenced by fetchData().

00023 { m_apdOverPNARMS = RMS; }

void LMFLaserIRedCorDat::setAPDOverPNBMean ( float  mean  )  [inline]

Definition at line 26 of file LMFLaserIRedCorDat.h.

References m_apdOverPNBMean.

Referenced by fetchData().

00026 { m_apdOverPNBMean = mean; }

void LMFLaserIRedCorDat::setAPDOverPNBRMS ( float  RMS  )  [inline]

Definition at line 29 of file LMFLaserIRedCorDat.h.

References m_apdOverPNBRMS.

Referenced by fetchData().

00029 { m_apdOverPNBRMS = RMS; }

void LMFLaserIRedCorDat::setAPDOverPNMean ( float  mean  )  [inline]

Definition at line 32 of file LMFLaserIRedCorDat.h.

References m_apdOverPNMean.

Referenced by fetchData().

00032 { m_apdOverPNMean = mean; }

void LMFLaserIRedCorDat::setAPDOverPNRMS ( float  RMS  )  [inline]

Definition at line 35 of file LMFLaserIRedCorDat.h.

References m_apdOverPNRMS.

Referenced by fetchData().

00035 { m_apdOverPNRMS = RMS; }

void LMFLaserIRedCorDat::writeDB ( const EcalLogicID ecid,
const LMFLaserIRedCorDat item,
LMFRunIOV iov 
) throw (std::runtime_error) [private]

Definition at line 52 of file LMFLaserIRedCorDat.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("LMFLaserIRedCorDat::writeDB:  IOV not in DB")); }
00060 
00061   int logicID = ecid->getLogicID();
00062   if (!logicID) { throw(runtime_error("LMFLaserIRedCorDat::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("LMFLaserIRedCorDat::writeDB():  "+e.getMessage()));
00079   }
00080 }


Friends And Related Function Documentation

friend class EcalCondDBInterface [friend]

Reimplemented from IDBObject.

Definition at line 14 of file LMFLaserIRedCorDat.h.


Member Data Documentation

float LMFLaserIRedCorDat::m_apdOverPNAMean [private]

Definition at line 50 of file LMFLaserIRedCorDat.h.

Referenced by getAPDOverPNAMean(), LMFLaserIRedCorDat(), and setAPDOverPNAMean().

float LMFLaserIRedCorDat::m_apdOverPNARMS [private]

Definition at line 51 of file LMFLaserIRedCorDat.h.

Referenced by getAPDOverPNARMS(), LMFLaserIRedCorDat(), and setAPDOverPNARMS().

float LMFLaserIRedCorDat::m_apdOverPNBMean [private]

Definition at line 52 of file LMFLaserIRedCorDat.h.

Referenced by getAPDOverPNBMean(), LMFLaserIRedCorDat(), and setAPDOverPNBMean().

float LMFLaserIRedCorDat::m_apdOverPNBRMS [private]

Definition at line 53 of file LMFLaserIRedCorDat.h.

Referenced by getAPDOverPNBRMS(), and setAPDOverPNBRMS().

float LMFLaserIRedCorDat::m_apdOverPNMean [private]

Definition at line 54 of file LMFLaserIRedCorDat.h.

Referenced by getAPDOverPNMean(), LMFLaserIRedCorDat(), and setAPDOverPNMean().

float LMFLaserIRedCorDat::m_apdOverPNRMS [private]

Definition at line 55 of file LMFLaserIRedCorDat.h.

Referenced by getAPDOverPNRMS(), LMFLaserIRedCorDat(), and setAPDOverPNRMS().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:27:47 2009 for CMSSW by  doxygen 1.5.4