16#ifndef _ALICEO2_HELIX_HELPER_
17#define _ALICEO2_HELIX_HELPER_
44 void set(
const T& trc,
float bz)
46 trc.getCircleParams(
bz, *
this,
s,
c);
66 float xDist = trcB.xC - trcA.xC, yDist = trcB.yC - trcA.yC;
67 float dist2 = xDist * xDist + yDist * yDist, dist = std::sqrt(dist2), rsum = trcA.rC + trcB.rC;
68 if (std::abs(dist) < 1e-12) {
78 }
else if (dist + trcB.rC < trcA.rC) {
84 if (std::abs(xDist) < std::abs(yDist)) {
85 float a = (trcA.rC * trcA.rC - trcB.rC * trcB.rC + dist2) / (2. * yDist),
b = -xDist / yDist, ab =
a *
b,
bb =
b *
b;
86 float det = ab * ab - (1. +
bb) * (
a *
a - trcA.rC * trcA.rC);
89 xDCA[0] = (-ab + det) / (1. +
b *
b);
92 xDCA[1] = (-ab - det) / (1. +
b *
b);
100 float a = (trcA.rC * trcA.rC - trcB.rC * trcB.rC + dist2) / (2. * xDist),
b = -yDist / xDist, ab =
a *
b,
bb =
b *
b;
101 float det = ab * ab - (1. +
bb) * (
a *
a - trcA.rC * trcA.rC);
103 det = std::sqrt(det);
104 yDCA[0] = (-ab + det) / (1. +
bb);
107 yDCA[1] = (-ab - det) / (1. +
bb);
128 auto t2d = (dist + trcA.rC - rBSign) / dist;
129 xDCA[0] = trcA.xC + 0.5 * (xDist * t2d);
130 yDCA[0] = trcA.yC + 0.5 * (yDist * t2d);
133 template <
typename T>
151 float dx =
trax1.
xC - trax0.xC;
152 float dy =
trax1.
yC - trax0.yC;
153 float dz =
tr1.getZ() -
tr0.getZ();
154 auto csp0i2 = 1. /
tr0.getCsp2();
155 auto csp0i = std::sqrt(csp0i2);
156 auto tgp0 =
tr0.getSnp() * csp0i;
157 float kx0 = trax0.c - trax0.s * tgp0;
158 float ky0 = trax0.s + trax0.c * tgp0;
159 float kz0 =
tr0.getTgl() * csp0i;
160 auto csp1i2 = 1. /
tr1.getCsp2();
161 auto csp1i = std::sqrt(csp1i2);
162 auto tgp1 =
tr1.getSnp() * std::sqrt(csp1i2);
165 float kz1 =
tr1.getTgl() * csp1i;
174 float a00 = (1.f +
tr0.getTgl() *
tr0.getTgl()) * csp0i2, a11 = (1.f +
tr1.getTgl() *
tr1.getTgl()) * csp1i2, a01 = -(kx0 * kx1 + ky0 * ky1 + kz0 * kz1);
175 float b0 = dx * kx0 + dy * ky0 + dz * kz0,
b1 = -(dx * kx1 + dy * ky1 + dz * kz1);
176 float det = a00 * a11 - a01 * a01, det0 = b0 * a11 -
b1 * a01, det1 = a00 *
b1 - a01 * b0;
178 auto detI = 1. / det;
179 auto t0 = det0 * detI;
180 auto t1 = det1 * detI;
181 float addx0 = kx0 *
t0, addy0 = ky0 *
t0, addx1 = kx1 *
t1, addy1 = ky1 *
t1;
187 xDCA[0] = (trax0.xC + addx0 +
trax1.
xC + addx1) * 0.5;
188 yDCA[0] = (trax0.yC + addy0 +
trax1.
yC + addy1) * 0.5;
194 template <
typename T>
212 const auto& traxH = trax0.rC >
trax1.
rC ? trax0 :
trax1;
213 const auto& traxL = trax0.rC >
trax1.
rC ?
trax1 : trax0;
217 float dx = traxL.
xC - traxH.xC;
218 float dy = traxL.yC - traxH.yC;
220 auto cspi2 = 1. / trcL.getCsp2();
221 auto cspi = std::sqrt(cspi2);
222 auto tgp = trcL.getSnp() * cspi;
223 float kx = traxL.c - traxL.s * tgp;
224 float ky = traxL.s + traxL.c * tgp;
225 double dk = dx * kx + dy * ky;
226 double det = dk * dk - cspi2 * (dx * dx + dy * dy - traxH.rC * traxH.rC);
228 det = std::sqrt(det);
229 float t0 = (-dk + det) * cspi2;
230 float t1 = (-dk - det) * cspi2;
231 xDCA[0] = traxL.xC + kx *
t0;
232 yDCA[0] = traxL.yC + ky *
t0;
233 xDCA[1] = traxL.xC + kx *
t1;
234 yDCA[1] = traxL.yC + ky *
t1;
238 float t = -dk * cspi2;
239 float xL = traxL.xC + kx * t, yL = traxL.yC + ky * t;
240 float dxc = xL - traxH.xC, dyc = yL - traxH.yC, dist = std::sqrt(dxc * dxc + dyc * dyc);
244 float drcf = traxH.rC / dist;
245 float xH = traxH.xC + dxc * drcf, yH = traxH.yC + dyc * drcf;
246 xDCA[0] = (xL + xH) * 0.5;
247 yDCA[0] = (yL + yH) * 0.5;
253 template <
typename T>
271 template <
typename T>
General auxilliary methods.
const GPUTPCGMMerger::trackCluster & b1
Declarations of 2D primitives.
GLboolean GLboolean GLboolean b
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat t0
GLboolean GLboolean GLboolean GLboolean a
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat t1
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
int set(const TrackAuxPar &trax0, const T &tr0, const TrackAuxPar &trax1, const T &tr1, float maxDistXY=MaxDistXYDef)
int linesCrossInfo(const TrackAuxPar &trax0, const T &tr0, const TrackAuxPar &trax1, const T &tr1, float maxDistXY=MaxDistXYDef)
const TrackAuxPar & trax1
CrossInfo(const TrackAuxPar &trax0, const T &tr0, const TrackAuxPar &trax1, const T &tr1, float maxDistXY=MaxDistXYDef)
const T const TrackAuxPar const T & tr1
int circlesCrossInfo(const TrackAuxPar &trax0, const TrackAuxPar &trax1, float maxDistXY=MaxDistXYDef)
const TrackAuxPar float maxDistXY
static constexpr float MaxDistXYDef
int circleLineCrossInfo(const TrackAuxPar &trax0, const T &tr0, const TrackAuxPar &trax1, const T &tr1, float maxDistXY=MaxDistXYDef)
void notTouchingXY(float dist, float xDist, float yDist, const TrackAuxPar &trcA, float rBSign)
TrackAuxPar(const T &trc, float bz)
float sinDif(const TrackAuxPar &t) const
ClassDefNV(TrackAuxPar, 1)
void set(const T &trc, float bz)
float cosDif(const TrackAuxPar &t) const