15 template <
class T>
inline T
sqr( T
t) {
return t*
t;}
27 : theTolerance(torlerance)
29 init(P1,P2,ip,fabs(curv));
45 Range ipRange(-ip, ip);
53 Range ipRangePlus =
Range(ipIntyPlus, ipCurvPlus); ipRangePlus.
sort();
54 Range ipRangeMinus =
Range(-ipIntyPlus, ipCurvMinus); ipRangeMinus.
sort();
62 double r,
int c,
double ip)
const
72 double ipOverR = ip*overR;
74 double delta = 1-4*(0.5*B+ipOverR)*(-B+A*r-ipOverR);
75 double sqrtdelta = (delta > 0) ?
std::sqrt(delta) : 0.;
76 double alpha = (c>0)? (-c+sqrtdelta)/(B+2*ipOverR) : (-c-sqrtdelta)/(B+2*ipOverR);
78 double v = alpha*overR;
79 double d2 = overR*overR - v*
v;
88 Range predRPhi(1.,-1.);
94 double phi1 = pred_tmp1.
unmap().
phi();
95 while ( phi1 >=
M_PI) phi1 -= 2*
M_PI;
96 while ( phi1 < -
M_PI) phi1 += 2*
M_PI;
97 double phi2 = phi1+radius*(pred_tmp2.v()-pred_tmp1.
v());
116 Range predRPhi(1.,-1.);
118 double invr2 = 1/radius/
radius;
119 double u =
sqrt(invr2);
124 for (
int i=0;
i < nIter; ++
i) {
126 double d2 = invr2-
sqr(v);
127 u = (d2 > 0) ?
sqrt(d2) : 0.;
130 double phi1 = pred_tmp1.
unmap().
phi();
131 while ( phi1 >=
M_PI) phi1 -= 2*
M_PI;
132 while ( phi1 < -
M_PI) phi1 += 2*
M_PI;
137 for (
int i=0;
i < nIter; ++
i) {
139 double d2 = invr2-
sqr(v);
140 u = (d2 > 0) ?
sqrt(d2) : 0.;
143 double phi2 = pred_tmp2.
unmap().
phi();
144 while ( phi2-phi1 >=
M_PI) phi2 -= 2*
M_PI;
145 while ( phi2-phi1 < -
M_PI) phi2 += 2*
M_PI;
167 double u1u2 =
p1.
u()*
p2.
u();
168 double du =
p2.
u() -
p1.
u();
171 double inInf = -charge*pv/(du*u1u2);
172 return inInf-curvature/(2.*u1u2);
Range rangeRPhiSlow(double radius, int charge, int nIter=5) const
PixelRecoRange< float > Range
Basic2DVector< double > Point2D
Basic3DVector< double > Point3D
MappedPoint< double > PointUV
void init(const GlobalPoint &P1, const GlobalPoint &P2, double ip, double curv)
double predV(double u, double ip, int charge) const
TkRotation< double > Rotation
T curvature(T InversePt, const edm::EventSetup &iSetup)
double coeffB(double impactParameter, int charge) const
PixelRecoRange< double > Ranged
Vector3DBase unit() const
ThirdHitPredictionFromInvParabola(const GlobalPoint &P1, const GlobalPoint &P2, double ip, double curv, double tolerance)
Range rangeRPhi(double radius, int charge) const
double coeffA(double impactParameter, int charge) const
PixelRecoRange< T > intersection(const PixelRecoRange< T > &r) const
Square< F >::type sqr(const F &f)
Geom::Phi< T > phi() const
Basic2DVector< T > unmap() const
PointUV findPointAtCurve(double radius, int charge, double ip) const
Global3DVector GlobalVector
double ipFromCurvature(double curvature, int charge) const