1 #ifndef RecoLocalTracker_SiPixelRecHits_pixelCPEforGPU_h
2 #define RecoLocalTracker_SiPixelRecHits_pixelCPEforGPU_h
15 namespace CPEFastParametrisation {
24 namespace pixelCPEforGPU {
123 DetParams const& __restrict__ detParams,
float const x,
float const y,
float& cotalpha,
float& cotbeta) {
125 auto gvx = x - detParams.x0;
126 auto gvy = y - detParams.y0;
127 auto gvz = -1.f / detParams.z0;
130 cotalpha = gvx * gvz;
137 uint16_t upper_edge_first_pix,
138 uint16_t lower_edge_last_pix,
155 auto w_inner = pitch * float(lower_edge_last_pix - upper_edge_first_pix);
158 auto w_pred = theThickness * cot_angle
169 simple = (w_eff < 0.0f) | (w_eff > pitch);
174 float sum_of_edge = 2.0f;
179 w_eff = pitch * 0.5f * sum_of_edge;
183 float qdiff = q_l - q_f;
184 float qsum = q_l + q_f;
190 return 0.5f * (qdiff / qsum) * w_eff;
198 uint16_t llx = cp.
minRow[ic] + 1;
199 uint16_t lly = cp.
minCol[ic] + 1;
202 uint16_t urx = cp.
maxRow[ic];
203 uint16_t ury = cp.
maxCol[ic];
210 auto mx = llxl + urxl;
211 auto my = llyl + uryl;
213 auto xsize = int(urxl) + 2 - int(llxl);
214 auto ysize = int(uryl) + 2 - int(llyl);
244 float cotalpha = 0, cotbeta = 0;
248 auto thickness = detParams.isBarrel ? comParams.theThicknessB : comParams.theThicknessE;
255 detParams.chargeWidthX,
267 detParams.chargeWidthY,
274 cp.
xpos[ic] = xPos + xcorr;
275 cp.
ypos[ic] = yPos + ycorr;
283 cp.
xerr[ic] = 0.0050;
284 cp.
yerr[ic] = 0.0085;
290 0.00375, 0.00230, 0.00250, 0.00250, 0.00230, 0.00230, 0.00210, 0.00210, 0.00240};
295 0.00375, 0.00230, 0.00250, 0.00250, 0.00230, 0.00230, 0.00210, 0.00210, 0.00240};
312 if (!isEdgeX && !isBig1X) {
313 if (not detParams.isBarrel) {
315 }
else if (detParams.layer == 1) {
322 if (!isEdgeY && !isBig1Y) {
323 if (not detParams.isBarrel) {
325 }
else if (detParams.layer == 1) {
338 cp.
xerr[ic] = 0.0050f;
339 cp.
yerr[ic] = 0.0085f;
348 bool isOneX = (0 == sx);
349 bool isOneY = (0 == sy);
357 if (ch < detParams.minCh[
bin + 1])
363 cp.
status[ic].
qBin = CPEFastParametrisation::kGenErrorQBins - 1 -
bin;
374 int jx = std::clamp(bin_value, low_value, high_value);
376 auto toCM = [](uint8_t x) {
return float(x) * 1.e-4
f; };
379 cp.
xerr[ic] = isOneX ? toCM(isBigX ? detParams.sx2 : detParams.sigmax1[jx])
380 : detParams.xfact[
bin] * toCM(detParams.sigmax[jx]);
383 auto ey = cp.
ysize[ic] > 8 ? detParams.sigmay[
std::min(cp.
ysize[ic] - 9, 15)] : detParams.sy1;
385 cp.
yerr[ic] = isOneY ? toCM(isBigY ? detParams.sy2 : detParams.sy1) : detParams.yfact[
bin] * toCM(ey);
391 #endif // RecoLocalTracker_SiPixelRecHits_pixelCPEforGPU_h
__device__ uint8_t layer(uint16_t id) const
constexpr uint16_t lastRowInModule
uint8_t sigmax[CPEFastParametrisation::kNumErrorBins]
float xfact[CPEFastParametrisation::kGenErrorQBins]
uint8_t sigmax1[CPEFastParametrisation::kNumErrorBins]
constexpr AverageGeometry const &__restrict__ averageGeometry() const
constexpr uint32_t numberOfLayers
DetParams const * m_detParams
constexpr uint16_t localY(uint16_t py)
uint32_t layerStart[phase1PixelTopology::numberOfLayers+1]
constexpr void position(CommonParams const &__restrict__ comParams, DetParams const &__restrict__ detParams, ClusParams &cp, uint32_t ic)
constexpr int kGenErrorQBins
constexpr uint16_t lastColInModule
LayerGeometry const * m_layerGeometry
constexpr uint32_t layerIndexSize
AverageGeometry const * m_averageGeometry
int minCh[CPEFastParametrisation::kGenErrorQBins]
constexpr uint32_t maxHitsInIter()
constexpr CommonParams const &__restrict__ commonParams() const
Abs< T >::type abs(const T &t)
constexpr bool isEdgeY(uint16_t py)
constexpr void computeAnglesFromDet(DetParams const &__restrict__ detParams, float const x, float const y, float &cotalpha, float &cotbeta)
constexpr bool isBigPixY(uint16_t py)
constexpr bool isEdgeX(uint16_t px)
constexpr bool isBigPixX(uint16_t px)
constexpr int16_t xOffset
CommonParams const * m_commonParams
constexpr uint16_t localX(uint16_t px)
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)
constexpr uint32_t maxModuleStride
float yfact[CPEFastParametrisation::kGenErrorQBins]
constexpr void errorFromSize(CommonParams const &__restrict__ comParams, DetParams const &__restrict__ detParams, ClusParams &cp, uint32_t ic)
constexpr void errorFromDB(CommonParams const &__restrict__ comParams, DetParams const &__restrict__ detParams, ClusParams &cp, uint32_t ic)
uint8_t sigmay[CPEFastParametrisation::kNumErrorBins]
constexpr DetParams const &__restrict__ detParams(int i) const
constexpr int16_t yOffset
tuple size
Write out results.
constexpr LayerGeometry const &__restrict__ layerGeometry() const
uint8_t layer[phase1PixelTopology::layerIndexSize]
constexpr int kNumErrorBins
constexpr int32_t MaxHitsInIter