CMS 3D CMS Logo

FEConfigParamDat Class Reference

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

Inheritance diagram for FEConfigParamDat:

IDataItem IDBObject

List of all members.

Public Member Functions

 FEConfigParamDat ()
float getETSat () const
float getFGhighratio () const
float getFGhighthresh () const
float getFGlowratio () const
float getFGlowthresh () const
std::string getTable ()
float getTTThreshhigh () const
float getTTThreshlow () const
void setETSat (float x)
void setFGhighratio (float x)
void setFGhighthresh (float x)
void setFGlowratio (float x)
void setFGlowthresh (float x)
void setTTThreshhigh (float x)
void setTTThreshlow (float x)
 ~FEConfigParamDat ()

Private Member Functions

void fetchData (std::map< EcalLogicID, FEConfigParamDat > *fillMap, FEConfigLinInfo *iconf) throw (std::runtime_error)
void prepareWrite () throw (std::runtime_error)
void writeArrayDB (const std::map< EcalLogicID, FEConfigParamDat > *data, FEConfigLinInfo *iconf) throw (std::runtime_error)
void writeDB (const EcalLogicID *ecid, const FEConfigParamDat *item, FEConfigLinInfo *iconf) throw (std::runtime_error)

Private Attributes

float m_etsat
float m_fghighthresh
float m_fglowthresh
float m_highratio
float m_lowratio
float m_tthreshhigh
float m_tthreshlow

Friends

class EcalCondDBInterface


Detailed Description

Definition at line 11 of file FEConfigParamDat.h.


Constructor & Destructor Documentation

FEConfigParamDat::FEConfigParamDat (  ) 

Definition at line 11 of file FEConfigParamDat.cc.

References IDBObject::m_conn, IDBObject::m_env, m_etsat, m_fghighthresh, m_fglowthresh, m_highratio, m_lowratio, IDataItem::m_readStmt, m_tthreshhigh, m_tthreshlow, 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_etsat = 0;
00019   m_tthreshlow = 0;
00020   m_tthreshhigh = 0;
00021   m_fglowthresh = 0;
00022   m_fghighthresh = 0;
00023   m_lowratio = 0;
00024   m_highratio = 0;
00025 
00026 }

FEConfigParamDat::~FEConfigParamDat (  ) 

Definition at line 30 of file FEConfigParamDat.cc.

00031 {
00032 }


Member Function Documentation

void FEConfigParamDat::fetchData ( std::map< EcalLogicID, FEConfigParamDat > *  fillMap,
FEConfigLinInfo iconf 
) throw (std::runtime_error) [private]

float FEConfigParamDat::getETSat (  )  const [inline]

Definition at line 29 of file FEConfigParamDat.h.

References m_etsat.

Referenced by writeArrayDB().

00029 { return m_etsat; }

float FEConfigParamDat::getFGhighratio (  )  const [inline]

Definition at line 35 of file FEConfigParamDat.h.

References m_highratio.

Referenced by writeArrayDB().

00035 { return m_highratio; }

float FEConfigParamDat::getFGhighthresh (  )  const [inline]

Definition at line 33 of file FEConfigParamDat.h.

References m_fghighthresh.

Referenced by writeArrayDB().

00033 { return m_fghighthresh; }

float FEConfigParamDat::getFGlowratio (  )  const [inline]

Definition at line 34 of file FEConfigParamDat.h.

References m_lowratio.

Referenced by writeArrayDB().

00034 { return m_lowratio ; }

float FEConfigParamDat::getFGlowthresh (  )  const [inline]

Definition at line 32 of file FEConfigParamDat.h.

References m_fglowthresh.

Referenced by writeArrayDB().

00032 { return m_fglowthresh; }

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

Implements IDataItem.

Definition at line 18 of file FEConfigParamDat.h.

00018 { return "FE_CONFIG_PARAM_DAT"; }

float FEConfigParamDat::getTTThreshhigh (  )  const [inline]

Definition at line 31 of file FEConfigParamDat.h.

References m_tthreshhigh.

Referenced by writeArrayDB().

00031 { return m_tthreshhigh; }

float FEConfigParamDat::getTTThreshlow (  )  const [inline]

Definition at line 30 of file FEConfigParamDat.h.

References m_tthreshlow.

Referenced by writeArrayDB().

00030 { return m_tthreshlow; }

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

Implements IDataItem.

Definition at line 36 of file FEConfigParamDat.cc.

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

00038 {
00039   this->checkConnection();
00040 
00041   try {
00042     m_writeStmt = m_conn->createStatement();
00043     m_writeStmt->setSQL("INSERT INTO fe_config_param_dat (lin_conf_id, logic_id, "
00044                       " etsat, ttthreshlow, ttthreshhigh, fg_lowthresh, fg_highthresh, fg_lowratio, fg_highratio ) "
00045                       "VALUES (:lin_conf_id, :logic_id, "
00046                       ":etsat, :ttthreshlow, :ttthreshhigh, :fg_lowthresh, :fg_highthresh, :fg_lowratio, :fg_highratio )" );
00047   } catch (SQLException &e) {
00048     throw(runtime_error("FEConfigParamDat::prepareWrite():  "+e.getMessage()));
00049   }
00050 }

void FEConfigParamDat::setETSat ( float  x  )  [inline]

Definition at line 21 of file FEConfigParamDat.h.

References m_etsat.

Referenced by EcalTPGParamBuilder::analyze().

00021 { m_etsat = x; }

void FEConfigParamDat::setFGhighratio ( float  x  )  [inline]

Definition at line 27 of file FEConfigParamDat.h.

References m_highratio.

Referenced by EcalTPGParamBuilder::analyze().

00027 { m_highratio = x; }

void FEConfigParamDat::setFGhighthresh ( float  x  )  [inline]

Definition at line 25 of file FEConfigParamDat.h.

References m_fghighthresh.

Referenced by EcalTPGParamBuilder::analyze().

00025 { m_fghighthresh = x; }

void FEConfigParamDat::setFGlowratio ( float  x  )  [inline]

Definition at line 26 of file FEConfigParamDat.h.

References m_lowratio.

Referenced by EcalTPGParamBuilder::analyze().

00026 { m_lowratio = x; }

void FEConfigParamDat::setFGlowthresh ( float  x  )  [inline]

Definition at line 24 of file FEConfigParamDat.h.

References m_fglowthresh.

Referenced by EcalTPGParamBuilder::analyze().

00024 { m_fglowthresh = x; }

void FEConfigParamDat::setTTThreshhigh ( float  x  )  [inline]

Definition at line 23 of file FEConfigParamDat.h.

References m_tthreshhigh.

Referenced by EcalTPGParamBuilder::analyze().

00023 { m_tthreshhigh = x; }

void FEConfigParamDat::setTTThreshlow ( float  x  )  [inline]

Definition at line 22 of file FEConfigParamDat.h.

References m_tthreshlow.

Referenced by EcalTPGParamBuilder::analyze().

00022 { m_tthreshlow = x; }

void FEConfigParamDat::writeArrayDB ( const std::map< EcalLogicID, FEConfigParamDat > *  data,
FEConfigLinInfo iconf 
) throw (std::runtime_error) [private]

Definition at line 136 of file FEConfigParamDat.cc.

References IDBObject::checkConnection(), IDataItem::checkPrepare(), count, data, getETSat(), getFGhighratio(), getFGhighthresh(), getFGlowratio(), getFGlowthresh(), EcalLogicID::getLogicID(), getTTThreshhigh(), getTTThreshlow(), IDataItem::m_writeStmt, r, st, t, tt, w, ww, x, y, and z.

00138 {
00139   this->checkConnection();
00140   this->checkPrepare();
00141 
00142   int iconfID = iconf->fetchID();
00143   if (!iconfID) { throw(runtime_error("FEConfigParamDat::writeArrayDB:  ICONF not in DB")); }
00144 
00145 
00146   int nrows=data->size(); 
00147   int* ids= new int[nrows];
00148   int* iov_vec= new int[nrows];
00149   float* xx= new float[nrows];
00150   float* yy= new float[nrows];
00151   float* zz= new float[nrows];
00152   float* ww= new float[nrows];
00153   float* uu= new float[nrows];
00154   float* tt= new float[nrows];
00155   float* st= new float[nrows];
00156 
00157   ub2* ids_len= new ub2[nrows];
00158   ub2* iov_len= new ub2[nrows];
00159   ub2* x_len= new ub2[nrows];
00160   ub2* y_len= new ub2[nrows];
00161   ub2* z_len= new ub2[nrows];
00162   ub2* w_len= new ub2[nrows];
00163   ub2* u_len= new ub2[nrows];
00164   ub2* t_len= new ub2[nrows];
00165   ub2* st_len= new ub2[nrows];
00166 
00167   const EcalLogicID* channel;
00168   const FEConfigParamDat* dataitem;
00169   int count=0;
00170   typedef map< EcalLogicID, FEConfigParamDat >::const_iterator CI;
00171   for (CI p = data->begin(); p != data->end(); ++p) {
00172         channel = &(p->first);
00173         int logicID = channel->getLogicID();
00174         if (!logicID) { throw(runtime_error("FEConfigParamDat::writeArrayDB:  Bad EcalLogicID")); }
00175         ids[count]=logicID;
00176         iov_vec[count]=iconfID;
00177 
00178         dataitem = &(p->second);
00179         // dataIface.writeDB( channel, dataitem, conf);
00180         float x=dataitem->getETSat();
00181         float y=dataitem->getTTThreshlow();
00182         float z=dataitem->getTTThreshhigh();
00183         float w=dataitem->getFGlowthresh();
00184         float u=dataitem->getFGhighthresh();
00185         float t=dataitem->getFGlowratio();
00186         float r=dataitem->getFGhighratio();
00187 
00188         xx[count]=x;
00189         yy[count]=y;
00190         zz[count]=z;
00191         ww[count]=w;
00192         uu[count]=u;
00193         tt[count]=t;
00194         st[count]=r;
00195 
00196 
00197         ids_len[count]=sizeof(ids[count]);
00198         iov_len[count]=sizeof(iov_vec[count]);
00199         
00200         x_len[count]=sizeof(xx[count]);
00201         y_len[count]=sizeof(yy[count]);
00202         z_len[count]=sizeof(zz[count]);
00203         w_len[count]=sizeof(ww[count]);
00204         u_len[count]=sizeof(uu[count]);
00205         t_len[count]=sizeof(tt[count]);
00206         st_len[count]=sizeof(st[count]);
00207 
00208         count++;
00209      }
00210 
00211 
00212   try {
00213     m_writeStmt->setDataBuffer(1, (dvoid*)iov_vec, OCCIINT, sizeof(iov_vec[0]),iov_len);
00214     m_writeStmt->setDataBuffer(2, (dvoid*)ids, OCCIINT, sizeof(ids[0]), ids_len );
00215     m_writeStmt->setDataBuffer(3, (dvoid*)xx, OCCIFLOAT , sizeof(xx[0]), x_len );
00216     m_writeStmt->setDataBuffer(4, (dvoid*)yy, OCCIFLOAT , sizeof(yy[0]), y_len );
00217     m_writeStmt->setDataBuffer(5, (dvoid*)zz, OCCIFLOAT , sizeof(zz[0]), z_len );
00218     m_writeStmt->setDataBuffer(6, (dvoid*)ww, OCCIFLOAT , sizeof(ww[0]), w_len );
00219     m_writeStmt->setDataBuffer(7, (dvoid*)uu, OCCIFLOAT , sizeof(uu[0]), u_len );
00220     m_writeStmt->setDataBuffer(8, (dvoid*)tt, OCCIFLOAT , sizeof(tt[0]), t_len );
00221     m_writeStmt->setDataBuffer(9, (dvoid*)st, OCCIFLOAT , sizeof(st[0]), st_len );
00222    
00223 
00224     m_writeStmt->executeArrayUpdate(nrows);
00225 
00226     delete [] ids;
00227     delete [] iov_vec;
00228     delete [] xx;
00229     delete [] yy;
00230     delete [] zz;
00231     delete [] ww;
00232     delete [] uu;
00233     delete [] tt;
00234     delete [] st;
00235 
00236     delete [] ids_len;
00237     delete [] iov_len;
00238     delete [] x_len;
00239     delete [] y_len;
00240     delete [] z_len;
00241     delete [] w_len;
00242     delete [] u_len;
00243     delete [] t_len;
00244     delete [] st_len;
00245 
00246   } catch (SQLException &e) {
00247     throw(runtime_error("FEConfigParamDat::writeArrayDB():  "+e.getMessage()));
00248   }
00249 }

void FEConfigParamDat::writeDB ( const EcalLogicID ecid,
const FEConfigParamDat item,
FEConfigLinInfo iconf 
) throw (std::runtime_error) [private]

Definition at line 54 of file FEConfigParamDat.cc.

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

00056 {
00057   this->checkConnection();
00058   this->checkPrepare();
00059 
00060   int iconfID = iconf->fetchID();
00061   if (!iconfID) { throw(runtime_error("FEConfigParamDat::writeDB:  ICONF not in DB")); }
00062 
00063   int logicID = ecid->getLogicID();
00064   if (!logicID) { throw(runtime_error("FEConfigParamDat::writeDB:  Bad EcalLogicID")); }
00065  
00066   try {
00067     m_writeStmt->setInt(1, iconfID);
00068     m_writeStmt->setInt(2, logicID);
00069     m_writeStmt->setFloat(3, item->getETSat());
00070     m_writeStmt->setFloat(4, item->getTTThreshlow());
00071     m_writeStmt->setFloat(5, item->getTTThreshhigh());
00072     m_writeStmt->setFloat(6, item->getFGlowthresh());
00073     m_writeStmt->setFloat(7, item->getFGhighthresh());
00074     m_writeStmt->setFloat(8, item->getFGlowratio());
00075     m_writeStmt->setFloat(9, item->getFGhighratio());
00076 
00077     m_writeStmt->executeUpdate();
00078   } catch (SQLException &e) {
00079     throw(runtime_error("FEConfigParamDat::writeDB():  "+e.getMessage()));
00080   }
00081 }


Friends And Related Function Documentation

friend class EcalCondDBInterface [friend]

Reimplemented from IDBObject.

Definition at line 13 of file FEConfigParamDat.h.


Member Data Documentation

float FEConfigParamDat::m_etsat [private]

Definition at line 53 of file FEConfigParamDat.h.

Referenced by FEConfigParamDat(), getETSat(), and setETSat().

float FEConfigParamDat::m_fghighthresh [private]

Definition at line 57 of file FEConfigParamDat.h.

Referenced by FEConfigParamDat(), getFGhighthresh(), and setFGhighthresh().

float FEConfigParamDat::m_fglowthresh [private]

Definition at line 56 of file FEConfigParamDat.h.

Referenced by FEConfigParamDat(), getFGlowthresh(), and setFGlowthresh().

float FEConfigParamDat::m_highratio [private]

Definition at line 59 of file FEConfigParamDat.h.

Referenced by FEConfigParamDat(), getFGhighratio(), and setFGhighratio().

float FEConfigParamDat::m_lowratio [private]

Definition at line 58 of file FEConfigParamDat.h.

Referenced by FEConfigParamDat(), getFGlowratio(), and setFGlowratio().

float FEConfigParamDat::m_tthreshhigh [private]

Definition at line 55 of file FEConfigParamDat.h.

Referenced by FEConfigParamDat(), getTTThreshhigh(), and setTTThreshhigh().

float FEConfigParamDat::m_tthreshlow [private]

Definition at line 54 of file FEConfigParamDat.h.

Referenced by FEConfigParamDat(), getTTThreshlow(), and setTTThreshlow().


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