14 : theStartingPos(
pos), theStartingDir(
dir), theRho(
rho), thePropDir(propDir) {
22 : theStartingPos(
pos.basicVector()), theStartingDir(
dir.basicVector()), theRho(
rho), thePropDir(propDir) {
33 const double sraightLineCutoff = 1.e-7;
48 typedef std::pair<bool, double> ResultType;
69 if (fabs(nx) > fabs(ny)) {
72 dfac = distToPlane / nx;
73 B = distCy - nfac * distCx;
74 C = (2. * distCx + dfac) * dfac;
78 dfac = distToPlane / ny;
79 B = distCx - nfac * distCy;
80 C = (2. * distCy + dfac) * dfac;
86 double dx1, dx2, dy1, dy2;
89 return ResultType(
false,
theS = 0.);
94 dy1 = dfac - nfac * dx1;
95 dy2 = dfac - nfac * dx2;
99 dx1 = dfac - nfac * dy1;
100 dx2 = dfac - nfac * dy2;
109 sinAlpha = std::copysign(1., sinAlpha);
111 return ResultType(
true,
theS);
113 return ResultType(
false,
theS = 0.);
123 if (
d1.mag2() < d2.
mag2()) {
PositionType theStartingPos
T x() const
Cartesian x coordinate.
T mag2() const
The vector magnitude squared. Equivalent to vec.dot(vec)
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Sin< T >::type sin(const T &t)
Global3DPoint GlobalPoint
T y() const
Cartesian y coordinate.
T y() const
Cartesian y coordinate.
DirectionType theStartingDir
bool chooseSolution(const Vector2D &d1, const Vector2D &d2)
DirectionType direction(double s) const override
Cos< T >::type cos(const T &t)
Abs< T >::type abs(const T &t)
Basic3DVector< float > PositionType
the helix is passed to the constructor and does not appear in the interface
Basic3DVector< float > DirectionType
std::pair< bool, double > pathLength(const Plane &plane) const
T perp() const
Magnitude of transverse component.
float localZ(const GlobalPoint &gp) const
T z() const
Cartesian z coordinate.
std::pair< bool, double > pathLength(const Plane &) override
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Basic2DVector< double > Vector2D
PropagationDirection thePropDir
bool samesign(T rh, T lh)
GlobalVector normalVector() const
Basic3DVector unit() const
HelixBarrelPlaneCrossingByCircle(const PositionType &pos, const DirectionType &dir, double rho, PropagationDirection propDir=alongMomentum)
static constexpr float d1
T x() const
Cartesian x coordinate.
PositionType position(double s) const override