 |
Belle II Software
release-05-01-25
|
12 #include <tracking/trackFindingCDC/geometry/Vector2D.h>
14 #include <tracking/trackFindingCDC/numerics/EForwardBackward.h>
15 #include <tracking/trackFindingCDC/numerics/ERightLeft.h>
16 #include <tracking/trackFindingCDC/numerics/ESign.h>
25 namespace TrackFindingCDC {
50 Line2D(
const double n0,
const double n1,
const double n2)
88 const EForwardBackward orientation)
96 return Line2D(end.cross(start), (start - end).orthogonal());
221 void scaleN(
const double factor)
255 double distance(
const double first,
const double second)
const
257 return n0() + first *
n1() + second *
n2();
296 const double closestParallel = -
n0();
298 return Vector2D(
n12(), closestParallel, closestOrthgonal);
304 return n12() * (-
n0());
483 double map(
const double first)
const
double slope() const
Returns the slope over the first coordinate.
void setSecond(const double second)
Setter for the second coordinate.
double m_n0
Memory for the first line parameter.
Line2D movedAlongSecond(const double second) const
Return a copy of the line activally moved long the first coordinate.
double n0() const
Getter for the first line parameter.
Vector2D orthogonal() const
Orthogonal vector to the counterclockwise direction.
EForwardBackward alignedWithSecond() const
Returns if the direction of positiv advance has a common component aligned or anti aligned with the s...
void setSlopeIntercept(const double slope, const double intercept)
Sets the new intercept and slope of the line the direction is set to be forward with the increasing x...
Line2D(const double n0, const double n1, const double n2)
Constructs taking all three line parameters.
A two dimensional vector which is equipped with functions for correct handeling of orientation relat...
void moveAlongSecond(const double second)
Activelly moves the line in the direction given in place along the second coordinate.
double normSquared() const
Calculates .
double operator()(const double first) const
Maps the first coordinate to the second.
void scaleN(const double factor)
Scales all parameters. Helper for normalize.
double n2() const
Getter for the third line parameter.
bool isLeft(const Vector2D &rhs) const
Return if the point given is left of the line.
Line2D passiveMovedAlongFirst(const double first) const
Return a copy of the line passively moved long the first coordinate.
void setN2(const double n2)
Setter for the third line parameter. May violate the normlization.
double second() const
Getter for the second coordinate.
Line2D()
Default constructor for ROOT compatibility.
bool isNull() const
Checks if the vector is the null vector.
EForwardBackward alignedWithFirst() const
Returns if the direction of positiv advance has a common component aligned or anti aligned with the f...
Vector2D intersection(const Line2D &line) const
Calculates the intersection point of two line. Infinity for parallels.
void flipSecond()
Flips the first coordinate inplace (no difference between active and passive)
EForwardBackward
Enumeration to represent the distinct possibilities of the right left passage information.
void setN1(const double n1)
Setter for the second line parameter. May violate the normlization.
double zero() const
Returns the root of the line.
double distanceToOrigin() const
Returns the distance to the origin The distance to the origin is equivalent to the first line paramet...
double distance(const Vector2D &point) const
Calculates the signed distance of the point to the line.
void passiveMoveAlongFirst(const double first)
Passively move the coordinate system in place along the first coordinate.
double dot(const Vector2D &rhs) const
Calculates the two dimensional dot product.
void setFirst(const double first)
Setter for the first coordinate.
static Line2D fromSlopeIntercept(const double slope, const double intercept)
Constructs a line from its slope and intercept over the first coordinate (default forward orientation...
Line2D flippedSecond() const
Makes a copy of the line with the second coordinate flipped (no difference between active and pasive)
double first() const
Getter for the first coordinate.
void reverse()
Flips orientation the line in place.
void moveAlongFirst(const double first)
Activelly moves the line in the direction given in place along the first coordinate.
bool isInvalid() const
Indicates if all circle parameters are zero.
void invert()
Turns the line function into its inverse function in place.
void flipSecond()
Flips the first coordinate inplace (no difference between active and pasive)
double lengthOnCurve(const Vector2D &from, const Vector2D &to) const
Calculates the length on the curve between two points.
ERightLeft isRightOrLeft(const Vector2D &point) const
Return if the point given is right or left of the line.
double normalizationSquared() const
Calculates the squared normalization. Helper for normalize.
Vector2D closest(const Vector2D &point) const
Calculates the point of closest approach on the line to the point.
Abstract base class for different kinds of events.
void normalize()
Updates the parameters to obey the normalization condition.
void passiveMoveBy(const Vector2D &by)
Passivelly move the coordinate system in place by the given vector.
double n1() const
Getter for the second line parameter.
void swapCoordinates()
Swaps the coordinates in place.
double inverseSlope() const
Returns the slope over the second coordinate.
double unnormalizedParallelComp(const Vector2D &relativTo) const
Same as parallelComp() but assumes the given vector to be of unit length.
ERightLeft
Enumeration to represent the distinct possibilities of the right left passage.
double normalization() const
Calculates the normalization. Helper for normalize.
void moveBy(const Vector2D &by)
Activelly moves the line in the direction given in place by the vector given.
void invalidate()
Sets all line parameters to zero.
void setN12(const double n1, const double n2)
Setter for the normal vector by its coordinates.
A two dimensional normal line.
Line2D passiveMovedAlongSecond(const double second) const
Return a copy of the line passively moved long the first coordinate.
Line2D inverted() const
Returns the inverse function line as a copy.
double intercept() const
Returns the intercept over the first coordinate.
double map(const double first) const
Maps the first coordinate to the second.
double inverseMap(const double second) const
Maps the second coordinate to the first.
const Vector2D & gradient() const
Getter for the gradient of the distance field.
Line2D reversed() const
Returns a copy of the line with the reversed orientation.
void setN(const double n0, const double n1, const double n2)
Setter the for the line parameters which takes care of the correct normalization of the normal vector...
void flipFirst()
Flips the first coordinate inplace (no difference between active and pasive)
Vector2D support() const
Getter for the support point of the line being the point closest to the origin.
double unnormalizedOrthogonalComp(const Vector2D &relativTo) const
Same as orthogonalComp() but assumes the given vector to be of unit length.
void set(const double first, const double second)
Setter for both coordinate.
const Vector2D & normal() const
Getter for the unit normal vector of the line.
void passiveMoveAlongSecond(const double second)
Passively move the coordinate system in place along the second coordinate.
Vector2D m_n12
Memory for the second line parameter.
bool isRight(const Vector2D &rhs) const
Return if the point given is right of the line.
Line2D movedAlongFirst(const double first) const
Return a copy of the line activally moved long the first coordinate.
const Vector2D & n12() const
Getter for the unit normal vector to the line.
Vector2D tangential() const
Gives the tangential vector in the direction of positiv advance on the line.
void setN0(const double n0)
Setter for first line parameter This sets the signed distance of the line to the origin.
Line2D flippedFirst() const
Makes a copy of the line with the first coordinate flipped (no difference between active and pasive)
Vector2D closestToOrigin() const
Returns the point closest to the origin.
double absoluteDistance(const Vector2D &point) const
Returns the absolute value of distance(point)
static Line2D throughPoints(const Vector2D &start, const Vector2D &end)
Constructs a line through the two given points.
void flipFirst()
Flips the first coordinate inplace (no difference between active and passive)