9#include <trg/cdc/modules/houghtracking/CDCTrigger2DFinderModule.h>
11#include <framework/logging/Logger.h>
15#include <root/TMatrix.h>
18#define CDC_SUPER_LAYERS 45
27 unsigned short lcnt = 0;
28 for (
int i = 0; i < CDC_SUPER_LAYERS; ++i) {
29 if (layer[i] ==
true) ++lcnt;
37 unsigned short lcnt = 0;
40 for (
int i = 0; i < CDC_SUPER_LAYERS; i += 2) {
41 if (layer[i] ==
true) ++lcnt;
58 double x1_s,
double x2_s,
59 double y1_s,
double y2_s,
61 unsigned ix_s,
unsigned iy_s)
64 for (
unsigned i = 0; i < iterations; ++i) indent +=
" ";
65 B2DEBUG(150, indent <<
"intercept finder iteration " << iterations
66 <<
" x1 " << x1_s * 180 / M_PI <<
" x2 " << x2_s * 180 / M_PI
67 <<
" y1 " << y1_s <<
" y2 " << y2_s
68 <<
" ix " << ix_s <<
" iy " << iy_s);
77 vector<unsigned> idx_list;
80 double x1_d, x2_d, y1_d, y2_d;
85 unitx = ((x2_s - x1_s) / 2.0);
86 unity = ((y2_s - y1_s) / 2.0);
89 for (i = 0; i < 2 ; ++i) {
91 for (j = 0; j < 2; ++j) {
92 x1_d = x1_s + i * unitx;
93 x2_d = x1_s + (i + 1) * unitx;
94 y1_d = y1_s + j * unity;
95 y2_d = y1_s + (j + 1) * unity;
101 if (x2_d <= -M_PI || x1_d >= M_PI || y2_d <= -maxR + shiftR || y1_d >=
maxR +
shiftR) {
102 B2DEBUG(150, indent <<
"skip Hough cell outside of plane limits");
114 bool layerHit[CDC_SUPER_LAYERS] = {
false};
117 for (
auto it = hits.begin(); it != hits.end(); ++it) {
126 y1 = m * sin(x1_d - 1e-10) - a * cos(x1_d - 1e-10);
127 y2 = m * sin(x2_d + 1e-10) - a * cos(x2_d + 1e-10);
130 if (!((y1 > y2_d && y2 > y2_d) || (y1 < y1_d && y2 < y1_d))) {
132 idx_list.push_back(iHit);
134 layerHit[iSL] =
true;
137 unsigned short nSL =
countSL(layerHit);
138 B2DEBUG(150, indent <<
"i " << i <<
" j " << j
139 <<
" layerHit " <<
int(layerHit[0]) <<
int(layerHit[2])
140 <<
int(layerHit[4]) <<
int(layerHit[6]) <<
int(layerHit[8])
150 ROOT::Math::XYVector v1(x1_d, y1_d);
151 ROOT::Math::XYVector v2(x2_d, y2_d);
161 for (
unsigned min =
m_minHits - 1; min > 0; --min) {
184 vector<vector<CDCTriggerHoughCand>> regions;
185 vector<CDCTriggerHoughCand> cpyCand =
houghCand;
188 B2DEBUG(50,
"houghCand number " << cpyCand.size());
189 for (
unsigned icand = 0; icand <
houghCand.size(); ++icand) {
192 <<
" nSL " <<
houghCand[icand].getSLcount()
193 <<
" x1 " << coord.first.X() <<
" x2 " << coord.second.X()
194 <<
" y1 " << coord.first.Y() <<
" y2 " << coord.second.Y());
198 while (cpyCand.size() > 0) {
199 B2DEBUG(100,
"make new region");
200 vector<CDCTriggerHoughCand> region;
201 vector<CDCTriggerHoughCand> rejected;
203 cpyCand.erase(cpyCand.begin());
204 region.push_back(start);
205 addNeighbors(start, cpyCand, region, rejected, start.getSLcount());
206 regions.push_back(region);
207 for (
auto cand = cpyCand.begin(); cand != cpyCand.end();) {
216 for (
unsigned ir = 0; ir < regions.size(); ++ir) {
217 B2DEBUG(50,
"region " << ir <<
" (" << regions[ir].size() <<
" cells).");
220 B2DEBUG(50,
"Skipping region with " << regions[ir].size() <<
" cells.");
223 double xfirst = regions[ir][0].getCoord().first.X();
227 vector<unsigned> mergedList;
232 vector<ROOT::Math::XYVector> cellIds = {};
233 for (
unsigned ir2 = 0; ir2 < regions[ir].size(); ++ir2) {
235 B2DEBUG(100,
" " << regions[ir][ir2].
getID()
236 <<
" nSL " << regions[ir][ir2].getSLcount()
237 <<
" x1 " << hc.first.X() <<
" x2 " << hc.second.X()
238 <<
" y1 " << hc.first.Y() <<
" y2 " << hc.second.Y());
239 int ix = floor((hc.first.X() + M_PI) / 2. / M_PI *
m_nCellsPhi + 0.5);
241 x += (hc.first.X() + hc.second.X());
242 if (xfirst - hc.first.X() > M_PI) {
245 }
else if (hc.first.X() - xfirst > M_PI) {
249 y += (hc.first.Y() + hc.second.Y());
251 vector<unsigned> idList = regions[ir][ir2].getIdList();
253 xmin = min(xmin, ix);
254 xmax = max(xmax, ix);
255 ymin = min(ymin, iy);
256 ymax = max(ymax, iy);
257 cellIds.push_back(ROOT::Math::XYVector(ix, iy));
265 B2DEBUG(50,
"x " << x <<
" y " << y);
268 vector<unsigned> selectedList = {};
269 vector<unsigned> unselectedList = {};
270 selectHits(mergedList, selectedList, unselectedList);
276 for (
unsigned i = 0; i < selectedList.size(); ++i) {
277 unsigned its = selectedList[i];
281 for (
unsigned i = 0; i < unselectedList.size(); ++i) {
282 unsigned its = unselectedList[i];
287 m_clusters.appendNew(xmin, xmax, ymin, ymax, cellIds);
288 track->addRelationTo(cluster);
294 const vector<CDCTriggerHoughCand>& candidates,
295 vector<CDCTriggerHoughCand>& merged,
296 vector<CDCTriggerHoughCand>& rejected,
297 unsigned short nSLmax)
const
299 for (
unsigned icand = 0; icand < candidates.size(); ++icand) {
300 B2DEBUG(120,
"compare center " << center.
getID()
301 <<
" to " << candidates[icand].getID());
302 if (
inList(candidates[icand], merged) ||
inList(candidates[icand], rejected)) {
303 B2DEBUG(120,
" " << candidates[icand].
getID() <<
" already in list");
306 bool reject =
inList(center, rejected);
307 if (
connected(center, candidates[icand])) {
309 B2DEBUG(100,
" lower than highest SLcount, rejected");
310 rejected.push_back(candidates[icand]);
311 }
else if (
m_onlyLocalMax && !reject && candidates[icand].getSLcount() > nSLmax) {
312 B2DEBUG(100,
" new highest SLcount, clearing list");
313 nSLmax = candidates[icand].getSLcount();
314 for (
unsigned imerged = 0; imerged < merged.size(); ++imerged) {
315 rejected.push_back(merged[imerged]);
318 merged.push_back(candidates[icand]);
320 B2DEBUG(100,
" connected to rejected cell, skip");
323 B2DEBUG(100,
" connected to rejected cell, rejected");
324 rejected.push_back(candidates[icand]);
326 B2DEBUG(100,
" connected");
327 merged.push_back(candidates[icand]);
329 vector<CDCTriggerHoughCand> cpyCand = candidates;
330 cpyCand.erase(cpyCand.begin() + icand);
331 addNeighbors(candidates[icand], cpyCand, merged, rejected, nSLmax);
338 const vector<CDCTriggerHoughCand>& list)
const
340 for (
unsigned i = 0; i < list.size(); ++i) {
341 if (a == list[i])
return true;
350 double ax1 = a.getCoord().first.X();
351 double ax2 = a.getCoord().second.X();
352 double ay1 = a.getCoord().first.Y();
353 double ay2 = a.getCoord().second.Y();
354 double bx1 = b.getCoord().first.X();
355 double bx2 = b.getCoord().second.X();
356 double by1 = b.getCoord().first.Y();
357 double by2 = b.getCoord().second.Y();
359 bool direct = ((ax2 == bx1 && ay1 == by1) ||
360 (ax1 == bx2 && ay1 == by1) ||
361 (ax1 == bx1 && ay2 == by1) ||
362 (ax1 == bx1 && ay1 == by2) ||
363 (ax1 + 2. * M_PI == bx2 && ay1 == by1) ||
364 (ax2 == bx1 + 2. * M_PI && ay1 == by1));
366 bool diagRise = ((ax2 == bx1 && ay2 == by1) ||
367 (ax1 == bx2 && ay1 == by2) ||
368 (ax1 + 2. * M_PI == bx2 && ay1 == by2) ||
369 (ax2 == bx1 + 2. * M_PI && ay2 == by1));
370 bool diagFall = ((ax1 == bx2 && ay2 == by1) ||
371 (ax2 == bx1 && ay1 == by2) ||
372 (ax2 == bx1 + 2. * M_PI && ay1 == by2) ||
373 (ax1 + 2. * M_PI == bx2 && ay2 == by1));
375 else if (
m_connect == 6)
return (direct || diagRise);
376 else if (
m_connect == 8)
return (direct || diagRise || diagFall);
377 else B2WARNING(
"Unknown option for connect " <<
m_connect <<
", using default.");
378 return (direct || diagRise);
386 std::vector<unsigned>& a,
387 std::vector<unsigned>& b)
391 for (
auto it = a.begin(); it != a.end(); ++it) {
393 for (
auto it_in = merged.begin(); it_in != merged.end(); ++it_in) {
400 merged.push_back(*it);
404 for (
auto it = b.begin(); it != b.end(); ++it) {
406 for (
auto it_in = merged.begin(); it_in != merged.end(); ++it_in) {
413 merged.push_back(*it);
420 double x1,
double x2,
421 double y1,
double y2,
424 double m, a, y1_h, y2_h;
427 if (iSL % 2)
continue;
429 if (
m_suppressClone && inputMap.find(iHit) == inputMap.end())
continue;
431 vector<double> phi = {0, 0, 0};
433 phi[1] = phi[0] + 0.5;
434 phi[2] = phi[0] - 0.5;
436 for (
unsigned i = 0; i < 3; ++i) {
438 m = cos(phi[i]) / r[i];
439 a = sin(phi[i]) / r[i];
441 y1_h = m * sin(x1 - 1e-10) - a * cos(x1 - 1e-10);
442 y2_h = m * sin(x2 + 1e-10) - a * cos(x2 + 1e-10);
444 if (y1_h > y2_h)
continue;
445 if (!((y1_h > y2 && y2_h > y2) || (y1_h < y1 && y2_h < y1))) {
446 list.push_back(iHit);
458 std::vector<unsigned>& selected,
459 std::vector<unsigned>& unselected)
461 std::vector<int> bestPerSL(5, -1);
462 for (
unsigned i = 0; i < list.size(); ++i) {
464 bool firstPriority = (
m_segmentHits[list[i]]->getPriorityPosition() == 3);
465 if (bestPerSL[iax] < 0) {
468 unsigned itsBest = list[bestPerSL[iax]];
469 bool firstBest = (
m_segmentHits[itsBest]->getPriorityPosition() == 3);
472 if ((firstPriority && !firstBest) ||
473 (firstPriority == firstBest &&
480 for (
unsigned i = 0; i < list.size(); ++i) {
482 if (
int(i) == bestPerSL[iax]) selected.push_back(list[i]);
483 else unselected.push_back(list[i]);
496 for (
unsigned icand = 0; icand <
houghCand.size(); ++icand) {
497 double x = (
houghCand[icand].getCoord().first.X() +
498 houghCand[icand].getCoord().second.X()) / 2.;
499 unsigned ix = floor((x + M_PI) / 2. / M_PI *
m_nCellsPhi);
500 double y = (
houghCand[icand].getCoord().first.Y() +
501 houghCand[icand].getCoord().second.Y()) / 2.;
503 plane2[ix / 2][iy / 2] += 1 << ((ix % 2) + 2 * (iy % 2));
504 planeIcand[ix][iy] = icand;
505 B2DEBUG(100,
"candidate " << icand <<
" at ix " << ix <<
" iy " << iy);
512 for (
unsigned ix = 0; ix < nX; ++ix) {
513 for (
unsigned iy = 0; iy < nY; ++iy) {
514 if (!plane2[ix][iy])
continue;
516 unsigned ileft = (ix - 1 + nX) % nX;
517 B2DEBUG(100,
"ix " << ix <<
" iy " << iy);
518 if (
connectedLR(plane2[ileft][iy], plane2[ix][iy]) ||
519 (iy > 0 &&
connectedUD(plane2[ix][iy - 1], plane2[ix][iy])) ||
520 (iy > 0 &&
connectedDiag(plane2[ileft][iy - 1], plane2[ix][iy]))) {
521 B2DEBUG(100,
"skip connected square");
525 vector<unsigned> pattern(rX * rY, 0);
526 pattern[0] = plane2[ix][iy];
527 vector<ROOT::Math::XYVector> cellIds = {ROOT::Math::XYVector(2 * ix, 2 * iy)};
528 for (
unsigned ix2 = 0; ix2 < rX; ++ix2) {
529 for (
unsigned iy2 = 0; iy2 < rY; ++iy2) {
530 if (iy + iy2 >= nY)
continue;
531 unsigned ip = ix2 + rX * iy2;
532 unsigned iright = (ix + ix2 + nX) % nX;
533 ileft = (iright - 1 + nX) % nX;
534 B2DEBUG(100,
"ix2 " << ix2 <<
" ileft " << ileft <<
" iright " << iright);
537 connectedLR(plane2[ileft][iy + iy2], plane2[iright][iy + iy2])) ||
540 connectedUD(plane2[iright][iy + iy2 - 1], plane2[iright][iy + iy2])) ||
541 (ix2 > 0 && iy2 > 0 &&
542 pattern[ip - rX - 1] &&
543 connectedDiag(plane2[ileft][iy + iy2 - 1], plane2[iright][iy + iy2]))) {
544 pattern[ip] = plane2[iright][iy + iy2];
545 B2DEBUG(100,
"connect cell " << iright <<
" " << iy + iy2);
546 cellIds.push_back(ROOT::Math::XYVector(2 * (ix + ix2), 2 * (iy + iy2)));
550 B2DEBUG(100,
"cluster starting at " << ix <<
" " << iy);
552 bool overflowRight =
false;
553 bool overflowTop =
false;
554 for (
unsigned iy2 = 0; iy2 < rY; ++iy2) {
555 unsigned ip = rX - 1 + rX * iy2;
556 if (!pattern[ip])
continue;
557 unsigned iright = (ix + rX + nX) % nX;
558 ileft = (iright - 1 + nX) % nX;
559 if (
connectedLR(plane2[ileft][iy + iy2], plane2[iright][iy + iy2]) ||
560 ((iy + iy2 + 1 < nY) &&
561 connectedDiag(plane2[ileft][iy + iy2], plane2[iright][iy + iy2 + 1]))) {
563 overflowRight =
true;
567 for (
unsigned ix2 = 0; ix2 < rX; ++ix2) {
568 unsigned ip = ix2 + rX * (rY - 1);
569 if (!pattern[ip])
continue;
570 unsigned iright = (ix + ix2 + 1 + nX) % nX;
571 ileft = (iright - 1 + nX) % nX;
572 if (
connectedUD(plane2[ileft][iy + rY - 1], plane2[ileft][iy + rY]) ||
573 connectedDiag(plane2[ileft][iy + rY - 1], plane2[iright][iy + rY])) {
579 if (overflowRight && !overflowTop) {
580 B2DEBUG(100,
"cluster extends right of " << rX <<
" x " << rY <<
" area");
581 }
else if (overflowTop && !overflowRight) {
582 B2DEBUG(100,
"cluster extends above " << rX <<
" x " << rY <<
" area");
583 }
else if (overflowRight && overflowTop) {
584 B2DEBUG(100,
"cluster extends right and above " << rX <<
" x " << rY <<
" area");
590 B2DEBUG(100,
"topRight2 " << topRight2 <<
" topRight " << topRight <<
" bottomLeft " << bottomLeft);
592 unsigned ixTR = 2 * (topRight2 %
m_clusterSizeX) + (topRight % 2);
593 unsigned ixBL = bottomLeft % 2;
594 unsigned iyTR = 2 * (topRight2 /
m_clusterSizeX) + (topRight / 2);
595 unsigned iyBL = bottomLeft / 2;
596 B2DEBUG(100,
"ixTR " << ixTR <<
" ixBL " << ixBL <<
" iyTR " << iyTR <<
" iyBL " << iyBL);
598 if (
m_minCells > 1 && ixTR == ixBL && iyTR == iyBL) {
599 B2DEBUG(100,
"skipping cluster of size 1");
602 float centerX = 2 * ix + (ixTR + ixBL) / 2.;
604 float centerY = 2 * iy + (iyTR + iyBL) / 2.;
605 B2DEBUG(100,
"center at cell (" << centerX <<
", " << centerY <<
")");
607 double x = -M_PI + (centerX + 0.5) * 2. * M_PI /
m_nCellsPhi;
609 B2DEBUG(100,
"center coordinates (" << x <<
", " << y <<
")");
611 vector <unsigned> idList = {};
613 unsigned icandTR = planeIcand[(ixTR + 2 * ix) %
m_nCellsPhi][iyTR + 2 * iy];
614 unsigned icandBL = planeIcand[ixBL + 2 * ix][iyBL + 2 * iy];
615 vector<unsigned> candIdListTR =
houghCand[icandTR].getIdList();
616 vector<unsigned> candIdListBL =
houghCand[icandBL].getIdList();
618 B2DEBUG(100,
"merge id lists from candidates " << icandTR <<
" and " << icandBL);
622 double x1 = (round(centerX) == centerX) ? x - dx : x - 2 * dx;
623 double x2 = (round(centerX) == centerX) ? x + dx : x + 2 * dx;
624 double y1 = (round(centerY) == centerY) ? y - dy : y - 2 * dy;
625 double y2 = (round(centerY) == centerY) ? y + dy : y + 2 * dy;
628 if (idList.size() == 0) {
630 B2DEBUG(100,
"id list empty");
634 vector<unsigned> selectedList = {};
635 vector<unsigned> unselectedList = {};
636 selectHits(idList, selectedList, unselectedList);
642 for (
unsigned i = 0; i < selectedList.size(); ++i) {
643 unsigned its = selectedList[i];
647 for (
unsigned i = 0; i < unselectedList.size(); ++i) {
648 unsigned its = unselectedList[i];
656 track->addRelationTo(cluster);
670 bool connectDirect = (((patternL >> 3) & 1) && ((patternR >> 2) & 1)) ||
671 (((patternL >> 1) & 1) && ((patternR >> 0) & 1));
675 bool connectRise = ((patternL >> 1) & 1) && ((patternR >> 2) & 1);
679 bool connectFall = ((patternL >> 3) & 1) && ((patternR >> 0) & 1);
681 if (
m_connect == 4)
return connectDirect;
682 else if (
m_connect == 6)
return (connectDirect || connectRise);
683 else if (
m_connect == 8)
return (connectDirect || connectRise || connectFall);
684 else B2WARNING(
"Unknown option for connect " <<
m_connect <<
", using default.");
685 return (connectDirect || connectRise);
697 bool connectDirect = (((patternU >> 0) & 1) && ((patternD >> 2) & 1)) ||
698 (((patternU >> 1) & 1) && ((patternD >> 3) & 1));
705 bool connectRise = ((patternU >> 1) & 1) && ((patternD >> 2) & 1);
712 bool connectFall = ((patternU >> 0) & 1) && ((patternD >> 3) & 1);
714 if (
m_connect == 4)
return connectDirect;
715 else if (
m_connect == 6)
return (connectDirect || connectRise);
716 else if (
m_connect == 8)
return (connectDirect || connectRise || connectFall);
717 else B2WARNING(
"Unknown option for connect " <<
m_connect <<
", using default.");
718 return (connectDirect || connectRise);
731 return (((patternRU >> 0) & 1) && ((patternLD >> 3) & 1));
738 for (
unsigned index = pattern.size() - 1; index > 0; --index) {
739 if (!pattern[index])
continue;
743 if (ix < m_clusterSizeX - 1 && iy > 0) {
745 for (
unsigned index2 = index - 1; index2 > 0; --index2) {
746 if (!pattern[index2])
continue;
749 if (iy2 < iy && ix2 > ix) {
756 B2DEBUG(100,
"topRightSquare not unique");
770 if ((pattern >> 3) & 1)
return 3;
771 if ((pattern >> 1) & 1) {
772 if ((pattern >> 2) & 1) {
774 B2DEBUG(100,
"topRightCorner not unique");
778 if ((pattern >> 2) & 1)
return 2;
788 if (pattern & 1)
return 0;
789 if ((pattern >> 2) & 1) {
790 if ((pattern >> 1) & 1) {
792 B2DEBUG(100,
"bottomLeftCorner not unique");
796 if ((pattern >> 1) & 1)
return 1;
std::vector< CDCTriggerHoughCand > houghCand
Hough Candidates.
bool connectedLR(unsigned patternL, unsigned patternR)
Check for left/right connection of patterns in 2 x 2 squares.
unsigned topRightCorner(unsigned pattern)
Find the top right corner within 2 x 2 square.
int fastInterceptFinder(cdcMap &hits, double x1_s, double x2_s, double y1_s, double y2_s, unsigned iterations, unsigned ix_s, unsigned iy_s)
Fast intercept finder Divide Hough plane recursively to find cells with enough crossing lines.
unsigned m_minCells
minimum number of cells in a cluster to form a track
bool connectedUD(unsigned patternD, unsigned patternU)
Check for up/down connection of patterns in 2 x 2 squares.
unsigned maxIterations
number of iterations for the fast peak finder, smallest n such that 2^(n+1) > max(nCellsPhi,...
unsigned m_minHitsShort
short tracks require hits in the first minHitsShort super layers to form a candidate
unsigned m_nCellsR
number of Hough cells in 1/r
StoreArray< CDCTriggerSegmentHit > m_segmentHits
list of track segment hits
unsigned m_nCellsPhi
number of Hough cells in phi
unsigned short countSL(bool *superLayers)
count the number of super layers with hits
double maxR
Hough plane limit in 1/r [1/cm].
bool m_hitRelationsFromCorners
switch for creating relations to hits in the pattern clustering algorithm.
unsigned m_storePlane
switch to save the Hough plane in DataStore (0: don't save, 1: save only peaks, 2: save full plane)
bool inList(const CDCTriggerHoughCand &a, const std::vector< CDCTriggerHoughCand > &list) const
Check if candidate is in list.
void patternClustering(const cdcMap &inputMap)
Combine Hough candidates to tracks by a fixed pattern algorithm.
unsigned m_connect
number of neighbors to check for connection (4: direct, 6: direct + upper right and lower left corner...
double shiftR
Hough plane shift in 1/r [1/cm].
void findAllCrossingHits(std::vector< unsigned > &list, double x1, double x2, double y1, double y2, const cdcMap &inputMap)
Find all hits in inputMap whose Hough curve crosses the rectangle with corners (x1,...
unsigned nCells
number of cells for the fast peak finder: 2^(maxIterations + 1).
void selectHits(std::vector< unsigned > &list, std::vector< unsigned > &selected, std::vector< unsigned > &unselected)
Select one hit per super layer.
bool m_suppressClone
switch to send only the first found track and suppress the subsequent clones
StoreArray< CDCTriggerTrack > m_tracks
list of found tracks
unsigned m_clusterSizeX
maximum cluster size for pattern algorithm
void mergeIdList(std::vector< unsigned > &merged, std::vector< unsigned > &a, std::vector< unsigned > &b)
Merge lists a and b and put the result in merged.
bool connected(const CDCTriggerHoughCand &a, const CDCTriggerHoughCand &b) const
Check if candidates are connected.
unsigned bottomLeftCorner(unsigned pattern)
Find the bottom left corner within 2 x 2 square.
bool m_requireSL0
switch to check separately for a hit in the innermost super layer
unsigned m_minHits
minimum number of hits from different super layers in a Hough cell to form a candidate
StoreArray< CDCTriggerHoughCluster > m_clusters
list of clusters in the Hough map
void addNeighbors(const CDCTriggerHoughCand ¢er, const std::vector< CDCTriggerHoughCand > &candidates, std::vector< CDCTriggerHoughCand > &merged, std::vector< CDCTriggerHoughCand > &rejected, unsigned short nSLmax) const
Recursive function to add combine connected cells.
bool shortTrack(bool *superLayers)
check the short track condition (= hits in the inner super layers rather than any super layers)
bool connectedDiag(unsigned patternLD, unsigned patternRU)
Check for diagonal connected of patterns in 2 x 2 squares.
unsigned topRightSquare(std::vector< unsigned > &pattern)
Find the top right square within a cluster of 2 x 2 squares In case of ambiguity, top is favored over...
unsigned TSoffset[10]
Number of track segments up to super layer.
double radius[9][5]
Radius of the CDC layers with priority wires (2 per super layer).
bool m_onlyLocalMax
switch to ignore candidates connected to cells with higher super layer count
unsigned m_clusterSizeY
maximum cluster size for pattern algorithm
void connectedRegions()
Combine Hough candidates to tracks by merging connected cells.
unsigned getID() const
Get candidate number.
unsigned short getSLcount() const
Get super layer count.
Cluster created by the Hough finder of the CDC trigger.
Track created by the CDC trigger.
void setReturnValue(int value)
Sets the return value for this module as integer.
T * appendNew()
Construct a new T object at the end of the array.
int getEntries() const
Get the number of objects in the array.
int getID(const std::vector< double > &breaks, double t)
get id of the time point t
std::map< int, cdcPair > cdcMap
Map of <counter, cdcPair>, for hits with indices.
std::pair< ROOT::Math::XYVector, ROOT::Math::XYVector > coord2dPair
Hough Tuples.
std::pair< unsigned short, ROOT::Math::XYVector > cdcPair
Pair of <iSuperLayer, (x, y)>, for hits in conformal space.
Abstract base class for different kinds of events.