12 #include <tracking/trackFindingCDC/hough/boxes/Box.h>
13 #include <tracking/trackFindingCDC/hough/axes/StandardAxes.h>
14 #include <tracking/trackFindingCDC/numerics/Weight.h>
15 #include <tracking/trackFindingCDC/eventdata/hits/CDCRecoHit3D.h>
16 #include <tracking/trackFindingCDC/hough/baseelements/SameSignChecker.h>
18 #include <framework/gearbox/Unit.h>
27 namespace TrackFindingCDC {
58 using HoughBox = Box<DiscreteQ, DiscreteP, DiscreteZ0>;
64 const float lowerQ = *(hyperBox->getLowerBound<
DiscreteQ>());
65 const float upperQ = *(hyperBox->getUpperBound<
DiscreteQ>());
66 const float deltaQ = 0.5 * (upperQ - lowerQ);
68 const float centerP = *(hyperBox->getCenter<1>());
70 const float centerZ0 = *(hyperBox->getCenter<2>());
72 const double perpS = recoHit.getArcLength2D();
73 const double recoZ = recoHit.getRecoZ();
76 catZ(upperQ, centerP, perpS) + centerZ0 + 100.0 *
Unit::cm * deltaQ - recoZ);
88 static bool compareDistances(
const HoughBox& hyperBox,
const CDCRecoHit3D& lhsRecoHit,
const CDCRecoHit3D& rhsRecoHit)
90 const float centerQ = *(hyperBox.getCenter<0>());
91 const float centerP = *(hyperBox.getCenter<1>());
92 const float centerZ0 = *(hyperBox.getCenter<2>());
94 const double lhsZ = lhsRecoHit.getRecoZ();
95 const double rhsZ = rhsRecoHit.getRecoZ();
97 const double lhsS = lhsRecoHit.getArcLength2D();
98 const double rhsS = rhsRecoHit.getArcLength2D();
100 const double lhsZDistance =
catZ(centerQ, centerP, lhsS) + centerZ0 - lhsZ;
101 const double rhsZDistance =
catZ(centerQ, centerP, rhsS) + centerZ0 - rhsZ;
103 return lhsZDistance < rhsZDistance;
108 static double catZ(
const double q,
const double p,
const double R)
111 return 100.0 *
Unit::cm * q * (std::sqrt(1 - p * p) * std::cosh(R / (100.0 *
Unit::cm) + std::asinh(p / std::sqrt(1 - p * p))) - 1);
118 return *(hyperBox.getCenter<0>());
124 return *(hyperBox.getCenter<1>());
130 return *(hyperBox.getCenter<2>());
136 const float lowerQ = *(hyperBox.getLowerBound<
DiscreteQ>());
137 const float upperQ = *(hyperBox.getUpperBound<
DiscreteQ>());
138 return 0.5 * (upperQ - lowerQ);
142 static const char*
debugLine() {
return "100.0 * [0] * (TMath::Sqrt(1 - [1] * [1]) * TMath::CosH(x / 100.0 + TMath::ASinH([1] / TMath::Sqrt(1 - [1] * [1]))) - 1) + [2]";}