12 #include <klm/eklm/modules/EKLMDataChecker/EKLMDataCheckerModule.h>
26 setDescription(
"EKLM data checker module.");
45 const uint16_t c_ChargeError = 0x0FFF;
47 std::map<int, StripData>::iterator it;
50 for (i = 0; i < n; i++) {
62 data.nBadDigits = (eklmDigit->
getCharge() == c_ChargeError) ? 1 : 0;
66 if (eklmDigit->
getCharge() == c_ChargeError)
67 it->second.nBadDigits++;
91 int section, layer, sector, plane, strip, stripGlobal;
92 std::map<int, StripData>::iterator it;
93 std::vector<StripData> stripDataVector;
94 std::vector<StripData>::iterator it2, it3, it4;
96 stripDataVector.push_back(it->second);
97 sort(stripDataVector.begin(), stripDataVector.end(), compareBadDigitRate);
98 printf(
"EKLM data checker report.\n"
99 "Strips with readout errors sorted by error rate:\n");
100 it2 = stripDataVector.begin();
101 while (it2 != stripDataVector.end()) {
102 if (it2->nBadDigits == 0)
105 while (it3 != stripDataVector.end()) {
106 if (it3->nBadDigits != it2->nBadDigits || it3->nDigits != it2->nDigits)
110 sort(it2, it3, compareStripNumber);
111 for (it4 = it2; it4 != it3; ++it4) {
113 it4->strip, §ion, &layer, §or, &plane, &strip);
114 printf(
"Section %d, layer %d, sector %d, plane %d, strip %d: %.1f%% "
116 section, layer, sector, plane, strip,
117 float(it4->nBadDigits) / it4->nDigits * 100,
118 it4->nBadDigits, it4->nDigits);
122 printf(
"Strips with no data collected:\n");
129 section, layer, sector, plane, strip);
132 printf(
"Section %d, layer %d, sector %d, plane %d, strip %d.\n",
133 section, layer, sector, plane, strip);