Belle II Software development
SegmentInZ0TanLambdaBox Class Reference

Predicate class to check for the containment of hits in a z0 tan lambda hough space part. More...

#include <SegmentInZ0TanLambdaBox.h>

Public Types

using HoughBox = Z0TanLambdaBox
 Use a Z0TanLambdaBox.
 

Public Member Functions

Weight operator() (const std::pair< CDCSegment3D, CDCTrajectorySZ > &segmentWithTrajectorySZ, const HoughBox *z0TanLambdaBox)
 Checks if the wire hit is contained in a z0 tan lambda hough space.
 

Detailed Description

Predicate class to check for the containment of hits in a z0 tan lambda hough space part.

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 26 of file SegmentInZ0TanLambdaBox.h.

Member Typedef Documentation

◆ HoughBox

Use a Z0TanLambdaBox.

Definition at line 30 of file SegmentInZ0TanLambdaBox.h.

Member Function Documentation

◆ operator()()

Weight operator() ( const std::pair< CDCSegment3D, CDCTrajectorySZ > &  segmentWithTrajectorySZ,
const HoughBox z0TanLambdaBox 
)
inline

Checks if the wire hit is contained in a z0 tan lambda hough space.

Returns 1.0 if it is contained, returns NAN if it is not contained.

Definition at line 36 of file SegmentInZ0TanLambdaBox.h.

38 {
39 float lowerZ0 = z0TanLambdaBox->getLowerZ0();
40 float upperZ0 = z0TanLambdaBox->getUpperZ0();
41
42 float lowerTanLambda = z0TanLambdaBox->getLowerTanLambda();
43 float upperTanLambda = z0TanLambdaBox->getUpperTanLambda();
44
45 const CDCTrajectorySZ& szTrajectory = segmentWithTrajectorySZ.second;
46 const CDCSegment3D& segment = segmentWithTrajectorySZ.first;
47
48 float trajectoryZ0 = szTrajectory.getZ0();
49 float trajectoryTanLambda = szTrajectory.getTanLambda();
50
51 if (std::isnan(trajectoryZ0) or std::isnan(trajectoryTanLambda)) {
52 return NAN;
53 }
54
55 if (SameSignChecker::isIn(trajectoryZ0, trajectoryTanLambda, lowerZ0, upperZ0, lowerTanLambda, upperTanLambda)) {
56 return 0.6 * segment.size();
57 }
58
59 return NAN;
60 }
static bool isIn(double x, double y, double x1, double x2, double y1, double y2)
Check if two values are in the rectangle spanned by the other four values.

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