21 inline float f_atan2f(
float y,
float x) {
return unsafe_atan2f<7>(
y,
x); }
23 inline float f_phi(
V v) {
24 return f_atan2f(v.y(), v.x());
35 return std::signbit(t) ? -
T(1.) :
T(1.);
38 inline T clamped_acos(
T x) {
40 return unsafe_acos<5>(
x);
44 inline T clamped_sqrt(
T t) {
52 :
p1(P1.x(), P1.
y()), theTolerance(tolerance) {
65 phi =
axis.
phi() - clamped_acos(cos);
68 float radius2 =
sqr(1.0
f / curvature);
69 float orthog = clamped_sqrt(radius2 -
delta2);
71 float rc2 = lcenter.
mag2();
72 float r2 =
sqr(radius);
74 phi = f_phi(lcenter) + sign * clamped_acos(cos);
82 return sin / clamped_sqrt(1 -
sqr(sin));
84 float radius2 =
sqr(1.0
f / curvature);
85 float orthog = clamped_sqrt(radius2 -
delta2);
88 float cos = (radius2 +
sqr(radius) - lcenter.
mag2()) * curvature / (2 * radius);
89 return -cos / clamped_sqrt(1.
f -
sqr(cos));
95 float phi2 =
proxim(
phi(curvature.first, radius), phi1);
105 transverseIP =
std::abs(transverseIP);
106 double transverseIP2 =
sqr(transverseIP);
108 double tip2 =
sqr(tip);
110 double lip2 =
sqr(lip);
113 double tmp1 = lip2 + tip2 - transverseIP2;
114 double tmp2 = 2. * (tip -
transverseIP) * (tip + transverseIP);
115 double tmp3 = 2. *
delta * origin;
116 double tmp4 = tmp1 +
delta2;
123 double u1 = 0,
u2 = 0;
124 constexpr
double SMALL = 1.0e-23;
125 constexpr
double LARGE = 1.0e23;
137 u2 = (
sqr(0.5 * tmp) - delta2 * tip2) / (tmp * tip);
141 double tmp6 = (tmp4 - tmp5) * (tmp4 + tmp5);
146 double tmp7 = tmp6 > 0 ? (transverseIP *
std::sqrt(tmp6) / tmp2) : 0.;
147 double tmp8 = tip * (tmp1 -
delta2) / tmp2;
155 if ((tmp3 < 0) == (tip < 0))
169 Scalar a = diff.
y() * axis2.
x() - diff.
x() * axis2.
y();
176 double invDist2 =
sqr(invDist);
178 return sgn(invDist) * curv;
186 double dist = 1.0 / invDist;
196 inline float arc(
float c,
float d) {
202 return std::min(1.
f, 2.
f * unsafe_asin<5>(c * d) / c);
226 constexpr
double maxAngle =
M_PI;
227 double halfAngle = (0.5 * maxAngle) * (z2 - z1) / (z3 - z1);
237 Scalar lip = circle->axis.y() * circle->p1.x() - circle->axis.x() * circle->p1.y();
247 Scalar cos2 = 0.5 *
curvature * (radius2 + b2 - circle->p1.mag2()) / b;
249 Scalar phi1 = clamped_acos(cos1);
250 Scalar phi2 = clamped_acos(cos2);
257 return z1 + ((u1 >= seg && u1 <
u2) ? u1 : u2) * dzdu;
260 #include <vdt/sincos.h>
268 Scalar lip = circle->axis.y() * circle->p1.x() - circle->axis.x() * circle->p1.y();
273 Scalar minR2 = (2. * circle->center - circle->p1).
mag2();
294 vdt::fast_sincosf(phi, s, c);
double transverseIP(const Vector2D &thirdPoint) const
const edm::EventSetup & c
Scalar invCenterOnAxis(const Vector2D &thirdPoint) const
constexpr float approx_asin_P< 7 >(float z)
Scalar zAtR(Scalar r) const
float angle(float curvature, float radius) const
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
constexpr T normalizedPhi(T phi)
Sin< T >::type sin(const T &t)
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
T curvature(T InversePt, const MagneticField &field)
constexpr T proxim(T b, T a)
Range curvature(double transverseIP) const
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t V
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
T mag2() const
The vector magnitude squared. Equivalent to vec.dot(vec)
Cos< T >::type cos(const T &t)
Abs< T >::type abs(const T &t)
ThirdHitPredictionFromCircle::Scalar Scalar
static const double SMALL
T y() const
Cartesian y coordinate.
ThirdHitPredictionFromCircle(const GlobalPoint &P1, const GlobalPoint &P2, float tolerance)
Range operator()(Range curvature, float radius) const
static double maxCurvature(const ThirdHitPredictionFromCircle *circle, double z1, double z2, double z3)
T mag2() const
The vector magnitude squared. Equivalent to vec.dot(vec)
PixelRecoRange< float > Range
Basic2DVector< Scalar > Vector2D
const ThirdHitPredictionFromCircle * circle
Scalar rAtZ(Scalar z) const
static constexpr float b2
Geom::Phi< T > phi() const
float phi(float curvature, float radius) const
T x() const
Cartesian x coordinate.