215 constexpr
int maxSize = TrackerTraits::maxSizeCluster;
217 uint16_t llx =
cp.minRow[ic] + 1;
218 uint16_t lly =
cp.minCol[ic] + 1;
221 uint16_t urx =
cp.maxRow[ic];
222 uint16_t ury =
cp.maxCol[ic];
224 uint16_t llxl = llx, llyl = lly, urxl = urx, uryl = ury;
226 llxl = TrackerTraits::localX(llx);
227 llyl = TrackerTraits::localY(lly);
228 urxl = TrackerTraits::localX(urx);
229 uryl = TrackerTraits::localY(ury);
231 auto mx = llxl + urxl;
232 auto my = llyl + uryl;
239 if (TrackerTraits::isBigPixX(
cp.minRow[ic]))
241 if (TrackerTraits::isBigPixX(
cp.maxRow[ic]))
243 if (TrackerTraits::isBigPixY(
cp.minCol[ic]))
245 if (TrackerTraits::isBigPixY(
cp.maxCol[ic]))
248 int unbalanceX = 8.f *
std::abs(
float(
cp.q_f_X[ic] -
cp.q_l_X[ic])) /
float(
cp.q_f_X[ic] +
cp.q_l_X[ic]);
249 int unbalanceY = 8.f *
std::abs(
float(
cp.q_f_Y[ic] -
cp.q_l_Y[ic])) /
float(
cp.q_f_Y[ic] +
cp.q_l_Y[ic]);
257 if (
cp.minRow[ic] == 0 ||
cp.maxRow[ic] == uint32_t(detParams.nRows - 1))
258 cp.xsize[ic] = -
cp.xsize[ic];
260 if (
cp.minCol[ic] == 0 ||
cp.maxCol[ic] == uint32_t(detParams.nCols - 1))
261 cp.ysize[ic] = -
cp.ysize[ic];
264 float xoff = 0.5f *
float(detParams.nRows) * comParams.thePitchX;
265 float yoff = 0.5f *
float(detParams.nCols) * comParams.thePitchY;
268 xoff = xoff + TrackerTraits::bigPixXCorrection * comParams.thePitchX;
269 yoff = yoff + TrackerTraits::bigPixYCorrection * comParams.thePitchY;
272 auto xPos = detParams.shiftX + (comParams.thePitchX * 0.5f *
float(mx)) - xoff;
273 auto yPos = detParams.shiftY + (comParams.thePitchY * 0.5f *
float(my)) - yoff;
275 float cotalpha = 0, cotbeta = 0;
279 auto thickness = detParams.isBarrel ? comParams.theThicknessB : comParams.theThicknessE;
286 detParams.chargeWidthX,
290 TrackerTraits::isBigPixX(
cp.minRow[ic]),
291 TrackerTraits::isBigPixX(
cp.maxRow[ic]));
298 detParams.chargeWidthY,
302 TrackerTraits::isBigPixY(
cp.minCol[ic]),
303 TrackerTraits::isBigPixY(
cp.maxCol[ic]));
305 cp.xpos[ic] = xPos + xcorr;
306 cp.ypos[ic] = yPos + ycorr;
Abs< T >::type abs(const T &t)
constexpr void computeAnglesFromDet(DetParams const &__restrict__ detParams, float const x, float const y, float &cotalpha, float &cotbeta)
constexpr float correction(int sizeM1, int q_f, int q_l, uint16_t upper_edge_first_pix, uint16_t lower_edge_last_pix, float lorentz_shift, float theThickness, float cot_angle, float pitch, bool first_is_big, bool last_is_big)