10#include <cdc/topology/ISuperLayer.h>
12#include <tracking/trackingUtilities/geometry/UncertainPerigeeCircle.h>
13#include <tracking/trackingUtilities/geometry/PerigeeCircle.h>
14#include <tracking/trackingUtilities/geometry/PerigeeParameters.h>
16#include <tracking/trackingUtilities/numerics/EForwardBackward.h>
17#include <tracking/trackingUtilities/numerics/ERightLeft.h>
18#include <tracking/trackingUtilities/numerics/ESign.h>
20#include <Math/Vector3D.h>
21#include <Math/Vector2D.h>
36 namespace TrackingUtilities {
61 double flightTime = NAN);
69 const ROOT::Math::XYVector& mom2D,
75 CDCTrajectory2D(
const ROOT::Math::XYVector& pos2D,
double time,
const ROOT::Math::XYVector& mom2D,
double charge);
141 ROOT::Math::XYVector
getClosest(
const ROOT::Math::XYVector& point)
const;
202 template <
class AHits>
212 template <
class AFromHits,
class AToHits>
215 const ROOT::Math::XYVector& fromRecoPos2D = fromHits.back().getRecoPos2D();
216 const ROOT::Math::XYVector& toRecoPos2D = toHits.front().getRecoPos2D();
224 template <
class AFromHits,
class AToHits>
227 const ROOT::Math::XYVector& fromRecoPos2D = fromHits.front().getRecoPos2D();
228 const ROOT::Math::XYVector& toRecoPos2D = toHits.front().getRecoPos2D();
236 template <
class AFromHits,
class AToHits>
239 const ROOT::Math::XYVector& fromRecoPos2D = fromHits.back().getRecoPos2D();
240 const ROOT::Math::XYVector& toRecoPos2D = toHits.back().getRecoPos2D();
246 template <
class AHits>
249 ROOT::Math::XYVector frontRecoPos2D = hits.front().getRecoPos2D();
250 ROOT::Math::XYVector backRecoPos2D = hits.back().getRecoPos2D();
289 void setPosMom2D(
const ROOT::Math::XYVector& pos2D,
const ROOT::Math::XYVector& mom2D,
double charge);
363 ROOT::Math::XYVector
getOuterExit(
double factor = 1)
const;
382 ROOT::Math::XYVector
getExit()
const;
386 bool isCurler(
double factor = 1)
const;
412 double getDist2D(
const ROOT::Math::XYVector& point)
const
548 std::ostream& operator<<(std::ostream& output,
const CDCTrajectory2D& trajectory2D);
A three dimensional limited line represented by its closest approach to the z-axes (reference positio...
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...
std::array< ROOT::Math::XYZVector, 2 > reconstructBoth3D(const CDC::WireLine &wireLine, double distance=0.0, double z=0) const
Gives the two three dimensional points where the drift circle touches the wire line.
double getMaximalCylindricalR() const
Getter for the maximal distance from the origin.
ROOT::Math::XYVector m_localOrigin
Memory for local coordinate origin of the circle representing the trajectory in global coordinates.
CDCTrajectory2D reversed() const
Returns the reverse trajectory as a copy.
ROOT::Math::XYVector getSupport() const
Get the support point of the trajectory in global coordinates.
double calcArcLength2DBetween(const ROOT::Math::XYVector &fromPoint, const ROOT::Math::XYVector &toPoint) const
Calculate the travel distance between the two given positions Returns the travel distance on the traj...
PerigeeCircle getGlobalCircle() const
Getter for the circle in global coordinates.
CDC::ISuperLayer getAxialISuperLayerAfterStart(EForwardBackward forwardBackwardInfo) const
Indicates which axial superlayer is traversed after the one, where the start point of the trajectory ...
CDC::ISuperLayer getISuperLayerAfter(CDC::ISuperLayer iSuperLayer, bool movingOutward) const
Returns which superlayer is traversed after the current one following the trajectory outward or inwar...
double reconstructZ(const CDC::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...
double getGlobalImpact() const
Getter for the signed impact parameter of the trajectory.
EForwardBackward isForwardOrBackwardTo(const AHits &hits) const
Calculates if this trajectory and the hits are coaligned Returns:
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.
CDC::ISuperLayer getStartISuperLayer() const
Indicates the superlayer the trajectory starts in.
ROOT::Math::XYVector getClosest(const ROOT::Math::XYVector &point) const
Calculates the closest approach on the trajectory to the given point.
double getFlightTime() const
Getter for the time when the particle reached the support point position.
ROOT::Math::XYVector getGlobalCenter() const
Getter for the center of the trajectory in global coordinates.
void setLocalCircle(const UncertainPerigeeCircle &localPerigeeCircle)
Setter for the generalized circle that describes the trajectory.
ESign getChargeSign() const
Gets the charge sign of the trajectory.
double calcArcLength2D(const ROOT::Math::XYVector &point) const
Calculate the travel distance from the start position of the trajectory.
CDC::ISuperLayer getISuperLayerAfterStart(bool movingOutward) const
Returns which superlayer is traversed after the current one following the trajectory outward or inwar...
double setLocalOrigin(const ROOT::Math::XYVector &localOrigin)
Setter for the origin of the local coordinate system.
ROOT::Math::XYVector getOuterExit(double factor=1) const
Calculates the point where the trajectory meets the outer wall of the CDC.
double getChi2() const
Getter for the chi2 value of the circle fit.
double getPValue() const
Getter for p-value.
void setPosMom2D(const ROOT::Math::XYVector &pos2D, const ROOT::Math::XYVector &mom2D, double charge)
Setter for start point and momentum at the start point subjected to the charge sign.
CDC::ISuperLayer getPreviousISuperLayer() const
Indicates which superlayer the trajectory traverses before the one, where the start point of the traj...
const ROOT::Math::XYVector & getLocalOrigin() const
Getter for the origin of the local coordinate system.
bool isCurler(double factor=1) const
Checks if the trajectory leaves the outer radius of the CDC times the given tolerance factor.
CDC::ISuperLayer getMinimalISuperLayer() const
Indicates the minimal superlayer the trajectory traverses.
void setGlobalCircle(const UncertainPerigeeCircle &perigeeCircle)
Setter for the generalized circle that describes the trajectory.
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.
ROOT::Math::XYVector getExit() const
Calculates the point where the trajectory leaves the CDC.
double getLocalCovariance(EPerigeeParameter iRow, EPerigeeParameter iCol) const
Getter for an individual element of the covariance matrix of the local helix parameters.
double getMinimalCylindricalR() const
Getter for the minimal distance from the origin - same as absolute value of the impact parameter.
ERightLeft isRightOrLeft(const ROOT::Math::XYVector &point) const
Checks if the given point is to the right or to the left of the trajectory.
CDC::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...
ROOT::Math::XYVector 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.
CDC::ISuperLayer getMaximalISuperLayer() const
Indicates the maximal superlayer the trajectory traverses.
void setNDF(std::size_t ndf)
Setter for the number of degrees of freedom of the circle fit.
ROOT::Math::XYVector getPos2DAtArcLength2D(double arcLength2D)
Getter for the position at a given two dimensional arc length.
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.
std::array< double, 2 > reconstructBothZ(const CDC::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.
ROOT::Math::XYVector getMom2DAtSupport() const
Get the momentum at the support point of the trajectory.
ROOT::Math::XYZVector reconstruct3D(const CDC::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...
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.
ROOT::Math::XYVector getGlobalPerigee() const
Getter for the closest approach on the trajectory to the global origin.
bool isMovingOutward() const
Indicates if the trajectory is moving outwards or inwards (to or away from the origin) from the start...
ROOT::Math::XYVector getInnerExit() const
Calculates the point where the trajectory meets the inner wall of the CDC.
CDC::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...
CDC::ISuperLayer getNextAxialISuperLayer() const
Indicates which axial superlayer the trajectory traverses after the one, where the start point of the...
ROOT::Math::XYVector getMom2DAtSupport(const double bZ) const
Get the momentum at the support point of the trajectory.
void setChi2(const double chi2)
Setter for the chi square value of the circle fit.
double getDist2D(const ROOT::Math::XYVector &point) const
Calculates the distance from the point to the trajectory as seen from the xy projection.
size_t getNDF() const
Getter for the number of degrees of freedom of the circle fit.
ROOT::Math::XYVector getFlightDirection2D(const ROOT::Math::XYVector &point) const
Get the unit direction of flight at the given point, where arcLength2D = 0.
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.
Extension of the generalized circle also caching the perigee coordinates.
ROOT::Math::XYVector tangential(const ROOT::Math::XYVector &point) const
Tangential vector to the circle near the given position.
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.
ROOT::Math::XYVector closest(const ROOT::Math::XYVector &point) const
Calculates the point of closest approach on the circle to the given point.
double distance(const ROOT::Math::XYVector &point) const
Getter for the proper signed distance of the point to the circle.
ERightLeft isRightOrLeft(const ROOT::Math::XYVector &point) const
Indicates if the point is on the right or left side of the circle.
ROOT::Math::XYVector perigee() const
Getter for the perigee point.
ROOT::Math::XYVector atArcLength(double arcLength) const
Calculates the point, which lies at the give perpendicular travel distance (counted from the perigee)
double curvature() const
Getter for the signed curvature.
ROOT::Math::XYVector center() const
Getter for the center of the circle. If it was a line both components will be infinity.
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.
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.
std::size_t ndf() const
Getter for the number of degrees of freediom used in the circle fit.
signed short ISuperLayer
The type of the layer and superlayer ids.
Abstract base class for different kinds of events.