33 auto isPhase2 = cpeParams->commonParams().isPhase2;
36 auto& agc =
hits.averageGeometry();
37 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;
51 agc.endCapZ[0] = ag.endCapZ[0] -
bs->z;
52 agc.endCapZ[1] = ag.endCapZ[1] -
bs->z;
82 printf(
"hitbuilder: %d clusters in module %d. will write at %d\n", nclus,
me,
clusters.clusModuleStart(
me));
84 for (
int startClus = 0, endClus = nclus; startClus < endClus; startClus +=
MaxHitsInIter) {
86 int lastClus = startClus + nClusInIter;
87 assert(nClusInIter <= nclus);
91 assert(nclus >
MaxHitsInIter || (0 == startClus && nClusInIter == nclus && lastClus == nclus));
96 clusParams.maxRow[ic] = 0;
98 clusParams.maxCol[ic] = 0;
99 clusParams.charge[ic] = 0;
100 clusParams.q_f_X[ic] = 0;
101 clusParams.q_l_X[ic] = 0;
102 clusParams.q_f_Y[ic] = 0;
103 clusParams.q_l_Y[ic] = 0;
111 auto id = digis.moduleInd(
i);
116 auto cl = digis.clus(
i);
117 if (cl < startClus || cl >= lastClus)
122 auto x = digis.xx(
i);
123 auto y = digis.yy(
i);
132 auto pixmx = cpeParams->detParams(
me).pixmx;
134 auto id = digis.moduleInd(
i);
139 auto cl = digis.clus(
i);
140 if (cl < startClus || cl >= lastClus)
145 auto x = digis.xx(
i);
146 auto y = digis.yy(
i);
147 auto ch = digis.adc(
i);
150 if (clusParams.minRow[
cl] ==
x)
152 if (clusParams.maxRow[
cl] ==
x)
154 if (clusParams.minCol[
cl] ==
y)
156 if (clusParams.maxCol[
cl] ==
y)
178 hits.setChargeAndStatus(
h, clusParams.charge[ic], clusParams.status[ic]);
182 hits.xLocal(
h) = xl = clusParams.xpos[ic];
183 hits.yLocal(
h) = yl = clusParams.ypos[ic];
185 hits.clusterSizeX(
h) = clusParams.xsize[ic];
186 hits.clusterSizeY(
h) = clusParams.ysize[ic];
188 hits.xerrLocal(
h) = clusParams.xerr[ic] * clusParams.xerr[ic] + cpeParams->detParams(
me).apeXX;
189 hits.yerrLocal(
h) = clusParams.yerr[ic] * clusParams.yerr[ic] + cpeParams->detParams(
me).apeYY;
194 cpeParams->detParams(
me).frame.toGlobal(xl, yl, xg, yg, zg);
200 hits.xGlobal(
h) = xg;
201 hits.yGlobal(
h) = yg;
202 hits.zGlobal(
h) = zg;
205 hits.iphi(
h) = unsafe_atan2s<7>(yg, xg);
T1 atomicMax(T1 *a, T2 b)
ClusParamsT< MaxHitsInIter > ClusParams
constexpr void position(CommonParams const &__restrict__ comParams, DetParams const &__restrict__ detParams, ClusParams &cp, uint32_t ic)
constexpr uint16_t numberOfLaddersInBarrel
constexpr uint32_t numberOfLaddersInBarrel
constexpr uint16_t invalidModuleId
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 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)
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