CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes | Friends

RunPTMTempDat Class Reference

#include <RunPTMTempDat.h>

Inheritance diagram for RunPTMTempDat:
IDataItem IDBObject

List of all members.

Public Member Functions

std::string getTable ()
float getTemperature () const
 RunPTMTempDat ()
void setTemperature (float t)
 ~RunPTMTempDat ()

Private Member Functions

void fetchData (std::map< EcalLogicID, RunPTMTempDat > *fillMap, RunIOV *iov) throw (std::runtime_error)
void prepareWrite () throw (std::runtime_error)
void writeDB (const EcalLogicID *ecid, const RunPTMTempDat *item, RunIOV *iov) throw (std::runtime_error)

Private Attributes

float m_temperature

Friends

class EcalCondDBInterface

Detailed Description

Definition at line 11 of file RunPTMTempDat.h.


Constructor & Destructor Documentation

RunPTMTempDat::RunPTMTempDat ( )

Definition at line 11 of file RunPTMTempDat.cc.

References NULL.

RunPTMTempDat::~RunPTMTempDat ( )

Definition at line 23 of file RunPTMTempDat.cc.

{
}

Member Function Documentation

void RunPTMTempDat::fetchData ( std::map< EcalLogicID, RunPTMTempDat > *  fillMap,
RunIOV iov 
) throw (std::runtime_error) [private]
std::string RunPTMTempDat::getTable ( ) [inline, virtual]

Implements IDataItem.

Definition at line 18 of file RunPTMTempDat.h.

{ return "RUN_PTM_TEMP_DAT"; }
float RunPTMTempDat::getTemperature ( ) const [inline]

Definition at line 20 of file RunPTMTempDat.h.

References m_temperature.

{ return m_temperature; }
void RunPTMTempDat::prepareWrite ( ) throw (std::runtime_error) [private, virtual]

Implements IDataItem.

Definition at line 29 of file RunPTMTempDat.cc.

{
  this->checkConnection();

  try {
    m_writeStmt = m_conn->createStatement();
    m_writeStmt->setSQL("INSERT INTO run_temperature_ptm_dat (iov_id, logic_id, "
                        "temperature) "
                        "VALUES (:iov_id, :logic_id, "
                        ":temperature)");
  } catch (SQLException &e) {
    throw(std::runtime_error("RunPTMTempDat::prepareWrite():  "+e.getMessage()));
  }
}
void RunPTMTempDat::setTemperature ( float  t) [inline]

Definition at line 19 of file RunPTMTempDat.h.

References m_temperature, and matplotRender::t.

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

Definition at line 47 of file RunPTMTempDat.cc.

References o2o::iov.

{
  this->checkConnection();
  this->checkPrepare();

  int iovID = iov->fetchID();
  if (!iovID) { throw(std::runtime_error("RunPTMTempDat::writeDB:  IOV not in DB")); }

  int logicID = ecid->getLogicID();
  if (!logicID) { throw(std::runtime_error("RunPTMTempDat::writeDB:  Bad EcalLogicID")); }
  
  try {
    m_writeStmt->setInt(1, iovID);
    m_writeStmt->setInt(2, logicID);
    m_writeStmt->setFloat(3, item->getTemperature());

    m_writeStmt->executeUpdate();
  } catch (SQLException &e) {
    throw(std::runtime_error("RunPTMTempDat::writeDB():  "+e.getMessage()));
  }
}

Friends And Related Function Documentation

friend class EcalCondDBInterface [friend]

Reimplemented from IDBObject.

Definition at line 13 of file RunPTMTempDat.h.


Member Data Documentation

Definition at line 33 of file RunPTMTempDat.h.

Referenced by getTemperature(), and setTemperature().