12 #include <tracking/trackFindingCDC/hough/axes/StandardAxes.h>
13 #include <tracking/trackFindingCDC/hough/boxes/Box.h>
14 #include <tracking/trackFindingCDC/topology/ILayer.h>
21 namespace TrackFindingCDC {
24 class InPhi0CurvTanLBox {
44 ILayer iCLayer = -1)
const
46 const std::array<DiscretePhi0, 2>& phi0Vec = houghBox.getBounds<
DiscretePhi0>();
47 const std::array<DiscreteCurvWithArcLength2DCache, 2>& curv =
49 const std::array<ContinuousTanL, 2>& tanL = houghBox.getBounds<
ContinuousTanL>();
51 float r2 = x * x + y * y;
53 std::array<float, 2> xRot;
54 xRot[0] = x * phi0Vec[0]->x() + y * phi0Vec[0]->y();
55 xRot[1] = x * phi0Vec[1]->x() + y * phi0Vec[1]->y();
57 std::array<float, 2> yRotPlusL;
58 yRotPlusL[0] = -x * phi0Vec[0]->y() + y * phi0Vec[0]->x() + l;
59 yRotPlusL[1] = -x * phi0Vec[1]->y() + y * phi0Vec[1]->x() + l;
65 std::array<float, 2> dydzRot;
66 dydzRot[0] = -dxdz * phi0Vec[0]->y() + dydz * phi0Vec[0]->x();
67 dydzRot[1] = -dxdz * phi0Vec[1]->y() + dydz * phi0Vec[1]->x();
70 if (onlyPositiveArm) {
72 if ((xRot[0] < 0) and (xRot[1] < 0))
return ESign::c_Invalid;
76 std::array<float, 2> s;
77 s[0] = curv[0]->getArcLength2D(iCLayer, (xRot[0] < 0) and (xRot[1] < 0));
78 s[1] = curv[1]->getArcLength2D(iCLayer, (xRot[0] < 0) and (xRot[1] < 0));
80 std::array<float, 2> r2TimesHalfCurv;
82 r2TimesHalfCurv[0] = r2 * (
static_cast<float>(*(curv[0])) / 2.0);
83 r2TimesHalfCurv[1] = r2 * (
static_cast<float>(*(curv[1])) / 2.0);
93 std::array<float, 4> z;
94 z[0b00] = s[0] *
static_cast<float>(tanL[0]);
95 z[0b01] = s[1] *
static_cast<float>(tanL[0]);
96 z[0b10] = s[0] *
static_cast<float>(tanL[1]);
97 z[0b11] = s[1] *
static_cast<float>(tanL[1]);
100 std::array<float, 8> dist;
101 dist[0b000] = r2TimesHalfCurv[0] - yRotPlusL[0] - dydzRot[0] * z[0b00];
102 dist[0b001] = r2TimesHalfCurv[0] - yRotPlusL[1] - dydzRot[1] * z[0b00];
103 dist[0b010] = r2TimesHalfCurv[1] - yRotPlusL[0] - dydzRot[0] * z[0b01];
104 dist[0b011] = r2TimesHalfCurv[1] - yRotPlusL[1] - dydzRot[1] * z[0b01];
106 dist[0b100] = r2TimesHalfCurv[0] - yRotPlusL[0] - dydzRot[0] * z[0b10];
107 dist[0b101] = r2TimesHalfCurv[0] - yRotPlusL[1] - dydzRot[1] * z[0b10];
108 dist[0b110] = r2TimesHalfCurv[1] - yRotPlusL[0] - dydzRot[0] * z[0b11];
109 dist[0b111] = r2TimesHalfCurv[1] - yRotPlusL[1] - dydzRot[1] * z[0b11];