9 bool inZeroRange =
false;
12 for (
int i = 0; i < 512; ++i) {
14 if (pad->
GetRawADC(i) == 0 && !inZeroRange) {
20 if (inZeroRange && pad->
GetRawADC(i) != 0) {
22 fillMissingData(pad, zeroStart, i);
30 void AtFilterZero::fillMissingData(
AtPad *pad,
int start,
int stop)
35 double avgSub = pad->
GetADC(start - 1) + pad->
GetADC(stop);
40 if (transition > fThreshold) {
43 avgSub = pad->
GetADC(start - 1);
46 avgSub = pad->
GetADC(stop);
51 for (
int i = start; i < stop; ++i) {
58 void AtFilterZero::fillMissingDataLine(
AtPad *pad,
int start,
int stop)
60 double slope = pad->
GetADC(stop) - pad->
GetADC(start - 1);
61 slope /= (stop - start + 1);
63 auto startVal = pad->
GetADC(start - 1);
65 for (
int i = start; i < stop; ++i) {
67 pad->
SetADC(i, startVal + (i - start + 1) * slope);