1 #ifndef RecoLocalTracker_SiPixelRecHits_pixelCPEforGPU_h
2 #define RecoLocalTracker_SiPixelRecHits_pixelCPEforGPU_h
105 DetParams const& __restrict__ detParams,
float const x,
float const y,
float& cotalpha,
float& cotbeta) {
107 auto gvx = x - detParams.x0;
108 auto gvy = y - detParams.y0;
109 auto gvz = -1.f / detParams.z0;
112 cotalpha = gvx * gvz;
119 uint16_t upper_edge_first_pix,
120 uint16_t lower_edge_last_pix,
137 auto w_inner = pitch *
float(lower_edge_last_pix - upper_edge_first_pix);
140 auto w_pred = theThickness * cot_angle
151 simple = (w_eff < 0.0f) | (w_eff > pitch);
156 float sum_of_edge = 2.0f;
161 w_eff = pitch * 0.5f * sum_of_edge;
165 float qdiff = q_l - q_f;
166 float qsum = q_l + q_f;
172 return 0.5f * (qdiff / qsum) * w_eff;
180 uint16_t llx =
cp.minRow[ic] + 1;
181 uint16_t lly =
cp.minCol[ic] + 1;
184 uint16_t urx =
cp.maxRow[ic];
185 uint16_t ury =
cp.maxCol[ic];
192 auto mx = llxl + urxl;
193 auto my = llyl + uryl;
209 int unbalanceX = 8. *
std::abs(
float(
cp.q_f_X[ic] -
cp.q_l_X[ic])) /
float(
cp.q_f_X[ic] +
cp.q_l_X[ic]);
210 int unbalanceY = 8. *
std::abs(
float(
cp.q_f_Y[ic] -
cp.q_l_Y[ic])) /
float(
cp.q_f_Y[ic] +
cp.q_l_Y[ic]);
218 cp.xsize[ic] = -
cp.xsize[ic];
220 cp.ysize[ic] = -
cp.ysize[ic];
226 float cotalpha = 0, cotbeta = 0;
230 auto thickness = detParams.isBarrel ? comParams.theThicknessB : comParams.theThicknessE;
237 detParams.chargeWidthX,
249 detParams.chargeWidthY,
256 cp.xpos[ic] = xPos + xcorr;
257 cp.ypos[ic] = yPos + ycorr;
265 cp.xerr[ic] = 0.0050;
266 cp.yerr[ic] = 0.0085;
269 constexpr
float xerr_barrel_l1[] = {0.00115, 0.00120, 0.00088};
270 constexpr
float xerr_barrel_l1_def = 0.00200;
271 constexpr
float yerr_barrel_l1[] = {
272 0.00375, 0.00230, 0.00250, 0.00250, 0.00230, 0.00230, 0.00210, 0.00210, 0.00240};
273 constexpr
float yerr_barrel_l1_def = 0.00210;
274 constexpr
float xerr_barrel_ln[] = {0.00115, 0.00120, 0.00088};
275 constexpr
float xerr_barrel_ln_def = 0.00200;
276 constexpr
float yerr_barrel_ln[] = {
277 0.00375, 0.00230, 0.00250, 0.00250, 0.00230, 0.00230, 0.00210, 0.00210, 0.00240};
278 constexpr
float yerr_barrel_ln_def = 0.00210;
279 constexpr
float xerr_endcap[] = {0.0020, 0.0020};
280 constexpr
float xerr_endcap_def = 0.0020;
281 constexpr
float yerr_endcap[] = {0.00210};
282 constexpr
float yerr_endcap_def = 0.00210;
284 auto sx =
cp.maxRow[ic] -
cp.minRow[ic];
285 auto sy =
cp.maxCol[ic] -
cp.minCol[ic];
295 if (not detParams.isBarrel) {
296 cp.xerr[ic] =
sx <
std::size(xerr_endcap) ? xerr_endcap[
sx] : xerr_endcap_def;
297 }
else if (detParams.layer == 1) {
298 cp.xerr[ic] =
sx <
std::size(xerr_barrel_l1) ? xerr_barrel_l1[
sx] : xerr_barrel_l1_def;
300 cp.xerr[ic] =
sx <
std::size(xerr_barrel_ln) ? xerr_barrel_ln[
sx] : xerr_barrel_ln_def;
305 if (not detParams.isBarrel) {
306 cp.yerr[ic] =
sy <
std::size(yerr_endcap) ? yerr_endcap[
sy] : yerr_endcap_def;
307 }
else if (detParams.layer == 1) {
308 cp.yerr[ic] =
sy <
std::size(yerr_barrel_l1) ? yerr_barrel_l1[
sy] : yerr_barrel_l1_def;
310 cp.yerr[ic] =
sy <
std::size(yerr_barrel_ln) ? yerr_barrel_ln[
sy] : yerr_barrel_ln_def;
320 cp.xerr[ic] = 0.0050f;
321 cp.yerr[ic] = 0.0085f;
323 auto sx =
cp.maxRow[ic] -
cp.minRow[ic];
324 auto sy =
cp.maxCol[ic] -
cp.minCol[ic];
330 uint32_t ix = (0 ==
sx);
331 uint32_t iy = (0 ==
sy);
336 cp.xerr[ic] = detParams.sx[ix];
338 cp.yerr[ic] = detParams.sy[iy];
343 #endif // RecoLocalTracker_SiPixelRecHits_pixelCPEforGPU_h