10#include <tracking/trackFindingCDC/geometry/GeneralizedCircle.h>
11#include <tracking/trackFindingCDC/geometry/Line2D.h>
13#include <tracking/trackFindingCDC/geometry/PerigeeParameters.h>
15#include <tracking/trackFindingCDC/geometry/Vector2D.h>
17#include <tracking/trackFindingCDC/numerics/EForwardBackward.h>
18#include <tracking/trackFindingCDC/numerics/ERightLeft.h>
19#include <tracking/trackFindingCDC/numerics/ERotation.h>
20#include <tracking/trackFindingCDC/numerics/ESign.h>
32 namespace TrackFindingCDC {
162 std::pair<Vector2D, Vector2D>
atCylindricalR(
double cylindricalR)
const;
330 return 2 * M_PI *
radius();
442 using namespace NPerigeeParameterIndices;
445 result(c_Phi0) =
phi0();
517 std::ostream& operator<<(std::ostream& output,
const PerigeeCircle& circle);
A two dimensional circle in its natural representation using center and radius as parameters.
const Vector2D & n12() const
Getter for the second and third circle parameter which natuarally from a vector.
double n3() const
Getter for the fourth circle parameter.
double n0() const
Getter for the first circle parameter.
A two dimensional normal line.
const Vector2D & n12() const
Getter for the unit normal vector to the line.
double n0() const
Getter for the first line parameter.
Extension of the generalized circle also caching the perigee coordinates.
Vector2D atArcLength(double arcLength) const
Calculates the point, which lies at the give perpendicular travel distance (counted from the perigee)
PerigeeCircle reversed() const
Returns a copy of the circle with opposite orientation.
void setCenterAndRadius(const Vector2D ¢er, double absRadius, ERotation orientation=ERotation::c_CounterClockwise)
Setter for the circle center and radius.
double fastImpact() const
Getter for the linearised distance to the origin.
double fastDistance(const Vector2D &point) const
Getter for the linearised distance measure to a point.
double m_phi0
Memory for the azimuth angle of the direction of flight at the perigee.
double n1() const
Getter for the generalised circle parameters n1.
bool isLine() const
Indicates if the perigee parameters represent a line.
Vector2D perigee() const
Getter for the perigee point.
Vector2D gradient(const Vector2D &point) const
Gradient of the distance field, hence indicates the direction of increasing distance.
Vector2D atCylindricalRForwardOf(const Vector2D &startPoint, double cylindricalR) const
Approach on the circle with the given cylindrical radius that lies in the forward direction of a star...
double phi0() const
Getter for the azimuth angle of the direction of flight at the perigee.
Vector2D tangential(const Vector2D &point) const
Tangential vector to the circle near the given position.
double arcLengthBetween(const Vector2D &from, const Vector2D &to) const
Calculates the arc length between two points of closest approach on the circle.
bool isInvalid() const
Indicates if all circle parameters are zero.
double minimalCylindricalR() const
Gives the minimal cylindrical radius the circle reaches (unsigned)
void reverse()
Flips the orientation of the circle in place.
EForwardBackward isForwardOrBackward(const Vector2D &to) const
Indicates whether to given point lies in the forward direction from the perigee.
double radius() const
Gives the signed radius of the circle. If it was a line this will be infinity.
Vector2D normal(const Vector2D &point) const
Unit normal vector from the circle to the given point.
void setCurvature(double curvature)
Setter for signed curvature.
Vector2D chooseNextForwardOf(const Vector2D &start, const Vector2D &end1, const Vector2D &end2) const
Returns the one of two end point which is first reached from the given start if one strictly follows ...
void setN(const Line2D &n012)
Setter for generalised circle parameters from a normal line.
double distance(const Vector2D &point) const
Getter for the proper signed distance of the point to the circle.
Vector2D apogee() const
Getter for the apogee of the circle. If it was a line both components will be infinity.
double omega() const
Getter for omega parameter of the common Belle2::Helix which is the wrong sign curvature.
void passiveMoveBy(const Vector2D &by)
Moves the coordinates system by the given vector. Updates perigee parameters in place.
bool isValid() const
Indicates if the combination of the circle parameters makes up a valid circle.
void setN(const GeneralizedCircle &n0123)
Setter for four generalised circle parameters.
void setImpact(double impact)
Sets the impact parameter of the circle.
void setPhi0(const Vector2D &phi0Vec)
Sets the unit direction of flight at the perigee.
EForwardBackward isForwardOrBackwardOf(const Vector2D &from, const Vector2D &to) const
Indicates whether to given point lies in the forward direction from the perigee.
Vector2D n12() const
Getter for the generalised circle parameters n1 and n2.
double impact() const
Getter for the signed distance of the origin to the circle.
Vector2D center() const
Getter for the center of the circle. If it was a line both components will be infinity.
double maximalCylindricalR() const
Gives the maximal cylindrical radius the circle reaches.
static PerigeeCircle fromCenterAndRadius(const Vector2D ¢er, double absRadius, ERotation orientation=ERotation::c_CounterClockwise)
Constructor from center, radius and a optional orientation.
double arcLengthAtDeltaLength(double delta, double dr) const
Helper method to calculate the arc length to a point at distance delta to the perigee and dr to circl...
const Vector2D & phi0Vec() const
Getter for the unit vector of the direction of flight at the perigee.
double n3() const
Getter for the generalised circle parameter n3.
void invalidate()
Sets all circle parameters to zero.
PerigeeParameters perigeeParameters() const
Getter for the three perigee parameters in the order defined by EPerigeeParameter....
void conformalTransform()
Transforms the generalized circle to conformal space inplace.
double m_impact
Memory for the signed impact parameter.
double perimeter() const
Gives the signed perimeter of the circle.
double n2() const
Getter for the generalised circle parameters n2.
bool isCircle() const
Indicates if the perigee parameters represent a closed circle.
ERightLeft isRightOrLeft(const Vector2D &point) const
Indicates if the point is on the right or left side of the circle.
PerigeeCircle()
Default constructor for ROOT compatibility.
Vector2D m_phi0Vec
Cached unit direction of flight at the perigee.
double m_curvature
Memory for the signed curvature.
double curvature() const
Getter for the signed curvature.
void setN(double n0, double n1, double n2, double n3=0.0)
Setter for four generalised circle parameters.
double d0() const
Getter for d0 parameter of the common Belle2::Helix representation.
double absRadius() const
Gives the signed radius of the circle. If it was a line this will be infinity.
double fastDistance(double distance) const
Helper function to translate the proper distance to the linearized distance measure of the circle ret...
Vector2D closest(const Vector2D &point) const
Calculates the point of closest approach on the circle to the given point.
double arcLengthAtSecantLength(double secantLength) const
Helper method to calculate the arc length between to points on the circle from a given direct secant ...
PerigeeCircle conformalTransformed() const
Returns a copy of the circle in conformal space.
const Vector2D & tangential() const
Getter for the tangtial vector at the perigee.
PerigeeJacobian passiveMoveByJacobian(const Vector2D &by) const
Computes the Jacobi matrix for a move of the coordinate system by the given vector.
std::pair< Vector2D, Vector2D > atCylindricalR(double cylindricalR) const
Calculates the two points with the given cylindrical radius on the generalised circle.
void setPhi0(double phi0)
Sets the azimuth angle of the direction of flight at the perigee.
void setPerigeeParameters(double curvature, double phi0, double impact)
Setter for the perigee parameters.
void setPerigeeParameters(double curvature, const Vector2D &phi0Vec, double impact)
Setter for the perigee parameters.
double n0() const
Getter for the generalised circle parameter n0.
static PerigeeCircle fromN(double n0, double n1, double n2, double n3=0)
Constructor with the four parameters of the generalized circle.
ERotation orientation() const
Getter for the orientation of the circle.
double arcLengthPeriod() const
Getter for the arc length for a full round of the circle.
double arcLengthTo(const Vector2D &point) const
Calculates the arc length between the perigee and the given point.
double arcLengthToCylindricalR(double cylindricalR) const
Calculates the two dimensional arc length till the cylindrical radius is reached If the radius can no...
A matrix implementation to be used as an interface typ through out the track finder.
A two dimensional vector which is equipped with functions for correct handling of orientation relate...
EForwardBackward isForwardOrBackwardOf(const Vector2D &rhs) const
Indicates if the given vector is more coaligned or reverse if you looked in the direction of this vec...
double x() const
Getter for the x coordinate.
double phi() const
Gives the azimuth angle being the angle to the x axes ( range -M_PI to M_PI )
Vector2D orthogonal() const
Orthogonal vector to the counterclockwise direction.
double y() const
Getter for the y coordinate.
Vector2D unit() const
Returns a unit vector colaligned with this.
static Vector2D Phi(const double phi)
Constructs a unit vector with azimuth angle equal to phi.
EForwardBackward
Enumeration to represent the distinct possibilities of the right left passage information.
ERightLeft
Enumeration to represent the distinct possibilities of the right left passage.
ERotation
Enumeration to represent the distinct possibilities of the right left passage information.
Abstract base class for different kinds of events.