#include <OnlineDB/EcalCondDB/interface/LMFLaserPrimDat.h>
Public Types | |
enum | laserColorNum { iBlue = 0, iGreen, iRed, iIRed } |
Public Member Functions | |
float | getAlpha () const |
float | getAPDOverPNAMean () const |
float | getAPDOverPNAPeak () const |
float | getAPDOverPNARMS () const |
float | getAPDOverPNBMean () const |
float | getAPDOverPNBPeak () const |
float | getAPDOverPNBRMS () const |
float | getAPDOverPNMean () const |
float | getAPDOverPNPeak () const |
float | getAPDOverPNRMS () const |
float | getBeta () const |
int | getFlag () const |
float | getMean () const |
float | getPeak () const |
float | getRMS () const |
float | getShapeCor () const |
std::string | getTable () |
LMFLaserPrimDat (const LMFLaserPrimDat &) | |
LMFLaserPrimDat () | |
void | setAlpha (float mean) |
void | setAPDOverPNAMean (float mean) |
void | setAPDOverPNAPeak (float x) |
void | setAPDOverPNARMS (float RMS) |
void | setAPDOverPNBMean (float mean) |
void | setAPDOverPNBPeak (float x) |
void | setAPDOverPNBRMS (float RMS) |
void | setAPDOverPNMean (float mean) |
void | setAPDOverPNPeak (float x) |
void | setAPDOverPNRMS (float RMS) |
void | setBeta (float x) |
void | setFlag (int x) |
void | setMean (float mean) |
void | setPeak (float x) |
void | setRMS (float RMS) |
void | setShapeCor (float x) |
~LMFLaserPrimDat () | |
Static Public Member Functions | |
static void | setColor (int color) |
Private Member Functions | |
void | fetchData (std::map< EcalLogicID, LMFLaserPrimDat > *fillVec, LMFRunIOV *iov) throw (std::runtime_error) |
void | prepareWrite () throw (std::runtime_error) |
void | writeArrayDB (const std::map< EcalLogicID, LMFLaserPrimDat > *data, LMFRunIOV *iov) throw (std::runtime_error) |
void | writeDB (const EcalLogicID *ecid, const LMFLaserPrimDat *item, LMFRunIOV *iov) throw (std::runtime_error) |
Private Attributes | |
float | m_Alpha |
float | m_apdOverPNAMean |
float | m_apdOverPNAPeak |
float | m_apdOverPNARMS |
float | m_apdOverPNBMean |
float | m_apdOverPNBPeak |
float | m_apdOverPNBRMS |
float | m_apdOverPNMean |
float | m_apdOverPNPeak |
float | m_apdOverPNRMS |
float | m_Beta |
int | m_Flag |
float | m_Mean |
float | m_Peak |
float | m_RMS |
float | m_ShapeCor |
Static Private Attributes | |
static int | _color = LMFLaserPrimDat::iBlue |
Friends | |
class | EcalCondDBInterface |
Definition at line 12 of file LMFLaserPrimDat.h.
LMFLaserPrimDat::LMFLaserPrimDat | ( | ) |
Definition at line 17 of file LMFLaserPrimDat.cc.
References _color, iBlue, iIRed, m_Alpha, m_apdOverPNAMean, m_apdOverPNAPeak, m_apdOverPNARMS, m_apdOverPNBMean, m_apdOverPNBPeak, m_apdOverPNBRMS, m_apdOverPNMean, m_apdOverPNPeak, m_apdOverPNRMS, m_Beta, IDBObject::m_conn, IDBObject::m_env, m_Flag, m_Mean, m_Peak, IDataItem::m_readStmt, m_RMS, m_ShapeCor, IDataItem::m_writeStmt, and NULL.
00018 { 00019 assert( _color>=iBlue && _color<=iIRed ); // GHM 00020 00021 m_env = NULL; 00022 m_conn = NULL; 00023 m_writeStmt = NULL; 00024 m_readStmt = NULL; 00025 00026 00027 m_Mean=0; 00028 m_RMS=0; 00029 m_Peak=0; 00030 m_Flag=0; 00031 m_apdOverPNAMean=0; 00032 m_apdOverPNARMS=0; 00033 m_apdOverPNAPeak=0; 00034 m_apdOverPNBMean=0; 00035 m_apdOverPNBRMS=0; 00036 m_apdOverPNBPeak=0; 00037 m_apdOverPNMean=0; 00038 m_apdOverPNRMS=0; 00039 m_apdOverPNPeak=0; 00040 m_Alpha=0; 00041 m_Beta=0; 00042 m_ShapeCor=0; 00043 }
LMFLaserPrimDat::LMFLaserPrimDat | ( | const LMFLaserPrimDat & | o | ) |
Definition at line 45 of file LMFLaserPrimDat.cc.
References _color, iBlue, iIRed, IDBObject::m_conn, IDBObject::m_env, IDataItem::m_readStmt, IDataItem::m_writeStmt, and NULL.
00045 : // GHM 00046 m_Mean(o.m_Mean), m_RMS(o.m_RMS), 00047 m_Peak(o.m_Peak), m_Flag(o.m_Flag), 00048 m_apdOverPNAMean(o.m_apdOverPNAMean), 00049 m_apdOverPNARMS(o.m_apdOverPNARMS), 00050 m_apdOverPNAPeak(o.m_apdOverPNAPeak), 00051 m_apdOverPNBMean(o.m_apdOverPNBMean), 00052 m_apdOverPNBRMS(o.m_apdOverPNBRMS), 00053 m_apdOverPNBPeak(o.m_apdOverPNBPeak), 00054 m_apdOverPNMean(o.m_apdOverPNMean), 00055 m_apdOverPNRMS(o.m_apdOverPNRMS), 00056 m_apdOverPNPeak(o.m_apdOverPNPeak), 00057 m_Alpha(o.m_Alpha), 00058 m_Beta(o.m_Beta), 00059 m_ShapeCor(o.m_ShapeCor) 00060 { 00061 assert( _color>=iBlue && _color<=iIRed ); 00062 00063 m_env = NULL; 00064 m_conn = NULL; 00065 m_writeStmt = NULL; 00066 m_readStmt = NULL; 00067 }
LMFLaserPrimDat::~LMFLaserPrimDat | ( | ) |
void LMFLaserPrimDat::fetchData | ( | std::map< EcalLogicID, LMFLaserPrimDat > * | fillVec, | |
LMFRunIOV * | iov | |||
) | throw (std::runtime_error) [private] |
Definition at line 325 of file LMFLaserPrimDat.cc.
References IDBObject::checkConnection(), e, getTable(), IDBObject::m_conn, IDBObject::m_env, IDataItem::m_readStmt, p, setAlpha(), setAPDOverPNAMean(), setAPDOverPNAPeak(), setAPDOverPNARMS(), setAPDOverPNBMean(), setAPDOverPNBPeak(), setAPDOverPNBRMS(), setAPDOverPNMean(), setAPDOverPNPeak(), setAPDOverPNRMS(), setBeta(), setFlag(), setMean(), setPeak(), setRMS(), and setShapeCor().
00327 { 00328 this->checkConnection(); 00329 fillMap->clear(); 00330 00331 iov->setConnection(m_env, m_conn); 00332 int iovID = iov->fetchID(); 00333 if (!iovID) { 00334 // throw(runtime_error("LMFLaserPrimDat::writeDB: IOV not in DB")); 00335 return; 00336 } 00337 00338 // GHM 00339 std::string command_ = "SELECT cv.name, cv.logic_id, cv.id1, cv.id2, cv.id3, cv.maps_to, d.flag, d.mean, d.rms, d.peak, d.apd_over_pnA_mean, d.apd_over_pnA_rms, d.apd_over_pnA_peak, d.apd_over_pnB_mean, d.apd_over_pnB_rms,d.apd_over_pnB_peak, d.apd_over_pn_mean, d.apd_over_pn_rms, d.apd_over_pn_peak, d.alpha, d.beta, d.shape_cor FROM channelview cv JOIN XXXXXX d ON cv.logic_id = d.logic_id AND cv.name = cv.maps_to WHERE d.lmf_iov_id = :iov_id"; 00340 command_.replace( command_.find("XXXXXX",0), 6, getTable() ); 00341 00342 // cout << "in fetchData: command_=" << command_ << endl; 00343 00344 try { 00345 00346 00347 m_readStmt->setSQL( command_.c_str() ); // GHM 00348 00349 m_readStmt->setInt(1, iovID); 00350 00351 ResultSet* rset = m_readStmt->executeQuery(); 00352 00353 std::pair< EcalLogicID, LMFLaserPrimDat > p; 00354 LMFLaserPrimDat dat; 00355 while(rset->next()) { 00356 p.first = EcalLogicID( rset->getString(1), // name 00357 rset->getInt(2), // logic_id 00358 rset->getInt(3), // id1 00359 rset->getInt(4), // id2 00360 rset->getInt(5), // id3 00361 rset->getString(6)); // maps_to 00362 00363 00364 dat.setFlag( rset->getInt(7) ); 00365 dat.setMean( rset->getFloat(8) ); 00366 dat.setRMS( rset->getFloat(9) ); 00367 dat.setPeak( rset->getFloat(10) ); 00368 00369 dat.setAPDOverPNAMean( rset->getFloat(11) ); 00370 dat.setAPDOverPNARMS( rset->getFloat(12) ); 00371 dat.setAPDOverPNAPeak( rset->getFloat(13) ); 00372 00373 dat.setAPDOverPNBMean( rset->getFloat(14) ); 00374 dat.setAPDOverPNBRMS( rset->getFloat(15) ); 00375 dat.setAPDOverPNBPeak( rset->getFloat(16) ); 00376 00377 dat.setAPDOverPNMean( rset->getFloat(17) ); 00378 dat.setAPDOverPNRMS( rset->getFloat(18) ); 00379 dat.setAPDOverPNPeak( rset->getFloat(19) ); 00380 00381 dat.setAlpha( rset->getFloat(20) ); 00382 dat.setBeta( rset->getFloat(21) ); 00383 dat.setShapeCor( rset->getFloat(22) ); 00384 p.second = dat; 00385 fillMap->insert(p); 00386 } 00387 00388 } catch (SQLException &e) { 00389 throw(runtime_error("LMFLaserPrimDat::fetchData(): "+e.getMessage())); 00390 } 00391 }
float LMFLaserPrimDat::getAlpha | ( | ) | const [inline] |
Definition at line 78 of file LMFLaserPrimDat.h.
References m_Alpha.
Referenced by writeArrayDB().
00078 { return m_Alpha; }
float LMFLaserPrimDat::getAPDOverPNAMean | ( | ) | const [inline] |
Definition at line 51 of file LMFLaserPrimDat.h.
References m_apdOverPNAMean.
Referenced by writeArrayDB().
00051 { return m_apdOverPNAMean; }
float LMFLaserPrimDat::getAPDOverPNAPeak | ( | ) | const [inline] |
Definition at line 57 of file LMFLaserPrimDat.h.
References m_apdOverPNAPeak.
Referenced by writeArrayDB().
00057 { return m_apdOverPNAPeak; }
float LMFLaserPrimDat::getAPDOverPNARMS | ( | ) | const [inline] |
Definition at line 54 of file LMFLaserPrimDat.h.
References m_apdOverPNARMS.
Referenced by writeArrayDB().
00054 { return m_apdOverPNARMS; }
float LMFLaserPrimDat::getAPDOverPNBMean | ( | ) | const [inline] |
Definition at line 60 of file LMFLaserPrimDat.h.
References m_apdOverPNBMean.
Referenced by writeArrayDB().
00060 { return m_apdOverPNBMean; }
float LMFLaserPrimDat::getAPDOverPNBPeak | ( | ) | const [inline] |
Definition at line 66 of file LMFLaserPrimDat.h.
References m_apdOverPNBPeak.
Referenced by writeArrayDB().
00066 { return m_apdOverPNBPeak; }
float LMFLaserPrimDat::getAPDOverPNBRMS | ( | ) | const [inline] |
Definition at line 63 of file LMFLaserPrimDat.h.
References m_apdOverPNBRMS.
Referenced by writeArrayDB().
00063 { return m_apdOverPNBRMS; }
float LMFLaserPrimDat::getAPDOverPNMean | ( | ) | const [inline] |
Definition at line 69 of file LMFLaserPrimDat.h.
References m_apdOverPNMean.
Referenced by writeArrayDB().
00069 { return m_apdOverPNMean; }
float LMFLaserPrimDat::getAPDOverPNPeak | ( | ) | const [inline] |
Definition at line 75 of file LMFLaserPrimDat.h.
References m_apdOverPNPeak.
Referenced by writeArrayDB().
00075 { return m_apdOverPNPeak; }
float LMFLaserPrimDat::getAPDOverPNRMS | ( | ) | const [inline] |
Definition at line 72 of file LMFLaserPrimDat.h.
References m_apdOverPNRMS.
Referenced by writeArrayDB().
00072 { return m_apdOverPNRMS; }
float LMFLaserPrimDat::getBeta | ( | ) | const [inline] |
Definition at line 81 of file LMFLaserPrimDat.h.
References m_Beta.
Referenced by writeArrayDB().
00081 { return m_Beta; }
int LMFLaserPrimDat::getFlag | ( | ) | const [inline] |
Definition at line 48 of file LMFLaserPrimDat.h.
References m_Flag.
Referenced by writeArrayDB().
00048 { return m_Flag; }
float LMFLaserPrimDat::getMean | ( | ) | const [inline] |
Definition at line 39 of file LMFLaserPrimDat.h.
References m_Mean.
Referenced by writeArrayDB().
00039 { return m_Mean; }
float LMFLaserPrimDat::getPeak | ( | ) | const [inline] |
Definition at line 45 of file LMFLaserPrimDat.h.
References m_Peak.
Referenced by writeArrayDB().
00045 { return m_Peak; }
float LMFLaserPrimDat::getRMS | ( | void | ) | const [inline] |
Definition at line 42 of file LMFLaserPrimDat.h.
References m_RMS.
Referenced by writeArrayDB().
00042 { return m_RMS; }
float LMFLaserPrimDat::getShapeCor | ( | ) | const [inline] |
Definition at line 84 of file LMFLaserPrimDat.h.
References m_ShapeCor.
Referenced by writeArrayDB().
00084 { return m_ShapeCor; }
std::string LMFLaserPrimDat::getTable | ( | ) | [inline, virtual] |
Implements IDataItem.
Definition at line 25 of file LMFLaserPrimDat.h.
References _color, iBlue, iGreen, iIRed, and iRed.
Referenced by fetchData(), and prepareWrite().
00026 { 00027 switch( _color ) 00028 { 00029 case iBlue: return "LMF_LASER_BLUE_PRIM_DAT"; 00030 case iGreen: return "LMF_LASER_GREEN_PRIM_DAT"; 00031 case iRed: return "LMF_LASER_RED_PRIM_DAT"; 00032 case iIRed: return "LMF_LASER_IRED_PRIM_DAT"; 00033 } 00034 // default 00035 return "LMF_LASER_BLUE_PRIM_DAT"; 00036 }
void LMFLaserPrimDat::prepareWrite | ( | ) | throw (std::runtime_error) [private, virtual] |
Implements IDataItem.
Definition at line 76 of file LMFLaserPrimDat.cc.
References IDBObject::checkConnection(), e, getTable(), IDBObject::m_conn, and IDataItem::m_writeStmt.
00078 { 00079 this->checkConnection(); 00080 00081 // GHM 00082 std::string command_ = "INSERT INTO XXXXXX (lmf_iov_id, logic_id, flag, mean, rms, peak, apd_over_pnA_mean, apd_over_pnA_rms, apd_over_pnA_peak, apd_over_pnB_mean, apd_over_pnB_rms, apd_over_pnB_peak, apd_over_pn_mean, apd_over_pn_rms, apd_over_pn_peak, alpha, beta, shape_cor ) VALUES (:1, :2, :3, :4, :5, :6, :7, :8, :9, :10, :11, :12, :13, :14, :15, :16, :17, :18 )"; 00083 command_.replace( command_.find("XXXXXX",0), 6, getTable() ); 00084 // cout << "In prepareWrite: command_" << command_ << endl; 00085 00086 try { 00087 m_writeStmt = m_conn->createStatement(); 00088 m_writeStmt->setSQL( command_.c_str() ); // GHM 00089 } catch (SQLException &e) { 00090 throw(runtime_error("LMFLaserPrimDat::prepareWrite(): "+e.getMessage())); 00091 } 00092 }
void LMFLaserPrimDat::setAlpha | ( | float | mean | ) | [inline] |
void LMFLaserPrimDat::setAPDOverPNAMean | ( | float | mean | ) | [inline] |
Definition at line 50 of file LMFLaserPrimDat.h.
References m_apdOverPNAMean.
Referenced by fetchData().
00050 { m_apdOverPNAMean = mean; }
void LMFLaserPrimDat::setAPDOverPNAPeak | ( | float | x | ) | [inline] |
Definition at line 56 of file LMFLaserPrimDat.h.
References m_apdOverPNAPeak.
Referenced by fetchData().
00056 { m_apdOverPNAPeak = x; }
void LMFLaserPrimDat::setAPDOverPNARMS | ( | float | RMS | ) | [inline] |
Definition at line 53 of file LMFLaserPrimDat.h.
References m_apdOverPNARMS.
Referenced by fetchData().
00053 { m_apdOverPNARMS = RMS; }
void LMFLaserPrimDat::setAPDOverPNBMean | ( | float | mean | ) | [inline] |
Definition at line 59 of file LMFLaserPrimDat.h.
References m_apdOverPNBMean.
Referenced by fetchData().
00059 { m_apdOverPNBMean = mean; }
void LMFLaserPrimDat::setAPDOverPNBPeak | ( | float | x | ) | [inline] |
Definition at line 65 of file LMFLaserPrimDat.h.
References m_apdOverPNBPeak.
Referenced by fetchData().
00065 { m_apdOverPNBPeak = x; }
void LMFLaserPrimDat::setAPDOverPNBRMS | ( | float | RMS | ) | [inline] |
Definition at line 62 of file LMFLaserPrimDat.h.
References m_apdOverPNBRMS.
Referenced by fetchData().
00062 { m_apdOverPNBRMS = RMS; }
void LMFLaserPrimDat::setAPDOverPNMean | ( | float | mean | ) | [inline] |
Definition at line 68 of file LMFLaserPrimDat.h.
References m_apdOverPNMean.
Referenced by fetchData().
00068 { m_apdOverPNMean = mean; }
void LMFLaserPrimDat::setAPDOverPNPeak | ( | float | x | ) | [inline] |
Definition at line 74 of file LMFLaserPrimDat.h.
References m_apdOverPNPeak.
Referenced by fetchData().
00074 { m_apdOverPNPeak = x; }
void LMFLaserPrimDat::setAPDOverPNRMS | ( | float | RMS | ) | [inline] |
Definition at line 71 of file LMFLaserPrimDat.h.
References m_apdOverPNRMS.
Referenced by fetchData().
00071 { m_apdOverPNRMS = RMS; }
void LMFLaserPrimDat::setBeta | ( | float | x | ) | [inline] |
void LMFLaserPrimDat::setMean | ( | float | mean | ) | [inline] |
void LMFLaserPrimDat::setPeak | ( | float | x | ) | [inline] |
void LMFLaserPrimDat::setRMS | ( | float | RMS | ) | [inline] |
Definition at line 41 of file LMFLaserPrimDat.h.
References m_RMS.
Referenced by fetchData().
00041 { m_RMS = RMS; }
void LMFLaserPrimDat::setShapeCor | ( | float | x | ) | [inline] |
Definition at line 83 of file LMFLaserPrimDat.h.
References m_ShapeCor.
Referenced by fetchData().
00083 { m_ShapeCor = x; }
void LMFLaserPrimDat::writeArrayDB | ( | const std::map< EcalLogicID, LMFLaserPrimDat > * | data, | |
LMFRunIOV * | iov | |||
) | throw (std::runtime_error) [private] |
Definition at line 136 of file LMFLaserPrimDat.cc.
References a, aa, DeDxTools::beta(), IDBObject::checkConnection(), IDataItem::checkPrepare(), count, data, e, getAlpha(), getAPDOverPNAMean(), getAPDOverPNAPeak(), getAPDOverPNARMS(), getAPDOverPNBMean(), getAPDOverPNBPeak(), getAPDOverPNBRMS(), getAPDOverPNMean(), getAPDOverPNPeak(), getAPDOverPNRMS(), getBeta(), getFlag(), EcalLogicID::getLogicID(), getMean(), getPeak(), getRMS(), getShapeCor(), IDataItem::m_writeStmt, p, t, tt, w, ww, x, y, and z.
00138 { 00139 this->checkConnection(); 00140 this->checkPrepare(); 00141 00142 int iovID = iov->fetchID(); 00143 if (!iovID) { throw(runtime_error("LMFLaserPrimDat::writeArrayDB: IOV not in DB")); } 00144 00145 00146 int nrows=data->size(); 00147 int* ids= new int[nrows]; 00148 int* iovid_vec= new int[nrows]; 00149 int* aa= new int[nrows]; 00150 float* xx= new float[nrows]; 00151 float* yy= new float[nrows]; 00152 float* zz= new float[nrows]; 00153 float* wwa= new float[nrows]; 00154 float* uua= new float[nrows]; 00155 float* tta= new float[nrows]; 00156 float* wwb= new float[nrows]; 00157 float* uub= new float[nrows]; 00158 float* ttb= new float[nrows]; 00159 float* ww= new float[nrows]; 00160 float* uu= new float[nrows]; 00161 float* tt= new float[nrows]; 00162 float* ualpha= new float[nrows]; 00163 float* ubeta= new float[nrows]; 00164 float* ushapecor= new float[nrows]; 00165 00166 ub2* ids_len= new ub2[nrows]; 00167 ub2* iov_len= new ub2[nrows]; 00168 ub2* a_len= new ub2[nrows]; 00169 ub2* x_len= new ub2[nrows]; 00170 ub2* y_len= new ub2[nrows]; 00171 ub2* z_len= new ub2[nrows]; 00172 ub2* wa_len= new ub2[nrows]; 00173 ub2* ua_len= new ub2[nrows]; 00174 ub2* ta_len= new ub2[nrows]; 00175 ub2* wb_len= new ub2[nrows]; 00176 ub2* ub_len= new ub2[nrows]; 00177 ub2* tb_len= new ub2[nrows]; 00178 ub2* w_len= new ub2[nrows]; 00179 ub2* u_len= new ub2[nrows]; 00180 ub2* t_len= new ub2[nrows]; 00181 ub2* ualpha_len= new ub2[nrows]; 00182 ub2* ubeta_len= new ub2[nrows]; 00183 ub2* ushapecor_len= new ub2[nrows]; 00184 00185 const EcalLogicID* channel; 00186 const LMFLaserPrimDat* dataitem; 00187 int count=0; 00188 typedef map< EcalLogicID, LMFLaserPrimDat >::const_iterator CI; 00189 for (CI p = data->begin(); p != data->end(); ++p) { 00190 channel = &(p->first); 00191 int logicID = channel->getLogicID(); 00192 if (!logicID) { throw(runtime_error("LMFLaserPrimDat::writeArrayDB: Bad EcalLogicID")); } 00193 ids[count]=logicID; 00194 iovid_vec[count]=iovID; 00195 00196 dataitem = &(p->second); 00197 // dataIface.writeDB( channel, dataitem, iov); 00198 int a=dataitem->getFlag(); 00199 float x=dataitem->getMean(); 00200 float y=dataitem->getRMS(); 00201 float z=dataitem->getPeak(); 00202 float wa=dataitem->getAPDOverPNAMean(); 00203 float ua=dataitem->getAPDOverPNARMS(); 00204 float ta=dataitem->getAPDOverPNAPeak(); 00205 float wb=dataitem->getAPDOverPNBMean(); 00206 float ub=dataitem->getAPDOverPNBRMS(); 00207 float tb=dataitem->getAPDOverPNBPeak(); 00208 float w=dataitem->getAPDOverPNMean(); 00209 float u=dataitem->getAPDOverPNRMS(); 00210 float t=dataitem->getAPDOverPNPeak(); 00211 float alpha=dataitem->getAlpha(); 00212 float beta=dataitem->getBeta(); 00213 float shapecor=dataitem->getShapeCor(); 00214 00215 00216 aa[count]=a; 00217 xx[count]=x; 00218 yy[count]=y; 00219 zz[count]=z; 00220 wwa[count]=wa; 00221 uua[count]=ua; 00222 tta[count]=ta; 00223 wwb[count]=wb; 00224 uub[count]=ub; 00225 ttb[count]=tb; 00226 ww[count]=w; 00227 uu[count]=u; 00228 tt[count]=t; 00229 ualpha[count]=alpha; 00230 ubeta[count]=beta; 00231 ushapecor[count]=shapecor; 00232 00233 ids_len[count]=sizeof(ids[count]); 00234 iov_len[count]=sizeof(iovid_vec[count]); 00235 00236 a_len[count]=sizeof(aa[count]); 00237 x_len[count]=sizeof(xx[count]); 00238 y_len[count]=sizeof(yy[count]); 00239 z_len[count]=sizeof(zz[count]); 00240 wa_len[count]=sizeof(wwa[count]); 00241 ua_len[count]=sizeof(uua[count]); 00242 ta_len[count]=sizeof(tta[count]); 00243 wb_len[count]=sizeof(wwb[count]); 00244 ub_len[count]=sizeof(uub[count]); 00245 tb_len[count]=sizeof(ttb[count]); 00246 w_len[count]=sizeof(ww[count]); 00247 u_len[count]=sizeof(uu[count]); 00248 t_len[count]=sizeof(tt[count]); 00249 ualpha_len[count]=sizeof(ualpha[count]); 00250 ubeta_len[count]=sizeof(ubeta[count]); 00251 ushapecor_len[count]=sizeof(ushapecor[count]); 00252 00253 count++; 00254 } 00255 00256 00257 try { 00258 m_writeStmt->setDataBuffer(1, (dvoid*)iovid_vec, OCCIINT, sizeof(iovid_vec[0]),iov_len); 00259 m_writeStmt->setDataBuffer(2, (dvoid*)ids, OCCIINT, sizeof(ids[0]), ids_len ); 00260 m_writeStmt->setDataBuffer(3, (dvoid*)aa, OCCIINT , sizeof(aa[0]), a_len ); 00261 m_writeStmt->setDataBuffer(4, (dvoid*)xx, OCCIFLOAT , sizeof(xx[0]), x_len ); 00262 m_writeStmt->setDataBuffer(5, (dvoid*)yy, OCCIFLOAT , sizeof(yy[0]), y_len ); 00263 m_writeStmt->setDataBuffer(6, (dvoid*)zz, OCCIFLOAT , sizeof(zz[0]), z_len ); 00264 m_writeStmt->setDataBuffer(7, (dvoid*)wwa, OCCIFLOAT , sizeof(wwa[0]), wa_len ); 00265 m_writeStmt->setDataBuffer(8, (dvoid*)uua, OCCIFLOAT , sizeof(uua[0]), ua_len ); 00266 m_writeStmt->setDataBuffer(9, (dvoid*)tta, OCCIFLOAT , sizeof(tta[0]), ta_len ); 00267 m_writeStmt->setDataBuffer(10, (dvoid*)wwb, OCCIFLOAT , sizeof(wwb[0]), wb_len ); 00268 m_writeStmt->setDataBuffer(11, (dvoid*)uub, OCCIFLOAT , sizeof(uub[0]), ub_len ); 00269 m_writeStmt->setDataBuffer(12, (dvoid*)ttb, OCCIFLOAT , sizeof(ttb[0]), tb_len ); 00270 m_writeStmt->setDataBuffer(13, (dvoid*)ww, OCCIFLOAT , sizeof(ww[0]), w_len ); 00271 m_writeStmt->setDataBuffer(14, (dvoid*)uu, OCCIFLOAT , sizeof(uu[0]), u_len ); 00272 m_writeStmt->setDataBuffer(15, (dvoid*)tt, OCCIFLOAT , sizeof(tt[0]), t_len ); 00273 m_writeStmt->setDataBuffer(16, (dvoid*)ualpha, OCCIFLOAT , sizeof(ualpha[0]), ualpha_len ); 00274 m_writeStmt->setDataBuffer(17, (dvoid*)ubeta, OCCIFLOAT , sizeof(ubeta[0]), ubeta_len ); 00275 m_writeStmt->setDataBuffer(18, (dvoid*)ushapecor, OCCIFLOAT , sizeof(ushapecor[0]), ushapecor_len ); 00276 00277 m_writeStmt->executeArrayUpdate(nrows); 00278 00279 delete [] ids; 00280 delete [] iovid_vec; 00281 delete [] aa; 00282 delete [] xx; 00283 delete [] yy; 00284 delete [] zz; 00285 delete [] ww; 00286 delete [] uu; 00287 delete [] tt; 00288 delete [] wwa; 00289 delete [] uua; 00290 delete [] tta; 00291 delete [] wwb; 00292 delete [] uub; 00293 delete [] ttb; 00294 delete [] ualpha; 00295 delete [] ubeta; 00296 delete [] ushapecor; 00297 00298 delete [] ids_len; 00299 delete [] iov_len; 00300 delete [] a_len; 00301 delete [] x_len; 00302 delete [] y_len; 00303 delete [] z_len; 00304 delete [] w_len; 00305 delete [] u_len; 00306 delete [] t_len; 00307 delete [] wa_len; 00308 delete [] ua_len; 00309 delete [] ta_len; 00310 delete [] wb_len; 00311 delete [] ub_len; 00312 delete [] tb_len; 00313 delete [] ualpha_len; 00314 delete [] ubeta_len; 00315 delete [] ushapecor_len; 00316 00317 00318 00319 00320 } catch (SQLException &e) { 00321 throw(runtime_error("LMFLaserPrimDat::writeArrayDB(): "+e.getMessage())); 00322 } 00323 }
void LMFLaserPrimDat::writeDB | ( | const EcalLogicID * | ecid, | |
const LMFLaserPrimDat * | item, | |||
LMFRunIOV * | iov | |||
) | throw (std::runtime_error) [private] |
Definition at line 96 of file LMFLaserPrimDat.cc.
References IDBObject::checkConnection(), IDataItem::checkPrepare(), e, and IDataItem::m_writeStmt.
00098 { 00099 this->checkConnection(); 00100 this->checkPrepare(); 00101 00102 int iovID = iov->fetchID(); 00103 if (!iovID) { throw(runtime_error("LMFLaserPrimDat::writeDB: IOV not in DB")); } 00104 00105 int logicID = ecid->getLogicID(); 00106 if (!logicID) { throw(runtime_error("LMFLaserPrimDat::writeDB: Bad EcalLogicID")); } 00107 00108 try { 00109 m_writeStmt->setInt(1, iovID); 00110 m_writeStmt->setInt(2, logicID); 00111 00112 m_writeStmt->setInt(3, item->getFlag() ); 00113 m_writeStmt->setFloat(4, item->getMean() ); 00114 m_writeStmt->setFloat(5, item->getRMS() ); 00115 m_writeStmt->setFloat(6, item->getPeak() ); 00116 m_writeStmt->setFloat(7, item->getAPDOverPNAMean() ); 00117 m_writeStmt->setFloat(8, item->getAPDOverPNARMS() ); 00118 m_writeStmt->setFloat(9, item->getAPDOverPNAPeak() ); 00119 m_writeStmt->setFloat(10, item->getAPDOverPNBMean() ); 00120 m_writeStmt->setFloat(11, item->getAPDOverPNBRMS() ); 00121 m_writeStmt->setFloat(12, item->getAPDOverPNBPeak() ); 00122 m_writeStmt->setFloat(13, item->getAPDOverPNMean() ); 00123 m_writeStmt->setFloat(14, item->getAPDOverPNRMS() ); 00124 m_writeStmt->setFloat(15, item->getAPDOverPNPeak() ); 00125 m_writeStmt->setFloat(16, item->getAlpha() ); 00126 m_writeStmt->setFloat(17, item->getBeta() ); 00127 m_writeStmt->setFloat(18, item->getShapeCor() ); 00128 00129 m_writeStmt->executeUpdate(); 00130 } catch (SQLException &e) { 00131 throw(runtime_error("LMFLaserPrimDat::writeDB(): "+e.getMessage())); 00132 } 00133 }
friend class EcalCondDBInterface [friend] |
int LMFLaserPrimDat::_color = LMFLaserPrimDat::iBlue [static, private] |
Definition at line 102 of file LMFLaserPrimDat.h.
Referenced by getTable(), LMFLaserPrimDat(), and setColor().
float LMFLaserPrimDat::m_Alpha [private] |
Definition at line 118 of file LMFLaserPrimDat.h.
Referenced by getAlpha(), LMFLaserPrimDat(), and setAlpha().
float LMFLaserPrimDat::m_apdOverPNAMean [private] |
Definition at line 109 of file LMFLaserPrimDat.h.
Referenced by getAPDOverPNAMean(), LMFLaserPrimDat(), and setAPDOverPNAMean().
float LMFLaserPrimDat::m_apdOverPNAPeak [private] |
Definition at line 111 of file LMFLaserPrimDat.h.
Referenced by getAPDOverPNAPeak(), LMFLaserPrimDat(), and setAPDOverPNAPeak().
float LMFLaserPrimDat::m_apdOverPNARMS [private] |
Definition at line 110 of file LMFLaserPrimDat.h.
Referenced by getAPDOverPNARMS(), LMFLaserPrimDat(), and setAPDOverPNARMS().
float LMFLaserPrimDat::m_apdOverPNBMean [private] |
Definition at line 112 of file LMFLaserPrimDat.h.
Referenced by getAPDOverPNBMean(), LMFLaserPrimDat(), and setAPDOverPNBMean().
float LMFLaserPrimDat::m_apdOverPNBPeak [private] |
Definition at line 114 of file LMFLaserPrimDat.h.
Referenced by getAPDOverPNBPeak(), LMFLaserPrimDat(), and setAPDOverPNBPeak().
float LMFLaserPrimDat::m_apdOverPNBRMS [private] |
Definition at line 113 of file LMFLaserPrimDat.h.
Referenced by getAPDOverPNBRMS(), LMFLaserPrimDat(), and setAPDOverPNBRMS().
float LMFLaserPrimDat::m_apdOverPNMean [private] |
Definition at line 115 of file LMFLaserPrimDat.h.
Referenced by getAPDOverPNMean(), LMFLaserPrimDat(), and setAPDOverPNMean().
float LMFLaserPrimDat::m_apdOverPNPeak [private] |
Definition at line 117 of file LMFLaserPrimDat.h.
Referenced by getAPDOverPNPeak(), LMFLaserPrimDat(), and setAPDOverPNPeak().
float LMFLaserPrimDat::m_apdOverPNRMS [private] |
Definition at line 116 of file LMFLaserPrimDat.h.
Referenced by getAPDOverPNRMS(), LMFLaserPrimDat(), and setAPDOverPNRMS().
float LMFLaserPrimDat::m_Beta [private] |
Definition at line 119 of file LMFLaserPrimDat.h.
Referenced by getBeta(), LMFLaserPrimDat(), and setBeta().
int LMFLaserPrimDat::m_Flag [private] |
Definition at line 108 of file LMFLaserPrimDat.h.
Referenced by getFlag(), LMFLaserPrimDat(), and setFlag().
float LMFLaserPrimDat::m_Mean [private] |
Definition at line 105 of file LMFLaserPrimDat.h.
Referenced by getMean(), LMFLaserPrimDat(), and setMean().
float LMFLaserPrimDat::m_Peak [private] |
Definition at line 107 of file LMFLaserPrimDat.h.
Referenced by getPeak(), LMFLaserPrimDat(), and setPeak().
float LMFLaserPrimDat::m_RMS [private] |
Definition at line 106 of file LMFLaserPrimDat.h.
Referenced by getRMS(), LMFLaserPrimDat(), and setRMS().
float LMFLaserPrimDat::m_ShapeCor [private] |
Definition at line 120 of file LMFLaserPrimDat.h.
Referenced by getShapeCor(), LMFLaserPrimDat(), and setShapeCor().