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};
115 for (
auto it = hits.begin(); it != hits.end(); ++it) {
123 y1 = m * sin(x1_d - 1e-10) - a * cos(x1_d - 1e-10);
124 y2 = m * sin(x2_d + 1e-10) - a * cos(x2_d + 1e-10);
127 if (!((y1 > y2_d && y2 > y2_d) || (y1 < y1_d && y2 < y1_d))) {
129 idx_list.push_back(iHit);
131 layerHit[iSL] =
true;
134 unsigned short nSL =
countSL(layerHit);
135 B2DEBUG(150, indent <<
"i " << i <<
" j " << j
136 <<
" layerHit " <<
int(layerHit[0]) <<
int(layerHit[2])
137 <<
int(layerHit[4]) <<
int(layerHit[6]) <<
int(layerHit[8])
147 ROOT::Math::XYVector v1(x1_d, y1_d);
148 ROOT::Math::XYVector v2(x2_d, y2_d);
158 for (
unsigned min =
m_minHits - 1; min > 0; --min) {
181 vector<vector<CDCTriggerHoughCand>> regions;
182 vector<CDCTriggerHoughCand> cpyCand =
houghCand;
185 B2DEBUG(50,
"houghCand number " << cpyCand.size());
186 for (
unsigned icand = 0; icand <
houghCand.size(); ++icand) {
189 <<
" nSL " <<
houghCand[icand].getSLcount()
190 <<
" x1 " << coord.first.X() <<
" x2 " << coord.second.X()
191 <<
" y1 " << coord.first.Y() <<
" y2 " << coord.second.Y());
195 while (cpyCand.size() > 0) {
196 B2DEBUG(100,
"make new region");
197 vector<CDCTriggerHoughCand> region;
198 vector<CDCTriggerHoughCand> rejected;
200 cpyCand.erase(cpyCand.begin());
201 region.push_back(start);
202 addNeighbors(start, cpyCand, region, rejected, start.getSLcount());
203 regions.push_back(region);
204 for (
auto cand = cpyCand.begin(); cand != cpyCand.end();) {
213 for (
unsigned ir = 0; ir < regions.size(); ++ir) {
214 B2DEBUG(50,
"region " << ir <<
" (" << regions[ir].size() <<
" cells).");
217 B2DEBUG(50,
"Skipping region with " << regions[ir].size() <<
" cells.");
220 double xfirst = regions[ir][0].getCoord().first.X();
224 vector<unsigned> mergedList;
229 vector<ROOT::Math::XYVector> cellIds = {};
230 for (
unsigned ir2 = 0; ir2 < regions[ir].size(); ++ir2) {
232 B2DEBUG(100,
" " << regions[ir][ir2].
getID()
233 <<
" nSL " << regions[ir][ir2].getSLcount()
234 <<
" x1 " << hc.first.X() <<
" x2 " << hc.second.X()
235 <<
" y1 " << hc.first.Y() <<
" y2 " << hc.second.Y());
236 int ix = floor((hc.first.X() + M_PI) / 2. / M_PI *
m_nCellsPhi + 0.5);
238 x += (hc.first.X() + hc.second.X());
239 if (xfirst - hc.first.X() > M_PI) {
242 }
else if (hc.first.X() - xfirst > M_PI) {
246 y += (hc.first.Y() + hc.second.Y());
248 vector<unsigned> idList = regions[ir][ir2].getIdList();
250 xmin = min(xmin, ix);
251 xmax = max(xmax, ix);
252 ymin = min(ymin, iy);
253 ymax = max(ymax, iy);
254 cellIds.push_back(ROOT::Math::XYVector(ix, iy));
262 B2DEBUG(50,
"x " << x <<
" y " << y);
265 vector<unsigned> selectedList = {};
266 vector<unsigned> unselectedList = {};
267 selectHits(mergedList, selectedList, unselectedList);
273 for (
unsigned i = 0; i < selectedList.size(); ++i) {
274 unsigned its = selectedList[i];
278 for (
unsigned i = 0; i < unselectedList.size(); ++i) {
279 unsigned its = unselectedList[i];
284 m_clusters.appendNew(xmin, xmax, ymin, ymax, cellIds);
285 track->addRelationTo(cluster);
291 const vector<CDCTriggerHoughCand>& candidates,
292 vector<CDCTriggerHoughCand>& merged,
293 vector<CDCTriggerHoughCand>& rejected,
294 unsigned short nSLmax)
const
296 for (
unsigned icand = 0; icand < candidates.size(); ++icand) {
297 B2DEBUG(120,
"compare center " << center.
getID()
298 <<
" to " << candidates[icand].getID());
299 if (
inList(candidates[icand], merged) ||
inList(candidates[icand], rejected)) {
300 B2DEBUG(120,
" " << candidates[icand].
getID() <<
" already in list");
303 bool reject =
inList(center, rejected);
304 if (
connected(center, candidates[icand])) {
306 B2DEBUG(100,
" lower than highest SLcount, rejected");
307 rejected.push_back(candidates[icand]);
308 }
else if (
m_onlyLocalMax && !reject && candidates[icand].getSLcount() > nSLmax) {
309 B2DEBUG(100,
" new highest SLcount, clearing list");
310 nSLmax = candidates[icand].getSLcount();
311 for (
unsigned imerged = 0; imerged < merged.size(); ++imerged) {
312 rejected.push_back(merged[imerged]);
315 merged.push_back(candidates[icand]);
317 B2DEBUG(100,
" connected to rejected cell, skip");
320 B2DEBUG(100,
" connected to rejected cell, rejected");
321 rejected.push_back(candidates[icand]);
323 B2DEBUG(100,
" connected");
324 merged.push_back(candidates[icand]);
326 vector<CDCTriggerHoughCand> cpyCand = candidates;
327 cpyCand.erase(cpyCand.begin() + icand);
328 addNeighbors(candidates[icand], cpyCand, merged, rejected, nSLmax);
335 const vector<CDCTriggerHoughCand>& list)
const
337 for (
unsigned i = 0; i < list.size(); ++i) {
338 if (a == list[i])
return true;
347 double ax1 = a.getCoord().first.X();
348 double ax2 = a.getCoord().second.X();
349 double ay1 = a.getCoord().first.Y();
350 double ay2 = a.getCoord().second.Y();
351 double bx1 = b.getCoord().first.X();
352 double bx2 = b.getCoord().second.X();
353 double by1 = b.getCoord().first.Y();
354 double by2 = b.getCoord().second.Y();
356 bool direct = ((ax2 == bx1 && ay1 == by1) ||
357 (ax1 == bx2 && ay1 == by1) ||
358 (ax1 == bx1 && ay2 == by1) ||
359 (ax1 == bx1 && ay1 == by2) ||
360 (ax1 + 2. * M_PI == bx2 && ay1 == by1) ||
361 (ax2 == bx1 + 2. * M_PI && ay1 == by1));
363 bool diagRise = ((ax2 == bx1 && ay2 == by1) ||
364 (ax1 == bx2 && ay1 == by2) ||
365 (ax1 + 2. * M_PI == bx2 && ay1 == by2) ||
366 (ax2 == bx1 + 2. * M_PI && ay2 == by1));
367 bool diagFall = ((ax1 == bx2 && ay2 == by1) ||
368 (ax2 == bx1 && ay1 == by2) ||
369 (ax2 == bx1 + 2. * M_PI && ay1 == by2) ||
370 (ax1 + 2. * M_PI == bx2 && ay2 == by1));
372 else if (
m_connect == 6)
return (direct || diagRise);
373 else if (
m_connect == 8)
return (direct || diagRise || diagFall);
374 else B2WARNING(
"Unknown option for connect " <<
m_connect <<
", using default.");
375 return (direct || diagRise);
383 std::vector<unsigned>& a,
384 std::vector<unsigned>& b)
388 for (
auto it = a.begin(); it != a.end(); ++it) {
390 for (
auto it_in = merged.begin(); it_in != merged.end(); ++it_in) {
397 merged.push_back(*it);
401 for (
auto it = b.begin(); it != b.end(); ++it) {
403 for (
auto it_in = merged.begin(); it_in != merged.end(); ++it_in) {
410 merged.push_back(*it);
417 double x1,
double x2,
418 double y1,
double y2,
421 double m, a, y1_h, y2_h;
424 if (iSL % 2)
continue;
426 if (
m_suppressClone && inputMap.find(iHit) == inputMap.end())
continue;
428 vector<double> phi = {0, 0, 0};
430 phi[1] = phi[0] + 0.5;
431 phi[2] = phi[0] - 0.5;
433 for (
unsigned i = 0; i < 3; ++i) {
435 m = cos(phi[i]) / r[i];
436 a = sin(phi[i]) / r[i];
438 y1_h = m * sin(x1 - 1e-10) - a * cos(x1 - 1e-10);
439 y2_h = m * sin(x2 + 1e-10) - a * cos(x2 + 1e-10);
441 if (y1_h > y2_h)
continue;
442 if (!((y1_h > y2 && y2_h > y2) || (y1_h < y1 && y2_h < y1))) {
443 list.push_back(iHit);
455 std::vector<unsigned>& selected,
456 std::vector<unsigned>& unselected)
458 std::vector<int> bestPerSL(5, -1);
459 for (
unsigned i = 0; i < list.size(); ++i) {
461 bool firstPriority = (
m_segmentHits[list[i]]->getPriorityPosition() == 3);
462 if (bestPerSL[iax] < 0) {
465 unsigned itsBest = list[bestPerSL[iax]];
466 bool firstBest = (
m_segmentHits[itsBest]->getPriorityPosition() == 3);
469 if ((firstPriority && !firstBest) ||
470 (firstPriority == firstBest &&
477 for (
unsigned i = 0; i < list.size(); ++i) {
479 if (
int(i) == bestPerSL[iax]) selected.push_back(list[i]);
480 else unselected.push_back(list[i]);
493 for (
unsigned icand = 0; icand <
houghCand.size(); ++icand) {
494 double x = (
houghCand[icand].getCoord().first.X() +
495 houghCand[icand].getCoord().second.X()) / 2.;
496 unsigned ix = floor((x + M_PI) / 2. / M_PI *
m_nCellsPhi);
497 double y = (
houghCand[icand].getCoord().first.Y() +
498 houghCand[icand].getCoord().second.Y()) / 2.;
500 plane2[ix / 2][iy / 2] += 1 << ((ix % 2) + 2 * (iy % 2));
501 planeIcand[ix][iy] = icand;
502 B2DEBUG(100,
"candidate " << icand <<
" at ix " << ix <<
" iy " << iy);
509 for (
unsigned ix = 0; ix < nX; ++ix) {
510 for (
unsigned iy = 0; iy < nY; ++iy) {
511 if (!plane2[ix][iy])
continue;
513 unsigned ileft = (ix - 1 + nX) % nX;
514 B2DEBUG(100,
"ix " << ix <<
" iy " << iy);
515 if (
connectedLR(plane2[ileft][iy], plane2[ix][iy]) ||
516 (iy > 0 &&
connectedUD(plane2[ix][iy - 1], plane2[ix][iy])) ||
517 (iy > 0 &&
connectedDiag(plane2[ileft][iy - 1], plane2[ix][iy]))) {
518 B2DEBUG(100,
"skip connected square");
522 vector<unsigned> pattern(rX * rY, 0);
523 pattern[0] = plane2[ix][iy];
524 vector<ROOT::Math::XYVector> cellIds = {ROOT::Math::XYVector(2 * ix, 2 * iy)};
525 for (
unsigned ix2 = 0; ix2 < rX; ++ix2) {
526 for (
unsigned iy2 = 0; iy2 < rY; ++iy2) {
527 if (iy + iy2 >= nY)
continue;
528 unsigned ip = ix2 + rX * iy2;
529 unsigned iright = (ix + ix2 + nX) % nX;
530 ileft = (iright - 1 + nX) % nX;
531 B2DEBUG(100,
"ix2 " << ix2 <<
" ileft " << ileft <<
" iright " << iright);
534 connectedLR(plane2[ileft][iy + iy2], plane2[iright][iy + iy2])) ||
537 connectedUD(plane2[iright][iy + iy2 - 1], plane2[iright][iy + iy2])) ||
538 (ix2 > 0 && iy2 > 0 &&
539 pattern[ip - rX - 1] &&
540 connectedDiag(plane2[ileft][iy + iy2 - 1], plane2[iright][iy + iy2]))) {
541 pattern[ip] = plane2[iright][iy + iy2];
542 B2DEBUG(100,
"connect cell " << iright <<
" " << iy + iy2);
543 cellIds.push_back(ROOT::Math::XYVector(2 * (ix + ix2), 2 * (iy + iy2)));
547 B2DEBUG(100,
"cluster starting at " << ix <<
" " << iy);
549 bool overflowRight =
false;
550 bool overflowTop =
false;
551 for (
unsigned iy2 = 0; iy2 < rY; ++iy2) {
552 unsigned ip = rX - 1 + rX * iy2;
553 if (!pattern[ip])
continue;
554 unsigned iright = (ix + rX + nX) % nX;
555 ileft = (iright - 1 + nX) % nX;
556 if (
connectedLR(plane2[ileft][iy + iy2], plane2[iright][iy + iy2]) ||
557 ((iy + iy2 + 1 < nY) &&
558 connectedDiag(plane2[ileft][iy + iy2], plane2[iright][iy + iy2 + 1]))) {
560 overflowRight =
true;
564 for (
unsigned ix2 = 0; ix2 < rX; ++ix2) {
565 unsigned ip = ix2 + rX * (rY - 1);
566 if (!pattern[ip])
continue;
567 unsigned iright = (ix + ix2 + 1 + nX) % nX;
568 ileft = (iright - 1 + nX) % nX;
569 if (
connectedUD(plane2[ileft][iy + rY - 1], plane2[ileft][iy + rY]) ||
570 connectedDiag(plane2[ileft][iy + rY - 1], plane2[iright][iy + rY])) {
576 if (overflowRight && !overflowTop) {
577 B2DEBUG(100,
"cluster extends right of " << rX <<
" x " << rY <<
" area");
578 }
else if (overflowTop && !overflowRight) {
579 B2DEBUG(100,
"cluster extends above " << rX <<
" x " << rY <<
" area");
580 }
else if (overflowRight && overflowTop) {
581 B2DEBUG(100,
"cluster extends right and above " << rX <<
" x " << rY <<
" area");
587 B2DEBUG(100,
"topRight2 " << topRight2 <<
" topRight " << topRight <<
" bottomLeft " << bottomLeft);
589 unsigned ixTR = 2 * (topRight2 %
m_clusterSizeX) + (topRight % 2);
590 unsigned ixBL = bottomLeft % 2;
591 unsigned iyTR = 2 * (topRight2 /
m_clusterSizeX) + (topRight / 2);
592 unsigned iyBL = bottomLeft / 2;
593 B2DEBUG(100,
"ixTR " << ixTR <<
" ixBL " << ixBL <<
" iyTR " << iyTR <<
" iyBL " << iyBL);
595 if (
m_minCells > 1 && ixTR == ixBL && iyTR == iyBL) {
596 B2DEBUG(100,
"skipping cluster of size 1");
599 float centerX = 2 * ix + (ixTR + ixBL) / 2.;
601 float centerY = 2 * iy + (iyTR + iyBL) / 2.;
602 B2DEBUG(100,
"center at cell (" << centerX <<
", " << centerY <<
")");
604 double x = -M_PI + (centerX + 0.5) * 2. * M_PI /
m_nCellsPhi;
606 B2DEBUG(100,
"center coordinates (" << x <<
", " << y <<
")");
608 vector <unsigned> idList = {};
610 unsigned icandTR = planeIcand[(ixTR + 2 * ix) %
m_nCellsPhi][iyTR + 2 * iy];
611 unsigned icandBL = planeIcand[ixBL + 2 * ix][iyBL + 2 * iy];
612 vector<unsigned> candIdListTR =
houghCand[icandTR].getIdList();
613 vector<unsigned> candIdListBL =
houghCand[icandBL].getIdList();
615 B2DEBUG(100,
"merge id lists from candidates " << icandTR <<
" and " << icandBL);
619 double x1 = (round(centerX) == centerX) ? x - dx : x - 2 * dx;
620 double x2 = (round(centerX) == centerX) ? x + dx : x + 2 * dx;
621 double y1 = (round(centerY) == centerY) ? y - dy : y - 2 * dy;
622 double y2 = (round(centerY) == centerY) ? y + dy : y + 2 * dy;
625 if (idList.size() == 0) {
627 B2DEBUG(100,
"id list empty");
631 vector<unsigned> selectedList = {};
632 vector<unsigned> unselectedList = {};
633 selectHits(idList, selectedList, unselectedList);
639 for (
unsigned i = 0; i < selectedList.size(); ++i) {
640 unsigned its = selectedList[i];
644 for (
unsigned i = 0; i < unselectedList.size(); ++i) {
645 unsigned its = unselectedList[i];
653 track->addRelationTo(cluster);
667 bool connectDirect = (((patternL >> 3) & 1) && ((patternR >> 2) & 1)) ||
668 (((patternL >> 1) & 1) && ((patternR >> 0) & 1));
672 bool connectRise = ((patternL >> 1) & 1) && ((patternR >> 2) & 1);
676 bool connectFall = ((patternL >> 3) & 1) && ((patternR >> 0) & 1);
678 if (
m_connect == 4)
return connectDirect;
679 else if (
m_connect == 6)
return (connectDirect || connectRise);
680 else if (
m_connect == 8)
return (connectDirect || connectRise || connectFall);
681 else B2WARNING(
"Unknown option for connect " <<
m_connect <<
", using default.");
682 return (connectDirect || connectRise);
694 bool connectDirect = (((patternU >> 0) & 1) && ((patternD >> 2) & 1)) ||
695 (((patternU >> 1) & 1) && ((patternD >> 3) & 1));
702 bool connectRise = ((patternU >> 1) & 1) && ((patternD >> 2) & 1);
709 bool connectFall = ((patternU >> 0) & 1) && ((patternD >> 3) & 1);
711 if (
m_connect == 4)
return connectDirect;
712 else if (
m_connect == 6)
return (connectDirect || connectRise);
713 else if (
m_connect == 8)
return (connectDirect || connectRise || connectFall);
714 else B2WARNING(
"Unknown option for connect " <<
m_connect <<
", using default.");
715 return (connectDirect || connectRise);
728 return (((patternRU >> 0) & 1) && ((patternLD >> 3) & 1));
735 for (
unsigned index = pattern.size() - 1; index > 0; --index) {
736 if (!pattern[index])
continue;
740 if (ix < m_clusterSizeX - 1 && iy > 0) {
742 for (
unsigned index2 = index - 1; index2 > 0; --index2) {
743 if (!pattern[index2])
continue;
746 if (iy2 < iy && ix2 > ix) {
753 B2DEBUG(100,
"topRightSquare not unique");
767 if ((pattern >> 3) & 1)
return 3;
768 if ((pattern >> 1) & 1) {
769 if ((pattern >> 2) & 1) {
771 B2DEBUG(100,
"topRightCorner not unique");
775 if ((pattern >> 2) & 1)
return 2;
785 if (pattern & 1)
return 0;
786 if ((pattern >> 2) & 1) {
787 if ((pattern >> 1) & 1) {
789 B2DEBUG(100,
"bottomLeftCorner not unique");
793 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.