14 theStartingPos( pos), theStartingDir(dir),
15 theRho(rho), thePropDir(propDir) {
init();}
21 theStartingPos( pos.basicVector()), theStartingDir(dir.basicVector()),
22 theRho(rho), thePropDir(propDir) {
init();}
32 const double sraightLineCutoff = 1.e-7;
33 if (fabs(
theRho) < sraightLineCutoff &&
47 std::pair<bool,double>
50 typedef std::pair<bool,double> ResultType;
73 if (fabs(nx) > fabs(ny)) {
76 dfac = distToPlane/nx;
77 B = distCy - nfac*distCx;
78 C = (2.*distCx + dfac)*dfac;
83 dfac = distToPlane/ny;
84 B = distCx - nfac*distCy;
85 C = (2.*distCy + dfac)*dfac;
87 B -= nfac*dfac; B *= 2;
90 double dx1, dx2, dy1, dy2;
92 if (!equation.
hasSolution)
return ResultType(
false, 0.);
97 dy1 = dfac - nfac*dx1;
98 dy2 = dfac - nfac*dx2;
101 dy1 = equation.
first;
103 dx1 = dfac - nfac*dy1;
104 dx2 = dfac - nfac*dy2;
112 if ( sinAlpha>(1.-10*DBL_EPSILON) ) sinAlpha = 1.-10*DBL_EPSILON;
113 else if ( sinAlpha<-(1.-10*DBL_EPSILON) ) sinAlpha = -(1.-10*DBL_EPSILON);
115 return ResultType(
true,
theS);
117 else return ResultType(
false, 0.);
187 double sinPhi, cosPhi;
190 if (s < 0) tmp = -
tmp;
192 sinPhi = 1.-(tmp*
tmp);
193 if ( sinPhi<0 ) sinPhi = 0.;
194 sinPhi = 2.*tmp*
sqrt(sinPhi);
195 cosPhi = 1.-2.*(tmp*
tmp);
virtual PositionType position(double s) const
T y() const
Cartesian y coordinate.
T x() const
Cartesian x coordinate.
PositionType theStartingPos
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
GlobalVector normalVector() const
Sin< T >::type sin(const T &t)
Basic3DVector unit() const
Global3DPoint GlobalPoint
float localZ(const GlobalPoint &gp) const
Fast access to distance from plane for a point.
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
DirectionType theStartingDir
bool chooseSolution(const Vector2D &d1, const Vector2D &d2)
Point3DBase< Scalar, GlobalTag > PositionType
T z() const
Cartesian z coordinate.
Cos< T >::type cos(const T &t)
T perp() const
Magnitude of transverse component.
Basic3DVector< float > PositionType
the helix is passed to the constructor and does not appear in the interface
Basic3DVector< float > DirectionType
T y() const
Cartesian y coordinate.
std::pair< bool, double > pathLength(const Plane &plane) const
virtual std::pair< bool, double > pathLength(const Plane &)
T mag2() const
The vector magnitude squared. Equivalent to vec.dot(vec)
Basic2DVector< double > Vector2D
std::vector< std::vector< double > > tmp
PropagationDirection thePropDir
bool samesign(T rh, T lh)
HelixBarrelPlaneCrossingByCircle(const PositionType &pos, const DirectionType &dir, double rho, PropagationDirection propDir=alongMomentum)
virtual DirectionType direction(double s) const
T x() const
Cartesian x coordinate.