24#ifndef GPUCA_ALIGPUCODE
47 static constexpr float Tiny = 1e-9;
49 GPUd()
Ray() : mP{0.f}, mD{0.f}, mDistXY2(0.f), mDistXY2i(0.f), mDistXYZ(0.f), mXDxPlusYDy(0.f), mXDxPlusYDyRed(0.f), mXDxPlusYDy2(0.f), mR02(0.f), mR12(0.f)
54#ifndef GPUCA_ALIGPUCODE
67 par1 = mCrossParams1[
i];
74 GPUd()
float getDist()
const {
return mDistXYZ; }
75 GPUd() float getDist(
float deltaT)
const {
return mDistXYZ * (deltaT > 0 ? deltaT : -deltaT); }
78 GPUd() float getPos(
float t,
int i)
const {
return mP[
i] + t * mD[
i]; }
80 GPUd() float getPhi(
float t)
const
82 float p = o2::gpu::CAMath::ATan2(mP[1] + t * mD[1], mP[0] + t * mD[0]);
83 o2::math_utils::bringTo02Pi(p);
87 GPUd() float getZ(
float t)
const {
return mP[2] + t * mD[2]; }
102 float mCrossParams1[2];
103 float mCrossParams2[2];
109#ifndef GPUCA_ALIGPUCODE
112 : mP{point0.X(), point0.Y(), point0.Z()}, mD{point1.X() - point0.X(), point1.Y() - point0.Y(), point1.Z() - point0.Z()}
114 mDistXY2 = mD[0] * mD[0] + mD[1] * mD[1];
115 mDistXY2i = mDistXY2 >
Tiny ? 1.f / mDistXY2 : 0.f;
116 mDistXYZ = o2::gpu::CAMath::Sqrt(mDistXY2 + mD[2] * mD[2]);
117 mXDxPlusYDy = point0.X() * mD[0] + point0.Y() * mD[1];
118 mXDxPlusYDyRed = -mXDxPlusYDy * mDistXY2i;
119 mXDxPlusYDy2 = mXDxPlusYDy * mXDxPlusYDy;
120 mR02 = point0.Perp2();
121 mR12 = point1.Perp2();
129 mDistXY2 = mD[0] * mD[0] + mD[1] * mD[1];
130 mDistXY2i = mDistXY2 >
Tiny ? 1.f / mDistXY2 : 0.f;
131 mDistXYZ = o2::gpu::CAMath::Sqrt(mDistXY2 + mD[2] * mD[2]);
132 mXDxPlusYDy =
x0 * mD[0] +
y0 * mD[1];
133 mXDxPlusYDyRed = -mXDxPlusYDy * mDistXY2i;
134 mXDxPlusYDy2 = mXDxPlusYDy * mXDxPlusYDy;
140GPUdi() float Ray::crossRadial(
float cs,
float sn)
const
143 float den = mD[0] * sn - mD[1] * cs;
144 return den != 0. ? (mP[1] * cs - mP[0] * sn) / den : InvalidT;
148GPUdi() bool Ray::crossCircleR(
float r2,
float& cross1,
float& cross2)
const
154 float det = mXDxPlusYDy2 - mDistXY2 * (mR02 - r2);
158 float detRed = o2::gpu::CAMath::Sqrt(det) * mDistXY2i;
159 cross1 = mXDxPlusYDyRed + detRed;
160 cross2 = mXDxPlusYDyRed - detRed;
165GPUdi() float Ray::crossRadial(const MatLayerCyl& lr,
int sliceID)
const
168 return crossRadial(lr.getSliceCos(sliceID), lr.getSliceSin(sliceID));
172GPUdi() float Ray::crossZ(
float z)
const
175 return mD[2] != 0. ? (
z - mP[2]) / mD[2] : InvalidT;
179GPUdi() bool Ray::validateZRange(
float& cpar1,
float& cpar2, const MatLayerCyl& lr)
const
184 if (zout0 == zout1) {
198GPUdi()
void Ray::getMinMaxR2(
float& rmin2,
float& rmax2)
const
208 if (mXDxPlusYDyRed > 0.f && mXDxPlusYDyRed < 1.f) {
211 float xMin = mP[0] + mXDxPlusYDyRed * mD[0], yMin = mP[1] + mXDxPlusYDyRed * mD[1];
212 rmin2 = xMin * xMin + yMin * yMin;
General auxilliary methods.
Declarations for single cylindrical material layer class.
GPUd() float getDist(float deltaT) const
GPUd() bool isTooShort() const
GPUd() float getPhi(float t) const
Ray(const math_utils::Point3D< float > point0, const math_utils::Point3D< float > point1)
static constexpr float MinDistToConsider
float float float float float z1
GPUd() float getZ(float t) const
float float &cross2 const
static constexpr float InvalidT
GPUdDefault() ~Ray()=default
static constexpr float Tiny
GLuint GLfloat GLfloat GLfloat GLfloat y1
GLuint GLfloat GLfloat GLfloat x1
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
GLuint GLfloat GLfloat y0
GLdouble GLdouble GLdouble z
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...