26 if (
first.genericSubdet() !=
second.genericSubdet())
27 return first.genericSubdet() <
second.genericSubdet();
28 if (
first.isHcalDetId()) {
31 return f1.zside() != s1.zside()
32 ?
f1.zside() < s1.zside()
33 :
f1.iphi() != s1.iphi()
34 ?
f1.iphi() < s1.iphi()
35 :
f1.ietaAbs() != s1.ietaAbs() ?
f1.ietaAbs() < s1.ietaAbs() :
f1.depth() < s1.depth();
41 class HcalElectronicsIdLess {
44 return first.readoutVMECrateId() !=
second.readoutVMECrateId()
45 ?
first.readoutVMECrateId() <
second.readoutVMECrateId()
59 std::vector<std::string>
result;
62 for (
unsigned i = 0;
i <= fLine.size();
i++) {
63 if (fLine[
i] ==
' ' ||
i == fLine.size()) {
79 std::vector<unsigned int>
result;
82 for (
unsigned i = 0;
i <= fLine.size();
i++) {
83 if (fLine[
i] ==
',' ||
i == fLine.size()) {
86 result.push_back(atoi(itemString.c_str()));
102 for (
unsigned i = 0;
i <= fLine.size();
i++) {
103 if (fLine[
i] ==
',' ||
i == fLine.size()) {
106 result.push_back(atof(itemString.c_str()));
119 std::vector<double>
result;
122 for (
unsigned i = 0;
i <= fLine.size();
i++) {
123 if (fLine[
i] ==
',' ||
i == fLine.size()) {
126 result.push_back(atof(itemString.c_str()));
147 " %15s %15s %15s %15s",
171 std::istringstream iss(
s);
172 return !(iss >>
f >>
t).fail();
175 template <
class S,
class T>
180 while (fInput.getline(
buffer, 1024)) {
186 if (
items.size() < 8) {
188 <<
"\n line must contain 8 items: eta, phi, depth, subdet, 4x values"
198 S fCondObject(
id, atof(
items[4].c_str()), atof(
items[5].c_str()), atof(
items[6].c_str()), atof(
items[7].c_str()));
199 fObject->addValues(fCondObject);
210 "# %15s %15s %15s %15s %8s %8s %8s %8s %10s\n",
221 std::vector<DetId>
channels = fObject.getAllChannels();
223 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
224 const float*
values = fObject.getValues(*channel)->getValues();
235 template <
class ObjectPrimitiveType,
class S,
class T>
240 while (fInput.getline(
buffer, 1024)) {
246 if (
items.size() < 5) {
248 <<
"\n line must contain 5 items: eta, phi, depth, subdet, value" << std::endl;
257 std::stringstream
ss(
items[4]);
258 ObjectPrimitiveType
x = 0;
260 S fCondObject(
id,
x);
261 fObject->addValues(fCondObject);
270 sprintf(
buffer,
"# %15s %15s %15s %15s %8s %10s\n",
"eta",
"phi",
"dep",
"det",
"value",
"DetId");
272 std::vector<DetId>
channels = fObject.getAllChannels();
274 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
275 const float value = fObject.getValues(*channel)->getValue();
277 sprintf(
buffer,
" %8.5f %10X\n",
value, channel->rawId());
286 sprintf(
buffer,
"# %15s %15s %15s %15s %8s %10s\n",
"eta",
"phi",
"dep",
"det",
"value",
"DetId");
288 std::vector<DetId>
channels = fObject.getAllChannels();
290 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
291 const int value = fObject.getValues(*channel)->getValue();
293 sprintf(
buffer,
" %15d %10X\n",
value, channel->rawId());
299 template <
class S,
class T>
304 while (fInput.getline(
buffer, 1024)) {
311 fCondObject =
new S(firstid.
rawId());
312 for (
int j = 0;
j != 10;
j++)
313 fCondObject->setValue(atoi(
items[4].c_str()), 0,
j, atof(
items[
j + 5].c_str()));
314 for (
int i = 1;
i != 40;
i++) {
315 fInput.getline(
buffer, 1024);
318 if (
id.rawId() != firstid.
rawId())
320 for (
int j = 0;
j != 10;
j++)
321 fCondObject->setValue(atoi(
items[4].c_str()),
i % 10,
j, atof(
items[
j + 5].c_str()));
323 fObject->addValues(*fCondObject);
333 "# %5s %5s %5s %5s %5s %8s %8s %8s %8s %8s %8s %8s %8s %8s %8s %10s\n",
351 std::vector<DetId>
channels = fObject.getAllChannels();
353 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
355 for (
int m = 0;
m != 4;
m++) {
356 for (
int i = 0;
i != 10;
i++) {
357 for (
int j = 0;
j != 10;
j++) {
359 thisline[
j] = fObject.getValues(*channel)->getValue(
m,
i,
j);
364 " %5i %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %10X\n",
388 bool getObject(std::istream& fInput,
HcalGains* fObject) {
return getHcalObject<HcalGain>(fInput, fObject); }
391 return getHcalObject<HcalGainWidth>(fInput, fObject);
396 return getHcalSingleObject<float, HcalRespCorr>(fInput, fObject);
403 return getHcalSingleObject<float, HcalLUTCorr>(fInput, fObject);
410 return getHcalSingleObject<float, HcalPFCorr>(fInput, fObject);
417 return getHcalSingleObject<float, HcalTimeCorr>(fInput, fObject);
424 return getHcalSingleObject<int, HcalZSThreshold>(fInput, fObject);
431 return getHcalSingleObject<float, HcalZDCLowGainFraction>(fInput, fObject);
438 return getHcalSingleObject<float, HcalValidationCorr>(fInput, fObject);
445 return getHcalSingleObject<int, HcalQIEType>(fInput, fObject);
457 while (fInput.getline(
buffer, 1024)) {
463 if (
items.size() < 6) {
465 <<
"\n line must contain 6 items: eta, phi, depth, subdet, param1, param2"
471 int packingScheme = 0;
472 if (
items.size() > 22) {
473 packingScheme = atoi(
items[22].c_str());
478 if (packingScheme == 0) {
479 param1 = atoi(
items[4].c_str());
480 param2 = atoi(
items[5].c_str());
483 if (packingScheme == 1) {
485 int aabits[6] = {1, 1, 8, 4, 4, 9};
486 int aamax[6] = {1, 1, 255, 15, 15, 511};
488 int bbbits[10] = {1, 4, 1, 4, 1, 4, 4, 4, 4, 4};
489 int bbmax[10] = {1, 15, 1, 15, 1, 15, 15, 15, 15, 15};
495 for (
int i = 0;
i < 6;
i++) {
499 float xphase = (
phase + 32.0) * 4.0;
502 aa = atoi(
items[
j].c_str());
504 if (aa > aamax[
i] || aa < 0) {
506 <<
"Bad line: " <<
buffer <<
"\n value for a" <<
i <<
" should be less than" << aamax[
i] << std::endl;
508 param1 = param1 | aa << aashift;
509 aashift = aashift + aabits[
i];
515 for (
int i = 0;
i < 10;
i++) {
517 bb = atoi(
items[
j].c_str());
520 <<
"Bad line: " <<
buffer <<
"\n value for b" <<
i <<
" should be less than" << bbmax[
i] << std::endl;
522 param2 = param2 | bb << bbshift;
523 bbshift = bbshift + bbbits[
i];
545 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
553 if (packingScheme == 0) {
555 if (myCounter == 1) {
557 "# %15s %15s %15s %15s %18s %15s %10s\n",
575 if (packingScheme == 1) {
576 if (myCounter == 1) {
577 char lineT[100], lineA[200], lineB[200];
579 sprintf(lineT,
"#%50s",
" ");
581 sprintf(lineA,
" %31s",
"a0: correctForPhaseContainment");
583 sprintf(lineB,
" %36s",
"b0: useLeakCorrection\n");
586 sprintf(lineT,
"#%50s",
" ");
588 sprintf(lineA,
" %31s",
"a1: correctForLeadingEdge");
590 sprintf(lineB,
" %36s",
"b1: leakCorrectionID\n");
593 sprintf(lineT,
"#%50s",
" ");
595 sprintf(lineA,
" %31s",
"a2: correctionPhaseNS");
597 sprintf(lineB,
" %36s",
"b2: correctForTimeslew\n");
600 sprintf(lineT,
"#%50s",
" ");
602 sprintf(lineA,
" %31s",
"a3: firstSample");
604 sprintf(lineB,
" %36s",
"b3: timeslewCorrectionID\n");
607 sprintf(lineT,
"#%50s",
" ");
609 sprintf(lineA,
" %31s",
"a4: samplesToAdd");
611 sprintf(lineB,
" %36s",
"b4: correctTiming\n");
614 sprintf(lineT,
"#%50s",
" ");
616 sprintf(lineA,
" %31s",
"a5: pulseShapeID");
618 sprintf(lineB,
" %36s",
"b5: firstAuxTS\n");
621 sprintf(lineT,
"#%50s",
" ");
623 sprintf(lineA,
" %31s",
" ");
625 sprintf(lineB,
" %36s",
"b6: specialCaseID\n");
628 sprintf(lineT,
"#%50s",
" ");
630 sprintf(lineA,
" %31s",
" ");
632 sprintf(lineB,
" %36s",
"b7: noiseFlaggingID\n");
635 sprintf(lineT,
"#%50s",
" ");
637 sprintf(lineA,
" %31s",
" ");
639 sprintf(lineB,
" %36s",
"b8: pileupCleaningID\n");
642 sprintf(lineT,
"#%50s",
" ");
644 sprintf(lineA,
" %31s",
" ");
646 sprintf(lineB,
" %36s",
"b9: packingScheme\n");
650 sprintf(lineT,
"# %5s %4s %4s %10s %11s %10s %10s",
"eta",
"phi",
"dep",
"det",
"param1",
"param2",
"DetId");
653 sprintf(lineA,
" %6s %4s %6s %4s %4s %4s",
"a0",
"a1",
"a2",
"a3",
"a4",
"a5");
656 sprintf(lineB,
" %6s %3s %3s %3s %3s %3s %3s %3s %3s\n",
"b0",
"b1",
"b2",
"b3",
"b4",
"b5",
"b6",
"b7",
"b8");
661 sprintf(
buffer,
" %11d %10d %10X", param1, param2, channel->rawId());
670 sprintf(
buffer,
" %6d %4d %6.1f %4d %4d %4d", aa0, aa1, aa2, aa3, aa4, aa5);
683 sprintf(
buffer,
" %6d %3d %3d %3d %3d %3d %3d %3d %3d %3d\n", bb0, bb1, bb2, bb3, bb4, bb5, bb6, bb7, bb8, bb9);
695 while (fInput.getline(
buffer, 1024)) {
701 if (
items.size() < 5) {
703 <<
"\n line must contain 6 items: eta, phi, depth, subdet, signalTSs, noiseTSs"
707 if (
items.size() > 7) {
709 <<
"Check line: " <<
buffer <<
"\n line must contain 6 items: eta, phi, depth, subdet, signalTSs, noiseTSs. "
710 <<
"\n ! signalTS and noiseTS must be of format <ts1,ts2,ts3,...> withOUT spaces. Ignoring line for safety"
730 while (fInput.getline(
buffer, 1024)) {
736 if (
items.size() < 7) {
738 <<
"\n line must contain 7 items: eta, phi, depth, subdet, nhit, phase, rms,detid"
762 buffer,
"# %15s %15s %15s %15s %15s %15s %15s %15s\n",
"eta",
"phi",
"dep",
"det",
"nhit",
"mean",
"rms",
"DetId");
766 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
769 " %15d %8.5f %8.5f %16X\n",
782 buffer,
"# %15s %15s %15s %15s %10s %10s %10s\n",
"eta",
"phi",
"dep",
"det",
"signalTSs",
"noiseTSs",
"DetId");
786 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
788 if (fId.isHcalZDCDetId()) {
790 std::vector<unsigned int> vNoiseTS = fObject.
getValues(*channel)->
noiseTS();
794 for (
unsigned int i = 0;
i < vSignalTS.size();
i++) {
799 sprintf(
buffer,
"%u", vSignalTS.at(
i));
804 for (
unsigned int i = 0;
i < vNoiseTS.size();
i++) {
809 sprintf(
buffer,
"%u", vNoiseTS.at(
i));
812 sprintf(
buffer,
" %10X\n", channel->rawId());
823 while (fInput.getline(
buffer, 1024)) {
829 if (
items.size() < 5) {
831 <<
"\n line must contain 5 items: eta, phi, depth, subdet, signalShape"
837 int packingScheme = 0;
838 if (
items.size() > 11) {
839 packingScheme = atoi(
items[11].c_str());
843 if (packingScheme == 0) {
844 param1 = atoi(
items[4].c_str());
847 if (packingScheme == 1) {
848 int aabits[6] = {9, 1, 4, 8, 5, 4};
849 int aamax[6] = {511, 1, 15, 255, 1, 16};
853 for (
int i = 0;
i < 6;
i++) {
857 float xphase = (
phase + 32.0) * 4.0;
860 aa = atoi(
items[
j].c_str());
862 if (aa > aamax[
i] || aa < 0) {
864 <<
"Bad line: " <<
buffer <<
"\n value for a" <<
i <<
" should be less than" << aamax[
i] << std::endl;
867 param1 = param1 | aa << aashift;
868 aashift = aashift + aabits[
i];
886 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
890 if (packingScheme == 0) {
891 if (myCounter == 1) {
892 sprintf(
buffer,
"# %15s %15s %15s %15s %14s %10s\n",
"eta",
"phi",
"dep",
"det",
"signalShape",
"DetId");
897 sprintf(
buffer,
" %10d %17X\n",
value, channel->rawId());
900 if (packingScheme == 1) {
901 if (myCounter == 1) {
902 char lineT[100], lineA[200];
904 sprintf(lineT,
"#%40s",
" ");
906 sprintf(lineA,
" %31s",
"a0: signalShape\n");
908 sprintf(lineT,
"#%40s",
" ");
910 sprintf(lineA,
" %31s",
"a1: syncPhase\n");
912 sprintf(lineT,
"#%40s",
" ");
914 sprintf(lineA,
" %31s",
"a2: binOfMaximum\n");
916 sprintf(lineT,
"#%40s",
" ");
918 sprintf(lineA,
" %31s",
"a3: timePhase\n");
920 sprintf(lineT,
"#%40s",
" ");
922 sprintf(lineA,
" %31s",
"a4: timeSmearing\n");
924 sprintf(lineT,
"#%40s",
" ");
926 sprintf(lineA,
" %31s",
"a5: packingScheme\n");
928 sprintf(lineT,
"# %5s %4s %4s %10s %11s %10s",
"eta",
"phi",
"dep",
"det",
"param1",
"DetId");
930 sprintf(lineA,
" %6s %4s %4s %6s %4s %4s\n",
"a0",
"a1",
"a2",
"a3",
"a4",
"a5");
935 sprintf(
buffer,
" %11d %10X", param1, channel->rawId());
943 sprintf(
buffer,
"%6d %4d %4d %6.1f %4d %4d\n", aa0, aa1, aa2, aa3, aa4, aa5);
953 while (fInput.getline(
buffer, 1024)) {
958 if (
items[0] ==
"#U") {
964 edm::LogWarning(
"Pedestal Unit Error") <<
"Unrecognized unit for pedestals. Assuming fC." << std::endl;
970 <<
"The unit for the pedestals is missing in the txt file." << std::endl;
975 while (fInput.getline(
buffer, 1024)) {
981 if (
items.size() < 8) {
983 <<
"Bad line: " <<
buffer <<
"\n line must contain 8 items: eta, phi, depth, subdet, 4x values"
984 <<
" or 12 items: eta, phi, depth, subdet, 4x values for mean, 4x values for width" << std::endl;
994 if (
items.size() < 12)
997 atof(
items[4].c_str()),
998 atof(
items[5].c_str()),
999 atof(
items[6].c_str()),
1000 atof(
items[7].c_str()),
1010 atof(
items[4].c_str()),
1011 atof(
items[5].c_str()),
1012 atof(
items[6].c_str()),
1013 atof(
items[7].c_str()),
1014 atof(
items[8].c_str()),
1015 atof(
items[9].c_str()),
1016 atof(
items[10].c_str()),
1017 atof(
items[11].c_str()));
1029 if (fObject.
isADC())
1030 sprintf(
buffer,
"#U ADC << this is the unit \n");
1032 sprintf(
buffer,
"#U fC << this is the unit \n");
1036 "# %15s %15s %15s %15s %8s %8s %8s %8s %8s %8s %8s %8s %10s\n",
1054 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
1057 dumpId(fOutput, *channel);
1059 " %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %10X\n",
1080 while (fInput.getline(
buffer, 1024)) {
1086 if (
items.size() < 6) {
1088 <<
"Bad line: " <<
buffer
1089 <<
"\n line must contain 6 items: eta, phi, depth, subdet, base - either (hex) or (dec), value" << std::endl;
1099 if (
items[4] ==
"(hex)")
1100 sscanf(
items[5].c_str(),
"%X", &mystatus);
1101 else if (
items[4] ==
"(dec)")
1102 sscanf(
items[5].c_str(),
"%u", &mystatus);
1105 <<
"\n value field must contain the base: one of (hex), (dec)" << std::endl;
1119 sprintf(
buffer,
"# %15s %15s %15s %15s %15s %10s\n",
"eta",
"phi",
"dep",
"det",
"(base) value",
"DetId");
1123 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
1125 dumpId(fOutput, *channel);
1126 sprintf(
buffer,
"%6s %15X %10X\n",
"(hex)",
value, channel->rawId());
1136 while (fInput.getline(
buffer, 1024)) {
1155 if (
items.size() < 7) {
1157 <<
"Bad line: " <<
buffer
1158 <<
"\n line must contain 7 items: eta, phi, depth, subdet, pedestal, resp.corr.gain, flag" << std::endl;
1177 sprintf(
buffer,
"#A %s << this is the algorithm name \n", fObject.
getAlgoString().c_str());
1182 "# %15s %15s %15s %15s %8s %13s %8s %10s\n",
1194 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
1197 dumpId(fOutput, *channel);
1199 " %12.7f %13.10f %12d %10X\n",
1200 item->getPedestal(),
1201 item->getRespGain(),
1213 int linecounter = 0;
1215 while (fInput.getline(
buffer, 1024)) {
1228 <<
"Unrecognized unit for pedestal widths. Assuming fC." << std::endl;
1234 <<
"The unit for the pedestal widths is missing in the txt file." << std::endl;
1240 while (fInput.getline(
buffer, 1024)) {
1247 if (
items.size() < 14) {
1249 <<
"\n line must contain 14 items: eta, phi, depth, subdet, 10x correlations"
1250 <<
" or 20 items: eta, phi, depth, subdet, 16x correlations" << std::endl;
1260 if (
items.size() < 20)
1273 values.setSigma(0, 1, 0.);
1274 values.setSigma(0, 2, 0.);
1275 values.setSigma(0, 3, 0.);
1276 values.setSigma(1, 2, 0.);
1277 values.setSigma(1, 3, 0.);
1278 values.setSigma(2, 3, 0.);
1309 if (fObject.
isADC())
1310 sprintf(
buffer,
"#U ADC << this is the unit \n");
1312 sprintf(
buffer,
"#U fC << this is the unit \n");
1316 "# %15s %15s %15s %15s %8s %8s %8s %8s %8s %8s %8s %8s %8s %8s %8s %8s %8s %8s %8s %8s %10s\n",
1341 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
1344 dumpId(fOutput, *channel);
1346 " %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %10X\n",
1347 item->getSigma(0, 0),
1348 item->getSigma(0, 1),
1349 item->getSigma(0, 2),
1350 item->getSigma(0, 3),
1351 item->getSigma(1, 0),
1352 item->getSigma(1, 1),
1353 item->getSigma(1, 2),
1354 item->getSigma(1, 3),
1355 item->getSigma(2, 0),
1356 item->getSigma(2, 1),
1357 item->getSigma(2, 2),
1358 item->getSigma(2, 3),
1359 item->getSigma(3, 0),
1360 item->getSigma(3, 1),
1361 item->getSigma(3, 2),
1362 item->getSigma(3, 3),
1373 while (fInput.getline(
buffer, 1024)) {
1379 if (
items[0] ==
"SHAPE") {
1382 if (
items.size() < 36) {
1384 <<
"\n line must contain 36 items: eta, phi, depth, subdet, 4 capId x 4 Ranges "
1385 "x offsets, 4 capId x 4 Ranges x slopes"
1398 for (
unsigned capid = 0; capid < 4; capid++) {
1403 for (
unsigned capid = 0; capid < 4; capid++) {
1420 fOutput <<
"# QIE data" << std::endl;
1422 "# %15s %15s %15s %15s %36s %36s %36s %36s %36s %36s %36s %36s\n",
1438 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
1440 dumpId(fOutput, *channel);
1441 for (
unsigned capid = 0; capid < 4; capid++) {
1447 for (
unsigned capid = 0; capid < 4; capid++) {
1453 fOutput << std::endl;
1461 while (fInput.getline(
buffer, 1024)) {
1465 if (
items.size() < 36) {
1467 <<
"\n line must contain 36 items: eta, phi, depth, subdet, 32 bin values"
1481 for (
unsigned bin = 0;
bin < 32;
bin++) {
1484 coder.setMinCharges(
values);
1494 fOutput <<
"# QIE data in calibration mode" << std::endl;
1495 sprintf(
buffer,
"# %15s %15s %15s %15s %288s\n",
"eta",
"phi",
"dep",
"det",
"32 x charges");
1499 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
1502 dumpId(fOutput, *channel);
1504 for (
unsigned bin = 0;
bin < 32;
bin++) {
1505 sprintf(
buffer,
" %8.5f", lowEdge[
bin]);
1508 fOutput << std::endl;
1520 while (fInput.getline(
buffer, 1024)) {
1524 if (
items.size() < 12) {
1527 if (
items.size() < 9) {
1532 while (
items.size() < 12)
1533 items.push_back(
"");
1534 }
else if (
items[8] ==
"HT") {
1535 if (
items.size() == 11)
1536 items.push_back(
"");
1539 <<
"\n HT line must contain at least 11 items: i cr sl tb dcc spigot fiber "
1540 "fiberchan subdet=HT ieta iphi";
1545 <<
"HcalElectronicsMap-> Bad line: " <<
buffer
1546 <<
"\n line must contain 12 items: i cr sl tb dcc spigot fiber fiberchan subdet ieta iphi depth";
1550 int crate = atoi(
items[1].c_str());
1551 int slot = atoi(
items[2].c_str());
1553 if (
items[3] ==
"b")
1555 int dcc = atoi(
items[4].c_str());
1556 int spigot = atoi(
items[5].c_str());
1558 if (
items[3][0] ==
'u') {
1559 int fiber = atoi(
items[6].c_str());
1560 int fiberCh = atoi(
items[7].c_str());
1561 bool isTrig = (
items[8] ==
"HT" ||
items[8] ==
"NT");
1563 }
else if (
items[8] ==
"HT" ||
items[8] ==
"NT") {
1565 int slbCh = atoi(
items[7].c_str());
1568 int fiber = atoi(
items[6].c_str());
1569 int fiberCh = atoi(
items[7].c_str());
1572 elId.
setHTR(crate, slot, top);
1576 if (
items[8] ==
"NA") {
1578 }
else if (
items[8] ==
"NT") {
1584 }
else if (
converter.isHcalTrigTowerDetId()) {
1588 <<
'/' <<
items[10] <<
'/' <<
items[11] << std::endl;
1592 auto fObject = std::make_unique<HcalElectronicsMap>(fObjectHelper);
1603 "# %7s %3s %3s %3s %4s %7s %10s %14s %7s %5s %5s %6s",
1616 fOutput <<
buf << std::endl;
1618 for (
unsigned i = 0;
i < eids.size();
i++) {
1620 if (
eid.isTriggerChainId()) {
1624 if (
eid.isVMEid()) {
1629 " %7X %3d %3d %3c %4d %7d %10d %14d %7s %5s %5s %6s",
1634 eid.readoutVMECrateId(),
1636 eid.htrTopBottom() > 0 ?
't' :
'b',
1639 eid.slbSiteNumber(),
1640 eid.slbChannelIndex(),
1645 fOutput <<
buf << std::endl;
1646 }
else if (
eid.isUTCAid()) {
1648 " %7X %3d %3d u %4d %7d %10d %14d %7s %5s %5s %6s",
1661 fOutput <<
buf << std::endl;
1663 sprintf(
buf,
"NOT SUPPORTED!");
1664 fOutput <<
buf << std::endl;
1669 if (channel.
rawId()) {
1671 if (
eid.isVMEid()) {
1675 " %7X %3d %3d %3c %4d %7d %10d %14d %7s %5s %5s %6s",
1678 eid.readoutVMECrateId(),
1680 eid.htrTopBottom() > 0 ?
't' :
'b',
1691 " %7X %3d %3d u %4d %7d %10d %14d %7s %5s %5s %6s",
1706 fOutput <<
buf << std::endl;
1717 while (fInput.getline(
buffer, 1024)) {
1724 if (
items.size() > 1 &&
items[0].find(
"RctLsb") != std::string::npos) {
1728 if (
items.size() > 1 &&
items[0].find(
"Gain") != std::string::npos) {
1733 if (
items.size() < 7) {
1735 <<
"Bad line: " <<
buffer
1736 <<
"\n line must contain 7 items: eta, phi, depth, subdet, Rcalib, LutGranularity, OutputLutThreshold"
1752 const float _rctLsb = fObject.
getRctLsb();
1754 sprintf(
buffer,
"# %20s\n",
"Non-channel data");
1756 sprintf(
buffer,
"%8s %8.5f\n",
"RctLsb", _rctLsb);
1758 sprintf(
buffer,
"%8s %8.5f\n",
"Gain", _gain);
1761 "# %15s %15s %15s %15s %8s %15s %19s %10s\n",
1768 "OutputLutThreshold",
1773 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
1777 dumpId(fOutput, *channel);
1778 sprintf(
buffer,
" %8.5f %15d %19d %10X\n", _rCalib, _lutGranularity, _outputLutThreshold, channel->
rawId());
1789 while (getline(fInput,
buffer)) {
1796 if (
items.size() < 9) {
1798 <<
"\n line must contain 9 items: subDet, side_ring, slice, type, subChannel, "
1799 "LS, Value, UpperLimit, LowerLimit"
1806 unsigned int slice, subchan;
1807 switch (
items[0].at(1)) {
1844 if (!(fObject->
addValue(newVal))) {
1845 edm::LogWarning(
"Data Error") <<
"Data from line " <<
buffer <<
"\nwas not added to the HcalDcsValues object."
1855 fOutput <<
"# subDet side_ring slice type subChan LS Value UpperLimit LowerLimit DcsId\n";
1859 for (HcalDcsValues::DcsSet::const_iterator
val = vals.begin();
val != vals.end(); ++
val) {
1862 switch (valId.subdet()) {
1876 fOutput << valId.subdet() <<
' ';
1880 fOutput << valId.ring() <<
' ';
1882 fOutput << valId.zside() <<
' ';
1884 fOutput << valId.slice() <<
' ' << valId.typeString(valId.type()) <<
' ' << valId.subchannel() <<
' ';
1885 fOutput <<
val->LS() <<
' ' <<
val->getValue() <<
' ' <<
val->getUpperLimit() <<
' ' <<
val->getLowerLimit()
1887 fOutput << std::hex <<
val->DcsId() <<
std::dec <<
'\n';
1908 while (fInput.getline(
buffer, 1024)) {
1912 if (
items.size() < 8) {
1917 <<
"HcalDcsMap-> Bad line: " <<
buffer
1918 <<
"\n line must contain 8 items: line side_ring slice subchannel subdet ieta iphi depth";
1924 unsigned int subchannel = atoi(
items[3].c_str());
1927 if (
items[4].
find(
"CALIB") != std::string::npos) {
1929 }
else if (
items[4].
find(
"HB") != std::string::npos) {
1931 }
else if (
items[4].
find(
"HE") != std::string::npos) {
1933 }
else if (
items[4].
find(
"HO") != std::string::npos) {
1935 }
else if (
items[4].
find(
"HF") != std::string::npos) {
1938 edm::LogError(
"MapFormat") <<
"HcalDcsMap-> Unknown subdetector, line is not accepted: " <<
items[5];
1948 <<
'/' <<
items[6] <<
'/' <<
items[7] << std::endl;
1953 auto fObject = std::make_unique<HcalDcsMap>(fObjectHelper);
1964 "# %7s %10s %6s %8s %7s %5s %5s %6s",
1973 fOutput <<
buf << std::endl;
1975 unsigned int line_counter = 0;
1981 " %8X %10d %6d %8d %7s %5s %5s %6s",
1986 _converter.getFlavor().c_str(),
1987 _converter.getField1().c_str(),
1988 _converter.getField2().c_str(),
1989 _converter.getField3().c_str());
1990 fOutput <<
buf << std::endl;
2000 while (fInput.getline(
buffer, 1024)) {
2006 if (
items.size() != 9) {
2008 <<
"Bad line: " <<
buffer
2009 <<
"\n line must contain at 9 least items: eta, phi, depth, subdet, firstSample, samplesToAdd, ExpectedPeak, "
2010 "MinEnergy, and a set of comma-separated coefficients"
2019 atoi(
items[4].c_str()),
2020 atoi(
items[5].c_str()),
2021 atoi(
items[6].c_str()),
2022 atof(
items[7].c_str()),
2034 "# %15s %15s %15s %15s %15s %15s %15s %15s %30s\n",
2047 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
2052 " %15u %15u %15u %15f",
2065 if (x < coef.size() - 1)
2080 unsigned int all(0), good(0);
2081 while (fInput.getline(
buffer, 1024)) {
2086 if (
items.size() != 6) {
2092 int rm = atoi(
items[5].c_str());
2095 edm::LogInfo(
"MapFormat") <<
"HcalFrontEndMap:: processed " << good <<
" records in " <<
all <<
" record"
2097 auto fObject = std::make_unique<HcalFrontEndMap>(fObjectHelper);
2104 sprintf(
buffer,
"# %15s %15s %15s %15s %8s %8s\n",
"eta",
"phi",
"dep",
"det",
"rbx",
"rm");
2109 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
2112 dumpId(fOutput, *channel);
2113 sprintf(
buffer,
" %8s %8d \n", rbx.c_str(),
rm);
2124 while (fInput.getline(
buffer, 1024)) {
2130 if (
items.size() < 9) {
2132 <<
"\n line must contain 9 items: eta, phi, depth, subdet, 5x values"
2139 atoi(
items[4].c_str()),
2140 atof(
items[5].c_str()),
2141 atof(
items[6].c_str()),
2142 atoi(
items[7].c_str()),
2143 atof(
items[8].c_str()));
2153 "# %15s %15s %15s %15s %8s %15s %15s %8s %15s\n",
2166 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
2173 sprintf(
buffer,
" %8d %15.6f %15.6f %8d %15.6f\n",
type, fcByPE, darkC, auxi1, auxi2);
2185 unsigned int all(0), good(0);
2186 while (fInput.getline(
buffer, 1024)) {
2191 if (
items.size() != 8) {
2199 float parL0 = atof(
items[2].c_str());
2200 float parL1 = atof(
items[3].c_str());
2201 float parL2 = atof(
items[4].c_str());
2202 float cTalk = atof(
items[5].c_str());
2203 int auxi1 = atoi(
items[6].c_str());
2204 float auxi2 = atof(
items[7].c_str());
2207 edm::LogInfo(
"MapFormat") <<
"HcalSiPMCharacteristics:: processed " << good <<
" records in " <<
all <<
" record"
2209 auto fObject = std::make_unique<HcalSiPMCharacteristics>(fObjectHelper);
2217 "# %8s %8s %15s %15s %15s %15s %8s %15s\n",
2229 for (
unsigned int k = 0;
k <
size; ++
k) {
2236 const float par0 = (!pars.empty()) ? pars[0] : 0;
2237 const float par1 = (pars.size() > 1) ? pars[1] : 0;
2238 const float par2 = (pars.size() > 2) ? pars[2] : 0;
2251 while (fInput.getline(
buffer, 1024)) {
2257 if (
items.size() < 8) {
2259 <<
"\n line must contain 8 items: eta, phi, depth, subdet, 4x values"
2266 id.rawId(), atoi(
items[4].c_str()), atoi(
items[5].c_str()), atoi(
items[6].c_str()), atoi(
items[7].c_str()));
2276 "# %15s %15s %15s %15s %15s %15s %15s %15s\n",
2288 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
2294 sprintf(
buffer,
" %15d %15d %15d %15d \n", mask, fgBitInfo, auxi1, auxi2);
2303 unsigned int all(0), good(0);
2304 while (fInput.getline(
buffer, 1024)) {
2309 if (
items.size() != 6) {
2316 int adcCut = atoi(
items[1].c_str());
2318 uint32_t tbits = atoi(
items[3].c_str());
2319 int auxi1 = atoi(
items[4].c_str());
2320 int auxi2 = atoi(
items[5].c_str());
2324 edm::LogInfo(
"MapFormat") <<
"HcalTPParameters:: processed " << good <<
" records in " <<
all <<
" record"
2332 buffer,
"# %15s %15s %16s %15s %15s %15s\n",
"FGAlgo_HBHE",
"ADCThrHF",
"TDCMaskHF",
"STBitsHF",
"auxi1",
"auxi2");
2339 const int auxi1 = fObject.
getAuxi1();
2340 const int auxi2 = fObject.
getAuxi2();
2342 sprintf(
buffer,
" %15d %15d %16jx %15x %15d %15d\n",
version, adcCut, tdcMask, tbits, auxi1, auxi2);
2353 "# %15s %15s %15s %15s %8s %8s %8s %8s %11s %11s %11s %11s %9s %9s %9s %9s %10s\n",
2375 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
2376 dumpId(fOutput, *channel);
2379 " %8.5f %8.5f %8.5f %8.5f %11.5f %11.5f %11.5f %11.5f %9.5f %9.5f %9.5f %9.5f %10X\n",
2401 "# %15s %15s %15s %15s %9s %9s %9s %9s %12s %12s %12s %12s %10s %10s %10s %10s %10s\n",
2423 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
2424 dumpId(fOutput, *channel);
2427 " %9.5f %9.5f %9.5f %9.5f %12.5f %12.5f %12.5f %12.5f %10.5f %10.5f %10.5f %10.5f %10X\n",