1 #ifndef RecoLocalTracker_SiPixelRecHits_plugins_gpuPixelRecHits_h
2 #define RecoLocalTracker_SiPixelRecHits_plugins_gpuPixelRecHits_h
15 namespace gpuPixelRecHits {
33 auto const digis = *pdigis;
38 auto& agc = hits.averageGeometry();
39 auto const& ag = cpeParams->averageGeometry();
42 agc.ladderZ[il] = ag.ladderZ[il] - bs->z;
43 agc.ladderX[il] = ag.ladderX[il] - bs->x;
44 agc.ladderY[il] = ag.ladderY[il] - bs->y;
45 agc.ladderR[il] =
sqrt(agc.ladderX[il] * agc.ladderX[il] + agc.ladderY[il] * agc.ladderY[il]);
46 agc.ladderMinZ[il] = ag.ladderMinZ[il] - bs->z;
47 agc.ladderMaxZ[il] = ag.ladderMaxZ[il] - bs->z;
50 agc.endCapZ[0] = ag.endCapZ[0] - bs->z;
51 agc.endCapZ[1] = ag.endCapZ[1] - bs->z;
83 printf(
"hitbuilder: %d clusters in module %d. will write at %d\n", nclus,
me,
clusters.clusModuleStart(
me));
86 for (
int startClus = 0, endClus = nclus; startClus < endClus; startClus +=
MaxHitsInIter) {
87 int nClusInIter =
std::min(MaxHitsInIter, endClus - startClus);
88 int lastClus = startClus + nClusInIter;
89 assert(nClusInIter <= nclus);
93 assert(nclus > MaxHitsInIter || (0 == startClus && nClusInIter == nclus && lastClus == nclus));
98 clusParams.maxRow[ic] = 0;
100 clusParams.maxCol[ic] = 0;
101 clusParams.charge[ic] = 0;
102 clusParams.q_f_X[ic] = 0;
103 clusParams.q_l_X[ic] = 0;
104 clusParams.q_f_Y[ic] = 0;
105 clusParams.q_l_Y[ic] = 0;
113 auto id = digis.moduleInd(
i);
118 auto cl = digis.clus(
i);
119 if (cl < startClus || cl >= lastClus)
124 auto x = digis.xx(
i);
125 auto y = digis.yy(
i);
134 auto pixmx = cpeParams->detParams(
me).pixmx;
136 auto id = digis.moduleInd(
i);
141 auto cl = digis.clus(
i);
142 if (cl < startClus || cl >= lastClus)
147 auto x = digis.xx(
i);
148 auto y = digis.yy(
i);
149 auto ch = digis.adc(
i);
152 if (clusParams.minRow[
cl] == x)
154 if (clusParams.maxRow[
cl] == x)
156 if (clusParams.minCol[
cl] == y)
158 if (clusParams.maxCol[
cl] == y)
177 hits.setChargeAndStatus(
h, clusParams.charge[ic], clusParams.status[ic]);
178 hits.detectorIndex(
h) =
me;
181 hits.xLocal(
h) = xl = clusParams.xpos[ic];
182 hits.yLocal(
h) = yl = clusParams.ypos[ic];
184 hits.clusterSizeX(
h) = clusParams.xsize[ic];
185 hits.clusterSizeY(
h) = clusParams.ysize[ic];
187 hits.xerrLocal(
h) = clusParams.xerr[ic] * clusParams.xerr[ic] + cpeParams->detParams(
me).apeXX;
188 hits.yerrLocal(
h) = clusParams.yerr[ic] * clusParams.yerr[ic] + cpeParams->detParams(
me).apeYY;
193 cpeParams->detParams(
me).frame.toGlobal(xl, yl, xg, yg, zg);
199 hits.xGlobal(
h) = xg;
200 hits.yGlobal(
h) = yg;
201 hits.zGlobal(
h) = zg;
203 hits.rGlobal(
h) =
std::sqrt(xg * xg + yg * yg);
204 hits.iphi(
h) = unsafe_atan2s<7>(yg, xg);
212 #endif // RecoLocalTracker_SiPixelRecHits_plugins_gpuPixelRecHits_h
T1 atomicMax(T1 *a, T2 b)
ClusParamsT< MaxHitsInIter > ClusParams
static constexpr auto numberOfLaddersInBarrel
constexpr void position(CommonParams const &__restrict__ comParams, DetParams const &__restrict__ detParams, ClusParams &cp, uint32_t ic)
printf("params %d %f %f %f\n", minT, eps, errmax, chi2max)
uint16_t *__restrict__ uint16_t const *__restrict__ uint32_t const *__restrict__ uint32_t *__restrict__ uint32_t const *__restrict__ int32_t *__restrict__ uint32_t numElements
constexpr uint16_t invalidModuleId
constexpr void errorFromDB(CommonParams const &__restrict__ comParams, DetParams const &__restrict__ detParams, ClusParams &cp, uint32_t ic)
T1 atomicMin(T1 *a, T2 b)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
T1 atomicAdd(T1 *a, T2 b)
constexpr int32_t MaxHitsInIter
caConstants::TupleMultiplicity const *__restrict__ HitsOnGPU const *__restrict__ tindex_type *__restrict__ double *__restrict__ phits