26 std::istringstream iss(s);
27 return !(iss >>
f >>
t).
fail();
38 if (rs->getString(1).find(
"HcalDetId")!=std::string::npos){
45 else if (rs->getString(1).find(
"HcalCalibDetId")!=std::string::npos){
52 else if (rs->getString(1).find(
"HcalTrigTowerDetId")!=std::string::npos){
57 else if (rs->getString(1).find(
"HcalZDCDetId")!=std::string::npos){
63 else if (rs->getString(1).find(
"HcalCastorDetId")!=std::string::npos){
75 const int fSubversion,
80 if (!fObject)
return false;
83 oracle::occi::Statement* stmt = connection->createStatement(fQuery);
84 stmt->setString(1,fTag);
86 stmt->setInt(2,fIOVBegin);
91 for (
int _i=1; _i!=12; _i++) rs->setMaxColumnSize(_i,128);
94 _row.setMessage(
"HCAL channels processed: ");
95 _row.setPrintCount(
true);
96 _row.setNewLine(
true);
106 _unit = rs->getInt(12);
107 float cap0 = rs->getFloat(13);
108 float cap1 = rs->getFloat(14);
109 float cap2 = rs->getFloat(15);
110 float cap3 = rs->getFloat(16);
111 float variance0 = rs->getFloat(17);
112 float variance1 = rs->getFloat(18);
113 float variance2 = rs->getFloat(19);
114 float variance3 = rs->getFloat(20);
122 HcalPedestal * fCondObject =
new HcalPedestal(
id.rawId(), cap0, cap1, cap2, cap3, variance0, variance1, variance2, variance3);
127 connection->terminateStatement(stmt);
131 bool unit_is_adc =
false;
132 if (_unit!=0) unit_is_adc =
true;
141 const int fSubversion,
146 if (!fObject)
return false;
149 oracle::occi::Statement* stmt = connection->createStatement(fQuery);
150 stmt->setString(1,fTag);
151 stmt->setInt(2,fIOVBegin);
155 rs->setMaxColumnSize(1,128);
156 rs->setMaxColumnSize(2,128);
157 rs->setMaxColumnSize(3,128);
158 rs->setMaxColumnSize(4,128);
159 rs->setMaxColumnSize(5,128);
160 rs->setMaxColumnSize(6,128);
161 rs->setMaxColumnSize(7,128);
162 rs->setMaxColumnSize(8,128);
163 rs->setMaxColumnSize(9,128);
164 rs->setMaxColumnSize(10,128);
165 rs->setMaxColumnSize(11,128);
168 _row.setMessage(
"HCAL channels processed: ");
169 _row.setPrintCount(
true);
170 _row.setNewLine(
true);
180 _unit = rs->getInt(12);
181 float covariance_00 = rs->getFloat(13);
182 float covariance_01 = rs->getFloat(14);
183 float covariance_02 = rs->getFloat(15);
184 float covariance_03 = rs->getFloat(16);
185 float covariance_10 = rs->getFloat(17);
186 float covariance_11 = rs->getFloat(18);
187 float covariance_12 = rs->getFloat(19);
188 float covariance_13 = rs->getFloat(20);
189 float covariance_20 = rs->getFloat(21);
190 float covariance_21 = rs->getFloat(22);
191 float covariance_22 = rs->getFloat(23);
192 float covariance_23 = rs->getFloat(24);
193 float covariance_30 = rs->getFloat(25);
194 float covariance_31 = rs->getFloat(26);
195 float covariance_32 = rs->getFloat(27);
196 float covariance_33 = rs->getFloat(28);
198 fCondObject->
setSigma(0,0,covariance_00);
199 fCondObject->
setSigma(0,1,covariance_01);
200 fCondObject->
setSigma(0,2,covariance_02);
201 fCondObject->
setSigma(0,3,covariance_03);
202 fCondObject->
setSigma(1,0,covariance_10);
203 fCondObject->
setSigma(1,1,covariance_11);
204 fCondObject->
setSigma(1,2,covariance_12);
205 fCondObject->
setSigma(1,3,covariance_13);
206 fCondObject->
setSigma(2,0,covariance_20);
207 fCondObject->
setSigma(2,1,covariance_21);
208 fCondObject->
setSigma(2,2,covariance_22);
209 fCondObject->
setSigma(2,3,covariance_23);
210 fCondObject->
setSigma(3,0,covariance_30);
211 fCondObject->
setSigma(3,1,covariance_31);
212 fCondObject->
setSigma(3,2,covariance_32);
213 fCondObject->
setSigma(3,3,covariance_33);
218 connection->terminateStatement(stmt);
222 bool unit_is_adc =
false;
223 if (_unit!=0) unit_is_adc =
true;
232 const int fSubversion,
237 if (!fObject)
return false;
239 oracle::occi::Statement* stmt = connection->createStatement(fQuery);
240 stmt->setString(1,fTag);
241 stmt->setInt(2,fIOVBegin);
246 for (
int _i=1; _i!=12; _i++) rs->setMaxColumnSize(_i,128);
249 _row.setMessage(
"HCAL channels processed: ");
250 _row.setPrintCount(
true);
251 _row.setNewLine(
true);
261 float cap0 = rs->getFloat(12);
262 float cap1 = rs->getFloat(13);
263 float cap2 = rs->getFloat(14);
264 float cap3 = rs->getFloat(15);
276 connection->terminateStatement(stmt);
287 const int fSubversion,
292 if (!fObject)
return false;
294 oracle::occi::Statement* stmt = connection->createStatement(fQuery);
295 stmt->setString(1,fTag);
296 stmt->setInt(2,fIOVBegin);
301 for (
int _i=1; _i!=12; _i++) rs->setMaxColumnSize(_i,128);
304 _row.setMessage(
"HCAL channels processed: ");
305 _row.setPrintCount(
true);
306 _row.setNewLine(
true);
316 float cap0 = rs->getFloat(12);
317 float cap1 = rs->getFloat(13);
318 float cap2 = rs->getFloat(14);
319 float cap3 = rs->getFloat(15);
331 connection->terminateStatement(stmt);
342 const int fSubversion,
347 if (!fObject)
return false;
349 oracle::occi::Statement* stmt = connection->createStatement(fQuery);
350 stmt->setString(1,fTag);
351 stmt->setInt(2,fIOVBegin);
355 rs->setMaxColumnSize(1,128);
356 rs->setMaxColumnSize(2,128);
357 rs->setMaxColumnSize(3,128);
358 rs->setMaxColumnSize(4,128);
359 rs->setMaxColumnSize(5,128);
360 rs->setMaxColumnSize(6,128);
361 rs->setMaxColumnSize(7,128);
362 rs->setMaxColumnSize(8,128);
363 rs->setMaxColumnSize(9,128);
364 rs->setMaxColumnSize(10,128);
365 rs->setMaxColumnSize(11,128);
368 _row.setMessage(
"HCAL channels processed: ");
369 _row.setPrintCount(
true);
370 _row.setNewLine(
true);
382 for (
int _i=0; _i!=32; _i++) items[_i] = rs->getFloat(_i+12);
384 for (
unsigned capid = 0; capid < 4; capid++) {
385 for (
unsigned range = 0; range < 4; range++) {
386 fCondObject->
setSlope (capid, range, items[capid*4+range]);
389 for (
unsigned capid = 0; capid < 4; capid++) {
390 for (
unsigned range = 0; range < 4; range++) {
391 fCondObject->
setOffset (capid, range, items[16+capid*4+range]);
398 connection->terminateStatement(stmt);
409 const int fSubversion,
413 std::cerr <<
"NOT IMPLEMENTED!" << std::endl;
421 const int fSubversion,
426 if (!fObject)
return false;
428 oracle::occi::Statement* stmt = connection->createStatement(fQuery);
429 stmt->setString(1,fTag);
430 stmt->setInt(2,fIOVBegin);
435 for (
int _i=1; _i!=20; _i++) rs->setMaxColumnSize(_i,128);
438 _row.setMessage(
"HCAL channels processed: ");
439 _row.setPrintCount(
true);
440 _row.setNewLine(
true);
451 int crate = rs->getInt(13);
452 int slot = rs->getInt(14);
453 int dcc = rs->getInt(16);
454 int spigot = rs->getInt(17);
457 if (tb.find(
"b")!=std::string::npos) top = 0;
459 if (_obj_name.find(
"HcalTrigTowerDetId")!=std::string::npos){
460 int slbCh = rs->getInt(19);
461 int slb = rs->getInt(18);
465 int fiberCh = rs->getInt(19);
466 int fiber = rs->getInt(18);
468 fCondObject->
setHTR(crate,slot,top);
470 if (_obj_name.find(
"HcalTrigTowerDetId")!=std::string::npos){
473 else if (_obj_name.find(
"HcalDetId")!=std::string::npos ||
474 _obj_name.find(
"HcalCalibDetId")!=std::string::npos ||
475 _obj_name.find(
"HcalZDCDetId")!=std::string::npos){
479 edm::LogWarning(
"Format Error") <<
"HcalElectronicsMap-> Unknown subdetector: "
480 << _obj_name << std::endl;
485 connection->terminateStatement(stmt);
497 const int fSubversion,
501 std::cout <<
" +++++=====> HcalDbOmds::getObject" << std::endl;
504 if (!fObject)
return false;
506 oracle::occi::Statement* stmt = connection->createStatement(fQuery);
507 stmt->setString(1,fTag);
508 stmt->setInt(2,fIOVBegin);
513 for (
int _i=1; _i!=12; _i++) rs->setMaxColumnSize(_i,128);
516 _row.setMessage(
"HCAL channels processed: ");
517 _row.setPrintCount(
true);
518 _row.setNewLine(
true);
528 int value = rs->getInt(12);
540 connection->terminateStatement(stmt);
551 const int fSubversion,
556 if (!fObject)
return false;
558 oracle::occi::Statement* stmt = connection->createStatement(fQuery);
559 stmt->setString(1,fTag);
560 stmt->setInt(2,fIOVBegin);
565 for (
int _i=1; _i!=12; _i++) rs->setMaxColumnSize(_i,128);
568 _row.setMessage(
"HCAL channels processed: ");
569 _row.setPrintCount(
true);
570 _row.setNewLine(
true);
580 float value = rs->getFloat(12);
592 connection->terminateStatement(stmt);
603 const int fSubversion,
608 if (!fObject)
return false;
610 oracle::occi::Statement* stmt = connection->createStatement(fQuery);
611 stmt->setString(1,fTag);
612 stmt->setInt(2,fIOVBegin);
617 for (
int _i=1; _i!=12; _i++) rs->setMaxColumnSize(_i,128);
620 _row.setMessage(
"HCAL channels processed: ");
621 _row.setPrintCount(
true);
622 _row.setNewLine(
true);
632 int zs = rs->getInt(12);
644 connection->terminateStatement(stmt);
655 const int fSubversion,
660 if (!fObject)
return false;
664 oracle::occi::Statement* stmt = connection->createStatement(fQuery);
665 stmt->setString(1,fTag);
666 stmt->setInt(2,fIOVBegin);
670 rs->setMaxColumnSize(1,128);
671 rs->setMaxColumnSize(2,128);
672 rs->setMaxColumnSize(3,128);
673 rs->setMaxColumnSize(4,128);
674 rs->setMaxColumnSize(5,128);
675 rs->setMaxColumnSize(6,128);
676 rs->setMaxColumnSize(7,128);
677 rs->setMaxColumnSize(8,128);
678 rs->setMaxColumnSize(9,128);
679 rs->setMaxColumnSize(10,128);
680 rs->setMaxColumnSize(11,128);
683 _row.setMessage(
"HCAL channels processed: ");
684 _row.setPrintCount(
true);
685 _row.setNewLine(
true);
704 float average_pedestal = rs->getFloat(12);
705 float response_corrected_gain = rs->getFloat(13);
706 int flag = rs->getInt(14);
708 if (metadata_name.find(
"lut_tag")!=std::string::npos){
709 _tag = rs->getString(16);
711 else if (metadata_name.find(
"algo_name")!=std::string::npos){
712 _algo = rs->getString(16);
719 connection->terminateStatement(stmt);
731 const int fSubversion,
736 if (!fObject)
return false;
738 oracle::occi::Statement* stmt = connection->createStatement(fQuery);
739 stmt->setString(1,fTag);
741 stmt->setInt(2,fIOVBegin);
746 for (
int _i=1; _i!=12; _i++) rs->setMaxColumnSize(_i,128);
749 _row.setMessage(
"HCAL channels processed: ");
750 _row.setPrintCount(
true);
751 _row.setNewLine(
true);
761 float value = rs->getFloat(12);
773 connection->terminateStatement(stmt);
784 const int fSubversion,
789 if (!fObject)
return false;
791 oracle::occi::Statement* stmt = connection->createStatement(fQuery);
792 stmt->setString(1,fTag);
794 stmt->setInt(2,fIOVBegin);
799 for (
int _i=1; _i!=12; _i++) rs->setMaxColumnSize(_i,128);
802 _row.setMessage(
"HCAL channels processed: ");
803 _row.setPrintCount(
true);
804 _row.setNewLine(
true);
819 if (rs->getString(1).find(
"fakeobjectname")!=std::string::npos){
820 float rctlsb = rs->getFloat(12);
821 float nominal_gain = rs->getFloat(13);
828 float rcalib = rs->getFloat(12);
829 uint32_t lut_granularity = rs->getInt(13);
830 uint32_t output_lut_threshold = rs->getInt(14);
834 output_lut_threshold);
840 connection->terminateStatement(stmt);
851 const int fSubversion,
856 if (!fObject)
return false;
858 oracle::occi::Statement* stmt = connection->createStatement(fQuery);
859 stmt->setString(1,fTag);
860 stmt->setString(2,fVersion);
861 stmt->setInt(3,fSubversion);
862 stmt->setInt(4,fIOVBegin);
864 std::cout <<
"DEBUG****** IOV=" << fIOVBegin << std::endl;
869 for (
int _i=1; _i!=9; _i++) rs->setMaxColumnSize(_i,128);
872 _row.setMessage(
"HCAL DCS records: ");
873 _row.setPrintCount(
true);
874 _row.setNewLine(
true);
902 int sidering = rs->getInt(7);
903 unsigned int slice = rs->getInt(8);
904 unsigned int subchan = rs->getInt(9);
910 int LS = rs->getInt(2);
911 float val = rs->getFloat(3);
912 float upper = rs->getFloat(4);
913 float lower = rs->getFloat(5);
921 if (!(fObject->
addValue(*fCondObject))) {
923 <<
"\nwas not added to the HcalDcsValues object." << std::endl;
929 connection->terminateStatement(stmt);
945 if ( _det.find(
"HB") != std::string::npos ) result =
HcalBarrel;
946 else if ( _det.find(
"HE") != std::string::npos ) result =
HcalEndcap;
947 else if ( _det.find(
"HF") != std::string::npos ) result =
HcalForward;
948 else if ( _det.find(
"HO") != std::string::npos ) result =
HcalOuter;
958 else if ( _section.find(
"EM") != std::string::npos ) result =
HcalZDCDetId::EM;
959 else if ( _section.find(
"HAD") != std::string::npos ) result =
HcalZDCDetId::HAD;
960 else if ( _section.find(
"LUM") != std::string::npos ) result =
HcalZDCDetId::LUM;
969 switch (_dpname.at(_dpname.find(
"HVcrate_")+9)) {
990 int _side_ring = 1000;
993 switch (_dpname.at(_dpname.find(
"HVcrate_")+9)) {
997 if (_dpname.at(_dpname.find(
"HVcrate_")+10) ==
'M') _side = -1;
998 else if (_dpname.at(_dpname.find(
"HVcrate_")+10) ==
'P') _side = +1;
1002 if (_dpname.at(_dpname.find(
"HVcrate_")+11) ==
'M') _side = -1;
1003 else if (_dpname.at(_dpname.find(
"HVcrate_")+11) ==
'P') _side = +1;
1004 _ring = atoi(&(_dpname.at(_dpname.find(
"HVcrate_")+10)));
1009 _side_ring = _side * _ring;
1015 HcalDbOmds::from_string<int>(
result, _dpname.substr(_dpname.find(
"/S")+2,2), std::dec);
1016 return (
unsigned int)
result;
1020 unsigned int result = 1000;
1021 HcalDbOmds::from_string<unsigned int>(
result, _dpname.substr(_dpname.find(
"/RM")+3,1), std::dec);
1029 std::string _type = _dpname.substr(_dpname.find(
"/RM")+4);
1036 switch (subdet.at(1)){
void setAlgoString(std::string fAlgo)
void setUnitADC(bool isADC)
HcalOtherSubdetector getSubDetFromDpName(std::string _dpname)
bool getObject(oracle::occi::Connection *connection, const std::string &fTag, const std::string &fVersion, const int fSubversion, const int fIOVBegin, const std::string &fQuery, HcalPedestals *fObject)
bool dumpObject(std::ostream &fOutput, const HcalPedestals &fObject)
HcalOtherSubdetector getSubDetFromString(std::string subdet)
void setOffset(unsigned fCapId, unsigned fRange, float fValue)
bool mapEId2tId(HcalElectronicsId fElectronicsId, HcalTrigTowerDetId fTriggerId)
bool addCoder(const HcalQIECoder &fCoder)
oracle::occi::SQLException SQLException
HcalSubdetector get_subdetector(std::string _det)
void setUnitADC(bool isADC)
unsigned int getSliceFromDpName(std::string _dpname)
HcalDcsDetId::DcsType getDcsTypeFromString(std::string type)
bool mapEId2chId(HcalElectronicsId fElectronicsId, DetId fId)
std::string toString(const std::pair< T, T > &aT)
void setHTR(int crate, int slot, int tb)
HcalDcsDetId::DcsType getDcsTypeFromDpName(std::string _dpname)
bool from_string(T &t, const std::string &s, std::ios_base &(*f)(std::ios_base &))
oracle::occi::ResultSet ResultSet
bool addValue(HcalDcsValue const &newVal)
unsigned int getSubChannelFromDpName(std::string _dpname)
void setTagString(std::string fTag)
bool addValues(const Item &myItem)
DetId getId(oracle::occi::ResultSet *rs)
HcalZDCDetId::Section get_zdc_section(std::string _section)
int getSideRingFromDpName(std::string _dpname)
Readout chain identification for Hcal [31:26] Unused (so far) [25] Trigger-chain id flag [24:20] Read...
void setSigma(int fCapId1, int fCapId2, float fSigma)
void setSlope(unsigned fCapId, unsigned fRange, float fValue)