#include <FEConfigPedDat.h>
Public Member Functions | |
FEConfigPedDat () | |
int | getId () const |
float | getPedMeanG1 () const |
float | getPedMeanG12 () const |
float | getPedMeanG6 () const |
std::string | getTable () |
void | setId (int x) |
void | setPedMeanG1 (float mean) |
void | setPedMeanG12 (float mean) |
void | setPedMeanG6 (float mean) |
~FEConfigPedDat () | |
Private Member Functions | |
void | fetchData (std::map< EcalLogicID, FEConfigPedDat > *fillMap, FEConfigPedInfo *iconf) throw (std::runtime_error) |
void | prepareWrite () throw (std::runtime_error) |
void | writeArrayDB (const std::map< EcalLogicID, FEConfigPedDat > *data, FEConfigPedInfo *iconf) throw (std::runtime_error) |
void | writeDB (const EcalLogicID *ecid, const FEConfigPedDat *item, FEConfigPedInfo *iconf) throw (std::runtime_error) |
Private Attributes | |
int | m_ID |
float | m_pedMeanG1 |
float | m_pedMeanG12 |
float | m_pedMeanG6 |
Friends | |
class | EcalCondDBInterface |
Definition at line 11 of file FEConfigPedDat.h.
FEConfigPedDat::FEConfigPedDat | ( | ) |
Definition at line 11 of file FEConfigPedDat.cc.
References NULL.
{ m_env = NULL; m_conn = NULL; m_writeStmt = NULL; m_readStmt = NULL; m_ID=0; m_pedMeanG1 = 0; m_pedMeanG6 = 0; m_pedMeanG12 = 0; }
FEConfigPedDat::~FEConfigPedDat | ( | ) |
Definition at line 26 of file FEConfigPedDat.cc.
{ }
void FEConfigPedDat::fetchData | ( | std::map< EcalLogicID, FEConfigPedDat > * | fillMap, |
FEConfigPedInfo * | iconf | ||
) | throw (std::runtime_error) [private] |
int FEConfigPedDat::getId | ( | ) | const [inline] |
float FEConfigPedDat::getPedMeanG1 | ( | ) | const [inline] |
Definition at line 24 of file FEConfigPedDat.h.
References m_pedMeanG1.
Referenced by EcalTPGParamBuilder::analyze(), popcon::EcalTPGPedestalsHandler::getNewObjects(), EcalTPGDBApp::readFromConfDB_TPGPedestals(), and writeArrayDB().
{ return m_pedMeanG1; }
float FEConfigPedDat::getPedMeanG12 | ( | ) | const [inline] |
Definition at line 30 of file FEConfigPedDat.h.
References m_pedMeanG12.
Referenced by EcalTPGParamBuilder::analyze(), popcon::EcalTPGPedestalsHandler::getNewObjects(), EcalTPGDBApp::readFromConfDB_TPGPedestals(), and writeArrayDB().
{ return m_pedMeanG12; }
float FEConfigPedDat::getPedMeanG6 | ( | ) | const [inline] |
Definition at line 27 of file FEConfigPedDat.h.
References m_pedMeanG6.
Referenced by EcalTPGParamBuilder::analyze(), popcon::EcalTPGPedestalsHandler::getNewObjects(), EcalTPGDBApp::readFromConfDB_TPGPedestals(), and writeArrayDB().
{ return m_pedMeanG6; }
std::string FEConfigPedDat::getTable | ( | ) | [inline, virtual] |
Implements IDataItem.
Definition at line 18 of file FEConfigPedDat.h.
{ return "FE_CONFIG_PED_DAT"; }
void FEConfigPedDat::prepareWrite | ( | ) | throw (std::runtime_error) [private, virtual] |
Implements IDataItem.
Definition at line 31 of file FEConfigPedDat.cc.
References alignCSCRings::e.
{ this->checkConnection(); try { m_writeStmt = m_conn->createStatement(); m_writeStmt->setSQL("INSERT INTO "+getTable()+" (ped_conf_id, logic_id, " "mean_12, mean_6, mean_1 ) " "VALUES (:ped_conf_id, :logic_id, " ":ped_mean_g12, :ped_mean_g6, :ped_mean_g1 )" ); } catch (SQLException &e) { throw(std::runtime_error("FEConfigPedDat::prepareWrite(): "+e.getMessage())); } }
void FEConfigPedDat::setId | ( | int | x | ) | [inline] |
void FEConfigPedDat::setPedMeanG1 | ( | float | mean | ) | [inline] |
Definition at line 23 of file FEConfigPedDat.h.
References m_pedMeanG1, and timingPdfMaker::mean.
Referenced by EcalTPGParamBuilder::analyze().
{ m_pedMeanG1 = mean; }
void FEConfigPedDat::setPedMeanG12 | ( | float | mean | ) | [inline] |
Definition at line 29 of file FEConfigPedDat.h.
References m_pedMeanG12, and timingPdfMaker::mean.
Referenced by EcalTPGParamBuilder::analyze().
{ m_pedMeanG12 = mean; }
void FEConfigPedDat::setPedMeanG6 | ( | float | mean | ) | [inline] |
Definition at line 26 of file FEConfigPedDat.h.
References m_pedMeanG6, and timingPdfMaker::mean.
Referenced by EcalTPGParamBuilder::analyze().
{ m_pedMeanG6 = mean; }
void FEConfigPedDat::writeArrayDB | ( | const std::map< EcalLogicID, FEConfigPedDat > * | data, |
FEConfigPedInfo * | iconf | ||
) | throw (std::runtime_error) [private] |
Definition at line 120 of file FEConfigPedDat.cc.
References prof2calltree::count, data, EcalLogicID::getLogicID(), getPedMeanG1(), getPedMeanG12(), getPedMeanG6(), AlCaHLTBitMon_ParallelJobs::p, x, detailsBasic3DVector::y, and z.
{ this->checkConnection(); this->checkPrepare(); int iconfID = iconf->fetchID(); if (!iconfID) { throw(std::runtime_error("FEConfigPedDat::writeArrayDB: ICONF not in DB")); } int nrows=data->size(); int* ids= new int[nrows]; int* iconfid_vec= new int[nrows]; float* xx= new float[nrows]; float* yy= new float[nrows]; float* zz= new float[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]; ub2* z_len= new ub2[nrows]; const EcalLogicID* channel; const FEConfigPedDat* dataitem; int count=0; typedef map< EcalLogicID, FEConfigPedDat >::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("FEConfigPedDat::writeArrayDB: Bad EcalLogicID")); } ids[count]=logicID; iconfid_vec[count]=iconfID; dataitem = &(p->second); // dataIface.writeDB( channel, dataitem, iconf); float x=dataitem->getPedMeanG12(); float y=dataitem->getPedMeanG6(); float z=dataitem->getPedMeanG1(); xx[count]=x; yy[count]=y; zz[count]=z; 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]); z_len[count]=sizeof(zz[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, OCCIFLOAT , sizeof(xx[0]), x_len ); m_writeStmt->setDataBuffer(4, (dvoid*)yy, OCCIFLOAT , sizeof(yy[0]), y_len ); m_writeStmt->setDataBuffer(5, (dvoid*)zz, OCCIFLOAT , sizeof(zz[0]), z_len ); m_writeStmt->executeArrayUpdate(nrows); delete [] ids; delete [] iconfid_vec; delete [] xx; delete [] yy; delete [] zz; delete [] ids_len; delete [] iconf_len; delete [] x_len; delete [] y_len; delete [] z_len; } catch (SQLException &e) { throw(std::runtime_error("FEConfigPedDat::writeArrayDB(): "+e.getMessage())); } }
void FEConfigPedDat::writeDB | ( | const EcalLogicID * | ecid, |
const FEConfigPedDat * | item, | ||
FEConfigPedInfo * | iconf | ||
) | throw (std::runtime_error) [private] |
Definition at line 50 of file FEConfigPedDat.cc.
References alignCSCRings::e.
{ this->checkConnection(); int iconfID = iconf->fetchID(); if (!iconfID) { throw(std::runtime_error("FEConfigPedDat::writeDB: ICONF not in DB")); } int logicID = ecid->getLogicID(); if (!logicID) { throw(std::runtime_error("FEConfigPedDat::writeDB: Bad EcalLogicID")); } try { m_writeStmt->setInt(1, iconfID); m_writeStmt->setInt(2, logicID); m_writeStmt->setFloat(3, item->getPedMeanG12()); m_writeStmt->setFloat(4, item->getPedMeanG6()); m_writeStmt->setFloat(5, item->getPedMeanG1()); m_writeStmt->executeUpdate(); } catch (SQLException &e) { throw(std::runtime_error("FEConfigPedDat::writeDB(): "+e.getMessage())); } }
friend class EcalCondDBInterface [friend] |
Reimplemented from IDBObject.
Definition at line 13 of file FEConfigPedDat.h.
int FEConfigPedDat::m_ID [private] |
Definition at line 50 of file FEConfigPedDat.h.
float FEConfigPedDat::m_pedMeanG1 [private] |
Definition at line 47 of file FEConfigPedDat.h.
Referenced by getPedMeanG1(), and setPedMeanG1().
float FEConfigPedDat::m_pedMeanG12 [private] |
Definition at line 49 of file FEConfigPedDat.h.
Referenced by getPedMeanG12(), and setPedMeanG12().
float FEConfigPedDat::m_pedMeanG6 [private] |
Definition at line 48 of file FEConfigPedDat.h.
Referenced by getPedMeanG6(), and setPedMeanG6().