1 #ifndef RecoLocalTracker_SiPixelRecHits_pixelCPEforGPU_h
2 #define RecoLocalTracker_SiPixelRecHits_pixelCPEforGPU_h
113 DetParams const& __restrict__ detParams,
float const x,
float const y,
float& cotalpha,
float& cotbeta) {
115 auto gvx = x - detParams.x0;
116 auto gvy = y - detParams.y0;
117 auto gvz = -1.f / detParams.z0;
120 cotalpha = gvx * gvz;
127 uint16_t upper_edge_first_pix,
128 uint16_t lower_edge_last_pix,
145 auto w_inner = pitch *
float(lower_edge_last_pix - upper_edge_first_pix);
148 auto w_pred = theThickness * cot_angle
159 simple = (w_eff < 0.0f) | (w_eff > pitch);
164 float sum_of_edge = 2.0f;
169 w_eff = pitch * 0.5f * sum_of_edge;
173 float qdiff = q_l - q_f;
174 float qsum = q_l + q_f;
180 return 0.5f * (qdiff / qsum) * w_eff;
188 uint16_t llx =
cp.minRow[ic] + 1;
189 uint16_t lly =
cp.minCol[ic] + 1;
192 uint16_t urx =
cp.maxRow[ic];
193 uint16_t ury =
cp.maxCol[ic];
200 auto mx = llxl + urxl;
201 auto my = llyl + uryl;
217 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]);
218 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]);
226 cp.xsize[ic] = -
cp.xsize[ic];
228 cp.ysize[ic] = -
cp.ysize[ic];
234 float cotalpha = 0, cotbeta = 0;
238 auto thickness = detParams.isBarrel ? comParams.theThicknessB : comParams.theThicknessE;
245 detParams.chargeWidthX,
257 detParams.chargeWidthY,
264 cp.xpos[ic] = xPos + xcorr;
265 cp.ypos[ic] = yPos + ycorr;
273 cp.xerr[ic] = 0.0050;
274 cp.yerr[ic] = 0.0085;
280 0.00375, 0.00230, 0.00250, 0.00250, 0.00230, 0.00230, 0.00210, 0.00210, 0.00240};
285 0.00375, 0.00230, 0.00250, 0.00250, 0.00230, 0.00230, 0.00210, 0.00210, 0.00240};
292 auto sx =
cp.maxRow[ic] -
cp.minRow[ic];
293 auto sy =
cp.maxCol[ic] -
cp.minCol[ic];
303 if (not detParams.isBarrel) {
305 }
else if (detParams.layer == 1) {
313 if (not detParams.isBarrel) {
315 }
else if (detParams.layer == 1) {
328 cp.xerr[ic] = 0.0050f;
329 cp.yerr[ic] = 0.0085f;
331 auto sx =
cp.maxRow[ic] -
cp.minRow[ic];
332 auto sy =
cp.maxCol[ic] -
cp.minCol[ic];
338 bool isOneX = (0 ==
sx);
339 bool isOneY = (0 ==
sy);
343 auto ch =
cp.charge[ic];
346 if (ch < detParams.minCh[
bin + 1])
350 cp.status[ic].qBin = 4 -
bin;
351 cp.status[ic].isOneX = isOneX;
352 cp.status[ic].isBigX = (isOneX & isBigX) |
isEdgeX;
353 cp.status[ic].isOneY = isOneY;
354 cp.status[ic].isBigY = (isOneY & isBigY) |
isEdgeY;
356 auto xoff = 81.f * comParams.thePitchX;
359 auto toCM = [](uint8_t x) {
return float(x) * 1.e-4; };
362 cp.xerr[ic] = isOneX ? toCM(isBigX ? detParams.sx2 : detParams.sigmax1[jx])
363 : detParams.xfact[
bin] * toCM(detParams.sigmax[jx]);
366 auto ey =
cp.ysize[ic] > 8 ? detParams.sigmay[
std::min(
cp.ysize[ic] - 9, 15)] : detParams.sy1;
368 cp.yerr[ic] = isOneY ? toCM(isBigY ? detParams.sy2 : detParams.sy1) : detParams.yfact[
bin] * toCM(ey);
374 #endif // RecoLocalTracker_SiPixelRecHits_pixelCPEforGPU_h