CMS 3D CMS Logo

LMFRunDat Class Reference

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

Inheritance diagram for LMFRunDat:

IDataItem IDBObject

List of all members.

Public Member Functions

int getNumEvents () const
int getQualityFlag () const
std::string getTable ()
 LMFRunDat ()
void setNumEvents (int num)
void setQualityFlag (int x)
 ~LMFRunDat ()

Private Member Functions

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

Private Attributes

int m_numEvents
int m_status

Friends

class EcalCondDBInterface


Detailed Description

Definition at line 11 of file LMFRunDat.h.


Constructor & Destructor Documentation

LMFRunDat::LMFRunDat (  ) 

Definition at line 11 of file LMFRunDat.cc.

References IDBObject::m_conn, IDBObject::m_env, m_numEvents, IDataItem::m_readStmt, m_status, IDataItem::m_writeStmt, and NULL.

00012 {
00013   m_env = NULL;
00014   m_conn = NULL;
00015   m_writeStmt = NULL;
00016   m_readStmt = NULL;
00017   //
00018   m_numEvents = 0;
00019   m_status = 0;
00020 }

LMFRunDat::~LMFRunDat (  ) 

Definition at line 24 of file LMFRunDat.cc.

00025 {
00026 }


Member Function Documentation

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

int LMFRunDat::getNumEvents (  )  const [inline]

Definition at line 21 of file LMFRunDat.h.

References m_numEvents.

00021 { return m_numEvents; }

int LMFRunDat::getQualityFlag (  )  const [inline]

Definition at line 24 of file LMFRunDat.h.

References m_status.

00024 { return m_status; }

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

Implements IDataItem.

Definition at line 18 of file LMFRunDat.h.

00018 { return "LMF_RUN_DAT"; }

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

Implements IDataItem.

Definition at line 30 of file LMFRunDat.cc.

References IDBObject::checkConnection(), e, IDBObject::m_conn, and IDataItem::m_writeStmt.

00032 {
00033   this->checkConnection();
00034 
00035   try {
00036     m_writeStmt = m_conn->createStatement();
00037     m_writeStmt->setSQL("INSERT INTO lmf_run_dat (lmf_iov_id, logic_id, "
00038                         "nevents, quality_flag ) "
00039                         "VALUES (:lmf_iov_id, :logic_id, "
00040                         ":nevents, :quality_flag ) ");
00041   } catch (SQLException &e) {
00042     throw(runtime_error("LMFRunDat::prepareWrite():  "+e.getMessage()));
00043   }
00044 }

void LMFRunDat::setNumEvents ( int  num  )  [inline]

Definition at line 20 of file LMFRunDat.h.

References m_numEvents.

00020 { m_numEvents = num; }

void LMFRunDat::setQualityFlag ( int  x  )  [inline]

Definition at line 23 of file LMFRunDat.h.

References m_status.

00023 { m_status = x; }

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

Definition at line 48 of file LMFRunDat.cc.

References IDBObject::checkConnection(), IDataItem::checkPrepare(), e, and IDataItem::m_writeStmt.

00050 {
00051   this->checkConnection();
00052   this->checkPrepare();
00053 
00054   int iovID = iov->fetchID();
00055   if (!iovID) { throw(runtime_error("LMFRunDat::writeDB:  IOV not in DB")); }
00056 
00057   int logicID = ecid->getLogicID();
00058   if (!logicID) { throw(runtime_error("LMFRunDat::writeDB:  Bad EcalLogicID")); }
00059   
00060   try {
00061     m_writeStmt->setInt(1, iovID);
00062     m_writeStmt->setInt(2, logicID);
00063     m_writeStmt->setInt(3, item->getNumEvents());
00064     m_writeStmt->setInt(4, item->getQualityFlag());
00065 
00066     m_writeStmt->executeUpdate();
00067   } catch (SQLException &e) {
00068     throw(runtime_error("LMFRunDat::writeDB():  "+e.getMessage()));
00069   }
00070 }


Friends And Related Function Documentation

friend class EcalCondDBInterface [friend]

Reimplemented from IDBObject.

Definition at line 13 of file LMFRunDat.h.


Member Data Documentation

int LMFRunDat::m_numEvents [private]

Definition at line 37 of file LMFRunDat.h.

Referenced by getNumEvents(), LMFRunDat(), and setNumEvents().

int LMFRunDat::m_status [private]

Definition at line 38 of file LMFRunDat.h.

Referenced by getQualityFlag(), LMFRunDat(), and setQualityFlag().


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