10#include <tracking/trackFindingCDC/hough/boxes/Box.h>
11#include <tracking/trackFindingCDC/hough/axes/StandardAxes.h>
12#include <tracking/trackFindingCDC/numerics/Weight.h>
13#include <tracking/trackFindingCDC/eventdata/hits/CDCRecoHit3D.h>
14#include <tracking/trackFindingCDC/hough/baseelements/SameSignChecker.h>
16#include <framework/gearbox/Unit.h>
25 namespace TrackFindingCDC {
62 const float lowerQ = *(hyperBox->getLowerBound<
DiscreteQ>());
63 const float upperQ = *(hyperBox->getUpperBound<
DiscreteQ>());
64 const float deltaQ = 0.5 * (upperQ - lowerQ);
66 const float centerP = *(hyperBox->getCenter<1>());
68 const float centerZ0 = *(hyperBox->getCenter<2>());
71 const double recoZ = recoHit.
getRecoZ();
74 catZ(upperQ, centerP, perpS) + centerZ0 + 100.0 *
Unit::cm * deltaQ - recoZ);
88 const float centerQ = *(hyperBox.getCenter<0>());
89 const float centerP = *(hyperBox.getCenter<1>());
90 const float centerZ0 = *(hyperBox.getCenter<2>());
92 const double lhsZ = lhsRecoHit.
getRecoZ();
93 const double rhsZ = rhsRecoHit.
getRecoZ();
98 const double lhsZDistance =
catZ(centerQ, centerP, lhsS) + centerZ0 - lhsZ;
99 const double rhsZDistance =
catZ(centerQ, centerP, rhsS) + centerZ0 - rhsZ;
101 return lhsZDistance < rhsZDistance;
106 static double catZ(
const double q,
const double p,
const double R)
109 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);
116 return *(hyperBox.getCenter<0>());
122 return *(hyperBox.getCenter<1>());
128 return *(hyperBox.getCenter<2>());
134 const float lowerQ = *(hyperBox.getLowerBound<
DiscreteQ>());
135 const float upperQ = *(hyperBox.getUpperBound<
DiscreteQ>());
136 return 0.5 * (upperQ - lowerQ);
140 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]";}
The base class for all boxes.
Class representing a three dimensional reconstructed hit.
double getRecoZ() const
Getter for the z coordinate of the reconstructed position.
double getArcLength2D() const
Getter for the travel distance in the xy projection.
Representation for a discrete position in an array of discrete positions.
An algorithm to check if a hit is contained in a hyperbolic cosine hough box.
static float centerY(const HoughBox &hyperBox)
Returns center value of the box along second (P) axis.
static const char * debugLine()
ROOT expression of the track hypothesis.
static float deltaX(const HoughBox &hyperBox)
Returns half width of the box along first (Q) axis.
static float centerX(const HoughBox &hyperBox)
Returns center value of the box along first (Q) axis.
static float centerZ(const HoughBox &hyperBox)
Returns center value of the box along third (Z0) axis.
static bool compareDistances(const HoughBox &hyperBox, const CDCRecoHit3D &lhsRecoHit, const CDCRecoHit3D &rhsRecoHit)
Compares distances from two hits to the track represented by the given box.
Weight operator()(const CDCRecoHit3D &recoHit, const HoughBox *hyperBox)
Returns weight of the hit for the given hough box; in this algorithm - 1 if hit inside the box,...
static double catZ(const double q, const double p, const double R)
Returns z(R) for the catenary with parameters q = E/p_t and p = p_z/E.
static bool sameSign(double n1, double n2)
Check if two values have the same sign.
static const double cm
Standard units with the value = 1.
Abstract base class for different kinds of events.