CMS 3D CMS Logo

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

RunH4TablePositionDat Class Reference

#include <RunH4TablePositionDat.h>

Inheritance diagram for RunH4TablePositionDat:
IDataItem IDBObject

List of all members.

Public Member Functions

int getNumEvents () const
int getNumSpills () const
std::string getTable ()
int getTableX () const
int getTableY () const
 RunH4TablePositionDat ()
void setNumEvents (int num)
void setNumSpills (int num)
void setTableX (int num)
void setTableY (int num)
 ~RunH4TablePositionDat ()

Private Member Functions

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

Private Attributes

int m_numEvents
int m_numSpills
int m_table_x
int m_table_y

Friends

class EcalCondDBInterface

Detailed Description

Definition at line 11 of file RunH4TablePositionDat.h.


Constructor & Destructor Documentation

RunH4TablePositionDat::RunH4TablePositionDat ( )

Definition at line 11 of file RunH4TablePositionDat.cc.

References NULL.

RunH4TablePositionDat::~RunH4TablePositionDat ( )

Definition at line 26 of file RunH4TablePositionDat.cc.

{
}

Member Function Documentation

void RunH4TablePositionDat::fetchData ( std::map< EcalLogicID, RunH4TablePositionDat > *  fillMap,
RunIOV iov 
) throw (std::runtime_error) [private]
int RunH4TablePositionDat::getNumEvents ( ) const [inline]

Definition at line 30 of file RunH4TablePositionDat.h.

References m_numEvents.

{ return m_numEvents; }
int RunH4TablePositionDat::getNumSpills ( ) const [inline]

Definition at line 27 of file RunH4TablePositionDat.h.

References m_numSpills.

{ return m_numSpills; }
std::string RunH4TablePositionDat::getTable ( ) [inline, virtual]

Implements IDataItem.

Definition at line 18 of file RunH4TablePositionDat.h.

{ return "RUN_H4_TABLE_POSITION_DAT"; }
int RunH4TablePositionDat::getTableX ( ) const [inline]

Definition at line 21 of file RunH4TablePositionDat.h.

References m_table_x.

{ return m_table_x; }
int RunH4TablePositionDat::getTableY ( ) const [inline]

Definition at line 24 of file RunH4TablePositionDat.h.

References m_table_y.

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

Implements IDataItem.

Definition at line 32 of file RunH4TablePositionDat.cc.

References ExpressReco_HICollisions_FallBack::e.

{
  this->checkConnection();

  try {
    m_writeStmt = m_conn->createStatement();
    m_writeStmt->setSQL("INSERT INTO run_h4_table_position_dat (iov_id, logic_id, "
                        "table_x, table_y, number_of_spills, number_of_events ) "
                        "VALUES (:iov_id, :logic_id, "
                        ":table_x, :table_y, :number_of_spills, :number_of_events)");
  } catch (SQLException &e) {
    throw(std::runtime_error("RunH4TablePositionDat::prepareWrite():  "+e.getMessage()));
  }
}
void RunH4TablePositionDat::setNumEvents ( int  num) [inline]

Definition at line 29 of file RunH4TablePositionDat.h.

References m_numEvents.

void RunH4TablePositionDat::setNumSpills ( int  num) [inline]

Definition at line 26 of file RunH4TablePositionDat.h.

References m_numSpills.

void RunH4TablePositionDat::setTableX ( int  num) [inline]

Definition at line 20 of file RunH4TablePositionDat.h.

References m_table_x.

{ m_table_x = num; }
void RunH4TablePositionDat::setTableY ( int  num) [inline]

Definition at line 23 of file RunH4TablePositionDat.h.

References m_table_y.

{ m_table_y = num; }
void RunH4TablePositionDat::writeDB ( const EcalLogicID ecid,
const RunH4TablePositionDat item,
RunIOV iov 
) throw (std::runtime_error) [private]

Definition at line 50 of file RunH4TablePositionDat.cc.

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

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

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

  int logicID = ecid->getLogicID();
  if (!logicID) { throw(std::runtime_error("RunH4TablePositionDat::writeDB:  Bad EcalLogicID")); }
  
  try {
    m_writeStmt->setInt(1, iovID);
    m_writeStmt->setInt(2, logicID);
    m_writeStmt->setInt(3, item->getTableX());
    m_writeStmt->setInt(4, item->getTableY());
    m_writeStmt->setInt(5, item->getNumSpills());
    m_writeStmt->setInt(6, item->getNumEvents());

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

Friends And Related Function Documentation

friend class EcalCondDBInterface [friend]

Reimplemented from IDBObject.

Definition at line 13 of file RunH4TablePositionDat.h.


Member Data Documentation

Definition at line 46 of file RunH4TablePositionDat.h.

Referenced by getNumEvents(), and setNumEvents().

Definition at line 45 of file RunH4TablePositionDat.h.

Referenced by getNumSpills(), and setNumSpills().

Definition at line 43 of file RunH4TablePositionDat.h.

Referenced by getTableX(), and setTableX().

Definition at line 44 of file RunH4TablePositionDat.h.

Referenced by getTableY(), and setTableY().