26 if (
first.genericSubdet() !=
second.genericSubdet())
27 return first.genericSubdet() <
second.genericSubdet();
28 if (
first.isHcalDetId()) {
31 return f1.zside() != s1.zside() ?
f1.zside() < s1.zside()
32 :
f1.iphi() != s1.iphi() ?
f1.iphi() < s1.iphi()
33 :
f1.ietaAbs() != s1.ietaAbs() ?
f1.ietaAbs() < s1.ietaAbs()
34 :
f1.depth() < s1.depth();
40 class HcalElectronicsIdLess {
43 return first.readoutVMECrateId() !=
second.readoutVMECrateId()
44 ?
first.readoutVMECrateId() <
second.readoutVMECrateId()
56 std::vector<std::string>
result;
59 for (
unsigned i = 0;
i <= fLine.size();
i++) {
60 if (fLine[
i] ==
' ' ||
i == fLine.size()) {
76 std::vector<unsigned int>
result;
79 for (
unsigned i = 0;
i <= fLine.size();
i++) {
80 if (fLine[
i] ==
',' ||
i == fLine.size()) {
83 result.push_back(atoi(itemString.c_str()));
99 for (
unsigned i = 0;
i <= fLine.size();
i++) {
100 if (fLine[
i] ==
',' ||
i == fLine.size()) {
103 result.push_back(atof(itemString.c_str()));
116 std::vector<double>
result;
119 for (
unsigned i = 0;
i <= fLine.size();
i++) {
120 if (fLine[
i] ==
',' ||
i == fLine.size()) {
123 result.push_back(atof(itemString.c_str()));
144 " %15s %15s %15s %15s",
168 std::istringstream iss(
s);
169 return !(iss >>
f >>
t).fail();
172 template <
class S,
class T>
177 while (fInput.getline(
buffer, 1024)) {
183 if (
items.size() < 8) {
185 <<
"\n line must contain 8 items: eta, phi, depth, subdet, 4x values" 195 S fCondObject(
id, atof(
items[4].c_str()), atof(
items[5].c_str()), atof(
items[6].c_str()), atof(
items[7].c_str()));
196 fObject->addValues(fCondObject);
207 "# %15s %15s %15s %15s %8s %8s %8s %8s %10s\n",
218 std::vector<DetId>
channels = fObject.getAllChannels();
220 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
221 const float*
values = fObject.getValues(*channel)->getValues();
232 template <
class ObjectPrimitiveType,
class S,
class T>
237 while (fInput.getline(
buffer, 1024)) {
243 if (
items.size() < 5) {
245 <<
"\n line must contain 5 items: eta, phi, depth, subdet, value" << std::endl;
254 std::stringstream
ss(
items[4]);
255 ObjectPrimitiveType
x = 0;
257 S fCondObject(
id,
x);
258 fObject->addValues(fCondObject);
267 sprintf(
buffer,
"# %15s %15s %15s %15s %10s %10s %10s\n",
"eta",
"phi",
"dep",
"det",
"value0",
"value1",
"DetId");
269 std::vector<DetId>
channels = fObject.getAllChannels();
271 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
272 const float value0 = fObject.getValues(*channel)->getValue0();
273 const float value1 = fObject.getValues(*channel)->getValue1();
275 sprintf(
buffer,
" %10.7f %10.7f %10X\n", value0,
value1, channel->rawId());
281 template <
class S,
class T>
286 while (fInput.getline(
buffer, 1024)) {
292 if (
items.size() < 6) {
294 <<
"\n line must contain 6 items: eta, phi, depth, subdet, value0, value1" 299 S fCondObject(
id, atof(
items[4].c_str()), atof(
items[5].c_str()));
300 fObject->addValues(fCondObject);
309 sprintf(
buffer,
"# %15s %15s %15s %15s %8s %10s\n",
"eta",
"phi",
"dep",
"det",
"value",
"DetId");
311 std::vector<DetId>
channels = fObject.getAllChannels();
313 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
314 const float value = fObject.getValues(*channel)->getValue();
316 sprintf(
buffer,
" %8.5f %10X\n",
value, channel->rawId());
325 sprintf(
buffer,
"# %15s %15s %15s %15s %8s %10s\n",
"eta",
"phi",
"dep",
"det",
"value",
"DetId");
327 std::vector<DetId>
channels = fObject.getAllChannels();
329 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
330 const int value = fObject.getValues(*channel)->getValue();
332 sprintf(
buffer,
" %15d %10X\n",
value, channel->rawId());
338 template <
class S,
class T>
343 while (fInput.getline(
buffer, 1024)) {
350 fCondObject =
new S(firstid.
rawId());
351 for (
int j = 0;
j != 10;
j++)
352 fCondObject->setValue(atoi(
items[4].c_str()), 0,
j, atof(
items[
j + 5].c_str()));
353 for (
int i = 1;
i != 40;
i++) {
354 fInput.getline(
buffer, 1024);
359 for (
int j = 0;
j != 10;
j++)
360 fCondObject->setValue(atoi(
items[4].c_str()),
i % 10,
j, atof(
items[
j + 5].c_str()));
362 fObject->addValues(*fCondObject);
372 "# %5s %5s %5s %5s %5s %8s %8s %8s %8s %8s %8s %8s %8s %8s %8s %10s\n",
390 std::vector<DetId>
channels = fObject.getAllChannels();
392 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
394 for (
int m = 0;
m != 4;
m++) {
395 for (
int i = 0;
i != 10;
i++) {
396 for (
int j = 0;
j != 10;
j++) {
398 thisline[
j] = fObject.getValues(*channel)->getValue(
m,
i,
j);
403 " %5i %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %10X\n",
427 bool getObject(std::istream& fInput,
HcalGains* fObject) {
return getHcalObject<HcalGain>(fInput, fObject); }
430 return getHcalObject<HcalGainWidth>(fInput, fObject);
435 return getHcalDoubleFloatObject<HcalPFCut>(fInput, fObject);
442 return getHcalSingleObject<float, HcalRespCorr>(fInput, fObject);
449 return getHcalSingleObject<float, HcalLUTCorr>(fInput, fObject);
456 return getHcalSingleObject<float, HcalPFCorr>(fInput, fObject);
463 return getHcalSingleObject<float, HcalTimeCorr>(fInput, fObject);
470 return getHcalSingleObject<int, HcalZSThreshold>(fInput, fObject);
477 return getHcalSingleObject<float, HcalZDCLowGainFraction>(fInput, fObject);
484 return getHcalSingleObject<float, HcalValidationCorr>(fInput, fObject);
491 return getHcalSingleObject<int, HcalQIEType>(fInput, fObject);
503 while (fInput.getline(
buffer, 1024)) {
509 if (
items.size() < 6) {
511 <<
"\n line must contain 6 items: eta, phi, depth, subdet, param1, param2" 517 int packingScheme = 0;
518 if (
items.size() > 22) {
519 packingScheme = atoi(
items[22].c_str());
524 if (packingScheme == 0) {
525 param1 = atoi(
items[4].c_str());
526 param2 = atoi(
items[5].c_str());
529 if (packingScheme == 1) {
531 int aabits[6] = {1, 1, 8, 4, 4, 9};
532 int aamax[6] = {1, 1, 255, 15, 15, 511};
534 int bbbits[10] = {1, 4, 1, 4, 1, 4, 4, 4, 4, 4};
535 int bbmax[10] = {1, 15, 1, 15, 1, 15, 15, 15, 15, 15};
541 for (
int i = 0;
i < 6;
i++) {
545 float xphase = (
phase + 32.0) * 4.0;
548 aa = atoi(
items[
j].c_str());
550 if (aa > aamax[
i] || aa < 0) {
552 <<
"Bad line: " <<
buffer <<
"\n value for a" <<
i <<
" should be less than" << aamax[
i] << std::endl;
554 param1 = param1 | aa << aashift;
555 aashift = aashift + aabits[
i];
561 for (
int i = 0;
i < 10;
i++) {
563 bb = atoi(
items[
j].c_str());
566 <<
"Bad line: " <<
buffer <<
"\n value for b" <<
i <<
" should be less than" << bbmax[
i] << std::endl;
568 param2 = param2 | bb << bbshift;
569 bbshift = bbshift + bbbits[
i];
591 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
599 if (packingScheme == 0) {
601 if (myCounter == 1) {
603 "# %15s %15s %15s %15s %18s %15s %10s\n",
621 if (packingScheme == 1) {
622 if (myCounter == 1) {
623 char lineT[100], lineA[200], lineB[200];
625 sprintf(lineT,
"#%50s",
" ");
627 sprintf(lineA,
" %31s",
"a0: correctForPhaseContainment");
629 sprintf(lineB,
" %36s",
"b0: useLeakCorrection\n");
632 sprintf(lineT,
"#%50s",
" ");
634 sprintf(lineA,
" %31s",
"a1: correctForLeadingEdge");
636 sprintf(lineB,
" %36s",
"b1: leakCorrectionID\n");
639 sprintf(lineT,
"#%50s",
" ");
641 sprintf(lineA,
" %31s",
"a2: correctionPhaseNS");
643 sprintf(lineB,
" %36s",
"b2: correctForTimeslew\n");
646 sprintf(lineT,
"#%50s",
" ");
648 sprintf(lineA,
" %31s",
"a3: firstSample");
650 sprintf(lineB,
" %36s",
"b3: timeslewCorrectionID\n");
653 sprintf(lineT,
"#%50s",
" ");
655 sprintf(lineA,
" %31s",
"a4: samplesToAdd");
657 sprintf(lineB,
" %36s",
"b4: correctTiming\n");
660 sprintf(lineT,
"#%50s",
" ");
662 sprintf(lineA,
" %31s",
"a5: pulseShapeID");
664 sprintf(lineB,
" %36s",
"b5: firstAuxTS\n");
667 sprintf(lineT,
"#%50s",
" ");
669 sprintf(lineA,
" %31s",
" ");
671 sprintf(lineB,
" %36s",
"b6: specialCaseID\n");
674 sprintf(lineT,
"#%50s",
" ");
676 sprintf(lineA,
" %31s",
" ");
678 sprintf(lineB,
" %36s",
"b7: noiseFlaggingID\n");
681 sprintf(lineT,
"#%50s",
" ");
683 sprintf(lineA,
" %31s",
" ");
685 sprintf(lineB,
" %36s",
"b8: pileupCleaningID\n");
688 sprintf(lineT,
"#%50s",
" ");
690 sprintf(lineA,
" %31s",
" ");
692 sprintf(lineB,
" %36s",
"b9: packingScheme\n");
696 sprintf(lineT,
"# %5s %4s %4s %10s %11s %10s %10s",
"eta",
"phi",
"dep",
"det",
"param1",
"param2",
"DetId");
699 sprintf(lineA,
" %6s %4s %6s %4s %4s %4s",
"a0",
"a1",
"a2",
"a3",
"a4",
"a5");
702 sprintf(lineB,
" %6s %3s %3s %3s %3s %3s %3s %3s %3s\n",
"b0",
"b1",
"b2",
"b3",
"b4",
"b5",
"b6",
"b7",
"b8");
707 sprintf(
buffer,
" %11d %10d %10X", param1, param2, channel->rawId());
716 sprintf(
buffer,
" %6d %4d %6.1f %4d %4d %4d", aa0, aa1, aa2, aa3, aa4, aa5);
729 sprintf(
buffer,
" %6d %3d %3d %3d %3d %3d %3d %3d %3d %3d\n", bb0, bb1, bb2, bb3, bb4, bb5, bb6, bb7, bb8, bb9);
741 while (fInput.getline(
buffer, 1024)) {
747 if (
items.size() < 5) {
749 <<
"\n line must contain 6 items: eta, phi, depth, subdet, signalTSs, noiseTSs" 753 if (
items.size() > 7) {
755 <<
"Check line: " <<
buffer <<
"\n line must contain 6 items: eta, phi, depth, subdet, signalTSs, noiseTSs. " 756 <<
"\n ! signalTS and noiseTS must be of format <ts1,ts2,ts3,...> withOUT spaces. Ignoring line for safety" 776 while (fInput.getline(
buffer, 1024)) {
782 if (
items.size() < 7) {
784 <<
"\n line must contain 7 items: eta, phi, depth, subdet, nhit, phase, rms,detid" 808 buffer,
"# %15s %15s %15s %15s %15s %15s %15s %15s\n",
"eta",
"phi",
"dep",
"det",
"nhit",
"mean",
"rms",
"DetId");
812 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
815 " %15d %8.5f %8.5f %16X\n",
828 buffer,
"# %15s %15s %15s %15s %10s %10s %10s\n",
"eta",
"phi",
"dep",
"det",
"signalTSs",
"noiseTSs",
"DetId");
832 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
834 if (fId.isHcalZDCDetId()) {
836 std::vector<unsigned int> vNoiseTS = fObject.
getValues(*channel)->
noiseTS();
840 for (
unsigned int i = 0;
i < vSignalTS.size();
i++) {
845 sprintf(
buffer,
"%u", vSignalTS.at(
i));
850 for (
unsigned int i = 0;
i < vNoiseTS.size();
i++) {
855 sprintf(
buffer,
"%u", vNoiseTS.at(
i));
858 sprintf(
buffer,
" %10X\n", channel->rawId());
869 while (fInput.getline(
buffer, 1024)) {
875 if (
items.size() < 5) {
877 <<
"\n line must contain 5 items: eta, phi, depth, subdet, signalShape" 883 int packingScheme = 0;
884 if (
items.size() > 11) {
885 packingScheme = atoi(
items[11].c_str());
889 if (packingScheme == 0) {
890 param1 = atoi(
items[4].c_str());
893 if (packingScheme == 1) {
894 int aabits[6] = {9, 1, 4, 8, 5, 4};
895 int aamax[6] = {511, 1, 15, 255, 1, 16};
899 for (
int i = 0;
i < 6;
i++) {
903 float xphase = (
phase + 32.0) * 4.0;
906 aa = atoi(
items[
j].c_str());
908 if (aa > aamax[
i] || aa < 0) {
910 <<
"Bad line: " <<
buffer <<
"\n value for a" <<
i <<
" should be less than" << aamax[
i] << std::endl;
913 param1 = param1 | aa << aashift;
914 aashift = aashift + aabits[
i];
932 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
936 if (packingScheme == 0) {
937 if (myCounter == 1) {
938 sprintf(
buffer,
"# %15s %15s %15s %15s %14s %10s\n",
"eta",
"phi",
"dep",
"det",
"signalShape",
"DetId");
943 sprintf(
buffer,
" %10d %17X\n",
value, channel->rawId());
946 if (packingScheme == 1) {
947 if (myCounter == 1) {
948 char lineT[100], lineA[200];
950 sprintf(lineT,
"#%40s",
" ");
952 sprintf(lineA,
" %31s",
"a0: signalShape\n");
954 sprintf(lineT,
"#%40s",
" ");
956 sprintf(lineA,
" %31s",
"a1: syncPhase\n");
958 sprintf(lineT,
"#%40s",
" ");
960 sprintf(lineA,
" %31s",
"a2: binOfMaximum\n");
962 sprintf(lineT,
"#%40s",
" ");
964 sprintf(lineA,
" %31s",
"a3: timePhase\n");
966 sprintf(lineT,
"#%40s",
" ");
968 sprintf(lineA,
" %31s",
"a4: timeSmearing\n");
970 sprintf(lineT,
"#%40s",
" ");
972 sprintf(lineA,
" %31s",
"a5: packingScheme\n");
974 sprintf(lineT,
"# %5s %4s %4s %10s %11s %10s",
"eta",
"phi",
"dep",
"det",
"param1",
"DetId");
976 sprintf(lineA,
" %6s %4s %4s %6s %4s %4s\n",
"a0",
"a1",
"a2",
"a3",
"a4",
"a5");
981 sprintf(
buffer,
" %11d %10X", param1, channel->rawId());
989 sprintf(
buffer,
"%6d %4d %4d %6.1f %4d %4d\n", aa0, aa1, aa2, aa3, aa4, aa5);
999 while (fInput.getline(
buffer, 1024)) {
1004 if (
items[0] ==
"#U") {
1010 edm::LogWarning(
"Pedestal Unit Error") <<
"Unrecognized unit for pedestals. Assuming fC." << std::endl;
1016 <<
"The unit for the pedestals is missing in the txt file." << std::endl;
1021 while (fInput.getline(
buffer, 1024)) {
1027 if (
items.size() < 8) {
1029 <<
"Bad line: " <<
buffer <<
"\n line must contain 8 items: eta, phi, depth, subdet, 4x values" 1030 <<
" or 12 items: eta, phi, depth, subdet, 4x values for mean, 4x values for width" << std::endl;
1040 if (
items.size() < 12)
1043 atof(
items[4].c_str()),
1044 atof(
items[5].c_str()),
1045 atof(
items[6].c_str()),
1046 atof(
items[7].c_str()),
1056 atof(
items[4].c_str()),
1057 atof(
items[5].c_str()),
1058 atof(
items[6].c_str()),
1059 atof(
items[7].c_str()),
1060 atof(
items[8].c_str()),
1061 atof(
items[9].c_str()),
1062 atof(
items[10].c_str()),
1063 atof(
items[11].c_str()));
1075 if (fObject.
isADC())
1076 sprintf(
buffer,
"#U ADC << this is the unit \n");
1078 sprintf(
buffer,
"#U fC << this is the unit \n");
1082 "# %15s %15s %15s %15s %8s %8s %8s %8s %8s %8s %8s %8s %10s\n",
1100 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
1103 dumpId(fOutput, *channel);
1105 " %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %10X\n",
1126 while (fInput.getline(
buffer, 1024)) {
1132 if (
items.size() < 6) {
1134 <<
"Bad line: " <<
buffer 1135 <<
"\n line must contain 6 items: eta, phi, depth, subdet, base - either (hex) or (dec), value" << std::endl;
1145 if (
items[4] ==
"(hex)")
1146 sscanf(
items[5].c_str(),
"%X", &mystatus);
1147 else if (
items[4] ==
"(dec)")
1148 sscanf(
items[5].c_str(),
"%u", &mystatus);
1151 <<
"\n value field must contain the base: one of (hex), (dec)" << std::endl;
1165 sprintf(
buffer,
"# %15s %15s %15s %15s %15s %10s\n",
"eta",
"phi",
"dep",
"det",
"(base) value",
"DetId");
1169 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
1171 dumpId(fOutput, *channel);
1172 sprintf(
buffer,
"%6s %15X %10X\n",
"(hex)",
value, channel->rawId());
1182 while (fInput.getline(
buffer, 1024)) {
1201 if (
items.size() < 7) {
1203 <<
"Bad line: " <<
buffer 1204 <<
"\n line must contain 7 items: eta, phi, depth, subdet, pedestal, resp.corr.gain, flag" << std::endl;
1223 sprintf(
buffer,
"#A %s << this is the algorithm name \n", fObject.
getAlgoString().c_str());
1228 "# %15s %15s %15s %15s %8s %13s %8s %10s\n",
1240 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
1243 dumpId(fOutput, *channel);
1245 " %12.7f %13.10f %12d %10X\n",
1246 item->getPedestal(),
1247 item->getRespGain(),
1259 int linecounter = 0;
1261 while (fInput.getline(
buffer, 1024)) {
1274 <<
"Unrecognized unit for pedestal widths. Assuming fC." << std::endl;
1280 <<
"The unit for the pedestal widths is missing in the txt file." << std::endl;
1286 while (fInput.getline(
buffer, 1024)) {
1293 if (
items.size() < 14) {
1295 <<
"\n line must contain 14 items: eta, phi, depth, subdet, 10x correlations" 1296 <<
" or 20 items: eta, phi, depth, subdet, 16x correlations" << std::endl;
1306 if (
items.size() < 20)
1319 values.setSigma(0, 1, 0.);
1320 values.setSigma(0, 2, 0.);
1321 values.setSigma(0, 3, 0.);
1322 values.setSigma(1, 2, 0.);
1323 values.setSigma(1, 3, 0.);
1324 values.setSigma(2, 3, 0.);
1355 if (fObject.
isADC())
1356 sprintf(
buffer,
"#U ADC << this is the unit \n");
1358 sprintf(
buffer,
"#U fC << this is the unit \n");
1362 "# %15s %15s %15s %15s %8s %8s %8s %8s %8s %8s %8s %8s %8s %8s %8s %8s %8s %8s %8s %8s %10s\n",
1387 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
1390 dumpId(fOutput, *channel);
1392 " %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",
1393 item->getSigma(0, 0),
1394 item->getSigma(0, 1),
1395 item->getSigma(0, 2),
1396 item->getSigma(0, 3),
1397 item->getSigma(1, 0),
1398 item->getSigma(1, 1),
1399 item->getSigma(1, 2),
1400 item->getSigma(1, 3),
1401 item->getSigma(2, 0),
1402 item->getSigma(2, 1),
1403 item->getSigma(2, 2),
1404 item->getSigma(2, 3),
1405 item->getSigma(3, 0),
1406 item->getSigma(3, 1),
1407 item->getSigma(3, 2),
1408 item->getSigma(3, 3),
1419 while (fInput.getline(
buffer, 1024)) {
1425 if (
items[0] ==
"SHAPE") {
1428 if (
items.size() < 36) {
1430 <<
"\n line must contain 36 items: eta, phi, depth, subdet, 4 capId x 4 Ranges " 1431 "x offsets, 4 capId x 4 Ranges x slopes" 1444 for (
unsigned capid = 0; capid < 4; capid++) {
1449 for (
unsigned capid = 0; capid < 4; capid++) {
1466 fOutput <<
"# QIE data" << std::endl;
1468 "# %15s %15s %15s %15s %36s %36s %36s %36s %36s %36s %36s %36s\n",
1484 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
1486 dumpId(fOutput, *channel);
1487 for (
unsigned capid = 0; capid < 4; capid++) {
1493 for (
unsigned capid = 0; capid < 4; capid++) {
1499 fOutput << std::endl;
1507 while (fInput.getline(
buffer, 1024)) {
1511 if (
items.size() < 36) {
1513 <<
"\n line must contain 36 items: eta, phi, depth, subdet, 32 bin values" 1527 for (
unsigned bin = 0;
bin < 32;
bin++) {
1530 coder.setMinCharges(
values);
1540 fOutput <<
"# QIE data in calibration mode" << std::endl;
1541 sprintf(
buffer,
"# %15s %15s %15s %15s %288s\n",
"eta",
"phi",
"dep",
"det",
"32 x charges");
1545 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
1548 dumpId(fOutput, *channel);
1550 for (
unsigned bin = 0;
bin < 32;
bin++) {
1551 sprintf(
buffer,
" %8.5f", lowEdge[
bin]);
1554 fOutput << std::endl;
1566 while (fInput.getline(
buffer, 1024)) {
1570 if (
items.size() < 12) {
1573 if (
items.size() < 9) {
1578 while (
items.size() < 12)
1579 items.push_back(
"");
1580 }
else if (
items[8] ==
"HT") {
1581 if (
items.size() == 11)
1582 items.push_back(
"");
1585 <<
"\n HT line must contain at least 11 items: i cr sl tb dcc spigot fiber " 1586 "fiberchan subdet=HT ieta iphi";
1591 <<
"HcalElectronicsMap-> Bad line: " <<
buffer 1592 <<
"\n line must contain 12 items: i cr sl tb dcc spigot fiber fiberchan subdet ieta iphi depth";
1596 int crate = atoi(
items[1].c_str());
1597 int slot = atoi(
items[2].c_str());
1599 if (
items[3] ==
"b")
1602 int spigot = atoi(
items[5].c_str());
1604 if (
items[3][0] ==
'u') {
1605 int fiber = atoi(
items[6].c_str());
1606 int fiberCh = atoi(
items[7].c_str());
1607 bool isTrig = (
items[8] ==
"HT" ||
items[8] ==
"NT");
1609 }
else if (
items[8] ==
"HT" ||
items[8] ==
"NT") {
1611 int slbCh = atoi(
items[7].c_str());
1614 int fiber = atoi(
items[6].c_str());
1615 int fiberCh = atoi(
items[7].c_str());
1618 elId.
setHTR(crate, slot, top);
1622 if (
items[8] ==
"NA") {
1624 }
else if (
items[8] ==
"NT") {
1630 }
else if (
converter.isHcalTrigTowerDetId()) {
1634 <<
'/' <<
items[10] <<
'/' <<
items[11] << std::endl;
1638 auto fObject = std::make_unique<HcalElectronicsMap>(fObjectHelper);
1649 "# %7s %3s %3s %3s %4s %7s %10s %14s %7s %5s %5s %6s",
1662 fOutput <<
buf << std::endl;
1664 for (
unsigned i = 0;
i < eids.size();
i++) {
1666 if (
eid.isTriggerChainId()) {
1670 if (
eid.isVMEid()) {
1675 " %7X %3d %3d %3c %4d %7d %10d %14d %7s %5s %5s %6s",
1680 eid.readoutVMECrateId(),
1682 eid.htrTopBottom() > 0 ?
't' :
'b',
1685 eid.slbSiteNumber(),
1686 eid.slbChannelIndex(),
1691 fOutput <<
buf << std::endl;
1692 }
else if (
eid.isUTCAid()) {
1694 " %7X %3d %3d u %4d %7d %10d %14d %7s %5s %5s %6s",
1707 fOutput <<
buf << std::endl;
1709 sprintf(
buf,
"NOT SUPPORTED!");
1710 fOutput <<
buf << std::endl;
1715 if (channel.
rawId()) {
1717 if (
eid.isVMEid()) {
1721 " %7X %3d %3d %3c %4d %7d %10d %14d %7s %5s %5s %6s",
1724 eid.readoutVMECrateId(),
1726 eid.htrTopBottom() > 0 ?
't' :
'b',
1737 " %7X %3d %3d u %4d %7d %10d %14d %7s %5s %5s %6s",
1752 fOutput <<
buf << std::endl;
1763 while (fInput.getline(
buffer, 1024)) {
1770 if (
items.size() > 1 &&
items[0].find(
"RctLsb") != std::string::npos) {
1774 if (
items.size() > 1 &&
items[0].find(
"Gain") != std::string::npos) {
1779 if (
items.size() < 7) {
1781 <<
"Bad line: " <<
buffer 1782 <<
"\n line must contain 7 items: eta, phi, depth, subdet, Rcalib, LutGranularity, OutputLutThreshold" 1798 const float _rctLsb = fObject.
getRctLsb();
1800 sprintf(
buffer,
"# %20s\n",
"Non-channel data");
1802 sprintf(
buffer,
"%8s %8.5f\n",
"RctLsb", _rctLsb);
1804 sprintf(
buffer,
"%8s %8.5f\n",
"Gain", _gain);
1807 "# %15s %15s %15s %15s %8s %15s %19s %10s\n",
1814 "OutputLutThreshold",
1819 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
1823 dumpId(fOutput, *channel);
1824 sprintf(
buffer,
" %8.5f %15d %19d %10X\n", _rCalib, _lutGranularity, _outputLutThreshold, channel->
rawId());
1835 while (getline(fInput,
buffer)) {
1842 if (
items.size() < 9) {
1844 <<
"\n line must contain 9 items: subDet, side_ring, slice, type, subChannel, " 1845 "LS, Value, UpperLimit, LowerLimit" 1852 unsigned int slice, subchan;
1853 switch (
items[0].at(1)) {
1878 float val, upper, lower;
1890 if (!(fObject->
addValue(newVal))) {
1891 edm::LogWarning(
"Data Error") <<
"Data from line " <<
buffer <<
"\nwas not added to the HcalDcsValues object." 1901 fOutput <<
"# subDet side_ring slice type subChan LS Value UpperLimit LowerLimit DcsId\n";
1905 for (HcalDcsValues::DcsSet::const_iterator
val = vals.begin();
val != vals.end(); ++
val) {
1908 switch (valId.subdet()) {
1922 fOutput << valId.subdet() <<
' ';
1926 fOutput << valId.ring() <<
' ';
1928 fOutput << valId.zside() <<
' ';
1930 fOutput << valId.slice() <<
' ' << valId.typeString(valId.type()) <<
' ' << valId.subchannel() <<
' ';
1931 fOutput <<
val->LS() <<
' ' <<
val->getValue() <<
' ' <<
val->getUpperLimit() <<
' ' <<
val->getLowerLimit()
1933 fOutput << std::hex <<
val->DcsId() <<
std::dec <<
'\n';
1954 while (fInput.getline(
buffer, 1024)) {
1958 if (
items.size() < 8) {
1963 <<
"HcalDcsMap-> Bad line: " <<
buffer 1964 <<
"\n line must contain 8 items: line side_ring slice subchannel subdet ieta iphi depth";
1970 unsigned int subchannel = atoi(
items[3].c_str());
1973 if (
items[4].
find(
"CALIB") != std::string::npos) {
1975 }
else if (
items[4].
find(
"HB") != std::string::npos) {
1977 }
else if (
items[4].
find(
"HE") != std::string::npos) {
1979 }
else if (
items[4].
find(
"HO") != std::string::npos) {
1981 }
else if (
items[4].
find(
"HF") != std::string::npos) {
1984 edm::LogError(
"MapFormat") <<
"HcalDcsMap-> Unknown subdetector, line is not accepted: " <<
items[5];
1994 <<
'/' <<
items[6] <<
'/' <<
items[7] << std::endl;
1999 auto fObject = std::make_unique<HcalDcsMap>(fObjectHelper);
2010 "# %7s %10s %6s %8s %7s %5s %5s %6s",
2019 fOutput <<
buf << std::endl;
2021 unsigned int line_counter = 0;
2027 " %8X %10d %6d %8d %7s %5s %5s %6s",
2032 _converter.getFlavor().c_str(),
2033 _converter.getField1().c_str(),
2034 _converter.getField2().c_str(),
2035 _converter.getField3().c_str());
2036 fOutput <<
buf << std::endl;
2046 while (fInput.getline(
buffer, 1024)) {
2052 if (
items.size() != 9) {
2054 <<
"Bad line: " <<
buffer 2055 <<
"\n line must contain at 9 least items: eta, phi, depth, subdet, firstSample, samplesToAdd, ExpectedPeak, " 2056 "MinEnergy, and a set of comma-separated coefficients" 2065 atoi(
items[4].c_str()),
2066 atoi(
items[5].c_str()),
2067 atoi(
items[6].c_str()),
2068 atof(
items[7].c_str()),
2080 "# %15s %15s %15s %15s %15s %15s %15s %15s %30s\n",
2093 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
2098 " %15u %15u %15u %15f",
2111 if (x < coef.size() - 1)
2127 while (fInput.getline(
buffer, 1024)) {
2132 if (
items.size() != 6) {
2138 int rm = atoi(
items[5].c_str());
2141 edm::LogInfo(
"MapFormat") <<
"HcalFrontEndMap:: processed " <<
good <<
" records in " <<
all <<
" record" 2143 auto fObject = std::make_unique<HcalFrontEndMap>(fObjectHelper);
2150 sprintf(
buffer,
"# %15s %15s %15s %15s %8s %8s\n",
"eta",
"phi",
"dep",
"det",
"rbx",
"rm");
2155 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
2158 dumpId(fOutput, *channel);
2159 sprintf(
buffer,
" %8s %8d \n", rbx.c_str(),
rm);
2170 while (fInput.getline(
buffer, 1024)) {
2176 if (
items.size() < 9) {
2178 <<
"\n line must contain 9 items: eta, phi, depth, subdet, 5x values" 2185 atoi(
items[4].c_str()),
2186 atof(
items[5].c_str()),
2187 atof(
items[6].c_str()),
2188 atoi(
items[7].c_str()),
2189 atof(
items[8].c_str()));
2199 "# %15s %15s %15s %15s %8s %15s %15s %8s %15s\n",
2212 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
2219 sprintf(
buffer,
" %8d %15.6f %15.6f %8d %15.6f\n",
type, fcByPE, darkC, auxi1, auxi2);
2232 while (fInput.getline(
buffer, 1024)) {
2237 if (
items.size() != 8) {
2244 int pixels = atoi(
items[1].c_str());
2245 float parL0 = atof(
items[2].c_str());
2246 float parL1 = atof(
items[3].c_str());
2247 float parL2 = atof(
items[4].c_str());
2248 float cTalk = atof(
items[5].c_str());
2249 int auxi1 = atoi(
items[6].c_str());
2250 float auxi2 = atof(
items[7].c_str());
2251 fObjectHelper.
loadObject(
type, pixels, parL0, parL1, parL2, cTalk, auxi1, auxi2);
2253 edm::LogInfo(
"MapFormat") <<
"HcalSiPMCharacteristics:: processed " <<
good <<
" records in " <<
all <<
" record" 2255 auto fObject = std::make_unique<HcalSiPMCharacteristics>(fObjectHelper);
2263 "# %8s %8s %15s %15s %15s %15s %8s %15s\n",
2275 for (
unsigned int k = 0;
k <
size; ++
k) {
2282 const float par0 = (!pars.empty()) ? pars[0] : 0;
2283 const float par1 = (pars.size() > 1) ? pars[1] : 0;
2284 const float par2 = (pars.size() > 2) ? pars[2] : 0;
2286 buffer,
" %8d %8d %15.6e %15.6e %15.6e %15.6f %8d %15.6f\n",
type, pixels,
par0,
par1,
par2, cTalk, auxi1, auxi2);
2297 while (fInput.getline(
buffer, 1024)) {
2303 if (
items.size() < 8) {
2305 <<
"\n line must contain 8 items: eta, phi, depth, subdet, 4x values" 2322 "# %15s %15s %15s %15s %15s %15s %15s %15s\n",
2334 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
2340 sprintf(
buffer,
" %15d %15d %15d %15d \n",
mask, fgBitInfo, auxi1, auxi2);
2350 while (fInput.getline(
buffer, 1024)) {
2355 if (
items.size() != 6) {
2362 int adcCut = atoi(
items[1].c_str());
2364 uint32_t tbits = atoi(
items[3].c_str());
2365 int auxi1 = atoi(
items[4].c_str());
2366 int auxi2 = atoi(
items[5].c_str());
2370 edm::LogInfo(
"MapFormat") <<
"HcalTPParameters:: processed " <<
good <<
" records in " <<
all <<
" record" 2378 buffer,
"# %15s %15s %16s %15s %15s %15s\n",
"FGAlgo_HBHE",
"ADCThrHF",
"TDCMaskHF",
"STBitsHF",
"auxi1",
"auxi2");
2385 const int auxi1 = fObject.
getAuxi1();
2386 const int auxi2 = fObject.
getAuxi2();
2388 sprintf(
buffer,
" %15d %15d %16jx %15x %15d %15d\n",
version, adcCut, tdcMask, tbits, auxi1, auxi2);
2399 "# %15s %15s %15s %15s %8s %8s %8s %8s %11s %11s %11s %11s %9s %9s %9s %9s %10s\n",
2421 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
2422 dumpId(fOutput, *channel);
2425 " %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",
2447 "# %15s %15s %15s %15s %9s %9s %9s %9s %12s %12s %12s %12s %10s %10s %10s %10s %10s\n",
2469 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
2470 dumpId(fOutput, *channel);
2473 " %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",
void dumpIdShort(std::ostream &fOutput, DetId id)
std::vector< double > HFdigiflagCoefficients() const
std::string getAlgoString() const
std::unique_ptr< HcalFrontEndMap > createObject< HcalFrontEndMap >(std::istream &fInput)
int getADCThresholdHF() const
get ADC threshold fof TDC mask of HF
const float * minCharges() const
constexpr void setHTR(int crate, int slot, int tb)
constexpr unsigned int param1() const
double HFdigiflagMinEThreshold() const
static const HcalDetId Undefined
bool mapEId2chId(HcalElectronicsId fElectronicsId, DetId fId)
void setUnitADC(bool isADC)
auto const good
min quality of good
constexpr unsigned int firstAuxTS() const
ALPAKA_FN_ACC int dcc(int ieta, int iphi)
bool from_string(T &t, const std::string &s, std::ios_base &(*f)(std::ios_base &))
int getFGVersionHBHE() const
get FineGrain Algorithm Version for HBHE
const HcalCalibrationQIECoder * getCoder(DetId fId) const
get QIE parameters
bool loadObject(DetId fId, int rm, std::string rbx)
load a new entry
bool timeSmearing() const
static int slb(const HcalTriggerPrimitiveSample &theSample)
int getAuxi1(int type) const
get auxiliary words
const HcalCalibrations & getCalibrations(const DetId id) const
uint32_t getMask() const
get mask for channel validity and self trigger information
uint32_t getHFTriggerInfo() const
get Self Trigger bits
constexpr unsigned int packingScheme() const
bool getHcalMatrixObject(std::istream &fInput, T *fObject, S *fCondObject)
std::vector< float > splitStringToFloatByComma(const std::string &fLine)
constexpr unsigned int specialCaseID() const
constexpr unsigned int firstSample() const
const DetId lookup(HcalElectronicsId fId) const
lookup the logical detid associated with the given electronics id
bool getHcalDoubleFloatObject(std::istream &fInput, T *fObject)
float getFCByPE() const
get fcByPE
std::vector< float > getNonLinearities(int type) const
get nonlinearity constants
std::vector< unsigned int > splitStringToIntByComma(const std::string &fLine)
float getDarkCurrent() const
get dark current
unsigned int param1() const
uint32_t HFdigiflagExpectedPeak() const
bool dumpHcalSingleFloatObject(std::ostream &fOutput, const T &fObject)
Log< level::Error, false > LogError
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
float getAuxi2(int type) const
std::vector< std::string > splitString(const std::string &fLine)
constexpr bool correctForPhaseContainment() const
bool addCoder(const HcalQIECoder &fCoder)
const_iterator beginById(void) const
void dumpId(std::ostream &fOutput, DetId id)
const Item * getValues(DetId fId, bool throwOnFail=true) const
const float * getValues() const
get value for all capId = 0..3
U second(std::pair< T, U > const &p)
const HcalQIECoder * getCoder(DetId fId) const
get QIE parameters
std::unique_ptr< HcalSiPMCharacteristics > createObject< HcalSiPMCharacteristics >(std::istream &fInput)
std::vector< HcalDcsValue > DcsSet
bool dumpHcalDoubleFloatObject(std::ostream &fOutput, const T &fObject)
constexpr bool correctForTimeslew() const
constexpr bool correctForLeadingEdge() const
float getCrossTalk(int type) const
get cross talk
void setUnitADC(bool isADC)
constexpr unsigned int pulseShapeID() const
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
HcalDetId getHcalDetId(void)
const int lookupRM(DetId fId) const
brief lookup the RM associated with the given logical id
constexpr unsigned int timeslewCorrectionID() const
float offset(unsigned fCapId, unsigned fRange) const
constexpr bool correctTiming() const
HcalDcsDetId getHcalDcsDetId(void)
bool dumpHcalMatrixObject(std::ostream &fOutput, const T &fObject)
std::vector< DetId > getAllChannels() const
bool mapGeomId2DcsId(HcalDetId fId, HcalDcsDetId fDcsId)
uint64_t getTDCMaskHF() const
get TDC mask for HF
int getType(unsigned int k) const
constexpr float correctionPhaseNS() const
float slope(unsigned fCapId, unsigned fRange) const
unsigned int signalShape() const
bool mapEId2tId(HcalElectronicsId fElectronicsId, HcalTrigTowerDetId fTriggerId)
std::vector< HcalElectronicsId > allElectronicsId() const
bool getHcalSingleObject(std::istream &fInput, T *fObject)
uint32_t getValue() const
bool operator()(const SiStripRecHit2D *a, const SiStripRecHit2D *b) const
std::vector< DetId > allDetIds() const
static DcsType DcsTypeFromString(const std::string &str)
Log< level::Info, false > LogInfo
constexpr bool useLeakCorrection() const
unsigned long long uint64_t
bool getHcalObject(std::istream &fInput, T *fObject)
uint32_t HFdigiflagFirstSample() const
constexpr uint32_t rawId() const
get the raw id
constexpr unsigned int samplesToAdd() const
const HcalCalibrationWidths & getCalibrationWidths(const DetId id) const
int getAuxi1() const
get Axiliary words
bool loadObject(int type, int pixels, float parLin1, float parLin2, float parLin3, float crossTalk, int auxi1=0, float auxi2=0)
std::vector< unsigned int > signalTS() const
std::vector< DetId > getAllChannels() const
std::string getTagString() const
void loadObject(int version, int adcCut, uint64_t tdcMask, uint32_t tbits, int auxi1, int auxi2)
static const HcalTrigTowerDetId Undefined
bool addValue(HcalDcsValue const &newVal)
constexpr unsigned int noiseFlaggingID() const
bool getObject(std::istream &fInput, HcalPedestals *fObject)
void setTagString(std::string const &fTag)
int getPixels(int type) const
get # of pixels
DetId getId(const std::vector< std::string > &items)
int getType() const
get SiPM type
bool dumpObject(std::ostream &fOutput, const HcalPedestals &fObject)
constexpr unsigned int pileupCleaningID() const
bool dumpHcalObject(std::ostream &fOutput, const T &fObject)
DcsSet const & getAllSubdetValues(DcsSubDet subd) const
uint32_t getFGBitInfo() const
get FG bit information
unsigned int packingScheme() const
const DetId lookupTrigger(HcalElectronicsId fId) const
brief lookup the trigger logical detid associated with the given electronics id
Log< level::Warning, false > LogWarning
std::unique_ptr< HcalDcsMap > createObject< HcalDcsMap >(std::istream &fInput)
unsigned int binOfMaximum() const
bool addCoder(const HcalCalibrationQIECoder &fCoder)
unsigned int getTypes() const
get # of types
constexpr unsigned int leakCorrectionID() const
bool addValues(const Item &myItem)
std::vector< DetId > getAllChannels() const
const_iterator endById(void) const
unsigned int nhits() const
void setAlgoString(std::string const &fAlgo)
std::unique_ptr< HcalElectronicsMap > createObject< HcalElectronicsMap >(std::istream &fInput)
const std::string lookupRBX(DetId fId) const
brief lookup the RBX associated with the given logical id
Readout chain identification for Hcal.
constexpr unsigned int param2() const
std::vector< unsigned int > noiseTS() const
bool dumpHcalSingleIntObject(std::ostream &fOutput, const T &fObject)
uint32_t HFdigiflagSamplesToAdd() const
std::vector< double > splitStringToDoubleByComma(const std::string &fLine)