CMS 3D CMS Logo

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

RunCrystalErrorsDat Class Reference

#include <RunCrystalErrorsDat.h>

Inheritance diagram for RunCrystalErrorsDat:
IDataItem IDBObject

List of all members.

Public Member Functions

uint64_t getErrorBits () const
std::string getTable ()
 RunCrystalErrorsDat ()
void setErrorBits (uint64_t bits)
 ~RunCrystalErrorsDat ()

Private Member Functions

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

Private Attributes

uint64_t m_errorBits

Friends

class EcalCondDBInterface

Detailed Description

Definition at line 12 of file RunCrystalErrorsDat.h.


Constructor & Destructor Documentation

RunCrystalErrorsDat::RunCrystalErrorsDat ( )

Definition at line 12 of file RunCrystalErrorsDat.cc.

References NULL.

RunCrystalErrorsDat::~RunCrystalErrorsDat ( )

Definition at line 22 of file RunCrystalErrorsDat.cc.

{
}

Member Function Documentation

void RunCrystalErrorsDat::fetchData ( std::map< EcalLogicID, RunCrystalErrorsDat > *  fillMap,
RunIOV iov 
) throw (std::runtime_error) [private]
uint64_t RunCrystalErrorsDat::getErrorBits ( ) const [inline]

Definition at line 22 of file RunCrystalErrorsDat.h.

References m_errorBits.

{ return m_errorBits; }
std::string RunCrystalErrorsDat::getTable ( ) [inline, virtual]

Implements IDataItem.

Definition at line 19 of file RunCrystalErrorsDat.h.

{ return "RUN_CRYSTAL_ERRORS_DAT"; }
void RunCrystalErrorsDat::prepareWrite ( ) throw (std::runtime_error) [private, virtual]

Implements IDataItem.

Definition at line 28 of file RunCrystalErrorsDat.cc.

References ExpressReco_HICollisions_FallBack::e.

{
  this->checkConnection();

  try {
    m_writeStmt = m_conn->createStatement();
    /* Using TO_NUMBER because OCCI does not support 64-bit integers well */
    m_writeStmt->setSQL("INSERT INTO run_crystal_errors_dat (iov_id, logic_id, "
                        "error_bits) "
                        "VALUES (:iov_id, :logic_id, "
                        "to_number(:error_bits))");
  } catch (SQLException &e) {
    throw(std::runtime_error("RunCrystalErrorsDat::prepareWrite():  "+e.getMessage()));
  }
}
void RunCrystalErrorsDat::setErrorBits ( uint64_t  bits) [inline]

Definition at line 21 of file RunCrystalErrorsDat.h.

References bits, and m_errorBits.

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

Definition at line 47 of file RunCrystalErrorsDat.cc.

References ExpressReco_HICollisions_FallBack::e, and o2o::iov.

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

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

  int logicID = ecid->getLogicID();
  if (!logicID) { throw(std::runtime_error("RunCrystalErrorsDat::writeDB:  Bad EcalLogicID")); }
  
  try {
    m_writeStmt->setInt(1, iovID);
    m_writeStmt->setInt(2, logicID);
    m_writeStmt->setString(3, ( boost::lexical_cast<std::string>(item->getErrorBits()) ).c_str());
    m_writeStmt->executeUpdate();
  } catch (SQLException &e) {
    throw(std::runtime_error("RunCrystalErrorsDat::writeDB():  "+e.getMessage()));
  }
}

Friends And Related Function Documentation

friend class EcalCondDBInterface [friend]

Reimplemented from IDBObject.

Definition at line 14 of file RunCrystalErrorsDat.h.


Member Data Documentation

Definition at line 35 of file RunCrystalErrorsDat.h.

Referenced by getErrorBits(), and setErrorBits().