1 #ifndef RecoLocalTracker_SiPixelRecHits_alpaka_PixelRecHits_h 2 #define RecoLocalTracker_SiPixelRecHits_alpaka_PixelRecHits_h 11 #include <alpaka/alpaka.hpp> 29 template <
typename TrackerTraits>
32 template <
typename TAcc,
typename = std::enable_if_t<alpaka::isAccelerator<TAcc>>>
38 uint32_t nonEmptyModules,
48 auto& agc =
hits.averageGeometry();
50 auto nLadders = TrackerTraits::numberOfLaddersInBarrel;
54 agc.ladderX[il] = ag.ladderX[il] -
bs->x;
55 agc.ladderY[il] = ag.ladderY[il] -
bs->y;
56 agc.ladderR[il] =
sqrt(agc.ladderX[il] * agc.ladderX[il] + agc.ladderY[il] * agc.ladderY[il]);
57 agc.ladderMinZ[il] = ag.ladderMinZ[il] -
bs->z;
58 agc.ladderMaxZ[il] = ag.ladderMaxZ[il] -
bs->z;
62 agc.endCapZ[0] = ag.endCapZ[0] -
bs->z;
63 agc.endCapZ[1] = ag.endCapZ[1] -
bs->z;
88 printf(
"hitbuilder: %d clusters in module %d. will write at %d\n",
94 auto& clusParams = alpaka::declareSharedVar<pixelCPEforDevice::ClusParams, __COUNTER__>(acc);
95 for (
int startClus = 0, endClus = nclus; startClus < endClus; startClus +=
maxHitsInIter) {
99 int lastClus = startClus + nClusInIter;
108 clusParams.maxRow[ic] = 0;
110 clusParams.maxCol[ic] = 0;
111 clusParams.charge[ic] = 0;
112 clusParams.q_f_X[ic] = 0;
113 clusParams.q_l_X[ic] = 0;
114 clusParams.q_f_Y[ic] = 0;
115 clusParams.q_l_Y[ic] = 0;
118 alpaka::syncBlockThreads(acc);
122 auto id = digis[
i].moduleId();
127 auto cl = digis[
i].clus();
128 if (cl < startClus || cl >= lastClus)
133 auto x = digis[
i].xx();
134 auto y = digis[
i].yy();
141 alpaka::syncBlockThreads(acc);
145 auto id = digis[
i].moduleId();
150 auto cl = digis[
i].clus();
151 if (cl < startClus || cl >= lastClus)
156 auto x = digis[
i].xx();
157 auto y = digis[
i].yy();
158 auto ch = digis[
i].adc();
161 if (clusParams.minRow[
cl] ==
x)
163 if (clusParams.maxRow[
cl] ==
x)
165 if (clusParams.minCol[
cl] == y)
167 if (clusParams.maxCol[
cl] == y)
171 alpaka::syncBlockThreads(acc);
181 pixelCPEforDevice::position<TrackerTraits>(
184 pixelCPEforDevice::errorFromDB<TrackerTraits>(
188 hits[
h].chargeAndStatus().charge = clusParams.charge[ic];
189 hits[
h].chargeAndStatus().status = clusParams.status[ic];
194 hits[
h].xLocal() = xl = clusParams.xpos[ic];
195 hits[
h].yLocal() = yl = clusParams.ypos[ic];
197 hits[
h].clusterSizeX() = clusParams.xsize[ic];
198 hits[
h].clusterSizeY() = clusParams.ysize[ic];
200 hits[
h].xerrLocal() = clusParams.xerr[ic] * clusParams.xerr[ic] + cpeParams->
detParams(
me).apeXX;
201 hits[
h].yerrLocal() = clusParams.yerr[ic] * clusParams.yerr[ic] + cpeParams->
detParams(
me).apeYY;
205 cpeParams->
detParams(
me).frame.toGlobal(xl, yl, xg, yg, zg);
211 hits[
h].xGlobal() = xg;
212 hits[
h].yGlobal() = yg;
213 hits[
h].zGlobal() = zg;
215 hits[
h].iphi() = unsafe_atan2s<7>(yg, xg);
217 alpaka::syncBlockThreads(acc);
226 #endif // RecoLocalTracker_SiPixelRecHits_plugins_alpaka_PixelRecHits_h T1 atomicMax(T1 *a, T2 b)
constexpr DetParams const &__restrict__ detParams(int i) const
constexpr int32_t MaxHitsInIter
float ladderZ[TrackerTraits::numberOfLaddersInBarrel]
constexpr uint32_t maxHitsInIter()
constexpr CommonParams const &__restrict__ commonParams() const
constexpr uint16_t invalidModuleId
ALPAKA_FN_ACC void operator()(const TAcc &acc, pixelCPEforDevice::ParamsOnDeviceT< TrackerTraits > const *__restrict__ cpeParams, BeamSpotPOD const *__restrict__ bs, SiPixelDigisSoAConstView digis, uint32_t numElements, uint32_t nonEmptyModules, SiPixelClustersSoAConstView clusters, TrackingRecHitSoAView< TrackerTraits > hits) const
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 AverageGeometry const &__restrict__ averageGeometry() const
uint16_t *__restrict__ uint16_t const *__restrict__ uint32_t const *__restrict__ uint32_t *__restrict__ uint32_t const *__restrict__ moduleId
typename TrackingRecHitSoA< TrackerTraits >::template TrackingRecHitSoALayout<>::View TrackingRecHitSoAView
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.
ALPAKA_ASSERT_ACC(offsets)
T1 atomicAdd(T1 *a, T2 b)
constexpr uint16_t invalidModuleId