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 %8s %10s\n",
"eta",
"phi",
"dep",
"det",
"value",
"DetId");
269 std::vector<DetId>
channels = fObject.getAllChannels();
271 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
272 const float value = fObject.getValues(*channel)->getValue();
274 sprintf(
buffer,
" %8.5f %10X\n",
value, channel->rawId());
283 sprintf(
buffer,
"# %15s %15s %15s %15s %8s %10s\n",
"eta",
"phi",
"dep",
"det",
"value",
"DetId");
285 std::vector<DetId>
channels = fObject.getAllChannels();
287 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
288 const int value = fObject.getValues(*channel)->getValue();
290 sprintf(
buffer,
" %15d %10X\n",
value, channel->rawId());
296 template <
class S,
class T>
301 while (fInput.getline(
buffer, 1024)) {
308 fCondObject =
new S(firstid.
rawId());
309 for (
int j = 0;
j != 10;
j++)
310 fCondObject->setValue(atoi(
items[4].c_str()), 0,
j, atof(
items[
j + 5].c_str()));
311 for (
int i = 1;
i != 40;
i++) {
312 fInput.getline(
buffer, 1024);
315 if (
id.rawId() != firstid.
rawId())
317 for (
int j = 0;
j != 10;
j++)
318 fCondObject->setValue(atoi(
items[4].c_str()),
i % 10,
j, atof(
items[
j + 5].c_str()));
320 fObject->addValues(*fCondObject);
330 "# %5s %5s %5s %5s %5s %8s %8s %8s %8s %8s %8s %8s %8s %8s %8s %10s\n",
348 std::vector<DetId>
channels = fObject.getAllChannels();
350 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
352 for (
int m = 0;
m != 4;
m++) {
353 for (
int i = 0;
i != 10;
i++) {
354 for (
int j = 0;
j != 10;
j++) {
356 thisline[
j] = fObject.getValues(*channel)->getValue(
m,
i,
j);
361 " %5i %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %10X\n",
385 bool getObject(std::istream& fInput,
HcalGains* fObject) {
return getHcalObject<HcalGain>(fInput, fObject); }
388 return getHcalObject<HcalGainWidth>(fInput, fObject);
393 return getHcalSingleObject<float, HcalRespCorr>(fInput, fObject);
400 return getHcalSingleObject<float, HcalLUTCorr>(fInput, fObject);
407 return getHcalSingleObject<float, HcalPFCorr>(fInput, fObject);
414 return getHcalSingleObject<float, HcalTimeCorr>(fInput, fObject);
421 return getHcalSingleObject<int, HcalZSThreshold>(fInput, fObject);
428 return getHcalSingleObject<float, HcalZDCLowGainFraction>(fInput, fObject);
435 return getHcalSingleObject<float, HcalValidationCorr>(fInput, fObject);
442 return getHcalSingleObject<int, HcalQIEType>(fInput, fObject);
454 while (fInput.getline(
buffer, 1024)) {
460 if (
items.size() < 6) {
462 <<
"\n line must contain 6 items: eta, phi, depth, subdet, param1, param2" 468 int packingScheme = 0;
469 if (
items.size() > 22) {
470 packingScheme = atoi(
items[22].c_str());
475 if (packingScheme == 0) {
476 param1 = atoi(
items[4].c_str());
477 param2 = atoi(
items[5].c_str());
480 if (packingScheme == 1) {
482 int aabits[6] = {1, 1, 8, 4, 4, 9};
483 int aamax[6] = {1, 1, 255, 15, 15, 511};
485 int bbbits[10] = {1, 4, 1, 4, 1, 4, 4, 4, 4, 4};
486 int bbmax[10] = {1, 15, 1, 15, 1, 15, 15, 15, 15, 15};
492 for (
int i = 0;
i < 6;
i++) {
496 float xphase = (
phase + 32.0) * 4.0;
499 aa = atoi(
items[
j].c_str());
501 if (aa > aamax[
i] || aa < 0) {
503 <<
"Bad line: " <<
buffer <<
"\n value for a" <<
i <<
" should be less than" << aamax[
i] << std::endl;
505 param1 = param1 | aa << aashift;
506 aashift = aashift + aabits[
i];
512 for (
int i = 0;
i < 10;
i++) {
514 bb = atoi(
items[
j].c_str());
517 <<
"Bad line: " <<
buffer <<
"\n value for b" <<
i <<
" should be less than" << bbmax[
i] << std::endl;
519 param2 = param2 | bb << bbshift;
520 bbshift = bbshift + bbbits[
i];
542 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
550 if (packingScheme == 0) {
552 if (myCounter == 1) {
554 "# %15s %15s %15s %15s %18s %15s %10s\n",
572 if (packingScheme == 1) {
573 if (myCounter == 1) {
574 char lineT[100], lineA[200], lineB[200];
576 sprintf(lineT,
"#%50s",
" ");
578 sprintf(lineA,
" %31s",
"a0: correctForPhaseContainment");
580 sprintf(lineB,
" %36s",
"b0: useLeakCorrection\n");
583 sprintf(lineT,
"#%50s",
" ");
585 sprintf(lineA,
" %31s",
"a1: correctForLeadingEdge");
587 sprintf(lineB,
" %36s",
"b1: leakCorrectionID\n");
590 sprintf(lineT,
"#%50s",
" ");
592 sprintf(lineA,
" %31s",
"a2: correctionPhaseNS");
594 sprintf(lineB,
" %36s",
"b2: correctForTimeslew\n");
597 sprintf(lineT,
"#%50s",
" ");
599 sprintf(lineA,
" %31s",
"a3: firstSample");
601 sprintf(lineB,
" %36s",
"b3: timeslewCorrectionID\n");
604 sprintf(lineT,
"#%50s",
" ");
606 sprintf(lineA,
" %31s",
"a4: samplesToAdd");
608 sprintf(lineB,
" %36s",
"b4: correctTiming\n");
611 sprintf(lineT,
"#%50s",
" ");
613 sprintf(lineA,
" %31s",
"a5: pulseShapeID");
615 sprintf(lineB,
" %36s",
"b5: firstAuxTS\n");
618 sprintf(lineT,
"#%50s",
" ");
620 sprintf(lineA,
" %31s",
" ");
622 sprintf(lineB,
" %36s",
"b6: specialCaseID\n");
625 sprintf(lineT,
"#%50s",
" ");
627 sprintf(lineA,
" %31s",
" ");
629 sprintf(lineB,
" %36s",
"b7: noiseFlaggingID\n");
632 sprintf(lineT,
"#%50s",
" ");
634 sprintf(lineA,
" %31s",
" ");
636 sprintf(lineB,
" %36s",
"b8: pileupCleaningID\n");
639 sprintf(lineT,
"#%50s",
" ");
641 sprintf(lineA,
" %31s",
" ");
643 sprintf(lineB,
" %36s",
"b9: packingScheme\n");
647 sprintf(lineT,
"# %5s %4s %4s %10s %11s %10s %10s",
"eta",
"phi",
"dep",
"det",
"param1",
"param2",
"DetId");
650 sprintf(lineA,
" %6s %4s %6s %4s %4s %4s",
"a0",
"a1",
"a2",
"a3",
"a4",
"a5");
653 sprintf(lineB,
" %6s %3s %3s %3s %3s %3s %3s %3s %3s\n",
"b0",
"b1",
"b2",
"b3",
"b4",
"b5",
"b6",
"b7",
"b8");
658 sprintf(
buffer,
" %11d %10d %10X", param1, param2, channel->rawId());
667 sprintf(
buffer,
" %6d %4d %6.1f %4d %4d %4d", aa0, aa1, aa2, aa3, aa4, aa5);
680 sprintf(
buffer,
" %6d %3d %3d %3d %3d %3d %3d %3d %3d %3d\n", bb0, bb1, bb2, bb3, bb4, bb5, bb6, bb7, bb8, bb9);
692 while (fInput.getline(
buffer, 1024)) {
698 if (
items.size() < 5) {
700 <<
"\n line must contain 6 items: eta, phi, depth, subdet, signalTSs, noiseTSs" 704 if (
items.size() > 7) {
706 <<
"Check line: " <<
buffer <<
"\n line must contain 6 items: eta, phi, depth, subdet, signalTSs, noiseTSs. " 707 <<
"\n ! signalTS and noiseTS must be of format <ts1,ts2,ts3,...> withOUT spaces. Ignoring line for safety" 727 while (fInput.getline(
buffer, 1024)) {
733 if (
items.size() < 7) {
735 <<
"\n line must contain 7 items: eta, phi, depth, subdet, nhit, phase, rms,detid" 759 buffer,
"# %15s %15s %15s %15s %15s %15s %15s %15s\n",
"eta",
"phi",
"dep",
"det",
"nhit",
"mean",
"rms",
"DetId");
763 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
766 " %15d %8.5f %8.5f %16X\n",
779 buffer,
"# %15s %15s %15s %15s %10s %10s %10s\n",
"eta",
"phi",
"dep",
"det",
"signalTSs",
"noiseTSs",
"DetId");
783 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
785 if (fId.isHcalZDCDetId()) {
787 std::vector<unsigned int> vNoiseTS = fObject.
getValues(*channel)->
noiseTS();
791 for (
unsigned int i = 0;
i < vSignalTS.size();
i++) {
796 sprintf(
buffer,
"%u", vSignalTS.at(
i));
801 for (
unsigned int i = 0;
i < vNoiseTS.size();
i++) {
806 sprintf(
buffer,
"%u", vNoiseTS.at(
i));
809 sprintf(
buffer,
" %10X\n", channel->rawId());
820 while (fInput.getline(
buffer, 1024)) {
826 if (
items.size() < 5) {
828 <<
"\n line must contain 5 items: eta, phi, depth, subdet, signalShape" 834 int packingScheme = 0;
835 if (
items.size() > 11) {
836 packingScheme = atoi(
items[11].c_str());
840 if (packingScheme == 0) {
841 param1 = atoi(
items[4].c_str());
844 if (packingScheme == 1) {
845 int aabits[6] = {9, 1, 4, 8, 5, 4};
846 int aamax[6] = {511, 1, 15, 255, 1, 16};
850 for (
int i = 0;
i < 6;
i++) {
854 float xphase = (
phase + 32.0) * 4.0;
857 aa = atoi(
items[
j].c_str());
859 if (aa > aamax[
i] || aa < 0) {
861 <<
"Bad line: " <<
buffer <<
"\n value for a" <<
i <<
" should be less than" << aamax[
i] << std::endl;
864 param1 = param1 | aa << aashift;
865 aashift = aashift + aabits[
i];
883 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
887 if (packingScheme == 0) {
888 if (myCounter == 1) {
889 sprintf(
buffer,
"# %15s %15s %15s %15s %14s %10s\n",
"eta",
"phi",
"dep",
"det",
"signalShape",
"DetId");
894 sprintf(
buffer,
" %10d %17X\n",
value, channel->rawId());
897 if (packingScheme == 1) {
898 if (myCounter == 1) {
899 char lineT[100], lineA[200];
901 sprintf(lineT,
"#%40s",
" ");
903 sprintf(lineA,
" %31s",
"a0: signalShape\n");
905 sprintf(lineT,
"#%40s",
" ");
907 sprintf(lineA,
" %31s",
"a1: syncPhase\n");
909 sprintf(lineT,
"#%40s",
" ");
911 sprintf(lineA,
" %31s",
"a2: binOfMaximum\n");
913 sprintf(lineT,
"#%40s",
" ");
915 sprintf(lineA,
" %31s",
"a3: timePhase\n");
917 sprintf(lineT,
"#%40s",
" ");
919 sprintf(lineA,
" %31s",
"a4: timeSmearing\n");
921 sprintf(lineT,
"#%40s",
" ");
923 sprintf(lineA,
" %31s",
"a5: packingScheme\n");
925 sprintf(lineT,
"# %5s %4s %4s %10s %11s %10s",
"eta",
"phi",
"dep",
"det",
"param1",
"DetId");
927 sprintf(lineA,
" %6s %4s %4s %6s %4s %4s\n",
"a0",
"a1",
"a2",
"a3",
"a4",
"a5");
932 sprintf(
buffer,
" %11d %10X", param1, channel->rawId());
940 sprintf(
buffer,
"%6d %4d %4d %6.1f %4d %4d\n", aa0, aa1, aa2, aa3, aa4, aa5);
950 while (fInput.getline(
buffer, 1024)) {
955 if (
items[0] ==
"#U") {
961 edm::LogWarning(
"Pedestal Unit Error") <<
"Unrecognized unit for pedestals. Assuming fC." << std::endl;
967 <<
"The unit for the pedestals is missing in the txt file." << std::endl;
972 while (fInput.getline(
buffer, 1024)) {
978 if (
items.size() < 8) {
980 <<
"Bad line: " <<
buffer <<
"\n line must contain 8 items: eta, phi, depth, subdet, 4x values" 981 <<
" or 12 items: eta, phi, depth, subdet, 4x values for mean, 4x values for width" << std::endl;
991 if (
items.size() < 12)
994 atof(
items[4].c_str()),
995 atof(
items[5].c_str()),
996 atof(
items[6].c_str()),
997 atof(
items[7].c_str()),
1007 atof(
items[4].c_str()),
1008 atof(
items[5].c_str()),
1009 atof(
items[6].c_str()),
1010 atof(
items[7].c_str()),
1011 atof(
items[8].c_str()),
1012 atof(
items[9].c_str()),
1013 atof(
items[10].c_str()),
1014 atof(
items[11].c_str()));
1026 if (fObject.
isADC())
1027 sprintf(
buffer,
"#U ADC << this is the unit \n");
1029 sprintf(
buffer,
"#U fC << this is the unit \n");
1033 "# %15s %15s %15s %15s %8s %8s %8s %8s %8s %8s %8s %8s %10s\n",
1051 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
1054 dumpId(fOutput, *channel);
1056 " %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %10X\n",
1077 while (fInput.getline(
buffer, 1024)) {
1083 if (
items.size() < 6) {
1085 <<
"Bad line: " <<
buffer 1086 <<
"\n line must contain 6 items: eta, phi, depth, subdet, base - either (hex) or (dec), value" << std::endl;
1096 if (
items[4] ==
"(hex)")
1097 sscanf(
items[5].c_str(),
"%X", &mystatus);
1098 else if (
items[4] ==
"(dec)")
1099 sscanf(
items[5].c_str(),
"%u", &mystatus);
1102 <<
"\n value field must contain the base: one of (hex), (dec)" << std::endl;
1116 sprintf(
buffer,
"# %15s %15s %15s %15s %15s %10s\n",
"eta",
"phi",
"dep",
"det",
"(base) value",
"DetId");
1120 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
1122 dumpId(fOutput, *channel);
1123 sprintf(
buffer,
"%6s %15X %10X\n",
"(hex)",
value, channel->rawId());
1133 while (fInput.getline(
buffer, 1024)) {
1152 if (
items.size() < 7) {
1154 <<
"Bad line: " <<
buffer 1155 <<
"\n line must contain 7 items: eta, phi, depth, subdet, pedestal, resp.corr.gain, flag" << std::endl;
1174 sprintf(
buffer,
"#A %s << this is the algorithm name \n", fObject.
getAlgoString().c_str());
1179 "# %15s %15s %15s %15s %8s %13s %8s %10s\n",
1191 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
1194 dumpId(fOutput, *channel);
1196 " %12.7f %13.10f %12d %10X\n",
1197 item->getPedestal(),
1198 item->getRespGain(),
1210 int linecounter = 0;
1212 while (fInput.getline(
buffer, 1024)) {
1225 <<
"Unrecognized unit for pedestal widths. Assuming fC." << std::endl;
1231 <<
"The unit for the pedestal widths is missing in the txt file." << std::endl;
1237 while (fInput.getline(
buffer, 1024)) {
1244 if (
items.size() < 14) {
1246 <<
"\n line must contain 14 items: eta, phi, depth, subdet, 10x correlations" 1247 <<
" or 20 items: eta, phi, depth, subdet, 16x correlations" << std::endl;
1257 if (
items.size() < 20)
1270 values.setSigma(0, 1, 0.);
1271 values.setSigma(0, 2, 0.);
1272 values.setSigma(0, 3, 0.);
1273 values.setSigma(1, 2, 0.);
1274 values.setSigma(1, 3, 0.);
1275 values.setSigma(2, 3, 0.);
1306 if (fObject.
isADC())
1307 sprintf(
buffer,
"#U ADC << this is the unit \n");
1309 sprintf(
buffer,
"#U fC << this is the unit \n");
1313 "# %15s %15s %15s %15s %8s %8s %8s %8s %8s %8s %8s %8s %8s %8s %8s %8s %8s %8s %8s %8s %10s\n",
1338 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
1341 dumpId(fOutput, *channel);
1343 " %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",
1344 item->getSigma(0, 0),
1345 item->getSigma(0, 1),
1346 item->getSigma(0, 2),
1347 item->getSigma(0, 3),
1348 item->getSigma(1, 0),
1349 item->getSigma(1, 1),
1350 item->getSigma(1, 2),
1351 item->getSigma(1, 3),
1352 item->getSigma(2, 0),
1353 item->getSigma(2, 1),
1354 item->getSigma(2, 2),
1355 item->getSigma(2, 3),
1356 item->getSigma(3, 0),
1357 item->getSigma(3, 1),
1358 item->getSigma(3, 2),
1359 item->getSigma(3, 3),
1370 while (fInput.getline(
buffer, 1024)) {
1376 if (
items[0] ==
"SHAPE") {
1379 if (
items.size() < 36) {
1381 <<
"\n line must contain 36 items: eta, phi, depth, subdet, 4 capId x 4 Ranges " 1382 "x offsets, 4 capId x 4 Ranges x slopes" 1395 for (
unsigned capid = 0; capid < 4; capid++) {
1400 for (
unsigned capid = 0; capid < 4; capid++) {
1417 fOutput <<
"# QIE data" << std::endl;
1419 "# %15s %15s %15s %15s %36s %36s %36s %36s %36s %36s %36s %36s\n",
1435 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
1437 dumpId(fOutput, *channel);
1438 for (
unsigned capid = 0; capid < 4; capid++) {
1444 for (
unsigned capid = 0; capid < 4; capid++) {
1450 fOutput << std::endl;
1458 while (fInput.getline(
buffer, 1024)) {
1462 if (
items.size() < 36) {
1464 <<
"\n line must contain 36 items: eta, phi, depth, subdet, 32 bin values" 1478 for (
unsigned bin = 0;
bin < 32;
bin++) {
1481 coder.setMinCharges(
values);
1491 fOutput <<
"# QIE data in calibration mode" << std::endl;
1492 sprintf(
buffer,
"# %15s %15s %15s %15s %288s\n",
"eta",
"phi",
"dep",
"det",
"32 x charges");
1496 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
1499 dumpId(fOutput, *channel);
1501 for (
unsigned bin = 0;
bin < 32;
bin++) {
1502 sprintf(
buffer,
" %8.5f", lowEdge[
bin]);
1505 fOutput << std::endl;
1517 while (fInput.getline(
buffer, 1024)) {
1521 if (
items.size() < 12) {
1524 if (
items.size() < 9) {
1529 while (
items.size() < 12)
1530 items.push_back(
"");
1531 }
else if (
items[8] ==
"HT") {
1532 if (
items.size() == 11)
1533 items.push_back(
"");
1536 <<
"\n HT line must contain at least 11 items: i cr sl tb dcc spigot fiber " 1537 "fiberchan subdet=HT ieta iphi";
1542 <<
"HcalElectronicsMap-> Bad line: " <<
buffer 1543 <<
"\n line must contain 12 items: i cr sl tb dcc spigot fiber fiberchan subdet ieta iphi depth";
1547 int crate = atoi(
items[1].c_str());
1548 int slot = atoi(
items[2].c_str());
1550 if (
items[3] ==
"b")
1552 int dcc = atoi(
items[4].c_str());
1553 int spigot = atoi(
items[5].c_str());
1555 if (
items[3][0] ==
'u') {
1556 int fiber = atoi(
items[6].c_str());
1557 int fiberCh = atoi(
items[7].c_str());
1558 bool isTrig = (
items[8] ==
"HT" ||
items[8] ==
"NT");
1560 }
else if (
items[8] ==
"HT" ||
items[8] ==
"NT") {
1562 int slbCh = atoi(
items[7].c_str());
1565 int fiber = atoi(
items[6].c_str());
1566 int fiberCh = atoi(
items[7].c_str());
1569 elId.
setHTR(crate, slot, top);
1573 if (
items[8] ==
"NA") {
1575 }
else if (
items[8] ==
"NT") {
1581 }
else if (
converter.isHcalTrigTowerDetId()) {
1585 <<
'/' <<
items[10] <<
'/' <<
items[11] << std::endl;
1589 auto fObject = std::make_unique<HcalElectronicsMap>(fObjectHelper);
1600 "# %7s %3s %3s %3s %4s %7s %10s %14s %7s %5s %5s %6s",
1613 fOutput <<
buf << std::endl;
1615 for (
unsigned i = 0;
i < eids.size();
i++) {
1617 if (
eid.isTriggerChainId()) {
1621 if (
eid.isVMEid()) {
1626 " %7X %3d %3d %3c %4d %7d %10d %14d %7s %5s %5s %6s",
1631 eid.readoutVMECrateId(),
1633 eid.htrTopBottom() > 0 ?
't' :
'b',
1636 eid.slbSiteNumber(),
1637 eid.slbChannelIndex(),
1642 fOutput <<
buf << std::endl;
1643 }
else if (
eid.isUTCAid()) {
1645 " %7X %3d %3d u %4d %7d %10d %14d %7s %5s %5s %6s",
1658 fOutput <<
buf << std::endl;
1660 sprintf(
buf,
"NOT SUPPORTED!");
1661 fOutput <<
buf << std::endl;
1666 if (channel.
rawId()) {
1668 if (
eid.isVMEid()) {
1672 " %7X %3d %3d %3c %4d %7d %10d %14d %7s %5s %5s %6s",
1675 eid.readoutVMECrateId(),
1677 eid.htrTopBottom() > 0 ?
't' :
'b',
1688 " %7X %3d %3d u %4d %7d %10d %14d %7s %5s %5s %6s",
1703 fOutput <<
buf << std::endl;
1714 while (fInput.getline(
buffer, 1024)) {
1721 if (
items.size() > 1 &&
items[0].find(
"RctLsb") != std::string::npos) {
1725 if (
items.size() > 1 &&
items[0].find(
"Gain") != std::string::npos) {
1730 if (
items.size() < 7) {
1732 <<
"Bad line: " <<
buffer 1733 <<
"\n line must contain 7 items: eta, phi, depth, subdet, Rcalib, LutGranularity, OutputLutThreshold" 1749 const float _rctLsb = fObject.
getRctLsb();
1751 sprintf(
buffer,
"# %20s\n",
"Non-channel data");
1753 sprintf(
buffer,
"%8s %8.5f\n",
"RctLsb", _rctLsb);
1755 sprintf(
buffer,
"%8s %8.5f\n",
"Gain", _gain);
1758 "# %15s %15s %15s %15s %8s %15s %19s %10s\n",
1765 "OutputLutThreshold",
1770 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
1774 dumpId(fOutput, *channel);
1775 sprintf(
buffer,
" %8.5f %15d %19d %10X\n", _rCalib, _lutGranularity, _outputLutThreshold, channel->
rawId());
1786 while (getline(fInput,
buffer)) {
1793 if (
items.size() < 9) {
1795 <<
"\n line must contain 9 items: subDet, side_ring, slice, type, subChannel, " 1796 "LS, Value, UpperLimit, LowerLimit" 1803 unsigned int slice, subchan;
1804 switch (
items[0].at(1)) {
1829 float val, upper, lower;
1841 if (!(fObject->
addValue(newVal))) {
1842 edm::LogWarning(
"Data Error") <<
"Data from line " <<
buffer <<
"\nwas not added to the HcalDcsValues object." 1852 fOutput <<
"# subDet side_ring slice type subChan LS Value UpperLimit LowerLimit DcsId\n";
1856 for (HcalDcsValues::DcsSet::const_iterator
val = vals.begin();
val != vals.end(); ++
val) {
1859 switch (valId.subdet()) {
1873 fOutput << valId.subdet() <<
' ';
1877 fOutput << valId.ring() <<
' ';
1879 fOutput << valId.zside() <<
' ';
1881 fOutput << valId.slice() <<
' ' << valId.typeString(valId.type()) <<
' ' << valId.subchannel() <<
' ';
1882 fOutput <<
val->LS() <<
' ' <<
val->getValue() <<
' ' <<
val->getUpperLimit() <<
' ' <<
val->getLowerLimit()
1884 fOutput << std::hex <<
val->DcsId() <<
std::dec <<
'\n';
1905 while (fInput.getline(
buffer, 1024)) {
1909 if (
items.size() < 8) {
1914 <<
"HcalDcsMap-> Bad line: " <<
buffer 1915 <<
"\n line must contain 8 items: line side_ring slice subchannel subdet ieta iphi depth";
1921 unsigned int subchannel = atoi(
items[3].c_str());
1924 if (
items[4].
find(
"CALIB") != std::string::npos) {
1926 }
else if (
items[4].
find(
"HB") != std::string::npos) {
1928 }
else if (
items[4].
find(
"HE") != std::string::npos) {
1930 }
else if (
items[4].
find(
"HO") != std::string::npos) {
1932 }
else if (
items[4].
find(
"HF") != std::string::npos) {
1935 edm::LogError(
"MapFormat") <<
"HcalDcsMap-> Unknown subdetector, line is not accepted: " <<
items[5];
1945 <<
'/' <<
items[6] <<
'/' <<
items[7] << std::endl;
1950 auto fObject = std::make_unique<HcalDcsMap>(fObjectHelper);
1961 "# %7s %10s %6s %8s %7s %5s %5s %6s",
1970 fOutput <<
buf << std::endl;
1972 unsigned int line_counter = 0;
1978 " %8X %10d %6d %8d %7s %5s %5s %6s",
1983 _converter.getFlavor().c_str(),
1984 _converter.getField1().c_str(),
1985 _converter.getField2().c_str(),
1986 _converter.getField3().c_str());
1987 fOutput <<
buf << std::endl;
1997 while (fInput.getline(
buffer, 1024)) {
2003 if (
items.size() != 9) {
2005 <<
"Bad line: " <<
buffer 2006 <<
"\n line must contain at 9 least items: eta, phi, depth, subdet, firstSample, samplesToAdd, ExpectedPeak, " 2007 "MinEnergy, and a set of comma-separated coefficients" 2016 atoi(
items[4].c_str()),
2017 atoi(
items[5].c_str()),
2018 atoi(
items[6].c_str()),
2019 atof(
items[7].c_str()),
2031 "# %15s %15s %15s %15s %15s %15s %15s %15s %30s\n",
2044 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
2049 " %15u %15u %15u %15f",
2062 if (x < coef.size() - 1)
2078 while (fInput.getline(
buffer, 1024)) {
2083 if (
items.size() != 6) {
2089 int rm = atoi(
items[5].c_str());
2092 edm::LogInfo(
"MapFormat") <<
"HcalFrontEndMap:: processed " <<
good <<
" records in " <<
all <<
" record" 2094 auto fObject = std::make_unique<HcalFrontEndMap>(fObjectHelper);
2101 sprintf(
buffer,
"# %15s %15s %15s %15s %8s %8s\n",
"eta",
"phi",
"dep",
"det",
"rbx",
"rm");
2106 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
2109 dumpId(fOutput, *channel);
2110 sprintf(
buffer,
" %8s %8d \n", rbx.c_str(),
rm);
2121 while (fInput.getline(
buffer, 1024)) {
2127 if (
items.size() < 9) {
2129 <<
"\n line must contain 9 items: eta, phi, depth, subdet, 5x values" 2136 atoi(
items[4].c_str()),
2137 atof(
items[5].c_str()),
2138 atof(
items[6].c_str()),
2139 atoi(
items[7].c_str()),
2140 atof(
items[8].c_str()));
2150 "# %15s %15s %15s %15s %8s %15s %15s %8s %15s\n",
2163 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
2170 sprintf(
buffer,
" %8d %15.6f %15.6f %8d %15.6f\n",
type, fcByPE, darkC, auxi1, auxi2);
2183 while (fInput.getline(
buffer, 1024)) {
2188 if (
items.size() != 8) {
2195 int pixels = atoi(
items[1].c_str());
2196 float parL0 = atof(
items[2].c_str());
2197 float parL1 = atof(
items[3].c_str());
2198 float parL2 = atof(
items[4].c_str());
2199 float cTalk = atof(
items[5].c_str());
2200 int auxi1 = atoi(
items[6].c_str());
2201 float auxi2 = atof(
items[7].c_str());
2202 fObjectHelper.
loadObject(
type, pixels, parL0, parL1, parL2, cTalk, auxi1, auxi2);
2204 edm::LogInfo(
"MapFormat") <<
"HcalSiPMCharacteristics:: processed " <<
good <<
" records in " <<
all <<
" record" 2206 auto fObject = std::make_unique<HcalSiPMCharacteristics>(fObjectHelper);
2214 "# %8s %8s %15s %15s %15s %15s %8s %15s\n",
2226 for (
unsigned int k = 0;
k <
size; ++
k) {
2233 const float par0 = (!pars.empty()) ? pars[0] : 0;
2234 const float par1 = (pars.size() > 1) ? pars[1] : 0;
2235 const float par2 = (pars.size() > 2) ? pars[2] : 0;
2237 buffer,
" %8d %8d %15.6e %15.6e %15.6e %15.6f %8d %15.6f\n",
type, pixels,
par0,
par1,
par2, cTalk, auxi1, auxi2);
2248 while (fInput.getline(
buffer, 1024)) {
2254 if (
items.size() < 8) {
2256 <<
"\n line must contain 8 items: eta, phi, depth, subdet, 4x values" 2263 id.rawId(), atoi(
items[4].c_str()), atoi(
items[5].c_str()), atoi(
items[6].c_str()), atoi(
items[7].c_str()));
2273 "# %15s %15s %15s %15s %15s %15s %15s %15s\n",
2285 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
2291 sprintf(
buffer,
" %15d %15d %15d %15d \n",
mask, fgBitInfo, auxi1, auxi2);
2301 while (fInput.getline(
buffer, 1024)) {
2306 if (
items.size() != 6) {
2313 int adcCut = atoi(
items[1].c_str());
2315 uint32_t tbits = atoi(
items[3].c_str());
2316 int auxi1 = atoi(
items[4].c_str());
2317 int auxi2 = atoi(
items[5].c_str());
2321 edm::LogInfo(
"MapFormat") <<
"HcalTPParameters:: processed " <<
good <<
" records in " <<
all <<
" record" 2329 buffer,
"# %15s %15s %16s %15s %15s %15s\n",
"FGAlgo_HBHE",
"ADCThrHF",
"TDCMaskHF",
"STBitsHF",
"auxi1",
"auxi2");
2336 const int auxi1 = fObject.
getAuxi1();
2337 const int auxi2 = fObject.
getAuxi2();
2339 sprintf(
buffer,
" %15d %15d %16jx %15x %15d %15d\n",
version, adcCut, tdcMask, tbits, auxi1, auxi2);
2350 "# %15s %15s %15s %15s %8s %8s %8s %8s %11s %11s %11s %11s %9s %9s %9s %9s %10s\n",
2372 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
2373 dumpId(fOutput, *channel);
2376 " %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",
2398 "# %15s %15s %15s %15s %9s %9s %9s %9s %12s %12s %12s %12s %10s %10s %10s %10s %10s\n",
2420 for (std::vector<DetId>::iterator channel =
channels.begin(); channel !=
channels.end(); ++channel) {
2421 dumpId(fOutput, *channel);
2424 " %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
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
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
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)