14 theStartingPos( pos), theStartingDir(dir),
15 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;
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 (
std::abs(sinAlpha)>1.) sinAlpha = std::copysign(1.,sinAlpha);
114 return ResultType(
true,
theS);
116 else return ResultType(
false,
theS=0.);
186 double sinPhi, cosPhi;
189 if (s < 0) tmp = -
tmp;
191 sinPhi = 1.-(tmp*
tmp);
192 if ( sinPhi<0 ) sinPhi = 0.;
193 sinPhi = 2.*tmp*
sqrt(sinPhi);
194 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
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
DirectionType theStartingDir
bool chooseSolution(const Vector2D &d1, const Vector2D &d2)
T z() const
Cartesian z coordinate.
Cos< T >::type cos(const T &t)
Abs< T >::type abs(const T &t)
static const std::string B
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.