Belle II Software development
HitInZ0TanLambdaBoxUsingZ Class Reference

Predicate class to check for the containment of hits in a z0 tan lambda hough space part using a different algorithm than normal. More...

#include <HitInZ0TanLambdaBoxUsingZ.h>

Public Types

using HoughBox = Z0TanLambdaBox
 Use a Z0TanLambdaBox.
 

Public Member Functions

Weight operator() (const CDCRecoHit3D &recoHit, const HoughBox *z0TanLambdaBox)
 Return exp{-distance} with distance = distance between the trajectory constructed from the box parameters and the hit in the xy-plane.
 

Static Public Member Functions

static bool compareDistances (const HoughBox &z0TanLambdaBox, const CDCRecoHit3D &lhsRecoHit, const CDCRecoHit3D &rhsRecoHit)
 Compares distances from two hits to the track represented by the given box.
 
static const char * debugLine ()
 ROOT-compatible formula for z(s) = z0 + tanlambda * s.
 

Detailed Description

Predicate class to check for the containment of hits in a z0 tan lambda hough space part using a different algorithm than normal.

Instead of calculating of the hit belongs to the box, it constructs a trajectory out if the box parameters (using its taln lambda and z0) and checks the distance from the hit to the trajectory. It returns e^{-distance}. Note this part this code defines the performance of the search in the hough plain quite significantly and there is probably room for improvement.

Definition at line 33 of file HitInZ0TanLambdaBoxUsingZ.h.

Member Typedef Documentation

◆ HoughBox

Use a Z0TanLambdaBox.

Definition at line 37 of file HitInZ0TanLambdaBoxUsingZ.h.

Member Function Documentation

◆ compareDistances()

static bool compareDistances ( const HoughBox z0TanLambdaBox,
const CDCRecoHit3D lhsRecoHit,
const 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 74 of file HitInZ0TanLambdaBoxUsingZ.h.

75 {
76 const double z0Mean = (z0TanLambdaBox.getLowerZ0() + z0TanLambdaBox.getUpperZ0()) / 2.0;
77 const double tanLambdaMean = (z0TanLambdaBox.getLowerTanLambda() + z0TanLambdaBox.getUpperTanLambda()) / 2.0;
78
79 const double lhsZ = lhsRecoHit.getRecoZ();
80 const double rhsZ = rhsRecoHit.getRecoZ();
81
82 const double lhsS = lhsRecoHit.getArcLength2D();
83 const double rhsS = rhsRecoHit.getArcLength2D();
84
85 const double lhsZDistance = lhsS * tanLambdaMean + z0Mean - lhsZ;
86 const double rhsZDistance = rhsS * tanLambdaMean + z0Mean - rhsZ;
87
88 return lhsZDistance < rhsZDistance;
89 }

◆ debugLine()

static const char * debugLine ( )
inlinestatic

ROOT-compatible formula for z(s) = z0 + tanlambda * s.

Definition at line 92 of file HitInZ0TanLambdaBoxUsingZ.h.

92{ return "[0] + [1] * x";}

◆ operator()()

Weight operator() ( const CDCRecoHit3D recoHit,
const HoughBox z0TanLambdaBox 
)
inline

Return exp{-distance} with distance = distance between the trajectory constructed from the box parameters and the hit in the xy-plane.

Note that this is not a binary decision and must be used with some sort of cutoff (because otherwise all hits belong in all boxes).

Definition at line 44 of file HitInZ0TanLambdaBoxUsingZ.h.

46 {
47 const CDCWire& wire = recoHit.getWire();
48 const WireLine& wireLine = wire.getWireLine();
49
50 float lowerZ0 = z0TanLambdaBox->getLowerZ0();
51 float upperZ0 = z0TanLambdaBox->getUpperZ0();
52 const float centerZ0 = 0.5 * (lowerZ0 + upperZ0);
53
54 float lowerTanLambda = z0TanLambdaBox->getLowerTanLambda();
55 float upperTanLambda = z0TanLambdaBox->getUpperTanLambda();
56 const float centerTanLambda = 0.5 * (lowerTanLambda + upperTanLambda);
57
58 float perpS = recoHit.getArcLength2D();
59 const Vector2D& recoPosition = recoHit.getRecoPos2D();
60
61 float hitZ = centerTanLambda * perpS + centerZ0;
62
63 Vector2D pos2D = wireLine.nominalPos2DAtZ(hitZ);
64
65 float distanceToRecoPosition = (pos2D - recoPosition).norm();
66
67 return exp(-distanceToRecoPosition);
68 }

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