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;
100 assert(nClusInIter <= nclus);
102 assert(lastClus <= nclus);
104 assert(nclus >
maxHitsInIter || (0 == startClus && nClusInIter == nclus && lastClus == nclus));
109 clusParams.maxRow[ic] = 0;
111 clusParams.maxCol[ic] = 0;
112 clusParams.charge[ic] = 0;
113 clusParams.q_f_X[ic] = 0;
114 clusParams.q_l_X[ic] = 0;
115 clusParams.q_f_Y[ic] = 0;
116 clusParams.q_l_Y[ic] = 0;
119 alpaka::syncBlockThreads(acc);
123 auto id = digis[
i].moduleId();
128 auto cl = digis[
i].clus();
129 if (cl < startClus || cl >= lastClus)
134 auto x = digis[
i].xx();
135 auto y = digis[
i].yy();
142 alpaka::syncBlockThreads(acc);
146 auto id = digis[
i].moduleId();
151 auto cl = digis[
i].clus();
152 if (cl < startClus || cl >= lastClus)
157 auto x = digis[
i].xx();
158 auto y = digis[
i].yy();
159 auto ch = digis[
i].adc();
162 if (clusParams.minRow[
cl] ==
x)
164 if (clusParams.maxRow[
cl] ==
x)
166 if (clusParams.minCol[
cl] == y)
168 if (clusParams.maxCol[
cl] == y)
172 alpaka::syncBlockThreads(acc);
182 pixelCPEforDevice::position<TrackerTraits>(
185 pixelCPEforDevice::errorFromDB<TrackerTraits>(
189 hits[
h].chargeAndStatus().charge = clusParams.charge[ic];
190 hits[
h].chargeAndStatus().status = clusParams.status[ic];
195 hits[
h].xLocal() = xl = clusParams.xpos[ic];
196 hits[
h].yLocal() = yl = clusParams.ypos[ic];
198 hits[
h].clusterSizeX() = clusParams.xsize[ic];
199 hits[
h].clusterSizeY() = clusParams.ysize[ic];
201 hits[
h].xerrLocal() = clusParams.xerr[ic] * clusParams.xerr[ic] + cpeParams->
detParams(
me).apeXX;
202 hits[
h].yerrLocal() = clusParams.yerr[ic] * clusParams.yerr[ic] + cpeParams->
detParams(
me).apeYY;
206 cpeParams->
detParams(
me).frame.toGlobal(xl, yl, xg, yg, zg);
212 hits[
h].xGlobal() = xg;
213 hits[
h].yGlobal() = yg;
214 hits[
h].zGlobal() = zg;
216 hits[
h].iphi() = unsafe_atan2s<7>(yg, xg);
218 alpaka::syncBlockThreads(acc);
227 #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