#include <FEConfigTimingDat.h>
Public Member Functions | |
FEConfigTimingDat () | |
std::string | getTable () |
int | getTimingPar1 () const |
int | getTimingPar2 () const |
void | setTimingPar1 (int x) |
void | setTimingPar2 (int x) |
~FEConfigTimingDat () | |
Private Member Functions | |
void | fetchData (std::map< EcalLogicID, FEConfigTimingDat > *fillMap, FEConfigTimingInfo *iconf) throw (std::runtime_error) |
void | prepareWrite () throw (std::runtime_error) |
void | writeArrayDB (const std::map< EcalLogicID, FEConfigTimingDat > *data, FEConfigTimingInfo *iconf) throw (std::runtime_error) |
void | writeDB (const EcalLogicID *ecid, const FEConfigTimingDat *item, FEConfigTimingInfo *iconf) throw (std::runtime_error) |
Private Attributes | |
int | m_par1 |
int | m_par2 |
Friends | |
class | EcalCondDBInterface |
Definition at line 11 of file FEConfigTimingDat.h.
FEConfigTimingDat::FEConfigTimingDat | ( | ) |
Definition at line 11 of file FEConfigTimingDat.cc.
References NULL.
{ m_env = NULL; m_conn = NULL; m_writeStmt = NULL; m_readStmt = NULL; m_par1 = 0; m_par2 = 0; }
FEConfigTimingDat::~FEConfigTimingDat | ( | ) |
Definition at line 25 of file FEConfigTimingDat.cc.
{ }
void FEConfigTimingDat::fetchData | ( | std::map< EcalLogicID, FEConfigTimingDat > * | fillMap, |
FEConfigTimingInfo * | iconf | ||
) | throw (std::runtime_error) [private] |
std::string FEConfigTimingDat::getTable | ( | ) | [inline, virtual] |
Implements IDataItem.
Definition at line 18 of file FEConfigTimingDat.h.
{ return "FE_CONFIG_Time_DAT"; }
int FEConfigTimingDat::getTimingPar1 | ( | ) | const [inline] |
Definition at line 21 of file FEConfigTimingDat.h.
References m_par1.
Referenced by writeArrayDB().
{ return m_par1; }
int FEConfigTimingDat::getTimingPar2 | ( | ) | const [inline] |
Definition at line 23 of file FEConfigTimingDat.h.
References m_par2.
Referenced by writeArrayDB().
{ return m_par2; }
void FEConfigTimingDat::prepareWrite | ( | ) | throw (std::runtime_error) [private, virtual] |
Implements IDataItem.
Definition at line 31 of file FEConfigTimingDat.cc.
References ExpressReco_HICollisions_FallBack::e.
{ this->checkConnection(); try { m_writeStmt = m_conn->createStatement(); m_writeStmt->setSQL("INSERT INTO "+getTable()+" (tim_conf_id, logic_id, " "time_par1, time_par2 ) VALUES (:tim_conf_id, :logic_id, :time_par1, :time_par2 )" ); } catch (SQLException &e) { throw(std::runtime_error("FEConfigTimingDat::prepareWrite(): "+e.getMessage())); } }
void FEConfigTimingDat::setTimingPar1 | ( | int | x | ) | [inline] |
Definition at line 20 of file FEConfigTimingDat.h.
References m_par1, and ExpressReco_HICollisions_FallBack::x.
void FEConfigTimingDat::setTimingPar2 | ( | int | x | ) | [inline] |
Definition at line 22 of file FEConfigTimingDat.h.
References m_par2, and ExpressReco_HICollisions_FallBack::x.
void FEConfigTimingDat::writeArrayDB | ( | const std::map< EcalLogicID, FEConfigTimingDat > * | data, |
FEConfigTimingInfo * | iconf | ||
) | throw (std::runtime_error) [private] |
Definition at line 114 of file FEConfigTimingDat.cc.
References prof2calltree::count, runTheMatrix::data, EcalLogicID::getLogicID(), getTimingPar1(), getTimingPar2(), L1TEmulatorMonitor_cff::p, ExpressReco_HICollisions_FallBack::x, and ExpressReco_HICollisions_FallBack::y.
{ this->checkConnection(); this->checkPrepare(); int iconfID = iconf->fetchID(); if (!iconfID) { throw(std::runtime_error("FEConfigTimingDat::writeArrayDB: tim_conf_id not in DB")); } int nrows=data->size(); int* ids= new int[nrows]; int* iconfid_vec= new int[nrows]; int* xx= new int[nrows]; int* yy= new int[nrows]; ub2* ids_len= new ub2[nrows]; ub2* iconf_len= new ub2[nrows]; ub2* x_len= new ub2[nrows]; ub2* y_len= new ub2[nrows]; const EcalLogicID* channel; const FEConfigTimingDat* dataitem; int count=0; typedef map< EcalLogicID, FEConfigTimingDat >::const_iterator CI; for (CI p = data->begin(); p != data->end(); ++p) { channel = &(p->first); int logicID = channel->getLogicID(); if (!logicID) { throw(std::runtime_error("FEConfigTimingDat::writeArrayDB: Bad EcalLogicID")); } ids[count]=logicID; iconfid_vec[count]=iconfID; dataitem = &(p->second); // dataIface.writeDB( channel, dataitem, iconf); int x=dataitem->getTimingPar1(); int y=dataitem->getTimingPar2(); xx[count]=x; yy[count]=y; ids_len[count]=sizeof(ids[count]); iconf_len[count]=sizeof(iconfid_vec[count]); x_len[count]=sizeof(xx[count]); y_len[count]=sizeof(yy[count]); count++; } try { m_writeStmt->setDataBuffer(1, (dvoid*)iconfid_vec, OCCIINT, sizeof(iconfid_vec[0]),iconf_len); m_writeStmt->setDataBuffer(2, (dvoid*)ids, OCCIINT, sizeof(ids[0]), ids_len ); m_writeStmt->setDataBuffer(3, (dvoid*)xx, OCCIINT , sizeof(xx[0]), x_len ); m_writeStmt->setDataBuffer(4, (dvoid*)yy, OCCIINT , sizeof(yy[0]), y_len ); m_writeStmt->executeArrayUpdate(nrows); delete [] ids; delete [] iconfid_vec; delete [] xx; delete [] yy; delete [] ids_len; delete [] iconf_len; delete [] x_len; delete [] y_len; } catch (SQLException &e) { throw(std::runtime_error("FEConfigTimingDat::writeArrayDB(): "+e.getMessage())); } }
void FEConfigTimingDat::writeDB | ( | const EcalLogicID * | ecid, |
const FEConfigTimingDat * | item, | ||
FEConfigTimingInfo * | iconf | ||
) | throw (std::runtime_error) [private] |
Definition at line 46 of file FEConfigTimingDat.cc.
References ExpressReco_HICollisions_FallBack::e.
{ this->checkConnection(); this->checkPrepare(); int iconfID = iconf->fetchID(); if (!iconfID) { throw(std::runtime_error("FEConfigTimingDat::writeDB: ICONF not in DB")); } int logicID = ecid->getLogicID(); if (!logicID) { throw(std::runtime_error("FEConfigTimingDat::writeDB: Bad EcalLogicID")); } try { m_writeStmt->setInt(1, iconfID); m_writeStmt->setInt(2, logicID); m_writeStmt->setInt(3, item->getTimingPar1()); m_writeStmt->setInt(4, item->getTimingPar2()); m_writeStmt->executeUpdate(); } catch (SQLException &e) { throw(std::runtime_error("FEConfigTimingDat::writeDB(): "+e.getMessage())); } }
friend class EcalCondDBInterface [friend] |
Reimplemented from IDBObject.
Definition at line 13 of file FEConfigTimingDat.h.
int FEConfigTimingDat::m_par1 [private] |
Definition at line 39 of file FEConfigTimingDat.h.
Referenced by getTimingPar1(), and setTimingPar1().
int FEConfigTimingDat::m_par2 [private] |
Definition at line 40 of file FEConfigTimingDat.h.
Referenced by getTimingPar2(), and setTimingPar2().