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) {
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]);
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;
204 hits.iphi(
h) = unsafe_atan2s<7>(yg, xg);