#include <FEConfigLUTGroupDat.h>
Definition at line 11 of file FEConfigLUTGroupDat.h.
FEConfigLUTGroupDat::FEConfigLUTGroupDat |
( |
| ) |
|
Definition at line 11 of file FEConfigLUTGroupDat.cc.
References i, and NULL.
19 for(
int i=0;
i<1024;
i++){
oracle::occi::Environment * m_env
oracle::occi::Statement * m_writeStmt
oracle::occi::Connection * m_conn
oracle::occi::Statement * m_readStmt
FEConfigLUTGroupDat::~FEConfigLUTGroupDat |
( |
| ) |
|
Definition at line 124 of file FEConfigLUTGroupDat.cc.
References alignCSCRings::e, AlCaHLTBitMon_ParallelJobs::p, setLUTGroupId(), and setLUTValue().
131 int iconfID = iconf->
fetchID();
133 throw(std::runtime_error(
"FEConfigLUTGroupDat::fetchData: ICONF not in DB"));
139 m_readStmt->setSQL(
"SELECT d.group_id, d.lut_id, d.lut_value "
140 "FROM fe_lut_per_group_dat d "
141 "WHERE lut_conf_id = :lut_conf_id order by d.group_id, d.lut_id ");
146 std::pair< EcalLogicID, FEConfigLUTGroupDat >
p;
154 while(rset->next()) {
156 int il=rset->getInt(2);
157 int ival=rset->getInt(3);
162 dat->setLUTGroupId( ig );
163 dat->setLUTValue( il, ival );
165 dat->setLUTValue( il, ival );
176 throw(std::runtime_error(
"FEConfigLUTGroupDat::fetchData: "+e.getMessage()));
oracle::occi::Environment * m_env
oracle::occi::Connection * m_conn
oracle::occi::SQLException SQLException
oracle::occi::Statement * m_readStmt
oracle::occi::ResultSet ResultSet
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
void checkConnection() const
int FEConfigLUTGroupDat::getLUTGroupId |
( |
| ) |
const |
|
inline |
int FEConfigLUTGroupDat::getLUTValue |
( |
int |
i | ) |
const |
|
inline |
std::string FEConfigLUTGroupDat::getTable |
( |
| ) |
|
|
inlinevirtual |
void FEConfigLUTGroupDat::prepareWrite |
( |
| ) |
|
throw | ( | std::runtime_error |
| ) | | |
|
privatevirtual |
Implements IDataItem.
Definition at line 33 of file FEConfigLUTGroupDat.cc.
References alignCSCRings::e.
40 m_writeStmt->setSQL(
"INSERT INTO fe_lut_per_group_dat (lut_conf_id, group_id, "
41 " lut_id, lut_value ) "
42 "VALUES (:lut_conf_id, :group_id, "
43 ":lut_id, :lut_value )" );
45 throw(std::runtime_error(
"FEConfigLUTGroupDat::prepareWrite(): "+e.getMessage()));
oracle::occi::Statement * m_writeStmt
oracle::occi::Connection * m_conn
oracle::occi::SQLException SQLException
void checkConnection() const
void FEConfigLUTGroupDat::setLUTGroupId |
( |
int |
x | ) |
|
|
inline |
void FEConfigLUTGroupDat::setLUTValue |
( |
int |
i, |
|
|
int |
x |
|
) |
| |
|
inline |
Definition at line 180 of file FEConfigLUTGroupDat.cc.
References KineDebug3::count(), gather_cfg::cout, data, alignCSCRings::e, getLUTGroupId(), getLUTValue(), i, AlCaHLTBitMon_ParallelJobs::p, x, y, and z.
186 int iconfID = iconf->
fetchID();
187 if (!iconfID) {
throw(std::runtime_error(
"FEConfigLUTGroupDat::writeArrayDB: ICONF not in DB")); }
190 int nrows=
data->size()*1024;
192 int* iconfid_vec=
new int[nrows];
193 int* xx=
new int[nrows];
194 int* yy=
new int[nrows];
195 int* zz=
new int[nrows];
199 ub2* iconf_len=
new ub2[nrows];
200 ub2* x_len=
new ub2[nrows];
201 ub2* y_len=
new ub2[nrows];
202 ub2* z_len=
new ub2[nrows];
207 typedef map< EcalLogicID, FEConfigLUTGroupDat >::const_iterator CI;
208 for (CI
p =
data->begin();
p !=
data->end(); ++
p) {
211 dataitem = &(
p->second);
215 for (
int i=0;
i<1024;
i++){
216 iconfid_vec[
count]=iconfID;
242 cout <<
"about to insert "<< iconfid_vec[
i]<<
" " <<xx[
i]<<
" "<< yy[
i]<<
" "<< zz[
i]<< endl;
244 cout <<
"about to insert "<< iconfid_vec[
i]<<
" " <<xx[
i]<<
" "<< yy[
i]<<
" "<< zz[
i]<< endl;
246 m_writeStmt->setDataBuffer(1, (dvoid*)iconfid_vec, OCCIINT,
sizeof(iconfid_vec[0]),iconf_len);
247 m_writeStmt->setDataBuffer(2, (dvoid*)xx, OCCIINT,
sizeof(xx[0]), x_len );
248 m_writeStmt->setDataBuffer(3, (dvoid*)yy, OCCIINT ,
sizeof(yy[0]), y_len );
249 m_writeStmt->setDataBuffer(4, (dvoid*)zz, OCCIINT ,
sizeof(zz[0]), z_len );
254 delete [] iconfid_vec;
268 throw(std::runtime_error(
"FEConfigLUTGroupDat::writeArrayDB(): "+e.getMessage()));
oracle::occi::Statement * m_writeStmt
int getLUTGroupId() const
oracle::occi::SQLException SQLException
int getLUTValue(int i) const
char data[epos_bytes_allocation]
void checkConnection() const
Definition at line 49 of file FEConfigLUTGroupDat.cc.
References KineDebug3::count(), gather_cfg::cout, alignCSCRings::e, x, y, and z.
57 cout<<
"iconf="<< iconfID << endl;
59 if (!iconfID) {
throw(std::runtime_error(
"FEConfigLUTGroupDat::writeArrayDB: ICONF not in DB")); }
63 int* iconfid_vec=
new int[nrows];
64 int* xx=
new int[nrows];
65 int* yy=
new int[nrows];
66 int* zz=
new int[nrows];
69 ub2* iconf_len=
new ub2[nrows];
70 ub2* x_len=
new ub2[nrows];
71 ub2* y_len=
new ub2[nrows];
72 ub2* z_len=
new ub2[nrows];
78 iconfid_vec[
count]=iconfID;
97 m_writeStmt->setDataBuffer(1, (dvoid*)iconfid_vec, OCCIINT,
sizeof(iconfid_vec[0]),iconf_len);
98 m_writeStmt->setDataBuffer(2, (dvoid*)xx, OCCIINT,
sizeof(xx[0]), x_len );
99 m_writeStmt->setDataBuffer(3, (dvoid*)yy, OCCIINT ,
sizeof(yy[0]), y_len );
100 m_writeStmt->setDataBuffer(4, (dvoid*)zz, OCCIINT ,
sizeof(zz[0]), z_len );
105 delete [] iconfid_vec;
119 throw(std::runtime_error(
"FEConfigLUTGroupDat::writeArrayDB(): "+e.getMessage()));
oracle::occi::Statement * m_writeStmt
int getLUTGroupId() const
oracle::occi::SQLException SQLException
void checkConnection() const
int FEConfigLUTGroupDat::m_group_id |
|
private |
int FEConfigLUTGroupDat::m_lut[1024] |
|
private |