10#include <tracking/trackFindingCDC/geometry/Line2D.h>
11#include <tracking/trackFindingCDC/geometry/Vector2D.h>
13#include <tracking/trackFindingCDC/numerics/EForwardBackward.h>
14#include <tracking/trackFindingCDC/numerics/ERightLeft.h>
15#include <tracking/trackFindingCDC/numerics/ERotation.h>
16#include <tracking/trackFindingCDC/numerics/ESign.h>
28 namespace TrackFindingCDC {
178 void setN(
const double n0,
const double n1,
const double n2,
const double n3 = 0.0)
214 setN(0.0, 0.0, 0.0, 0.0);
255 if (normalization_squared > 0)
scaleN(1.0 / std::sqrt(normalization_squared));
349 return point * (2.0 *
n3()) +
n12();
433 std::pair<Belle2::TrackFindingCDC::Vector2D, Belle2::TrackFindingCDC::Vector2D>
519 return std::fabs(
impact());
603 return 2 * M_PI *
radius();
A two dimensional circle in its natural representation using center and radius as parameters.
Vector2D atArcLength(double arcLength) const
Calculates the point, which lies at the give perpendicular travel distance (counted from the perigee)
void setCenterAndRadius(const Vector2D ¢er, double absRadius, ERotation orientation=ERotation::c_CounterClockwise)
Setter for the circle center and radius.
double fastImpact() const
Approximate distance to the origin.
Vector2D tangential() const
Gives the tangential vector at the closest approach to the origin / at the perigee.
double fastDistance(const Vector2D &point) const
Approximate distance.
double absDistance(const Vector2D &point) const
Gives the proper absolute distance of the point to the circle line.
double m_n3
Memory for the fourth parameter.
double n1() const
Getter for the second circle parameter.
bool isLine() const
Indicates if the generalized circle is actually a line.
Vector2D perigee() const
Calculates the closest approach to the two dimensional origin.
Vector2D gradient(const Vector2D &point) const
Gradient of the distance field Gives the gradient of the approximated distance field for the given po...
GeneralizedCircle reversed() const
Returns a copy of the circle with opposite orientation.
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...
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.
void setPerigeeParameters(double curvature, const Vector2D &tangential, double impact)
Setter for the perigee parameters.
double minimalCylindricalR() const
Gives the minimal cylindrical radius the circle reaches (unsigned)
void reverse()
Flips the orientation of the circle in place.
void setN0(const double n0)
Setter for first circle parameter.
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
Normal vector to the circle near the given position.
Vector2D chooseNextForwardOf(const Vector2D &start, const Vector2D &end1, const Vector2D &end2) const
Returns the end point which is first reached if one follows the forward direction of the circle start...
const Vector2D & n12() const
Getter for the second and third circle parameter which natuarally from a vector.
void setN(const Line2D &n012)
Setter for all four circle parameters from another circle.
double distance(const Vector2D &point) const
Gives the proper distance of the point to the circle line retaining the sign of the fast distance.
void setN2(const double n2)
Setter for third circle parameter.
Vector2D apogee() const
Calculates the point on the circle that is furthest away from the origin.
double omega() const
Gives the omega parameter as used by the framework helix.
void setN3(const double n3)
Setter for fourth circle parameter.
void setN1(const double n1)
Setter for second circle parameter.
double m_n0
Memory for the first parameter.
void passiveMoveBy(const Vector2D &by)
Moves the coordinate system by the given vector.
bool isValid() const
Indicates if the combination of the circle parameters makes up a valid circle.
bool isLeft(const Vector2D &rhs) const
Return if the point given is left of the line.
void setN(const GeneralizedCircle &n0123)
Setter for all four circle parameters from another circle.
bool isRight(const Vector2D &rhs) const
Return if the point given is right of the line.
EForwardBackward isForwardOrBackwardOf(const Vector2D &from, const Vector2D &to) const
Calculates if the to vector is closer to the from vector following the along orientation of the circl...
double impact() const
Gives the signed distance of the origin to the circle.
Vector2D center() const
Gives the center of the circle. If it was a line both components will be infinity.
void setN12(const double n1, const double n2)
Setter for second and third circle parameter.
double normalizationSquared() const
Calculates the generalized circle specific squared norm.
double maximalCylindricalR() const
Gives the maximal cylindrical radius the circle reaches.
static GeneralizedCircle fromPerigeeParameters(double curvature, const Vector2D &tangential, double impact)
Constructor of a generalized circle from perigee parameters.
GeneralizedCircle()
Default constructor for ROOT compatibility.
double n3() const
Getter for the fourth circle parameter.
void invalidate()
Sets all circle parameters to zero.
void conformalTransform()
Transforms the generalized circle to conformal space inplace Applies the conformal map in the self-in...
static GeneralizedCircle fromCenterAndRadius(const Vector2D ¢er, double absRadius, ERotation orientation=ERotation::c_CounterClockwise)
Constructor from center, radius and a optional orientation.
void scaleN(const double factor)
Scales the circle parameters by a common factor.
double perimeter() const
Gives the perimeter of the circle.
double n2() const
Getter for the third circle parameter.
bool isCircle() const
Indicates if the generalized circle is actually a circle.
double arcLengthTo(const Vector2D &to) const
Calculates the arc length between the perigee and the given point.
ERightLeft isRightOrLeft(const Vector2D &point) const
Indicates if the point is on the right or left side of the circle.
void setPerigeeParameters(const double curvature, const double tangentialPhi, const double impact)
Setter for the perigee parameters.
void setN12(const Vector2D &n12)
Setter for second and third circle parameter.
double curvature() const
Gives the signed curvature of the generalized circle.
double d0() const
Getter for the absolute distance to the z axes at the support point.
double absRadius() const
Gives the signed radius of the circle. If it was a line this will be infinity.
Vector2D closest(const Vector2D &point) const
Closest approach on the circle to the point.
double arcLengthFactor(const double directDistance) const
Helper function the calculate the factor between the length of a secant line and the length on the ar...
std::pair< Belle2::TrackFindingCDC::Vector2D, Belle2::TrackFindingCDC::Vector2D > atCylindricalR(double cylindricalR) const
Calculates the two points with the given cylindrical radius on the generalised circle.
void normalize()
Normalizes the circle parameters.
double tangentialPhi() const
Gives to azimuth angle phi of the direction of flight at the perigee.
Vector2D m_n12
Memory for the second and third parameter.
double fastDistance(const double distance) const
Helper function to translate the proper distance to the linearized distance measure of the generalize...
void setN(const double n0, const Vector2D &n12, const double n3=0.0)
Setter for all four circle parameters.
double n0() const
Getter for the first circle parameter.
void setN(const double n0, const double n1, const double n2, const double n3=0.0)
Setter for all four circle parameters.
ERotation orientation() const
Gives the orientation of the circle.
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...
std::pair< Vector2D, Vector2D > intersections(const GeneralizedCircle &generalizedCircle) const
Calculates the two points common to both circles.
GeneralizedCircle conformalTransformed() const
Returns a copy of the circle in conformal space.
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.
A two dimensional vector which is equipped with functions for correct handling of orientation relate...
double dot(const Vector2D &rhs) const
Calculates the two dimensional dot product.
void setXY(const double x, const double y)
Setter for both coordinate.
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 )
double normSquared() const
Calculates .
bool isNull() const
Checks if the vector is the null vector.
Vector2D orthogonal() const
Orthogonal vector to the counterclockwise direction.
Vector2D divided(const double denominator) const
Returns a copy where all coordinates got divided by a common denominator.
void setY(const double y)
Setter for the y coordinate.
double y() const
Getter for the y coordinate.
Vector2D unit() const
Returns a unit vector colaligned with this.
void setX(const double x)
Setter for the x coordinate.
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.