Belle II Software development
HitInHyperBox Class Reference

An algorithm to check if a hit is contained in a hyperbolic cosine hough box. More...

#include <HitInHyperBox.h>

Public Types

using HoughBox = Box<DiscreteQ, DiscreteP, DiscreteZ0>
 Hough space is 3D with axes q, p, z0 as described above.
 

Public Member Functions

TrackingUtilities::Weight operator() (const TrackingUtilities::CDCRecoHit3D &recoHit, const HoughBox *hyperBox)
 Returns weight of the hit for the given hough box; in this algorithm - 1 if hit inside the box, NaN otherwise.
 

Static Public Member Functions

static bool compareDistances (const HoughBox &hyperBox, const TrackingUtilities::CDCRecoHit3D &lhsRecoHit, const TrackingUtilities::CDCRecoHit3D &rhsRecoHit)
 Compares distances from two hits to the track represented by the given box.
 
static float centerX (const HoughBox &hyperBox)
 Returns center value of the box along first (Q) axis.
 
static float centerY (const HoughBox &hyperBox)
 Returns center value of the box along second (P) axis.
 
static float centerZ (const HoughBox &hyperBox)
 Returns center value of the box along third (Z0) axis.
 
static float deltaX (const HoughBox &hyperBox)
 Returns half width of the box along first (Q) axis.
 
static const char * debugLine ()
 ROOT expression of the track hypothesis.
 

Static Private Member Functions

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.
 

Detailed Description

An algorithm to check if a hit is contained in a hyperbolic cosine hough box.

The exact parameterization is z(R) = 1 / mu * (sqrt(1 - p * p) * cosh(R * mu / q + arcsinh(p / sqrt(1 - p * p))) - 1) + z0

q is p_t / E - transverse fraction of energy p is p_z / E - longitudinal fraction of energy mu is gcB / E - inverse of scale; ranges from 0.0375 for E=6GeV, g=0.5 to 2.25 for E=1GeV, g=5.0 z0 is z at R=0 z and R are in units of CDC size

If we apply a constraint z0=0, The tree will not perform well as mu is highly correlated to q (and p)

Instead we relax z0=0 and apply mu=q Then for a better continuity around g=0 (sign flip), we take 1/q as new q

Resulting parameterization is z(R) = q * (sqrt(1 - p * p) * cosh(R + arcsinh(p / sqrt(1 - p * p))) - 1) + z0 Which can still provide reasonable fits.

Additionally, box edges are behaving more or less on same scale near origin and near edges of CDC if z(R) = +-dQ + 1 / (q +- dQ) * (sqrt(1 - p * p) * cosh(R + arcsinh(p / sqrt(1 - p * p))) - 1) + z0

Definition at line 52 of file HitInHyperBox.h.

Member Typedef Documentation

◆ HoughBox

Hough space is 3D with axes q, p, z0 as described above.

Definition at line 56 of file HitInHyperBox.h.

Member Function Documentation

◆ catZ()

static double catZ ( const double q,
const double p,
const double R )
inlinestaticprivate

Returns z(R) for the catenary with parameters q = E/p_t and p = p_z/E.

Definition at line 107 of file HitInHyperBox.h.

108 {
109 //100 here is a reference - size of CDC in cm
110 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);
111 }
double R
typedef autogenerated by FFTW

◆ centerX()

static float centerX ( const HoughBox & hyperBox)
inlinestatic

Returns center value of the box along first (Q) axis.

Definition at line 115 of file HitInHyperBox.h.

116 {
117 return *(hyperBox.getCenter<0>());
118 }

◆ centerY()

static float centerY ( const HoughBox & hyperBox)
inlinestatic

Returns center value of the box along second (P) axis.

Definition at line 121 of file HitInHyperBox.h.

122 {
123 return *(hyperBox.getCenter<1>());
124 }

◆ centerZ()

static float centerZ ( const HoughBox & hyperBox)
inlinestatic

Returns center value of the box along third (Z0) axis.

Definition at line 127 of file HitInHyperBox.h.

128 {
129 return *(hyperBox.getCenter<2>());
130 }

◆ compareDistances()

static bool compareDistances ( const HoughBox & hyperBox,
const TrackingUtilities::CDCRecoHit3D & lhsRecoHit,
const TrackingUtilities::CDCRecoHit3D & rhsRecoHit )
inlinestatic

Compares distances from two hits to the track represented by the given box.

The comparison is done based on reconstructed Z coordinates of hits and track Z position.

Definition at line 86 of file HitInHyperBox.h.

88 {
89 const float centerQ = *(hyperBox.getCenter<0>());
90 const float centerP = *(hyperBox.getCenter<1>());
91 const float centerZ0 = *(hyperBox.getCenter<2>());
92
93 const double lhsZ = lhsRecoHit.getRecoZ();
94 const double rhsZ = rhsRecoHit.getRecoZ();
95
96 const double lhsS = lhsRecoHit.getArcLength2D();
97 const double rhsS = rhsRecoHit.getArcLength2D();
98
99 const double lhsZDistance = catZ(centerQ, centerP, lhsS) + centerZ0 - lhsZ;
100 const double rhsZDistance = catZ(centerQ, centerP, rhsS) + centerZ0 - rhsZ;
101
102 return lhsZDistance < rhsZDistance;
103 }

◆ debugLine()

static const char * debugLine ( )
inlinestatic

ROOT expression of the track hypothesis.

Definition at line 141 of file HitInHyperBox.h.

141{ return "100.0 * [0] * (TMath::Sqrt(1 - [1] * [1]) * TMath::CosH(x / 100.0 + TMath::ASinH([1] / TMath::Sqrt(1 - [1] * [1]))) - 1) + [2]";}

◆ deltaX()

static float deltaX ( const HoughBox & hyperBox)
inlinestatic

Returns half width of the box along first (Q) axis.

Definition at line 133 of file HitInHyperBox.h.

134 {
135 const float lowerQ = *(hyperBox.getLowerBound<DiscreteQ>()); //DiscreteValue is based on std::vector<T>::const_iterator
136 const float upperQ = *(hyperBox.getUpperBound<DiscreteQ>());
137 return 0.5 * (upperQ - lowerQ);
138 }

◆ operator()()

TrackingUtilities::Weight operator() ( const TrackingUtilities::CDCRecoHit3D & recoHit,
const HoughBox * hyperBox )
inline

Returns weight of the hit for the given hough box; in this algorithm - 1 if hit inside the box, NaN otherwise.

Definition at line 59 of file HitInHyperBox.h.

61 {
62 const float lowerQ = *(hyperBox->getLowerBound<DiscreteQ>()); //DiscreteValue is based on std::vector<T>::const_iterator
63 const float upperQ = *(hyperBox->getUpperBound<DiscreteQ>());
64 const float deltaQ = 0.5 * (upperQ - lowerQ);
65
66 const float centerP = *(hyperBox->getCenter<1>()); //TODO getCenter(class T) is not implemented
67
68 const float centerZ0 = *(hyperBox->getCenter<2>());
69
70 const double perpS = recoHit.getArcLength2D();
71 const double recoZ = recoHit.getRecoZ();
72
73 const bool sameSign = SameSignChecker::sameSign(catZ(lowerQ, centerP, perpS) + centerZ0 - 100.0 * Unit::cm * deltaQ - recoZ,
74 catZ(upperQ, centerP, perpS) + centerZ0 + 100.0 * Unit::cm * deltaQ - recoZ); //100 is a reference - size of CDC in cm
75 if (not sameSign) {
76 return 1.0;
77 } else {
78 return NAN;
79 }
80 }
bool sameSign(double expected, double actual)
Predicate checking that two values have the same sign.

The documentation for this class was generated from the following file: