CMS 3D CMS Logo

LMFLaserBluePulseDat Class Reference

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

Inheritance diagram for LMFLaserBluePulseDat:

IDataItem IDBObject

List of all members.

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


Detailed Description

Definition at line 12 of file LMFLaserBluePulseDat.h.


Constructor & Destructor Documentation

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 (  ) 

Definition at line 33 of file LMFLaserBluePulseDat.cc.

00034 {
00035 }


Member Function Documentation

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]

Definition at line 21 of file LMFLaserBluePulseDat.h.

References m_ampl.

00021 { return m_ampl; }

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]

Definition at line 29 of file LMFLaserBluePulseDat.h.

References m_fw20.

00029 { return m_fw20; }

float LMFLaserBluePulseDat::getFW80 (  )  const [inline]

Definition at line 31 of file LMFLaserBluePulseDat.h.

References m_fw80.

00031 { return m_fw80; }

float LMFLaserBluePulseDat::getFWHM (  )  const [inline]

Definition at line 27 of file LMFLaserBluePulseDat.h.

References m_fwhm.

00027 { return m_fwhm; }

float LMFLaserBluePulseDat::getRise (  )  const [inline]

Definition at line 25 of file LMFLaserBluePulseDat.h.

References m_rise.

00025 { return m_rise; }

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]

Implements IDataItem.

Definition at line 19 of file LMFLaserBluePulseDat.h.

00019 { return "LMF_LASER_BLUE_PULSE_DAT"; }

float LMFLaserBluePulseDat::getTime ( void   )  const [inline]

Definition at line 23 of file LMFLaserBluePulseDat.h.

References m_time.

00023 { return m_time; }

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 20 of file LMFLaserBluePulseDat.h.

References m_ampl.

Referenced by fetchData().

00020 { m_ampl = x; }

void LMFLaserBluePulseDat::setFitMethod ( int  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]

Definition at line 28 of file LMFLaserBluePulseDat.h.

References m_fw20.

Referenced by fetchData().

00028 { m_fw20 = x; }

void LMFLaserBluePulseDat::setFW80 ( float  x  )  [inline]

Definition at line 30 of file LMFLaserBluePulseDat.h.

References m_fw80.

Referenced by fetchData().

00030 { m_fw80 = x; }

void LMFLaserBluePulseDat::setFWHM ( float  x  )  [inline]

Definition at line 26 of file LMFLaserBluePulseDat.h.

References m_fwhm.

Referenced by fetchData().

00026 { m_fwhm = x; }

void LMFLaserBluePulseDat::setRise ( float  x  )  [inline]

Definition at line 24 of file LMFLaserBluePulseDat.h.

References m_rise.

Referenced by fetchData().

00024 { m_rise = x; }

void LMFLaserBluePulseDat::setSliding ( float  x  )  [inline]

Definition at line 32 of file LMFLaserBluePulseDat.h.

References m_sliding.

Referenced by fetchData().

00032 { m_sliding = x; }

void LMFLaserBluePulseDat::setTime ( float  x  )  [inline]

Definition at line 22 of file LMFLaserBluePulseDat.h.

References m_time.

Referenced by fetchData().

00022 { m_time = x; }

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 }


Friends And Related Function Documentation

friend class EcalCondDBInterface [friend]

Reimplemented from IDBObject.

Definition at line 14 of file LMFLaserBluePulseDat.h.


Member Data Documentation

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().


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