Belle II Software development
InPhi0CurvTanLBox Class Reference

Checker if a position is contained in a family of curves over phi0 and tan lambda. More...

#include <InPhi0CurvTanLBox.h>

Public Types

using HoughBox = Box< DiscretePhi0, DiscreteCurvWithArcLength2DCache, ContinuousTanL >
 The box to which this object corresponds.
 

Public Member Functions

 InPhi0CurvTanLBox (float curlCurv)
 Create a new box with the given curler curvature.
 
ESign getDistanceSign (const HoughBox &houghBox, float x, float y, float l, float dxdz, float dydz, ILayer iCLayer=-1) const
 Function that gives the sign of the distance from an observed drift circle to the sweeped object.
 

Private Attributes

float m_curlCurv
 Curler curvature - set to value greater zero to activate one arm exclusive finding.
 

Detailed Description

Checker if a position is contained in a family of curves over phi0 and tan lambda.

Definition at line 22 of file InPhi0CurvTanLBox.h.

Member Typedef Documentation

◆ HoughBox

The box to which this object corresponds.

Definition at line 32 of file InPhi0CurvTanLBox.h.

Constructor & Destructor Documentation

◆ InPhi0CurvTanLBox()

InPhi0CurvTanLBox ( float  curlCurv)
inlineexplicit

Create a new box with the given curler curvature.

Definition at line 26 of file InPhi0CurvTanLBox.h.

27 : m_curlCurv(curlCurv)
28 {}
float m_curlCurv
Curler curvature - set to value greater zero to activate one arm exclusive finding.

Member Function Documentation

◆ getDistanceSign()

ESign getDistanceSign ( const HoughBox houghBox,
float  x,
float  y,
float  l,
float  dxdz,
float  dydz,
ILayer  iCLayer = -1 
) const
inline

Function that gives the sign of the distance from an observed drift circle to the sweeped object.

Two dimensional arc length

Definition at line 36 of file InPhi0CurvTanLBox.h.

43 {
44 const std::array<DiscretePhi0, 2>& phi0Vec = houghBox.getBounds<DiscretePhi0>();
45 const std::array<DiscreteCurvWithArcLength2DCache, 2>& curv =
46 houghBox.getBounds<DiscreteCurvWithArcLength2DCache>();
47 const std::array<ContinuousTanL, 2>& tanL = houghBox.getBounds<ContinuousTanL>();
48
49 float r2 = x * x + y * y;
50
51 std::array<float, 2> xRot;
52 xRot[0] = x * phi0Vec[0]->x() + y * phi0Vec[0]->y();
53 xRot[1] = x * phi0Vec[1]->x() + y * phi0Vec[1]->y();
54
55 std::array<float, 2> yRotPlusL;
56 yRotPlusL[0] = -x * phi0Vec[0]->y() + y * phi0Vec[0]->x() + l;
57 yRotPlusL[1] = -x * phi0Vec[1]->y() + y * phi0Vec[1]->x() + l;
58
59 // std::array<float, 2> dxdzRot;
60 // dxdzRot[0] = dxdz * phi0Vec[0]->x() + dydz * phi0Vec[0]->y();
61 // dxdzRot[1] = dxdz * phi0Vec[1]->x() + dydz * phi0Vec[1]->y();
62
63 std::array<float, 2> dydzRot;
64 dydzRot[0] = -dxdz * phi0Vec[0]->y() + dydz * phi0Vec[0]->x();
65 dydzRot[1] = -dxdz * phi0Vec[1]->y() + dydz * phi0Vec[1]->x();
66
67 const bool onlyPositiveArm = 0 < m_curlCurv;
68 if (onlyPositiveArm) {
69 // Reject hit if it is on the inward going branch but the curvature suggest it is no curler
70 if ((xRot[0] < 0) and (xRot[1] < 0)) return ESign::c_Invalid;
71 }
72
74 std::array<float, 2> s;
75 s[0] = curv[0]->getArcLength2D(iCLayer, (xRot[0] < 0) and (xRot[1] < 0));
76 s[1] = curv[1]->getArcLength2D(iCLayer, (xRot[0] < 0) and (xRot[1] < 0));
77
78 std::array<float, 2> r2TimesHalfCurv;
79 r2 -= l * l;
80 r2TimesHalfCurv[0] = r2 * (static_cast<float>(*(curv[0])) / 2.0);
81 r2TimesHalfCurv[1] = r2 * (static_cast<float>(*(curv[1])) / 2.0);
82
83 // std::array<float, 4> xRotCor;
84 // xRotCor[0b00] = xRot[0] + dxdzRot[0] * s[0] * static_cast<float>(tanL[0]);
85 // xRotCor[0b01] = xRot[0] + dxdzRot[0] * s[0] * static_cast<float>(tanL[1]);
86 // xRotCor[0b10] = xRot[1] + dxdzRot[1] * s[1] * static_cast<float>(tanL[0]);
87 // xRotCor[0b11] = xRot[1] + dxdzRot[1] * s[1] * static_cast<float>(tanL[1]);
88
89 // const std::array<float, 4>& sCor = xRotCor;
90
91 std::array<float, 4> z;
92 z[0b00] = s[0] * static_cast<float>(tanL[0]);
93 z[0b01] = s[1] * static_cast<float>(tanL[0]);
94 z[0b10] = s[0] * static_cast<float>(tanL[1]);
95 z[0b11] = s[1] * static_cast<float>(tanL[1]);
96
97 // Using binary notation encoding lower and upper box bounds to fill the flat array.
98 std::array<float, 8> dist;
99 dist[0b000] = r2TimesHalfCurv[0] - yRotPlusL[0] - dydzRot[0] * z[0b00];
100 dist[0b001] = r2TimesHalfCurv[0] - yRotPlusL[1] - dydzRot[1] * z[0b00];
101 dist[0b010] = r2TimesHalfCurv[1] - yRotPlusL[0] - dydzRot[0] * z[0b01];
102 dist[0b011] = r2TimesHalfCurv[1] - yRotPlusL[1] - dydzRot[1] * z[0b01];
103
104 dist[0b100] = r2TimesHalfCurv[0] - yRotPlusL[0] - dydzRot[0] * z[0b10];
105 dist[0b101] = r2TimesHalfCurv[0] - yRotPlusL[1] - dydzRot[1] * z[0b10];
106 dist[0b110] = r2TimesHalfCurv[1] - yRotPlusL[0] - dydzRot[0] * z[0b11];
107 dist[0b111] = r2TimesHalfCurv[1] - yRotPlusL[1] - dydzRot[1] * z[0b11];
108
109 return ESignUtil::common(dist);
110 }
static ESign common(ESign n1, ESign n2)
Check if two values have a common sign.
Definition: ESign.h:57

Member Data Documentation

◆ m_curlCurv

float m_curlCurv
private

Curler curvature - set to value greater zero to activate one arm exclusive finding.

Definition at line 114 of file InPhi0CurvTanLBox.h.


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