10#include <tracking/trackFindingCDC/topology/ISuperLayer.h>
12#include <tracking/trackFindingCDC/geometry/UncertainPerigeeCircle.h>
13#include <tracking/trackFindingCDC/geometry/PerigeeCircle.h>
14#include <tracking/trackFindingCDC/geometry/PerigeeParameters.h>
15#include <tracking/trackFindingCDC/geometry/Vector3D.h>
16#include <tracking/trackFindingCDC/geometry/Vector2D.h>
18#include <tracking/trackFindingCDC/numerics/EForwardBackward.h>
19#include <tracking/trackFindingCDC/numerics/ERightLeft.h>
20#include <tracking/trackFindingCDC/numerics/ESign.h>
32 namespace TrackFindingCDC {
58 double flightTime = NAN);
199 template <
class AHits>
209 template <
class AFromHits,
class AToHits>
212 const Vector2D& fromRecoPos2D = fromHits.back().getRecoPos2D();
213 const Vector2D& toRecoPos2D = toHits.front().getRecoPos2D();
221 template <
class AFromHits,
class AToHits>
224 const Vector2D& fromRecoPos2D = fromHits.front().getRecoPos2D();
225 const Vector2D& toRecoPos2D = toHits.front().getRecoPos2D();
233 template <
class AFromHits,
class AToHits>
236 const Vector2D& fromRecoPos2D = fromHits.back().getRecoPos2D();
237 const Vector2D& toRecoPos2D = toHits.back().getRecoPos2D();
243 template <
class AHits>
246 Vector2D frontRecoPos2D = hits.front().getRecoPos2D();
247 Vector2D backRecoPos2D = hits.back().getRecoPos2D();
383 bool isCurler(
double factor = 1)
const;
545 std::ostream& operator<<(std::ostream& output,
const CDCTrajectory2D& trajectory2D);
Particle trajectory as it is seen in xy projection represented as a circle.
double getTotalArcLength2D(const AHits &hits) const
Calculates the perpendicular travel distance from the first position of the hits to the last position...
void setPosMom2D(const Vector2D &pos2D, const Vector2D &mom2D, double charge)
Setter for start point and momentum at the start point subjected to the charge sign.
double getMaximalCylindricalR() const
Getter for the maximal distance from the origin.
CDCTrajectory2D reversed() const
Returns the reverse trajectory as a copy.
Vector2D getMom2DAtSupport(const double bZ) const
Get the momentum at the support point of the trajectory.
PerigeeCircle getGlobalCircle() const
Getter for the circle in global coordinates.
ISuperLayer getAxialISuperLayerAfterStart(EForwardBackward forwardBackwardInfo) const
Indicates which axial superlayer is traversed after the one, where the start point of the trajectory ...
Vector2D getOuterExit(double factor=1) const
Calculates the point where the trajectory meets the outer wall of the CDC.
double getGlobalImpact() const
Getter for the signed impact parameter of the trajectory.
ISuperLayer getISuperLayerAfter(ISuperLayer iSuperLayer, bool movingOutward) const
Returns which superlayer is traversed after the current one following the trajectory outward or inwar...
EForwardBackward isForwardOrBackwardTo(const AHits &hits) const
Calculates if this trajectory and the hits are coaligned Returns:
std::array< double, 2 > reconstructBothZ(const WireLine &wireLine, double distance=0.0, double z=0) const
Gives the two z positions where the given drift circle on the wire line touches the trajectory.
void reverse()
Reverses the trajectory in place.
bool isOriginer(double factor=1) const
Checks if the trajectory intersects with the inner radius of the CDC time the given tolerance factor.
ISuperLayer getStartISuperLayer() const
Indicates the superlayer the trajectory starts in.
double getFlightTime() const
Getter for the time when the particle reached the support point position.
Vector2D m_localOrigin
Memory for local coordinate origin of the circle representing the trajectory in global coordinates.
double setLocalOrigin(const Vector2D &localOrigin)
Setter for the origin of the local coordinate system.
void setLocalCircle(const UncertainPerigeeCircle &localPerigeeCircle)
Setter for the generalized circle that describes the trajectory.
double calcArcLength2D(const Vector2D &point) const
Calculate the travel distance from the start position of the trajectory.
ESign getChargeSign() const
Gets the charge sign of the trajectory.
ISuperLayer getISuperLayerAfterStart(bool movingOutward) const
Returns which superlayer is traversed after the current one following the trajectory outward or inwar...
double getChi2() const
Getter for the chi2 value of the circle fit.
double calcArcLength2DBetween(const Vector2D &fromPoint, const Vector2D &toPoint) const
Calculate the travel distance between the two given positions Returns the travel distance on the traj...
double getPValue() const
Getter for p-value.
ISuperLayer getPreviousISuperLayer() const
Indicates which superlayer the trajectory traverses before the one, where the start point of the traj...
bool isCurler(double factor=1) const
Checks if the trajectory leaves the outer radius of the CDC times the given tolerance factor.
Vector2D getPos2DAtArcLength2D(double arcLength2D)
Getter for the position at a given two dimensional arc length.
ISuperLayer getMinimalISuperLayer() const
Indicates the minimal superlayer the trajectory traverses.
void setGlobalCircle(const UncertainPerigeeCircle &perigeeCircle)
Setter for the generalized circle that describes the trajectory.
double reconstructZ(const WireLine &wireLine, double distance=0.0, double z=0) const
Gives the one z positions within the CDC closest to the given z where the given drift circle on the w...
bool isFitted() const
Checks if the circle is already set to a valid value.
double getLocalVariance(EPerigeeParameter i) const
Getter for an individual diagonal element of the covariance matrix of the local helix parameters.
double getLocalCovariance(EPerigeeParameter iRow, EPerigeeParameter iCol) const
Getter for an individual element of the covariance matrix of the local helix parameters.
Vector2D getSupport() const
Get the support point of the trajectory in global coordinates.
double getMinimalCylindricalR() const
Getter for the minimal distance from the origin - same as absolute value of the impact parameter.
const Vector2D & getLocalOrigin() const
Getter for the origin of the local coordinate system.
ISuperLayer getPreviousAxialISuperLayer() const
Indicates which axial superlayer the trajectory traverses before the one, where the start point of th...
double getArcLength2DGap(const AFromHits &fromHits, const AToHits &toHits) const
Calculates the perpendicular travel distance from the last position of the fromHits to the first posi...
std::array< Vector3D, 2 > reconstructBoth3D(const WireLine &wireLine, double distance=0.0, double z=0) const
Gives the two three dimensional points where the drift circle touches the wire line.
Vector2D getFlightDirection2DAtSupport() const
Get the unit direction of flight at the support point, where arcLength2D = 0.
double getArcLength2DPeriod() const
Getter for the arc length for one round trip around the trajectory.
ISuperLayer getMaximalISuperLayer() const
Indicates the maximal superlayer the trajectory traverses.
ERightLeft isRightOrLeft(const Vector2D &point) const
Checks if the given point is to the right or to the left of the trajectory.
Vector2D getClosest(const Vector2D &point) const
Calculates the closest approach on the trajectory to the given point.
Vector2D getExit() const
Calculates the point where the trajectory leaves the CDC.
void setNDF(std::size_t ndf)
Setter for the number of degrees of freedom of the circle fit.
double getAbsMom2D() const
Get the estimation for the absolute value of the transvers momentum.
const UncertainPerigeeCircle & getLocalCircle() const
Getter for the circle in local coordinates.
Vector2D getGlobalCenter() const
Getter for the center of the trajectory in global coordinates.
UncertainPerigeeCircle m_localPerigeeCircle
Memory for the generalized circle describing the trajectory in coordinates from the local origin.
double getArcLength2DBackOffset(const AFromHits &fromHits, const AToHits &toHits) const
Calculates the perpendicular travel distance from the last position of the fromHits to the last posit...
CDCTrajectory2D()
Default constructor for ROOT compatibility.
void clear()
Clears all information from this trajectory.
void setFlightTime(double flightTime)
Setter for the time when the particle reached the support point position.
Vector2D getFlightDirection2D(const Vector2D &point) const
Get the unit direction of flight at the given point, where arcLength2D = 0.
bool isMovingOutward() const
Indicates if the trajectory is moving outwards or inwards (to or away from the origin) from the start...
ISuperLayer getNextISuperLayer() const
Indicates which superlayer the trajectory traverses after the one, where the start point of the traje...
double getArcLength2DFrontOffset(const AFromHits &fromHits, const AToHits &toHits) const
Calculates the perpendicular travel distance from the first position of the fromHits to the first pos...
ISuperLayer getNextAxialISuperLayer() const
Indicates which axial superlayer the trajectory traverses after the one, where the start point of the...
void setChi2(const double chi2)
Setter for the chi square value of the circle fit.
size_t getNDF() const
Getter for the number of degrees of freedom of the circle fit.
Vector2D getGlobalPerigee() const
Getter for the closest approach on the trajectory to the global origin.
Vector2D getInnerExit() const
Calculates the point where the trajectory meets the inner wall of the CDC.
Vector3D reconstruct3D(const WireLine &wireLine, double distance=0.0, double z=0) const
Gives the one three dimensional positions within the CDC closest to the given z where the given drift...
double getDist2D(const Vector2D &point) const
Calculates the distance from the point to the trajectory as seen from the xy projection.
double m_flightTime
Memory for the estimation of the time at which the particle arrived at the support point.
double getCurvature() const
Getter for the curvature as seen from the xy projection.
Vector2D getMom2DAtSupport() const
Get the momentum at the support point of the trajectory.
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)
Vector2D perigee() const
Getter for the perigee point.
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.
double distance(const Vector2D &point) const
Getter for the proper signed distance of the point to the circle.
Vector2D center() const
Getter for the center of the circle. If it was a line both components will be infinity.
ERightLeft isRightOrLeft(const Vector2D &point) const
Indicates if the point is on the right or left side of the circle.
double curvature() const
Getter for the signed curvature.
Vector2D closest(const Vector2D &point) const
Calculates the point of closest approach on the circle to the given point.
double arcLengthPeriod() const
Getter for the arc length for a full round of the circle.
Adds an uncertainty matrix to the circle in perigee parameterisation.
double covariance(const EPerigeeParameter &iRow, const EPerigeeParameter &iCol) const
Getter for individual elements of the covariance matrix.
void passiveMoveBy(const Vector2D &by)
Moves the coordinate system by the vector by and calculates the new perigee and its covariance matrix...
double variance(const EPerigeeParameter &i) const
Getter for individual diagonal elements of the covariance matrix.
double chi2() const
Getter for the chi square value of the circle fit.
void setNDF(std::size_t ndf)
Setter for the number of degrees of freediom used in the circle fit.
void setChi2(const double chi2)
Setter for the chi square value of the circle fit.
std::size_t ndf() const
Getter for the number of degrees of freediom used in the circle fit.
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.
A three dimensional vector.
A three dimensional limited line represented by its closest approach to the z-axes (reference positio...
ESign
Enumeration for the distinct sign values of floating point variables.
EForwardBackward
Enumeration to represent the distinct possibilities of the right left passage information.
EPerigeeParameter
Enumeration to address the individual perigee parameters in a vector or matrix.
ERightLeft
Enumeration to represent the distinct possibilities of the right left passage.
Abstract base class for different kinds of events.