 |
Belle II Software
release-05-02-19
|
12 #include <tracking/trackFindingCDC/geometry/Line2D.h>
13 #include <tracking/trackFindingCDC/geometry/Vector2D.h>
15 #include <tracking/trackFindingCDC/numerics/EForwardBackward.h>
16 #include <tracking/trackFindingCDC/numerics/ERightLeft.h>
17 #include <tracking/trackFindingCDC/numerics/ERotation.h>
18 #include <tracking/trackFindingCDC/numerics/ESign.h>
30 namespace TrackFindingCDC {
53 class GeneralizedCircle {
180 void setN(
const double n0,
const double n1,
const double n2,
const double n3 = 0.0)
193 void setN(
const double n0,
const Vector2D&
n12,
const double n3 = 0.0)
202 void setN(
const Line2D& n012)
204 setN(n012.n0(), n012.n12());
210 setN(n0123.n0(), n0123.n12(), n0123.n3());
257 if (normalization_squared > 0)
scaleN(1.0 / std::sqrt(normalization_squared));
349 Vector2D
gradient(
const Vector2D& point)
const
351 return point * (2.0 *
n3()) +
n12();
363 Vector2D
normal(
const Vector2D& point)
const
376 Vector2D
tangential(
const Vector2D& point)
const
387 Vector2D
closest(
const Vector2D& point)
const;
412 Vector2D difference = to - from;
414 return tangentialAtFrom.isForwardOrBackwardOf(difference);
432 chooseNextForwardOf(
const Vector2D& start,
const Vector2D& end1,
const Vector2D& end2)
const;
435 std::pair<Belle2::TrackFindingCDC::Vector2D, Belle2::TrackFindingCDC::Vector2D>
463 return n0() + point.dot(
n12()) + point.normSquared() *
n3();
546 bool isLeft(
const Vector2D& rhs)
const
Vector2D tangential() const
Gives the tangential vector at the closest approach to the origin / at the perigee.
bool isCircle() const
Indicates if the generalized circle is actually a circle.
Vector2D m_n12
Memory for the second and third parameter.
double fastImpact() const
Approximate distance to the origin.
Vector2D orthogonal() const
Orthogonal vector to the counterclockwise direction.
std::ostream & operator<<(std::ostream &output, const IntervalOfValidity &iov)
void setY(const double y)
Setter for the y coordinate.
Vector2D unit() const
Returns a unit vector colaligned with this.
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...
void setCenterAndRadius(const Vector2D ¢er, double absRadius, ERotation orientation=ERotation::c_CounterClockwise)
Setter for the circle center and radius.
A two dimensional vector which is equipped with functions for correct handeling of orientation relat...
double minimalCylindricalR() const
Gives the minimal cylindrical radius the circle reaches (unsigned)
double normSquared() const
Calculates .
double tangentialPhi() const
Gives to azimuth angle phi of the direction of flight at the perigee.
double y() const
Getter for the y coordinate.
double n2() const
Getter for the third circle parameter.
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...
void setN3(const double n3)
Setter for fourth circle parameter.
double perimeter() const
Gives the perimeter of the circle.
double m_n0
Memory for the first parameter.
bool isNull() const
Checks if the vector is the null vector.
double omega() const
Gives the omega parameter as used by the framework helix.
double d0() const
Getter for the absolute distance to the z axes at the support point.
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 setN(const GeneralizedCircle &n0123)
Setter for all four circle parameters from another circle.
EForwardBackward
Enumeration to represent the distinct possibilities of the right left passage information.
double phi() const
Gives the azimuth angle being the angle to the x axes ( range -M_PI to M_PI )
void passiveMoveBy(const Vector2D &by)
Moves the coordinate system by the given vector.
double distance(const Vector2D &point) const
Gives the proper distance of the point to the circle line retaining the sign of the fast distance.
double radius() const
Gives the signed radius of the circle. If it was a line this will be infinity.
void setXY(const double x, const double y)
Setter for both coordinate.
GeneralizedCircle()
Default constructor for ROOT compatibility.
double n3() const
Getter for the fourth circle parameter.
double arcLengthTo(const Vector2D &to) const
Calculates the arc length between the perigee and the given point.
Vector2D normal(const Vector2D &point) const
Normal vector to the circle near the given position.
Vector2D apogee() const
Calculates the point on the circle that is furthest away from the origin.
void setN(const double n0, const double n1, const double n2, const double n3=0.0)
Setter for all four circle parameters.
void setN12(const double n1, const double n2)
Setter for second and third circle parameter.
double fastDistance(const Vector2D &point) const
Approximate distance.
Vector2D perigee() const
Calculates the closest approach to the two dimensional origin.
static Vector2D Phi(const double phi)
Constucts a unit vector with azimuth angle equal to phi.
Vector2D gradient(const Vector2D &point) const
Gradient of the distance field Gives the gradient of the approximated distance field for the given po...
double m_n3
Memory for the fourth parameter.
std::pair< Vector2D, Vector2D > intersections(const GeneralizedCircle &generalizedCircle) const
Calculates the two points common to both circles.
Vector2D divided(const double denominator) const
Returns a copy where all coordinates got divided by a common denominator.
ERotation orientation() const
Gives the orientation of the circle.
Abstract base class for different kinds of events.
GeneralizedCircle conformalTransformed() const
Returns a copy of the circle in conformal space.
void setN(const Line2D &n012)
Setter for all four circle parameters from another circle.
double maximalCylindricalR() const
Gives the maximal cylindrical radius the circle reaches.
void setN0(const double n0)
Setter for first circle parameter.
static GeneralizedCircle fromPerigeeParameters(double curvature, const Vector2D &tangential, double impact)
Constructor of a generalized circle from perigee parameters.
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...
double arcLengthToCylindricalR(double cylindricalR) const
Calculates the two dimensional arc length till the cylindrical radius is reached If the radius can no...
double impact() const
Gives the signed distance of the origin to the circle.
bool isValid() const
Indicates if the combination of the circle parameters makes up a valid circle.
ERightLeft isRightOrLeft(const Vector2D &point) const
Indicates if the point is on the right or left side of the circle.
void invalidate()
Sets all circle parameters to zero.
double curvature() const
Gives the signed curvature of the generalized circle.
ERightLeft
Enumeration to represent the distinct possibilities of the right left passage.
Vector2D center() const
Gives the center of the circle. If it was a line both components will be infinity.
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...
ERotation
Enumeration to represent the distinct possibilities of the right left passage information.
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 x() const
Getter for the x coordinate.
A two dimensional normal line.
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.
bool isRight(const Vector2D &rhs) const
Return if the point given is right of the line.
double absDistance(const Vector2D &point) const
Gives the proper absolute distance of the point to the circle line.
double n0() const
Getter for the first circle parameter.
void conformalTransform()
Transforms the generalized circle to conformal space inplace Applies the conformal map in the self-in...
void normalize()
Normalizes the circle parameters.
bool isLine() const
Indicates if the generalized circle is actually a line.
Vector2D closest(const Vector2D &point) const
Closest approach on the circle to the point.
void setN1(const double n1)
Setter for second circle parameter.
double n1() const
Getter for the second circle parameter.
const Vector2D & n12() const
Getter for the second and third circle parameter which natuarally from a vector.
void setN2(const double n2)
Setter for third circle parameter.
void setX(const double x)
Setter for the x coordinate.
void setPerigeeParameters(double curvature, const Vector2D &tangential, double impact)
Setter for the perigee parameters.
bool isLeft(const Vector2D &rhs) const
Return if the point given is left of the line.
double normalizationSquared() const
Calculates the generalized circle specific squared norm.
GeneralizedCircle reversed() const
Returns a copy of the circle with opposite orientation.
bool isInvalid() const
Indicates if all circle parameters are zero.
void reverse()
Flips the orientation of the circle in place.
double absRadius() const
Gives the signed radius of the circle. If it was a line this will be infinity.
double arcLengthBetween(const Vector2D &from, const Vector2D &to) const
Calculates the arc length between two points of closest approach on the circle.
double arcLengthPeriod() const
Getter for the arc length for a full round of the circle.