10#include <tracking/trackingUtilities/geometry/PerigeeCircle.h>
11#include <tracking/trackingUtilities/geometry/SZLine.h>
13#include <tracking/trackingUtilities/geometry/HelixParameters.h>
14#include <tracking/trackingUtilities/geometry/VectorUtil.h>
16#include <Math/Vector3D.h>
17#include <Math/Vector2D.h>
27 namespace TrackingUtilities {
48 explicit Helix(
const HelixParameters& parameters)
120 ROOT::Math::XYZVector
closest(
const ROOT::Math::XYZVector& point,
bool firstPeriod =
true)
const
127 ROOT::Math::XYZVector
closestXY(
const ROOT::Math::XYVector& pointXY)
const
134 double distance(
const ROOT::Math::XYZVector& point)
const
136 return VectorUtil::Distance(point,
closest(point));
154 m_circleXY.passiveMoveBy(VectorUtil::getXYVector(by));
155 ROOT::Math::XYVector bySZ(byS, by.z());
169 double arcLength2D = nPeriods * fabs(
perimeterXY());
170 m_szLine.passiveMoveBy(ROOT::Math::XYVector(arcLength2D, 0.0));
179 return ROOT::Math::XYZVector(tmp.X(), tmp.Y(),
szLine().map(s));
183 ROOT::Math::XYZVector
atZ(
double z)
const
185 const auto& tmp =
xyAtZ(z);
186 return ROOT::Math::XYZVector(tmp.X(), tmp.Y(), z);
190 ROOT::Math::XYVector
xyAtZ(
double z)
const
192 return ROOT::Math::XYVector(
circleXY().atArcLength(
szLine().inverseMap(z)));
241 return ROOT::Math::XYZVector(tmp.X(), tmp.Y(),
z0());
297 return VectorUtil::unit(ROOT::Math::XYZVector(tmp.X(), tmp.Y(),
tanLambda()));
315 HelixParameters result;
318 result(c_Phi0) =
phi0();
348 std::ostream& operator<<(std::ostream& output,
const Helix& helix);
Extension of the generalized circle also caching the perigee coordinates.
ROOT::Math::XYZVector perigee() const
Getter for the perigee point of the helix.
PerigeeCircle m_circleXY
Memory of the projection of the helix in xy space.
Helix(const HelixParameters ¶meters)
Constructor taking all stored parameters for internal use.
ROOT::Math::XYZVector closestXY(const ROOT::Math::XYVector &pointXY) const
Calculates the point on the helix with the smallest perpendicular (xy) distance.
Helix(const PerigeeCircle &circleXY, const SZLine &szLine)
Constructor combining a two dimensional circle with the linear augment in the sz space.
ROOT::Math::XYZVector closest(const ROOT::Math::XYZVector &point, bool firstPeriod=true) const
Calculates the point on the helix with the smallest total distance.
double z0() const
Getter for z coordinate at the perigee point of the helix.
double distance(const ROOT::Math::XYZVector &point) const
Calculates the distance of the point to the point of closest approach on the helix.
double phi0() const
Getter for the azimuth angle of the direction of flight at the perigee.
double cotTheta() const
Getter for the proportinality factor from arc length in xy space to z.
bool isInvalid() const
Indicates if the stored parameter combination designates a valid helix.
double minimalCylindricalR() const
Gives the minimal cylindrical radius the circle reaches (unsigned)
void reverse()
Flips the travel direction of the helix in place, pivot point is unchanged.
double perimeterXY() const
Getter for the perimeter of the circle in the xy projection.
ROOT::Math::XYVector perigeeXY() const
Getter for the perigee point in the xy projection.
ROOT::Math::XYZVector atZ(double z) const
Calculates the point, which lies at the given z coordinate.
double impactXY() const
Getter for the signed distance to the z axes at the perigee point.
ROOT::Math::XYZVector tangential() const
Getter for the unit three dimensional tangential vector at the perigee point of the helix.
double omega() const
Getter for the omega parameter of the common helix parameterisation.
Helix reversed() const
Returns a copy of the helix with flips the travel direction, pivot point is the same.
double shiftPeriod(int nPeriods)
Adjust the arclength measure to start n periods later.
double tanLambda() const
Getter for the proportinality factor from arc length in xy space to z.
double maximalCylindricalR() const
Gives the maximal cylindrical radius the circle reaches.
double curvatureXY() const
Getter for the signed curvature in the xy projection.
double arcLength2DToCylindricalR(double cylindricalR) const
Calculates the two dimensional arc length that first reaches a cylindrical radius on the helix Return...
ROOT::Math::XYVector xyAtZ(double z) const
Calculates the point, which lies at the given z coordinate.
HelixParameters helixParameters() const
Getter for the five helix parameters in the order defined by EHelixParameter.h.
double zPeriod() const
Getter for the distance in z at which the two points on the helix coincide in the xy projection.
void invalidate()
Sets all circle parameters to zero.
double radiusXY() const
Getter for the radius of the circle in the xy projection.
double arcLength2DToXY(const ROOT::Math::XYVector &point) const
Calculates the two dimensional arc length that is closest to two dimensional point in the xy projecti...
double passiveMoveBy(const ROOT::Math::XYZVector &by)
Moves the coordinates system by the given vector.
HelixJacobian passiveMoveByJacobian(const ROOT::Math::XYZVector &by) const
Computes the Jacobi matrix for a move of the coordinate system by the given vector.
double arcLength2DPeriod() const
Getter for the arc length of one trip around the helix.
Helix(double curvature, const ROOT::Math::XYVector &phi0Vec, double impact, double tanLambda, double z0)
Constructor from all helix parameter, phi given as a unit vector.
ROOT::Math::XYVector centerXY() const
Getter for the central point of the helix.
double d0() const
Getter for the signed distance to the z axes at the perigee point.
double arcLength2DToClosest(const ROOT::Math::XYZVector &point, bool firstPeriod=true) const
Calculates the perpendicular travel distance at which the helix has the closest approach to the given...
SZLine m_szLine
Memory of the of the linear relation between perpendicular travel distance and the z position.
const PerigeeCircle & circleXY() const
Getter for the projection into xy space.
double distanceXY(const ROOT::Math::XYVector &point) const
Calculates the distance of the line parallel to the z axes through the given point.
Helix()
Default constructor for ROOT compatibility.
const ROOT::Math::XYVector & phi0Vec() const
Getter for the direction vector in the xy projection at the perigee of the helix.
Helix(double curvature, double phi0, double impact, double tanLambda, double z0)
Constructor from all helix parameter.
ROOT::Math::XYZVector atArcLength2D(double s) const
Calculates the point, which lies at the give perpendicular travel distance (counted from the perigee)
const SZLine & szLine() const
Getter for the projection into xy space.
Extension of the generalized circle also caching the perigee coordinates.
double arcLengthTo(const ROOT::Math::XYVector &point) const
Calculates the arc length between the perigee and the given point.
double phi0() const
Getter for the azimuth angle of the direction of flight at the perigee.
bool isInvalid() const
Indicates if all circle parameters are zero.
double minimalCylindricalR() const
Gives the minimal cylindrical radius the circle reaches (unsigned)
double radius() const
Gives the signed radius of the circle. If it was a line this will be infinity.
double omega() const
Getter for omega parameter of the common Belle2::Helix which is the wrong sign curvature.
double impact() const
Getter for the signed distance of the origin to the circle.
double maximalCylindricalR() const
Gives the maximal cylindrical radius the circle reaches.
ROOT::Math::XYVector perigee() const
Getter for the perigee point.
double perimeter() const
Gives the signed perimeter of the circle.
ROOT::Math::XYVector atArcLength(double arcLength) const
Calculates the point, which lies at the give perpendicular travel distance (counted from the perigee)
double curvature() const
Getter for the signed curvature.
double d0() const
Getter for d0 parameter of the common Belle2::Helix representation.
ROOT::Math::XYVector center() const
Getter for the center of the circle. If it was a line both components will be infinity.
const ROOT::Math::XYVector & phi0Vec() const
Getter for the unit vector of the direction of flight at the perigee.
double arcLengthPeriod() const
Getter for the arc length for a full round of the circle.
double arcLengthToCylindricalR(double cylindricalR) const
Calculates the two dimensional arc length till the cylindrical radius is reached If the radius can no...
bool isInvalid() const
Indicates if the line parameters do not represent a valid line.
Namespace to hide the contained enum constants.
Abstract base class for different kinds of events.
Utility struct for functions and types related to the helix parameters.