50 if (mCosmicInfo.size() > 5000) {
54 TStopwatch timerProcess;
61 int ndig =
array->size();
62 int ndig2 = ndig * fill;
69 int volID1[5], volID2[5];
70 float pos1[3], pos2[3], pos2or[3];
72 std::vector<int> mIcandClus;
73 mIcandClus.reserve(200);
75 bool trackFound =
false;
77 for (
int i = 0;
i < ndig;
i++) {
81 auto& dig1 = (*array)[
i];
82 int ch1 = dig1.getChannel();
84 if (mCounters[ch1] > 3) {
89 int64_t bc1 = int64_t(dig1.getBC());
90 int tdc1 =
int(dig1.getTDC());
91 float tot1 = dig1.getTOT() * 48.8E-3;
95 float tm1 = (dig1.getIR().differenceInBC(
ir0) * 1024 + tdc1) *
Geo::TDCBIN;
99 mCosmicTrackTemp.clear();
100 mCosmicTrackTemp.emplace_back(ch1, pos1[0], pos1[1], pos1[2], 0.0, tot1);
103 for (
int j =
i + 1;
j < ndig2;
j++) {
104 auto& dig2 = (*array)[
j];
105 int64_t bc2 = int64_t(dig2.getBC()) - bc1;
106 if (std::abs(bc2) > bcdist) {
110 int ch2 = dig2.getChannel();
111 if (mCounters[ch2] > 3) {
114 float tm2 = (dig2.getIR().differenceInBC(
ir0) * 1024 +
int(dig2.getTDC())) *
Geo::TDCBIN;
116 int tdc2 =
int(dig2.getTDC()) - tdc1;
117 float tot2 = dig2.getTOT() * 48.8E-3;
120 pos2[0] = pos2or[0] - pos1[0];
121 pos2[1] = pos2or[1] - pos1[1];
122 pos2[2] = pos2or[2] - pos1[2];
126 float lt2 = pos2[0] * pos2[0] + pos2[1] * pos2[1];
127 float l = sqrt(lt2 + pos2[2] * pos2[2]);
129 if (!trackFound && lt2 < 40000 && std::abs(dtime) < 10000) {
130 mCosmicTrackTemp.emplace_back(ch2, pos2or[0], pos2or[1], pos2or[2], dtime, tot2);
140 dtime -= l * 33.356409;
142 if (std::abs(dtime) > thr) {
147 mCosmicInfo.emplace_back(ch1, ch2, dtime, tot1, tot2, l, tm1, tm2);
149 if (!trackFound && ndig < 1000 && mCosmicTrackTemp.size() > 4) {
158 LOG(
debug) <<
"We had " << ndig <<
" digits in this event";