53 <<
"TrigScintFirmwareTracker: produce() starts! Event number: "
54 <<
event.getEventHeader().getEventNumber();
62 for (
int i = 0; i < NCENT; ++i) {
63 for (
int j = 0; j < COMBO; ++j) {
64 for (
int k = 0; k < 2; ++k) {
74 for (
int i = 0; i < NCENT; i++) {
75 for (
int j = 0; j < COMBO; j++) {
76 LOOKUP[i][j][0] = (i - A[1] + A[0]);
77 LOOKUP[i][j][1] = (i - A[2] + A[0]);
80 }
else if (j / 3 == 2) {
85 }
else if (j % 3 == 2) {
88 if (not((LOOKUP[i][j][0] >= 0) and (LOOKUP[i][j][1] >= 0) and
89 (LOOKUP[i][j][0] < NCENT) and (LOOKUP[i][j][1] < NCENT))) {
107 for (
int j = 0; j < NHITS; j++) {
112 for (
int j = 0; j < NCLUS; j++) {
119 for (
int j = 0; j < NTRK; j++) {
120 clearTrack(outTrk[j]);
131 ldmx_log(debug) <<
"Got digi collection " << digis1_collection_ <<
"_"
132 << passName_ <<
" with " << digis1.size() <<
" entries ";
139 for (
int i = 0; i < NCHAN; i++) {
143 for (
const auto &digi : digis1) {
144 if ((digi.getPE() >
minThr_) and (digi.getBarID() <= NCHAN) and
145 (digi.getBarID() >= 0)) {
148 if (occupied[digi.getBarID()] >= 0) {
149 if (HPad1[occupied[digi.getBarID()]].Amp < digi.getPE()) {
150 HPad1[occupied[digi.getBarID()]].bID = (
ap_int<12>)(digi.getBarID());
151 HPad1[occupied[digi.getBarID()]].mID =
153 HPad1[occupied[digi.getBarID()]].Amp = (
ap_int<12>)(digi.getPE());
154 HPad1[occupied[digi.getBarID()]].Time = (
ap_int<12>)(digi.getTime());
157 HPad1[count].bID = (
ap_int<12>)(digi.getBarID());
158 HPad1[count].mID = (
ap_int<12>)(digi.getModuleID());
159 HPad1[count].Amp = (
ap_int<12>)(digi.getPE());
160 HPad1[count].Time = (
ap_int<12>)(digi.getTime());
161 occupied[digi.getBarID()] = count;
167 for (
int i = 0; i < NCHAN; i++) {
171 for (
const auto &digi : digis2) {
172 if ((digi.getPE() >
minThr_) and (digi.getBarID() <= NCHAN) and
173 (digi.getBarID() >= 0)) {
176 if (occupied[digi.getBarID()] >= 0) {
177 if (HPad2[occupied[digi.getBarID()]].Amp < digi.getPE()) {
178 HPad2[occupied[digi.getBarID()]].bID = (
ap_int<12>)(digi.getBarID());
179 HPad2[occupied[digi.getBarID()]].mID =
181 HPad2[occupied[digi.getBarID()]].Amp = (
ap_int<12>)(digi.getPE());
182 HPad2[occupied[digi.getBarID()]].Time = (
ap_int<12>)(digi.getTime());
185 HPad2[count].bID = (
ap_int<12>)(digi.getBarID());
186 HPad2[count].mID = (
ap_int<12>)(digi.getModuleID());
187 HPad2[count].Amp = (
ap_int<12>)(digi.getPE());
188 HPad2[count].Time = (
ap_int<12>)(digi.getTime());
189 occupied[digi.getBarID()] = count;
194 for (
int i = 0; i < NCHAN; i++) {
198 for (
const auto &digi : digis3) {
199 if ((digi.getPE() >
minThr_) and (digi.getBarID() <= NCHAN) and
200 (digi.getBarID() >= 0)) {
203 if (occupied[digi.getBarID()] >= 0) {
204 if (HPad3[occupied[digi.getBarID()]].Amp < digi.getPE()) {
205 HPad3[occupied[digi.getBarID()]].bID = (
ap_int<12>)(digi.getBarID());
206 HPad3[occupied[digi.getBarID()]].mID =
208 HPad3[occupied[digi.getBarID()]].Amp = (
ap_int<12>)(digi.getPE());
209 HPad3[occupied[digi.getBarID()]].Time = (
ap_int<12>)(digi.getTime());
212 HPad3[count].bID = (
ap_int<12>)(digi.getBarID());
213 HPad3[count].mID = (
ap_int<12>)(digi.getModuleID());
214 HPad3[count].Amp = (
ap_int<12>)(digi.getPE());
215 HPad3[count].Time = (
ap_int<12>)(digi.getTime());
216 occupied[digi.getBarID()] = count;
226 std::array<Cluster, NCLUS> Point1 = clusterproducer_sw(HPad1);
228 for (
int i = 0; i < NCLUS; i++) {
229 if ((Point1[i].Seed.Amp < 450) and (Point1[i].Seed.Amp > 30) and
230 (Point1[i].Seed.bID < (NCHAN + 1)) and (Point1[i].Seed.bID >= 0) and
231 (Point1[i].Sec.Amp < 450) and (counterN < NTRK)) {
232 if (Point1[i].Seed.bID >= topSeed) {
233 cpyHit(Pad1[counterN].Seed, Point1[i].Seed);
234 cpyHit(Pad1[counterN].Sec, Point1[i].Sec);
235 calcCent(Pad1[counterN]);
237 topSeed = Point1[i].Seed.bID;
241 std::array<Cluster, NCLUS> Point2 = clusterproducer_sw(HPad2);
243 for (
int i = 0; i < NCLUS; i++) {
244 if ((Point2[i].Seed.Amp < 450) and (Point2[i].Seed.Amp > 30) and
245 (Point2[i].Seed.bID < (NCHAN + 1)) and (Point2[i].Seed.bID >= 0) and
246 (Point2[i].Sec.Amp < 450)) {
247 if (Point2[i].Seed.bID >= topSeed) {
248 cpyHit(Pad2[i].Seed, Point2[i].Seed);
249 cpyHit(Pad2[i].Sec, Point2[i].Sec);
251 topSeed = Point2[i].Seed.bID;
255 std::array<Cluster, NCLUS> Point3 = clusterproducer_sw(HPad3);
257 for (
int i = 0; i < NCLUS; i++) {
258 if ((Point3[i].Seed.Amp < 450) and (Point3[i].Seed.Amp > 30) and
259 (Point3[i].Seed.bID < (NCHAN + 1)) and (Point3[i].Seed.bID >= 0) and
260 (Point3[i].Sec.Amp < 450)) {
261 if (Point3[i].Seed.bID >= topSeed) {
262 cpyHit(Pad3[i].Seed, Point3[i].Seed);
263 cpyHit(Pad3[i].Sec, Point3[i].Sec);
265 topSeed = Point3[i].Seed.bID;
279 trackproducer_hw(Pad1, Pad2, Pad3, outTrk, LOOKUP);
280 for (
int I = 0; I < NTRK; I++) {
281 if (outTrk[I].Pad1.Seed.Amp > 0. && outTrk[I].Pad1.Sec.Amp >= 0. &&
282 outTrk[I].Pad2.Seed.Amp > 0. && outTrk[I].Pad2.Sec.Amp >= 0. &&
283 outTrk[I].Pad3.Seed.Amp > 0. && outTrk[I].Pad3.Sec.Amp >= 0.) {
285 tracks_.push_back(trk);
288 event.add(output_collection_, tracks_);