5#include "TrigScint/Firmware/clusterproducer.h"
6#include "TrigScint/Firmware/objdef.h"
8std::array<Cluster, NCLUS> clusterproducer_sw(
Hit inHit[NHITS]) {
14 std::array<Cluster, NCLUS> outClus;
16 for (
int i = 0; i < NCLUS; ++i) {
17 clearClus(outClus[i]);
21 for (
int i = 0; i < NCHAN; ++i) {
25 for (
int j = 0; j < NHITS; ++j) {
26 if (inHit[j].bID > -1) {
27 mapL1[inHit[j].bID] = j;
31 for (
int k = 0; k < NCLUS; ++k) {
32 bool doNextCluster =
true;
33 if ((mapL1[2 * k] > -1)) {
34 if (inHit[mapL1[2 * k]].Amp > SEEDTHR) {
35 clearClus(outClus[k]);
36 outClus[k].Seed.mID = inHit[mapL1[2 * k]].mID;
37 outClus[k].Seed.bID = inHit[mapL1[2 * k]].bID;
38 outClus[k].Seed.Amp = inHit[mapL1[2 * k]].Amp;
39 outClus[k].Seed.Time = inHit[mapL1[2 * k]].Time;
40 if (mapL1[2 * k + 1] > -1) {
41 if (inHit[mapL1[2 * k + 1]].Amp > CLUSTHR) {
42 outClus[k].Sec.mID = inHit[mapL1[2 * k + 1]].mID;
43 outClus[k].Sec.bID = inHit[mapL1[2 * k + 1]].bID;
44 outClus[k].Sec.Amp = inHit[mapL1[2 * k + 1]].Amp;
45 outClus[k].Sec.Time = inHit[mapL1[2 * k + 1]].Time;
46 doNextCluster =
false;
48 clearHit(inHit[mapL1[2 * k + 1]]);
53 if ((mapL1[2 * k + 1] > -1) and (doNextCluster)) {
54 if (inHit[mapL1[2 * k + 1]].Amp > SEEDTHR) {
55 clearClus(outClus[k]);
56 outClus[k].Seed.mID = inHit[mapL1[2 * k + 1]].mID;
57 outClus[k].Seed.bID = inHit[mapL1[2 * k + 1]].bID;
58 outClus[k].Seed.Amp = inHit[mapL1[2 * k + 1]].Amp;
59 outClus[k].Seed.Time = inHit[mapL1[2 * k + 1]].Time;
61 if (mapL1[2 * k + 2] > -1) {
62 if (inHit[mapL1[2 * k + 2]].Amp > CLUSTHR) {
63 outClus[k].Sec.mID = inHit[mapL1[2 * k + 2]].mID;
64 outClus[k].Sec.bID = inHit[mapL1[2 * k + 2]].bID;
65 outClus[k].Sec.Amp = inHit[mapL1[2 * k + 2]].Amp;
66 outClus[k].Sec.Time = inHit[mapL1[2 * k + 2]].Time;
68 clearHit(inHit[mapL1[2 * k + 2]]);
Sign Arbitrary Precision Type.