15 m_writeStmt =
nullptr;
24 this->checkConnection();
27 m_writeStmt = m_conn->createStatement();
29 "INSERT INTO " + getTable() +
30 " (coke_conf_id, logic_id, " 31 " THRESHOLD, SUCC_EVENT_LIMIT, CUMUL_EVENT_LIMIT, SUCC_DETECT_ENABLE, CUMUL_DETECT_ENABLE, THD1_THRESHOLD, " 32 "SUCC1_EV_LIMIT, CUMUL1_EV_LIMIT, COMBI_MODE, OCC_MODE, COMB_SUCC_DETECT, COMB_CUMUL_DETECT, OCC_DETECT, " 33 "CUMUL1_DETECT, THD2_THRESHOLD , OCC_LIMIT , THD3_THRESHOLD , CUMUL2_LIMIT , STOP_BUFW ) " 34 "VALUES (:coke_conf_id, :logic_id, " 35 ":m1, :m2, :m3, :m4, :m5, :m6, :m7, :m8, :m9, :m10, :m11, :m12, :m13, :m14, :m15, :m16, :m17, :m18, :m19 )");
36 }
catch (SQLException&
e) {
37 throw cms::Exception(
"SQLException") <<
"FEConfigCokeDat::prepareWrite(): " <<
e.getMessage();
44 this->checkConnection();
47 int iconfID = iconf->fetchID();
49 throw(std::runtime_error(
"FEConfigCokeDat::writeDB: ICONF not in DB"));
52 int logicID = ecid->getLogicID();
54 throw(std::runtime_error(
"FEConfigCokeDat::writeDB: Bad EcalLogicID"));
58 m_writeStmt->setInt(1, iconfID);
59 m_writeStmt->setInt(2, logicID);
60 m_writeStmt->setInt(3,
item->getPar1());
61 m_writeStmt->setInt(4,
item->getPar2());
62 m_writeStmt->setInt(5,
item->getPar3());
63 m_writeStmt->setInt(6,
item->getPar4());
64 m_writeStmt->setInt(7,
item->getPar5());
65 m_writeStmt->setInt(8,
item->getPar6());
66 m_writeStmt->setInt(9,
item->getPar7());
67 m_writeStmt->setInt(10,
item->getPar8());
68 m_writeStmt->setInt(11,
item->getPar9());
69 m_writeStmt->setInt(12,
item->getPar10());
70 m_writeStmt->setInt(13,
item->getPar11());
71 m_writeStmt->setInt(14,
item->getPar12());
72 m_writeStmt->setInt(15,
item->getPar13());
73 m_writeStmt->setInt(16,
item->getPar14());
74 m_writeStmt->setInt(17,
item->getPar15());
75 m_writeStmt->setInt(18,
item->getPar16());
76 m_writeStmt->setInt(19,
item->getPar17());
77 m_writeStmt->setInt(20,
item->getPar18());
78 m_writeStmt->setInt(21,
item->getPar19());
80 m_writeStmt->executeUpdate();
81 }
catch (SQLException&
e) {
82 throw cms::Exception(
"SQLException") <<
"FEConfigCokeDat::writeDB(): " <<
e.getMessage();
87 this->checkConnection();
90 iconf->setConnection(m_env, m_conn);
91 int iconfID = iconf->fetchID();
99 "SELECT cv.name, cv.logic_id, cv.id1, cv.id2, cv.id3, cv.maps_to, " 100 " d.THRESHOLD, d.SUCC_EVENT_LIMIT, d.CUMUL_EVENT_LIMIT, d.SUCC_DETECT_ENABLE, d.CUMUL_DETECT_ENABLE, " 101 "d.THD1_THRESHOLD, d.SUCC1_EV_LIMIT, d.CUMUL1_EV_LIMIT, d.COMBI_MODE, d.OCC_MODE, d.COMB_SUCC_DETECT, " 102 "d.COMB_CUMUL_DETECT, d.OCC_DETECT, d.CUMUL1_DETECT, d.THD2_THRESHOLD , d.OCC_LIMIT , d.THD3_THRESHOLD , " 103 "d.CUMUL2_LIMIT , d.STOP_BUFW " 104 "FROM channelview cv JOIN " +
107 "ON cv.logic_id = d.logic_id AND cv.name = cv.maps_to " 108 "WHERE coke_conf_id = :coke_conf_id");
109 m_readStmt->setInt(1, iconfID);
110 ResultSet* rset = m_readStmt->executeQuery();
112 std::pair<EcalLogicID, FEConfigCokeDat>
p;
114 while (rset->next()) {
145 }
catch (SQLException&
e) {
146 throw cms::Exception(
"SQLException") <<
"FEConfigCokeDat::fetchData: " <<
e.getMessage();
152 this->checkConnection();
153 this->checkPrepare();
155 int iconfID = iconf->fetchID();
157 throw(std::runtime_error(
"FEConfigCokeDat::writeArrayDB: ICONF not in DB"));
160 int nrows =
data->size();
161 int* ids =
new int[nrows];
162 int* iconfid_vec =
new int[nrows];
163 int* xx1 =
new int[nrows];
164 int* xx2 =
new int[nrows];
165 int* xx3 =
new int[nrows];
166 int* xx4 =
new int[nrows];
167 int* xx5 =
new int[nrows];
168 int* xx6 =
new int[nrows];
169 int* xx7 =
new int[nrows];
170 int* xx8 =
new int[nrows];
171 int* xx9 =
new int[nrows];
172 int* xx10 =
new int[nrows];
173 int* xx11 =
new int[nrows];
174 int* xx12 =
new int[nrows];
175 int* xx13 =
new int[nrows];
176 int* xx14 =
new int[nrows];
177 int* xx15 =
new int[nrows];
178 int* xx16 =
new int[nrows];
179 int* xx17 =
new int[nrows];
180 int* xx18 =
new int[nrows];
181 int* xx19 =
new int[nrows];
183 ub2* ids_len =
new ub2[nrows];
184 ub2* iconf_len =
new ub2[nrows];
185 ub2* x1_len =
new ub2[nrows];
186 ub2* x2_len =
new ub2[nrows];
187 ub2* x3_len =
new ub2[nrows];
188 ub2* x4_len =
new ub2[nrows];
189 ub2* x5_len =
new ub2[nrows];
190 ub2* x6_len =
new ub2[nrows];
191 ub2* x7_len =
new ub2[nrows];
192 ub2* x8_len =
new ub2[nrows];
193 ub2* x9_len =
new ub2[nrows];
194 ub2* x10_len =
new ub2[nrows];
195 ub2* x11_len =
new ub2[nrows];
196 ub2* x12_len =
new ub2[nrows];
197 ub2* x13_len =
new ub2[nrows];
198 ub2* x14_len =
new ub2[nrows];
199 ub2* x15_len =
new ub2[nrows];
200 ub2* x16_len =
new ub2[nrows];
201 ub2* x17_len =
new ub2[nrows];
202 ub2* x18_len =
new ub2[nrows];
203 ub2* x19_len =
new ub2[nrows];
208 typedef map<EcalLogicID, FEConfigCokeDat>::const_iterator CI;
209 for (CI
p =
data->begin();
p !=
data->end(); ++
p) {
210 channel = &(
p->first);
213 throw(std::runtime_error(
"FEConfigCokeDat::writeArrayDB: Bad EcalLogicID"));
215 ids[
count] = logicID;
216 iconfid_vec[
count] = iconfID;
218 dataitem = &(
p->second);
241 iconf_len[
count] =
sizeof(iconfid_vec[
count]);
267 m_writeStmt->setDataBuffer(1, (dvoid*)iconfid_vec, OCCIINT,
sizeof(iconfid_vec[0]), iconf_len);
268 m_writeStmt->setDataBuffer(2, (dvoid*)ids, OCCIINT,
sizeof(ids[0]), ids_len);
269 m_writeStmt->setDataBuffer(3, (dvoid*)xx1, OCCIINT,
sizeof(xx1[0]), x1_len);
270 m_writeStmt->setDataBuffer(4, (dvoid*)xx2, OCCIINT,
sizeof(xx2[0]), x2_len);
271 m_writeStmt->setDataBuffer(5, (dvoid*)xx3, OCCIINT,
sizeof(xx3[0]), x3_len);
272 m_writeStmt->setDataBuffer(6, (dvoid*)xx4, OCCIINT,
sizeof(xx4[0]), x4_len);
273 m_writeStmt->setDataBuffer(7, (dvoid*)xx5, OCCIINT,
sizeof(xx5[0]), x5_len);
274 m_writeStmt->setDataBuffer(8, (dvoid*)xx6, OCCIINT,
sizeof(xx6[0]), x6_len);
275 m_writeStmt->setDataBuffer(9, (dvoid*)xx7, OCCIINT,
sizeof(xx7[0]), x7_len);
276 m_writeStmt->setDataBuffer(10, (dvoid*)xx8, OCCIINT,
sizeof(xx8[0]), x8_len);
277 m_writeStmt->setDataBuffer(11, (dvoid*)xx9, OCCIINT,
sizeof(xx9[0]), x9_len);
278 m_writeStmt->setDataBuffer(12, (dvoid*)xx10, OCCIINT,
sizeof(xx10[0]), x10_len);
279 m_writeStmt->setDataBuffer(13, (dvoid*)xx11, OCCIINT,
sizeof(xx11[0]), x11_len);
280 m_writeStmt->setDataBuffer(14, (dvoid*)xx12, OCCIINT,
sizeof(xx12[0]), x12_len);
281 m_writeStmt->setDataBuffer(15, (dvoid*)xx13, OCCIINT,
sizeof(xx13[0]), x13_len);
282 m_writeStmt->setDataBuffer(16, (dvoid*)xx14, OCCIINT,
sizeof(xx14[0]), x14_len);
283 m_writeStmt->setDataBuffer(17, (dvoid*)xx15, OCCIINT,
sizeof(xx15[0]), x15_len);
284 m_writeStmt->setDataBuffer(18, (dvoid*)xx16, OCCIINT,
sizeof(xx16[0]), x16_len);
285 m_writeStmt->setDataBuffer(19, (dvoid*)xx17, OCCIINT,
sizeof(xx17[0]), x17_len);
286 m_writeStmt->setDataBuffer(20, (dvoid*)xx18, OCCIINT,
sizeof(xx18[0]), x18_len);
287 m_writeStmt->setDataBuffer(21, (dvoid*)xx19, OCCIINT,
sizeof(xx19[0]), x19_len);
289 m_writeStmt->executeArrayUpdate(nrows);
292 delete[] iconfid_vec;
335 }
catch (SQLException&
e) {
336 throw cms::Exception(
"SQLException") <<
"FEConfigCokeDat::writeArrayDB(): " <<
e.getMessage();
void writeArrayDB(const std::map< EcalLogicID, FEConfigCokeDat > *data, FEConfigCokeInfo *iconf) noexcept(false)
~FEConfigCokeDat() override
void prepareWrite() noexcept(false) override
void writeDB(const EcalLogicID *ecid, const FEConfigCokeDat *item, FEConfigCokeInfo *iconf) noexcept(false)
char data[epos_bytes_allocation]
void clear(HadCaloObj &c)
void fetchData(std::map< EcalLogicID, FEConfigCokeDat > *fillMap, FEConfigCokeInfo *iconf) noexcept(false)