22 float f_atan2f(
float y,
float x) {
return unsafe_atan2f<7>(
y,
x); }
23 template<
typename V>
inline float f_phi(V
v) {
return f_atan2f(v.y(),v.x());}
28 template<
class T>
inline T sqr(
T t) {
return t *
t; }
29 template<
class T>
inline T sgn(
T t) {
return std::signbit(t) ? -
T(1.) :
T(1.); }
30 template<
class T>
inline T clamped_acos(
T x) {
32 return unsafe_acos<5>(
x);
40 :
p1(P1.x(), P1.
y()), theTolerance(tolerance)
55 phi =
axis.
phi() - clamped_acos(cos);
58 float radius2 =
sqr(1.0
f / curvature);
59 float orthog = clamped_sqrt(radius2 -
delta2);
61 float rc2 = lcenter.
mag2();
62 float r2 =
sqr(radius);
64 phi = f_phi(lcenter) + sign * clamped_acos(cos);
73 return sin / clamped_sqrt(1 -
sqr(sin));
75 float radius2 =
sqr(1.0
f / curvature);
76 float orthog = clamped_sqrt(radius2 -
delta2);
79 float cos = (radius2 +
sqr(radius) - lcenter.
mag2()) *
80 curvature / (2 * radius);
81 return - cos / clamped_sqrt(1.
f -
sqr(cos));
89 float phi2 =
proxim(
phi(curvature.first, radius),phi1);
100 transverseIP =
std::abs(transverseIP);
101 double transverseIP2 =
sqr(transverseIP);
103 double tip2 =
sqr(tip);
105 double lip2 =
sqr(lip);
108 double tmp1 = lip2 + tip2 - transverseIP2;
109 double tmp2 = 2. * (tip -
transverseIP) * (tip + transverseIP);
110 double tmp3 = 2. *
delta * origin;
111 double tmp4 = tmp1 +
delta2;
132 u2 = (
sqr(0.5 * tmp) - delta2 * tip2) / (tmp * tip);
136 double tmp6 = (tmp4 - tmp5) * (tmp4 + tmp5);
141 double tmp7 = tmp6 > 0 ? (transverseIP *
std::sqrt(tmp6) / tmp2) : 0.;
142 double tmp8 = tip * (tmp1 -
delta2) / tmp2;
150 if ((tmp3 < 0) == (tip < 0))
167 Scalar a = diff.
y() * axis2.
x() - diff.
x() * axis2.
y();
175 double invDist2 =
sqr(invDist);
177 return sgn(invDist) * curv;
186 double dist = 1.0 / invDist;
198 float arc(
float c,
float d) {
202 if (z>0.5
f)
return std::min(1.
f,2.
f*unsafe_asin<5>(c*d)/c);
227 double halfAngle = (0.5 * maxAngle) * (z2 - z1) / (z3 - z1);
239 Scalar lip = circle->axis.y() * circle->p1.x() -
240 circle->axis.x() * circle->p1.y();
250 Scalar cos2 = 0.5 *
curvature * (radius2 + b2 - circle->p1.mag2()) / b;
252 Scalar phi1 = clamped_acos(cos1);
253 Scalar phi2 = clamped_acos(cos2);
260 return z1 + ((u1 >= seg && u1 <
u2)? u1 : u2) * dzdu;
264 #include<vdt/sincos.h>
273 Scalar lip = circle->axis.y() * circle->p1.x() -
274 circle->axis.x() * circle->p1.y();
279 Scalar minR2 = (2. * circle->center - circle->p1).
mag2();
300 vdt::fast_sincosf(phi,s,c);
double transverseIP(const Vector2D &thirdPoint) const
float approx_asin_P< 7 >(float z)
Scalar invCenterOnAxis(const Vector2D &thirdPoint) const
Scalar zAtR(Scalar r) const
float angle(float curvature, float radius) const
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Sin< T >::type sin(const T &t)
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Range curvature(double transverseIP) const
T x() const
Cartesian x coordinate.
T curvature(T InversePt, const edm::EventSetup &iSetup)
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)
std::vector< std::vector< double > > tmp
PixelRecoRange< float > Range
Square< F >::type sqr(const F &f)
Basic2DVector< Scalar > Vector2D
const ThirdHitPredictionFromCircle * circle
Scalar rAtZ(Scalar z) const
Geom::Phi< T > phi() const
float phi(float curvature, float radius) const
T x() const
Cartesian x coordinate.