10#include <tracking/trackingUtilities/geometry/VectorUtil.h>
12#include <tracking/trackingUtilities/numerics/ERightLeft.h>
13#include <tracking/trackingUtilities/numerics/ERotation.h>
14#include <tracking/trackingUtilities/numerics/ESign.h>
16#include <framework/geometry/VectorUtil.h>
18#include <Math/Vector2D.h>
19#include <Math/VectorUtil.h>
28 namespace TrackingUtilities {
106 double distance(
const ROOT::Math::XYVector& point)
const
126 return static_cast<ERightLeft
>(sign(
distance(point)));
130 bool isLeft(
const ROOT::Math::XYVector& rhs)
const
136 bool isRight(
const ROOT::Math::XYVector& rhs)
const
142 ROOT::Math::XYVector
closest(
const ROOT::Math::XYVector& point)
const
144 ROOT::Math::XYVector connection = point -
center();
145 if (connection.R() != 0.0) {
146 connection *= (
absRadius() / connection.R());
155 ROOT::Math::XYVector connection =
center();
156 if (connection.R() != 0.0) {
157 connection *= (-
absRadius() / connection.R());
166 return VectorUtil::unit(
tangential(ROOT::Math::XYVector(0.0, 0.0)));
176 ROOT::Math::XYVector
gradient(
const ROOT::Math::XYVector& point)
const
179 return VectorUtil::unit(connection);
183 ROOT::Math::XYVector
normal(
const ROOT::Math::XYVector& point)
const
185 return VectorUtil::unit(
gradient(point));
189 ROOT::Math::XYVector
tangential(
const ROOT::Math::XYVector& point)
const
191 return VectorUtil::Orthogonal(
normal(point));
195 double openingAngle(
const ROOT::Math::XYVector& from,
const ROOT::Math::XYVector& to)
const
201 double arcLengthBetween(
const ROOT::Math::XYVector& from,
const ROOT::Math::XYVector& to)
const
227 return static_cast<ERotation
>(sign(
radius()));
239 void moveBy(
const ROOT::Math::XYVector& by)
ROOT::Math::XYVector tangential(const ROOT::Math::XYVector &point) const
Tangential vector to the circle near the given position.
ROOT::Math::XYVector m_center
Memory for the central point.
Circle2D reversed() const
Returns a copy of the line with the reversed orientation.
ROOT::Math::XYVector gradient(const ROOT::Math::XYVector &point) const
Gradient of the distance field.
double m_radius
Memory for the signed radius.
bool isRight(const ROOT::Math::XYVector &rhs) const
Return if the point given is right of the circle line.
void reverse()
Flips orientation the circle in place.
double arcLengthBetween(const ROOT::Math::XYVector &from, const ROOT::Math::XYVector &to) const
Calculates the arc length between two points of closest approach on the circle.
double radius() const
Getter for the signed radius.
Circle2D(const ROOT::Math::XYVector ¢er, const double radius)
Constructs a circle with given center and radius/ orientation as given by the signedRadius.
void moveBy(const ROOT::Math::XYVector &by)
Actively moves the circle in the direction given in place by the vector given.
bool isLeft(const ROOT::Math::XYVector &rhs) const
Return if the point given is left of the circle line.
ROOT::Math::XYVector closest(const ROOT::Math::XYVector &point) const
Calculates the point of closest approach on the line to the point.
Circle2D conformalTransformed() const
Returns a copy of the circle in conformal space.
void moveAlongFirst(const double first)
Actively moves the circle in the direction given in place along the first coordinate.
ROOT::Math::XYVector normal(const ROOT::Math::XYVector &point) const
Normal vector to the circle near the given position.
double impact() const
Returns the signed distance to the origin.
Circle2D()
Default constructor for ROOT compatibility. Creates an invalid circle.
double absDistance(const ROOT::Math::XYVector &point) const
Returns the euclidean distance of the point to the circle line.
double distance(const ROOT::Math::XYVector &point) const
Calculates the signed distance of the point to the circle line.
void passiveMoveAlongFirst(const double first)
Passively move the coordinate system in place along the first coordinate.
ERightLeft isRightOrLeft(const ROOT::Math::XYVector &point) const
Return if the point given is right or left of the line.
ROOT::Math::XYVector perigee() const
Returns the point closest to the origin.
double radiusSquared() const
Getter for the squared radius.
void passiveMoveBy(const ROOT::Math::XYVector &by)
Passively move the coordinate system in place by the given vector.
ROOT::Math::XYVector tangential() const
Gives the tangential vector at the closest approach to the origin / at the perigee.
void conformalTransform()
Transforms the circle to conformal space inplace.
double absRadius() const
Getter for the absolute radius.
double openingAngle(const ROOT::Math::XYVector &from, const ROOT::Math::XYVector &to) const
Calculates the angle between two points as seen from the center of the circle.
Circle2D(const ROOT::Math::XYVector ¢er, const double absRadius, const ERotation ccwInfo)
Constructs a circle with given center, absolute value of the radius and orientation.
double tangentialPhi() const
Gives to azimuth phi of the direction of flight at the perigee.
ROOT::Math::XYVector center() const
Getter for the central point of the circle.
void passiveMoveAlongSecond(const double second)
Passively move the coordinate system in place along the second coordinate.
ERotation orientation() const
Indicates if the circle is to be interpreted counterclockwise or clockwise.
void moveAlongSecond(const double second)
Actively moves the circle in the direction given in place along the second coordinate.
Abstract base class for different kinds of events.