19 const double padSizeX,
const double padSizeY)
26 const double ycorr =
GetYcorr(dy) / padSizeY;
31 return std::make_pair(dx, dy);
52 dx =
viM == 1 ? 0. : -1;
62 dx =
viM == 1 ? 0. : -1;
75 dy =
viM == 1 ? -0.5 : 0.5;
84 return std::make_pair(dx, dy);
91 int n(n0 ? n0 :
fSignal.size());
92 for (
int ir(0); ir < n; ir++) {
93 if (
fSignal[ir].xe > 0)
continue;
97 if (std::abs(R) > 0)
return dx / R;
105 double dy(0.), T(0.);
106 int n(n0 ? n0 :
fSignal.size());
107 for (
int it(0); it < n; it++) {
113 if (std::abs(T) > 0)
return dy / T;
125 if (dx >= -0.5 && dx < 0.5)
return;
126 int ishift = int(dx - 0.5) + (dx > 0.5 ? 1 : 0);
127 if (
vcM + ishift < 0)
134 for (uint idx(0); idx <
fSignal.size(); idx++)
144 if (dy >= -0.5 && dy < 0.5)
return;
145 int ishift = int(dy - 0.5) + (dy > 0.5 ? 1 : 0);
161 else if (n0 > 5 &&
HasOvf())
169 int a0m = std::abs(a0);
170 uint8_t xmap =
vyM & 0xff;
194 if (typ < 0 || typ > 2) {
198 double dx = std::abs(dxIn);
206 i0 = std::max(0, ii - 1);
219 double DDx = (xval[1] - xval[0]), a = DDx /
fgCorrXdx, b = xval[0] - DDx * (i0 + 0.5);
220 return (dxIn > 0 ? 1 : -1) * b + a * dxIn;
229 float fdy(1.), yoff(0.);
237 yoff = (dy > 0 ? -1 : 1) * 1.56;
241 yoff = (dy > 0 ? -1 : 1) * 1.06;
272 return dy * fdy + yoff;
284 {-0.001, -0.001, -0.002, -0.002, -0.003, -0.003, -0.003, -0.004, -0.004, -0.006, -0.006, -0.006, -0.007,
285 -0.007, -0.008, -0.008, -0.008, -0.009, -0.009, -0.011, -0.011, -0.011, -0.012, -0.012, -0.012, -0.012,
286 -0.013, -0.013, -0.013, -0.013, -0.014, -0.014, -0.014, -0.014, -0.014, -0.016, -0.016, -0.016, -0.016,
287 -0.017, -0.017, -0.017, -0.018, -0.018, -0.018, -0.018, -0.018, 0.000, 0.000, 0.000},
288 {0.467, 0.430, 0.396, 0.364, 0.335, 0.312, 0.291, 0.256, 0.234, 0.219, 0.207, 0.191, 0.172,
289 0.154, 0.147, 0.134, 0.123, 0.119, 0.109, 0.122, 0.113, 0.104, 0.093, 0.087, 0.079, 0.073,
290 0.067, 0.063, 0.058, 0.053, 0.049, 0.046, 0.042, 0.038, 0.036, 0.032, 0.029, 0.027, 0.024,
291 0.022, 0.019, 0.017, 0.014, 0.013, 0.011, 0.009, 0.007, 0.004, 0.003, 0.001},
292 {0.001, 0.001, 0.001, 0.001, 0.002, 0.002, 0.001, 0.002, 0.004, 0.003, 0.002, 0.002, 0.002,
293 0.002, 0.002, 0.002, 0.003, 0.004, 0.003, 0.004, 0.004, 0.007, 0.003, 0.004, 0.002, 0.002,
294 -0.011, -0.011, -0.012, -0.012, -0.012, -0.013, -0.013, -0.013, -0.014, -0.014, -0.014, -0.016, -0.016,
295 -0.016, -0.017, -0.017, -0.017, -0.018, -0.018, -0.018, -0.019, 0.029, 0.018, 0.001}};
297 {0.629389, -0.215285},
299 {0.151913, 0.054404}};
301 {-0.00050, -0.00050, -0.00150, -0.00250, -0.00250, -0.00350, -0.00450, -0.00450, -0.00550, -0.00650,
302 -0.00650, -0.00750, -0.00850, -0.00850, -0.00850, -0.00950, -0.00950, -0.00950, -0.01050, -0.01150,
303 -0.01150, -0.01150, -0.01250, -0.01250, -0.01250, -0.01250, -0.01350, -0.01350, -0.01350, -0.01350,
304 -0.01450, -0.01450, -0.01450, -0.01550, -0.01550, -0.01550, -0.01550, -0.01650, -0.01650, -0.01550,
305 -0.01650, -0.01614, -0.01620, -0.01624, -0.01626, -0.01627, -0.01626, -0.01624, -0.01620, -0.01615},
306 {0.36412, 0.34567, 0.32815, 0.31152, 0.29574, 0.28075, 0.26652, 0.25302, 0.24020, 0.22803,
307 0.21647, 0.21400, 0.19400, 0.18520, 0.17582, 0.16600, 0.14600, 0.13800, 0.14280, 0.14200,
308 0.13400, 0.12600, 0.12200, 0.11000, 0.10200, 0.09400, 0.09000, 0.08600, 0.08200, 0.07400,
309 0.07000, 0.06600, 0.06600, 0.06200, 0.05800, 0.05400, 0.05400, 0.05000, 0.04600, 0.04600,
310 0.04200, 0.03800, 0.03800, 0.03400, 0.03400, 0.03000, 0.03000, 0.02600, 0.02200, 0.02200}};
312 {0.00100, 0.00260, 0.00540, 0.00740, 0.00900, 0.01060, 0.01300, 0.01460, 0.01660, 0.01900,
313 0.02060, 0.02260, 0.02420, 0.02700, 0.02860, 0.02980, 0.03220, 0.03340, 0.03540, 0.03620,
314 0.03820, 0.04020, 0.04180, 0.04340, 0.04460, 0.04620, 0.04740, 0.04941, 0.05088, 0.05233,
315 0.05375, 0.05515, 0.05653, 0.05788, 0.05921, 0.06052, 0.06180, 0.06306, 0.06430, 0.06551,
316 0.06670, 0.06786, 0.06901, 0.07012, 0.07122, 0.07229, 0.07334, 0.07436, 0.07536, 0.07634},
317 {0.00100, 0.00380, 0.00780, 0.00900, 0.01220, 0.01460, 0.01860, 0.01940, 0.02260, 0.02540,
318 0.02820, 0.03060, 0.03220, 0.03660, 0.03980, 0.04094, 0.04420, 0.04620, 0.04824, 0.04980,
319 0.05298, 0.05532, 0.05740, 0.05991, 0.06217, 0.06500, 0.06540, 0.06900, 0.07096, 0.07310,
320 0.07380, 0.07729, 0.07935, 0.08139, 0.08340, 0.08538, 0.08734, 0.08928, 0.08900, 0.09307,
321 0.09493, 0.09340, 0.09858, 0.09620, 0.09740, 0.10386, 0.09980, 0.10726, 0.10892, 0.11056},
322 {0.00011, 0.00140, 0.00340, 0.00420, 0.00500, 0.00620, 0.00820, 0.00860, 0.01060, 0.01100,
323 0.01220, 0.01340, 0.01500, 0.01540, 0.01700, 0.01820, 0.01900, 0.02060, 0.02180, 0.02260,
324 0.02340, 0.02420, 0.02500, 0.02500, 0.02660, 0.02740, 0.02820, 0.02900, 0.03020, 0.03180,
325 0.03300, 0.03260, 0.03380, 0.03460, 0.03500, 0.03580, 0.03780, 0.03820, 0.03860, 0.03900,
326 0.04100, 0.04180, 0.04060, 0.04300, 0.04340, 0.04340, 0.04380, 0.04460, 0.04580, 0.04540}};
void RecenterXoffset(double &dx)
static float fgCorrYval[NBINSCORRY][2]
discretized correction LUT
void RecenterYoffset(double &dy)
Shift graph representation to [-0.5, 0.5].
bool IsBiasXright() const
std::pair< double, double > GetDxDy(const int n0)
std::pair< double, double > CorrectPosition(double dx, double dy, const double xcorr, const double padSizeX, const double padSizeY)
Shift graph representation to [-0.5, 0.5].
static float fgCorrXval[3][NBINSCORRX]
step of the discretized correction LUT
int Nint(T x) const
discretized correction LUT
double GetYoffset(int n0=0) const
uint16_t vyM
index of maximum signal in the projection
static float fgCorrRcXbiasXval[3][NBINSCORRX]
discretized correction LUT
double GetYcorr(double dy, int cls=0) const
y position correction based on LUT
std::vector< signal > fSignal
uint8_t vcM
start time of current hit [clk]
int GetHitRcClass(int a0) const
Hit classification wrt signal bias.
double GetXoffset(int n0=0) const
int GetHitClass() const
Hit classification wrt center pad.
double GetXcorr(double dx, int typ, int cls=0) const
static float fgCorrRcXval[2][NBINSCORRX]
discretized correction params