30 mEnvironment = oracle::occi::Environment::createEnvironment (oracle::occi::Environment::OBJECT);
32 size_t ipass = fDb.find (
'/');
33 size_t ihost = fDb.find (
'@');
35 if (ipass == std::string::npos || ihost == std::string::npos) {
36 std::cerr <<
"HcalDbOnline::HcalDbOnline-> Error in connection string format: " << fDb
37 <<
" Expect user/password@db" << std::endl;
49 std::cerr <<
"HcalDbOnline::HcalDbOnline exception-> " << sqlExcp.getErrorCode () <<
": " << sqlExcp.what () << std::endl;
57 oracle::occi::Environment::terminateEnvironment (
mEnvironment);
61 if (!fObject)
return false;
65 std::cout <<
"HcalDbOnline::getObject (HcalElectronicsMap*..)-> Using default tag: " << tag << std::endl;
68 sql_query +=
"SELECT\n";
69 sql_query +=
" DAT2.SIDE, DAT2.ETA, DAT2.PHI, DAT2.DEPTH, DAT2.SUBDETECTOR,\n" ;
70 sql_query +=
" DAT2.CRATE, DAT2.HTR_SLOT, DAT2.HTR_FPGA, DAT2.DCC, DAT2.DCC_SPIGOT, DAT2.HTR_FIBER, DAT2.FIBER_CHANNEL \n" ;
71 sql_query +=
" FROM\n";
72 sql_query +=
" CMS_HCL_HCAL_CONDITION_OWNER.HCAL_HARDWARE_LOGICAL_MAPS DAT2,\n";
73 sql_query +=
" CMS_HCL_CORE_CONDITION_OWNER.COND_DATA_SETS DS2,\n";
74 sql_query +=
" CMS_HCL_CORE_CONDITION_OWNER.KINDS_OF_CONDITIONS KOC2\n";
75 sql_query +=
" WHERE\n";
76 sql_query +=
" DS2.CONDITION_DATA_SET_ID=DAT2.CONDITION_DATA_SET_ID\n";
77 sql_query +=
" AND KOC2.KIND_OF_CONDITION_ID=DS2.KIND_OF_CONDITION_ID \n";
78 sql_query +=
" AND KOC2.IS_RECORD_DELETED='F' AND DS2.IS_RECORD_DELETED='F' \n";
79 sql_query +=
" AND KOC2.EXTENSION_TABLE_NAME='HCAL_HARDWARE_LOGICAL_MAPS' \n";
80 sql_query +=
" AND DS2.VERSION='" + tag +
"'\n";
87 while (rset->next ()) {
89 int z = rset->getInt (index++) > 0 ? 1 : -1;
90 int eta = rset->getInt (index++);
91 int phi = rset->getInt (index++);
92 int depth = rset->getInt (index++);
94 int crate = rset->getInt (index++);
95 int slot = rset->getInt (index++);
96 int fpga = rset->getInt (index++) > 0 ? 1 : 0;
97 int dcc = rset->getInt (index++);
98 int spigot = rset->getInt (index++);
99 int fiber = rset->getInt (index++);
100 int fiberChannel = rset->getInt (index++);
103 eid.
setHTR (crate, slot, fpga);
116 std::cerr <<
"HcalDbOnline::getObject exception-> " << sqlExcp.getErrorCode () <<
": " << sqlExcp.what () << std::endl;
123 if (!fObject)
return false;
125 sql_what +=
" ADC_CH.SIDE, ADC_CH.ETA, ADC_CH.PHI, ADC_CH.DEPTH, ADC_CH.SUBDETECTOR,\n" ;
126 sql_what +=
" DAT.CAP0_RANGE0_OFFSET, DAT.CAP0_RANGE0_SLOPE,\n" ;
127 sql_what +=
" DAT.CAP0_RANGE1_OFFSET, DAT.CAP1_RANGE0_SLOPE,\n" ;
128 sql_what +=
" DAT.CAP0_RANGE2_OFFSET, DAT.CAP2_RANGE0_SLOPE,\n" ;
129 sql_what +=
" DAT.CAP0_RANGE3_OFFSET, DAT.CAP3_RANGE0_SLOPE,\n" ;
130 sql_what +=
" DAT.CAP1_RANGE0_OFFSET, DAT.CAP0_RANGE1_SLOPE,\n" ;
131 sql_what +=
" DAT.CAP1_RANGE1_OFFSET, DAT.CAP1_RANGE1_SLOPE,\n" ;
132 sql_what +=
" DAT.CAP1_RANGE2_OFFSET, DAT.CAP2_RANGE1_SLOPE,\n" ;
133 sql_what +=
" DAT.CAP1_RANGE3_OFFSET, DAT.CAP3_RANGE1_SLOPE,\n" ;
134 sql_what +=
" DAT.CAP2_RANGE0_OFFSET, DAT.CAP0_RANGE2_SLOPE,\n" ;
135 sql_what +=
" DAT.CAP2_RANGE1_OFFSET, DAT.CAP1_RANGE2_SLOPE,\n" ;
136 sql_what +=
" DAT.CAP2_RANGE2_OFFSET, DAT.CAP2_RANGE2_SLOPE,\n" ;
137 sql_what +=
" DAT.CAP2_RANGE3_OFFSET, DAT.CAP3_RANGE2_SLOPE,\n" ;
138 sql_what +=
" DAT.CAP3_RANGE0_OFFSET, DAT.CAP0_RANGE3_SLOPE,\n" ;
139 sql_what +=
" DAT.CAP3_RANGE1_OFFSET, DAT.CAP1_RANGE3_SLOPE,\n" ;
140 sql_what +=
" DAT.CAP3_RANGE2_OFFSET, DAT.CAP2_RANGE3_SLOPE,\n" ;
141 sql_what +=
" DAT.CAP3_RANGE3_OFFSET, DAT.CAP3_RANGE3_SLOPE \n" ;
145 sql_hbheho +=
" FROM \n";
146 sql_hbheho +=
" CMS_HCL_HCAL_CONDITION_OWNER.QIECARD_ADC_NORMMODE DAT\n";
147 sql_hbheho +=
" inner join CMS_HCL_CORE_CONDITION_OWNER.COND_DATA_SETS DS\n";
148 sql_hbheho +=
" on DAT.CONDITION_DATA_SET_ID=DS.CONDITION_DATA_SET_ID\n";
149 sql_hbheho +=
" inner join \n";
150 sql_hbheho +=
" ( \n";
151 sql_hbheho +=
" select\n";
152 sql_hbheho +=
" LOGMAP.SIDE,\n";
153 sql_hbheho +=
" LOGMAP.ETA,\n";
154 sql_hbheho +=
" LOGMAP.PHI,\n";
155 sql_hbheho +=
" LOGMAP.DEPTH,\n";
156 sql_hbheho +=
" LOGMAP.SUBDETECTOR,\n";
157 sql_hbheho +=
" ADC_CHAIN.ADC_PART_ID\n";
158 sql_hbheho +=
" from\n";
159 sql_hbheho +=
" CMS_HCL_HCAL_CONDITION_OWNER.HCAL_HARDWARE_LOGICAL_MAPS_V2 LOGMAP\n";
160 sql_hbheho +=
" inner join CMS_HCL_CORE_CONDITION_OWNER.COND_DATA_SETS LOGMAP_DS\n";
161 sql_hbheho +=
" on LOGMAP_DS.CONDITION_DATA_SET_ID=LOGMAP.CONDITION_DATA_SET_ID\n";
162 sql_hbheho +=
" inner join\n";
163 sql_hbheho +=
" (\n";
164 sql_hbheho +=
" select ADC.PART_ID as ADC_PART_ID, \n";
165 sql_hbheho +=
" SLOT.NAME_LABEL as RBX_SLOT,\n";
166 sql_hbheho +=
" RM.RM_SLOT as RM_SLOT,\n";
167 sql_hbheho +=
" QIE.QIE_SLOT as QIE_SLOT,\n";
168 sql_hbheho +=
" ADC.ADC_POSITION as ADC\n";
169 sql_hbheho +=
" from CMS_HCL_CORE_CONSTRUCT_OWNER.V_HCAL_READOUTBOX_SLOTS SLOT\n";
170 sql_hbheho +=
" inner join CMS_HCL_CORE_CONSTRUCT_OWNER.V_HCAL_READOUTBOXS RBX\n";
171 sql_hbheho +=
" on RBX.PART_PARENT_ID=SLOT.PART_ID\n";
172 sql_hbheho +=
" inner join CMS_HCL_CORE_CONSTRUCT_OWNER.V_HCAL_READOUTMODULES RM\n";
173 sql_hbheho +=
" on RM.PART_PARENT_ID=RBX.PART_ID\n";
174 sql_hbheho +=
" inner join CMS_HCL_CORE_CONSTRUCT_OWNER.V_HCAL_QIECARDS QIE\n";
175 sql_hbheho +=
" on QIE.PART_PARENT_ID=RM.PART_ID\n";
176 sql_hbheho +=
" inner join CMS_HCL_CORE_CONSTRUCT_OWNER.V_HCAL_ADCS ADC\n";
177 sql_hbheho +=
" on ADC.PART_PARENT_ID=QIE.PART_ID \n";
178 sql_hbheho +=
" ) ADC_CHAIN\n";
179 sql_hbheho +=
" on ADC_CHAIN.RBX_SLOT = LOGMAP.RBX_SLOT and\n";
180 sql_hbheho +=
" ADC_CHAIN.RM_SLOT = LOGMAP.RM_SLOT and\n";
181 sql_hbheho +=
" ADC_CHAIN.QIE_SLOT = LOGMAP.QIE_SLOT and\n";
182 sql_hbheho +=
" ADC_CHAIN.ADC = LOGMAP.ADC\n";
183 sql_hbheho +=
" where LOGMAP_DS.VERSION='15'\n";
184 sql_hbheho +=
" ) ADC_CH\n";
185 sql_hbheho +=
" on DS.PART_ID=ADC_CH.ADC_PART_ID\n";
186 sql_hbheho +=
" where DS.VERSION='3'\n";
191 sql_hf +=
" FROM \n";
192 sql_hf +=
" CMS_HCL_HCAL_CONDITION_OWNER.QIECARD_ADC_NORMMODE DAT\n";
193 sql_hf +=
" inner join CMS_HCL_CORE_CONDITION_OWNER.COND_DATA_SETS DS\n";
194 sql_hf +=
" on DAT.CONDITION_DATA_SET_ID=DS.CONDITION_DATA_SET_ID\n";
195 sql_hf +=
" inner join \n";
197 sql_hf +=
" select\n";
198 sql_hf +=
" LOGMAP.SIDE,\n";
199 sql_hf +=
" LOGMAP.ETA,\n";
200 sql_hf +=
" LOGMAP.PHI,\n";
201 sql_hf +=
" LOGMAP.DEPTH,\n";
202 sql_hf +=
" LOGMAP.SUBDETECTOR,\n";
203 sql_hf +=
" ADC_CHAIN.ADC_PART_ID\n";
205 sql_hf +=
" CMS_HCL_HCAL_CONDITION_OWNER.HCAL_HARDWARE_LOGICAL_MAPS_V2 LOGMAP\n";
206 sql_hf +=
" inner join CMS_HCL_CORE_CONDITION_OWNER.COND_DATA_SETS LOGMAP_DS\n";
207 sql_hf +=
" on LOGMAP_DS.CONDITION_DATA_SET_ID=LOGMAP.CONDITION_DATA_SET_ID\n";
208 sql_hf +=
" inner join\n";
210 sql_hf +=
" select ADC.PART_ID as ADC_PART_ID, \n";
211 sql_hf +=
" SLOT.NAME_LABEL as CRATE_SLOT,\n";
212 sql_hf +=
" QIE.QIE_SLOT as QIE_SLOT,\n";
213 sql_hf +=
" ADC.ADC_POSITION as ADC\n";
214 sql_hf +=
" from CMS_HCL_CORE_CONSTRUCT_OWNER.V_HCAL_WEDGE_SLOTS SLOT\n";
215 sql_hf +=
" inner join CMS_HCL_CORE_CONSTRUCT_OWNER.V_HCAL_HF_FE_CRATE CR\n";
216 sql_hf +=
" on CR.PART_PARENT_ID=SLOT.PART_ID\n";
217 sql_hf +=
" inner join CMS_HCL_CORE_CONSTRUCT_OWNER.V_HCAL_QIECARDS QIE\n";
218 sql_hf +=
" on QIE.PART_PARENT_ID=CR.PART_ID\n";
219 sql_hf +=
" inner join CMS_HCL_CORE_CONSTRUCT_OWNER.V_HCAL_ADCS ADC\n";
220 sql_hf +=
" on ADC.PART_PARENT_ID=QIE.PART_ID \n";
221 sql_hf +=
" ) ADC_CHAIN\n";
222 sql_hf +=
" on ADC_CHAIN.CRATE_SLOT = LOGMAP.RBX_SLOT and\n";
223 sql_hf +=
" ADC_CHAIN.QIE_SLOT = LOGMAP.QIE_SLOT and\n";
224 sql_hf +=
" ADC_CHAIN.ADC = LOGMAP.ADC\n";
225 sql_hf +=
" where LOGMAP_DS.VERSION='15'\n";
226 sql_hf +=
" ) ADC_CH\n";
227 sql_hf +=
" on DS.PART_ID=ADC_CH.ADC_PART_ID\n";
228 sql_hf +=
" where DS.VERSION='3'\n";
231 sql_query [0] =
" SELECT \n" + sql_what + sql_hbheho;
232 sql_query [1] =
" SELECT \n" + sql_what + sql_hf;
235 for (
int i = 0;
i < 2;
i++) {
240 while (rset->next ()) {
242 int z = rset->getInt (index++);
243 int eta = rset->getInt (index++);
244 int phi = rset->getInt (index++);
245 int depth = rset->getInt (index++);
249 for (
int capId = 0; capId < 4; capId++) {
250 for (
int range = 0; range < 4; range++) {
251 offset [capId][range] = rset->getFloat (index++);
252 slope [capId][range] = rset->getFloat (index++);
260 for (
int capId = 0; capId < 4; capId++) {
261 for (
int range = 0; range < 4; range++) {
262 coder.
setOffset (capId, range, offset [capId][range]);
263 coder.
setSlope (capId, range, slope [capId][range]);
273 std::cerr <<
"HcalDbOnline::getObject exception-> " << sqlExcp.getErrorCode () <<
": " << sqlExcp.what () << std::endl;
280 if (!fObject)
return false;
282 sql_what +=
" ADC_CH.SIDE, ADC_CH.ETA, ADC_CH.PHI, ADC_CH.DEPTH, ADC_CH.SUBDETECTOR,\n" ;
283 sql_what +=
" DAT.BIN0, DAT.BIN1, DAT.BIN2, DAT.BIN3, DAT.BIN4, DAT.BIN5, DAT.BIN6, DAT.BIN7,\n";
284 sql_what +=
" DAT.BIN8, DAT.BIN9, DAT.BIN10, DAT.BIN11, DAT.BIN12, DAT.BIN13, DAT.BIN14, DAT.BIN15,\n";
285 sql_what +=
" DAT.BIN16, DAT.BIN17, DAT.BIN18, DAT.BIN19, DAT.BIN20, DAT.BIN21, DAT.BIN22, DAT.BIN23,\n";
286 sql_what +=
" DAT.BIN24, DAT.BIN25, DAT.BIN26, DAT.BIN27, DAT.BIN28, DAT.BIN29, DAT.BIN30, DAT.BIN31 \n";
290 sql_hbheho +=
" FROM \n";
291 sql_hbheho +=
" CMS_HCL_HCAL_CONDITION_OWNER.QIECARD_ADC_CALIBMODE DAT\n";
292 sql_hbheho +=
" inner join CMS_HCL_CORE_CONDITION_OWNER.COND_DATA_SETS DS\n";
293 sql_hbheho +=
" on DAT.CONDITION_DATA_SET_ID=DS.CONDITION_DATA_SET_ID\n";
294 sql_hbheho +=
" inner join \n";
295 sql_hbheho +=
" ( \n";
296 sql_hbheho +=
" select\n";
297 sql_hbheho +=
" LOGMAP.SIDE,\n";
298 sql_hbheho +=
" LOGMAP.ETA,\n";
299 sql_hbheho +=
" LOGMAP.PHI,\n";
300 sql_hbheho +=
" LOGMAP.DEPTH,\n";
301 sql_hbheho +=
" LOGMAP.SUBDETECTOR,\n";
302 sql_hbheho +=
" ADC_CHAIN.ADC_PART_ID\n";
303 sql_hbheho +=
" from\n";
304 sql_hbheho +=
" CMS_HCL_HCAL_CONDITION_OWNER.HCAL_HARDWARE_LOGICAL_MAPS_V2 LOGMAP\n";
305 sql_hbheho +=
" inner join CMS_HCL_CORE_CONDITION_OWNER.COND_DATA_SETS LOGMAP_DS\n";
306 sql_hbheho +=
" on LOGMAP_DS.CONDITION_DATA_SET_ID=LOGMAP.CONDITION_DATA_SET_ID\n";
307 sql_hbheho +=
" inner join\n";
308 sql_hbheho +=
" (\n";
309 sql_hbheho +=
" select ADC.PART_ID as ADC_PART_ID, \n";
310 sql_hbheho +=
" SLOT.NAME_LABEL as RBX_SLOT,\n";
311 sql_hbheho +=
" RM.RM_SLOT as RM_SLOT,\n";
312 sql_hbheho +=
" QIE.QIE_SLOT as QIE_SLOT,\n";
313 sql_hbheho +=
" ADC.ADC_POSITION as ADC\n";
314 sql_hbheho +=
" from CMS_HCL_CORE_CONSTRUCT_OWNER.V_HCAL_READOUTBOX_SLOTS SLOT\n";
315 sql_hbheho +=
" inner join CMS_HCL_CORE_CONSTRUCT_OWNER.V_HCAL_READOUTBOXS RBX\n";
316 sql_hbheho +=
" on RBX.PART_PARENT_ID=SLOT.PART_ID\n";
317 sql_hbheho +=
" inner join CMS_HCL_CORE_CONSTRUCT_OWNER.V_HCAL_READOUTMODULES RM\n";
318 sql_hbheho +=
" on RM.PART_PARENT_ID=RBX.PART_ID\n";
319 sql_hbheho +=
" inner join CMS_HCL_CORE_CONSTRUCT_OWNER.V_HCAL_QIECARDS QIE\n";
320 sql_hbheho +=
" on QIE.PART_PARENT_ID=RM.PART_ID\n";
321 sql_hbheho +=
" inner join CMS_HCL_CORE_CONSTRUCT_OWNER.V_HCAL_ADCS ADC\n";
322 sql_hbheho +=
" on ADC.PART_PARENT_ID=QIE.PART_ID \n";
323 sql_hbheho +=
" ) ADC_CHAIN\n";
324 sql_hbheho +=
" on ADC_CHAIN.RBX_SLOT = LOGMAP.RBX_SLOT and\n";
325 sql_hbheho +=
" ADC_CHAIN.RM_SLOT = LOGMAP.RM_SLOT and\n";
326 sql_hbheho +=
" ADC_CHAIN.QIE_SLOT = LOGMAP.QIE_SLOT and\n";
327 sql_hbheho +=
" ADC_CHAIN.ADC = LOGMAP.ADC\n";
328 sql_hbheho +=
" where LOGMAP_DS.VERSION='15'\n";
329 sql_hbheho +=
" ) ADC_CH\n";
330 sql_hbheho +=
" on DS.PART_ID=ADC_CH.ADC_PART_ID\n";
331 sql_hbheho +=
" where DS.VERSION='3'\n";
336 sql_hf +=
" FROM \n";
337 sql_hf +=
" CMS_HCL_HCAL_CONDITION_OWNER.QIECARD_ADC_CALIBMODE DAT\n";
338 sql_hf +=
" inner join CMS_HCL_CORE_CONDITION_OWNER.COND_DATA_SETS DS\n";
339 sql_hf +=
" on DAT.CONDITION_DATA_SET_ID=DS.CONDITION_DATA_SET_ID\n";
340 sql_hf +=
" inner join \n";
342 sql_hf +=
" select\n";
343 sql_hf +=
" LOGMAP.SIDE,\n";
344 sql_hf +=
" LOGMAP.ETA,\n";
345 sql_hf +=
" LOGMAP.PHI,\n";
346 sql_hf +=
" LOGMAP.DEPTH,\n";
347 sql_hf +=
" LOGMAP.SUBDETECTOR,\n";
348 sql_hf +=
" ADC_CHAIN.ADC_PART_ID\n";
350 sql_hf +=
" CMS_HCL_HCAL_CONDITION_OWNER.HCAL_HARDWARE_LOGICAL_MAPS_V2 LOGMAP\n";
351 sql_hf +=
" inner join CMS_HCL_CORE_CONDITION_OWNER.COND_DATA_SETS LOGMAP_DS\n";
352 sql_hf +=
" on LOGMAP_DS.CONDITION_DATA_SET_ID=LOGMAP.CONDITION_DATA_SET_ID\n";
353 sql_hf +=
" inner join\n";
355 sql_hf +=
" select ADC.PART_ID as ADC_PART_ID, \n";
356 sql_hf +=
" SLOT.NAME_LABEL as CRATE_SLOT,\n";
357 sql_hf +=
" QIE.QIE_SLOT as QIE_SLOT,\n";
358 sql_hf +=
" ADC.ADC_POSITION as ADC\n";
359 sql_hf +=
" from CMS_HCL_CORE_CONSTRUCT_OWNER.V_HCAL_WEDGE_SLOTS SLOT\n";
360 sql_hf +=
" inner join CMS_HCL_CORE_CONSTRUCT_OWNER.V_HCAL_HF_FE_CRATE CR\n";
361 sql_hf +=
" on CR.PART_PARENT_ID=SLOT.PART_ID\n";
362 sql_hf +=
" inner join CMS_HCL_CORE_CONSTRUCT_OWNER.V_HCAL_QIECARDS QIE\n";
363 sql_hf +=
" on QIE.PART_PARENT_ID=CR.PART_ID\n";
364 sql_hf +=
" inner join CMS_HCL_CORE_CONSTRUCT_OWNER.V_HCAL_ADCS ADC\n";
365 sql_hf +=
" on ADC.PART_PARENT_ID=QIE.PART_ID \n";
366 sql_hf +=
" ) ADC_CHAIN\n";
367 sql_hf +=
" on ADC_CHAIN.CRATE_SLOT = LOGMAP.RBX_SLOT and\n";
368 sql_hf +=
" ADC_CHAIN.QIE_SLOT = LOGMAP.QIE_SLOT and\n";
369 sql_hf +=
" ADC_CHAIN.ADC = LOGMAP.ADC\n";
370 sql_hf +=
" where LOGMAP_DS.VERSION='15'\n";
371 sql_hf +=
" ) ADC_CH\n";
372 sql_hf +=
" on DS.PART_ID=ADC_CH.ADC_PART_ID\n";
373 sql_hf +=
" where DS.VERSION='3'\n";
377 sql_query [0] =
" SELECT \n" + sql_what + sql_hbheho;
378 sql_query [1] =
" SELECT \n" + sql_what + sql_hf;
381 for (
int i = 0;
i < 2;
i++) {
387 while (rset->next ()) {
389 int z = rset->getInt (index++);
390 int eta = rset->getInt (index++);
391 int phi = rset->getInt (index++);
392 int depth = rset->getInt (index++);
395 for (
unsigned bin = 0;
bin < 32;
bin++) values [
bin] = rset->getFloat (index++);
410 std::cerr <<
"HcalDbOnline::getObject exception-> " << sqlExcp.getErrorCode () <<
": " << sqlExcp.what () << std::endl;
418 if (!fObject && !fWidths)
return false;
419 std::ostringstream sTime;
422 sql_query +=
"SELECT\n";
423 sql_query +=
" Z, ETA, PHI, DEPTH, DETECTOR_NAME\n";
424 sql_query +=
" , CAPACITOR_0_VALUE, CAPACITOR_1_VALUE, CAPACITOR_2_VALUE, CAPACITOR_3_VALUE\n";
425 sql_query +=
" , SIGMA_0_0, SIGMA_0_1, SIGMA_0_2, SIGMA_0_3, SIGMA_1_1, SIGMA_1_2, SIGMA_1_3, SIGMA_2_2, SIGMA_2_3, SIGMA_3_3\n";
426 sql_query +=
" , RUN_NUMBER, INTERVAL_OF_VALIDITY_BEGIN, INTERVAL_OF_VALIDITY_END\n";
427 sql_query +=
"FROM V_HCAL_PEDESTALS_V2\n";
428 sql_query +=
"WHERE TAG_NAME='" + fTag +
"'\n";
429 sql_query +=
"AND INTERVAL_OF_VALIDITY_BEGIN=" + sTime.str() +
"\n";
430 sql_query +=
"AND (INTERVAL_OF_VALIDITY_END IS NULL OR INTERVAL_OF_VALIDITY_END>" + sTime.str() +
")\n";
436 while (rset->next ()) {
438 int z = rset->getInt (index++);
439 int eta = rset->getInt (index++);
440 int phi = rset->getInt (index++);
441 int depth = rset->getInt (index++);
446 for (
int i = 0;
i < 4;
i++) values[
i] = rset->getFloat (index++);
447 for (
int i = 0;
i < 4;
i++)
448 for (
int j =
i;
j < 4;
j++) widths [
i][
j] = rset->getFloat (index++);
459 std::cerr <<
"HcalDbOnline::getObject-> Ignore data to redefine channel " <<
id.rawId() << std::endl;
462 HcalPedestal myped(
id,values[0],values[1],values[2],values[3]);
468 std::cerr <<
"HcalDbOnline::getObject-> Ignore data to redefine channel " <<
id.rawId() << std::endl;
472 for (
int i = 0;
i < 4;
i++)
481 std::cerr <<
"HcalDbOnline::getObject exception-> " << sqlExcp.getErrorCode () <<
": " << sqlExcp.what () << std::endl;
497 if (!fObject && !fWidths)
return false;
498 std::ostringstream sTime;
501 sql_query +=
"SELECT\n";
502 sql_query +=
" Z, ETA, PHI, DEPTH, DETECTOR_NAME\n";
503 sql_query +=
" , CAPACITOR_0_VALUE, CAPACITOR_1_VALUE, CAPACITOR_2_VALUE, CAPACITOR_3_VALUE\n";
504 sql_query +=
" , CAPACITOR_0_ERROR, CAPACITOR_1_ERROR, CAPACITOR_2_ERROR, CAPACITOR_3_ERROR\n";
505 sql_query +=
" , RUN_NUMBER, INTERVAL_OF_VALIDITY_BEGIN, INTERVAL_OF_VALIDITY_END\n";
506 sql_query +=
"FROM V_HCAL_GAIN_CALIBRATIONS\n";
507 sql_query +=
"WHERE TAG_NAME='" + fTag +
"'\n";
508 sql_query +=
"AND INTERVAL_OF_VALIDITY_BEGIN=" + sTime.str() +
"\n";
509 sql_query +=
"AND (INTERVAL_OF_VALIDITY_END IS NULL OR INTERVAL_OF_VALIDITY_END>" + sTime.str() +
")\n";
515 std::cout <<
"query is executed... " << std::endl;
516 while (rset->next ()) {
518 int z = rset->getInt (index++);
519 int eta = rset->getInt (index++);
520 int phi = rset->getInt (index++);
521 int depth = rset->getInt (index++);
525 for (
int i = 0;
i < 4;
i++) values[
i] = rset->getFloat (index++);
526 for (
int i = 0;
i < 4;
i++) rset->getFloat (index++);
536 std::cerr <<
"HcalDbOnline::getObject-> Ignore data to redefine channel " <<
id.rawId() << std::endl;
539 HcalGain mygain(
id,values[0],values[1],values[2],values[3]);
545 std::cerr <<
"HcalDbOnline::getObject-> Ignore data to redefine channel " <<
id.rawId() << std::endl;
548 HcalGainWidth mywid(
id,values[0],values[1],values[2],values[3]);
556 std::cerr <<
"HcalDbOnline::getObject exception-> " << sqlExcp.getErrorCode () <<
": " << sqlExcp.what () << std::endl;
572 std::vector<std::string>
result;
574 sql_query +=
"SELECT unique TAG_NAME from V_TAG_IOV_CONDDATASET order by TAG_NAME\n";
580 while (rset->next ()) {
582 result.push_back (tag);
586 std::cerr <<
"HcalDbOnline::metadataAllTags exception-> " << sqlExcp.getErrorCode () <<
": " << sqlExcp.what () << std::endl;
592 std::vector<IntervalOV>
result;
594 sql_query +=
"SELECT unique INTERVAL_OF_VALIDITY_BEGIN, INTERVAL_OF_VALIDITY_END from V_TAG_IOV_CONDDATASET\n";
595 sql_query +=
"WHERE TAG_NAME='" + fTag +
"'\n";
596 sql_query +=
"ORDER by INTERVAL_OF_VALIDITY_BEGIN\n";
602 while (rset->next ()) {
611 IOVTime beginIov = (
unsigned long) rset->getNumber (1);
614 IOVTime endIov = rset->getInt (2);
616 result.push_back (std::make_pair (beginIov, endIov));
620 std::cerr <<
"HcalDbOnline::getIOVs exception-> " << sqlExcp.getErrorCode () <<
": " << sqlExcp.what () << std::endl;
oracle::occi::Environment * mEnvironment
static const double slope[3]
void setOffset(unsigned fCapId, unsigned fRange, float fValue)
bool addCoder(const HcalQIECoder &fCoder)
oracle::occi::SQLException SQLException
const bool exists(DetId fId) const
std::vector< IntervalOV > getIOVs(const std::string &fTag)
unsigned long long IOVTime
void setMinCharges(const float fValue[32])
bool mapEId2chId(HcalElectronicsId fElectronicsId, DetId fId)
HcalDbOnline(const std::string &fDb, bool fVerbose=false)
oracle::occi::Statement * mStatement
std::vector< std::string > metadataAllTags()
void setHTR(int crate, int slot, int tb)
bool getObject(HcalPedestals *fObject, HcalPedestalWidths *fWidths, const std::string &fTag, IOVTime fTime)
oracle::occi::Connection * mConnect
oracle::occi::ResultSet ResultSet
mVerbose(fConfig.getUntrackedParameter< bool >("verbose", false))
bool addCoder(const HcalCalibrationQIECoder &fCoder)
bool addValues(const Item &myItem)
Readout chain identification for Hcal.
void setSigma(int fCapId1, int fCapId2, float fSigma)
void setSlope(unsigned fCapId, unsigned fRange, float fValue)