Belle II Software development
CDCTrajectory3D Class Reference

Particle full three dimensional trajectory. More...

#include <CDCTrajectory3D.h>

Public Member Functions

 CDCTrajectory3D ()
 Default constructor for ROOT compatibility.
 
 CDCTrajectory3D (const UncertainHelix &helix)
 Constructs a trajectory from a helix with reference point equivalent to the origin.
 
 CDCTrajectory3D (const Helix &helix)
 conversion constructor to make that one stupid test work
 
 CDCTrajectory3D (const ROOT::Math::XYZVector &localOrigin, const UncertainHelix &localHelix, double flightTime=NAN)
 Constructs a trajectory from a local helix taken as relative to the given origin.
 
 CDCTrajectory3D (const CDCTrajectory2D &trajectory2D, const CDCTrajectorySZ &trajectorySZ)
 Construct a three dimensional trajectory from a two dimensional circular trajectory and sz linear trajectory.
 
 CDCTrajectory3D (const CDCTrajectory2D &trajectory2D)
 Construct a trajectory from a two dimensional circular trajectory filling the remaining two parameters and covariance matrix with default values.
 
 CDCTrajectory3D (const ROOT::Math::XYZVector &pos3D, double time, const ROOT::Math::XYZVector &mom3D, double charge, double bZ)
 Construct a trajectory with given start point, momentum at the start point and given charge.
 
 CDCTrajectory3D (const ROOT::Math::XYZVector &pos3D, double time, const ROOT::Math::XYZVector &mom3D, double charge)
 Construct a trajectory with given start point, momentum at the start point and given charge.
 
 CDCTrajectory3D (const MCParticle &mcParticle, double bZ)
 Construct a trajectory from the MCParticles vertex and momentum.
 
 CDCTrajectory3D (const MCParticle &mcParticle)
 Construct a trajectory from the MCParticles vertex and momentum.
 
 CDCTrajectory3D (const genfit::TrackCand &gfTrackCand, double bZ)
 Construct a trajectory by extracting the seed position of the genfit::TrackCand.
 
 CDCTrajectory3D (const genfit::TrackCand &gfTrackCand)
 Construct a trajectory by extracting the seed position of the genfit::TrackCand.
 
bool isInvalid () const
 Checks if the trajectory is already set to a valid value.
 
bool isFitted () const
 Checks if the trajectory has already been set to a valid value.
 
void clear ()
 Clears all information from this trajectoy.
 
bool fillInto (genfit::TrackCand &trackCand) const
 Copies the trajectory information to the Genfit track candidate.
 
bool fillInto (genfit::TrackCand &gfTrackCand, double bZ) const
 Copies the trajectory information to the Genfit track candidate.
 
CovarianceMatrix< 6 > getCartesianCovariance (double bZ) const
 Convert the helix parameters to the cartesian coordinates x,y,z,px,py,pz.
 
void reverse ()
 Reverses the trajectory in place.
 
CDCTrajectory3D reversed () const
 Returns the reverse trajectory as a copy.
 
ROOT::Math::XYZVector reconstruct3D (const CDC::WireLine &wireLine, double distance=0.0) const
 Gives the three dimensional point which is on the dirft circle away from the wire line.
 
double calcArcLength2D (const ROOT::Math::XYZVector &point) const
 Calculate the travel distance from the start position of the trajectory.
 
double getArcLength2DPeriod () const
 Getter for the arc length for one round trip around the trajectory.
 
double shiftPeriod (int nPeriods)
 Adjusts the z0 to the one that lies n periods forward.
 
ESign getChargeSign () const
 Gets the charge sign of the trajectory.
 
double getAbsMom3D (double bZ) const
 Get the estimation for the absolute value of the transvers momentum.
 
double getAbsMom3D () const
 Get the estimation for the absolute value of the transvers momentum.
 
ROOT::Math::XYZVector getMom3DAtSupport (const double bZ) const
 Get the momentum at the start point of the trajectory.
 
ROOT::Math::XYZVector getMom3DAtSupport () const
 Get the momentum at the start point of the trajectory.
 
ROOT::Math::XYZVector getFlightDirection3DAtSupport () const
 Get the unit momentum at the start point of the trajectory.
 
ROOT::Math::XYZVector getSupport () const
 Getter for the support point of the trajectory in global coordinates, where arcLength2D = 0.
 
ROOT::Math::XYZVector getGlobalPerigee () const
 Getter for the closest approach on the trajectory to the global origin.
 
ROOT::Math::XYVector getGlobalCenter () const
 Getter for the center of the helix in global coordinates.
 
bool isCurler (double factor=1) const
 Checks if the trajectory leaves the outer radius of the CDC times the given tolerance factor.
 
double getMaximalCylindricalR () const
 Getter for the maximal distance from the origin.
 
double getMinimalCylindricalR () const
 Getter for the minimal distance from the origin.
 
double getGlobalImpact () const
 Getter for the signed impact parameter of the trajectory.
 
CDCTrajectory2D getTrajectory2D () const
 Getter for the two dimensional trajectory.
 
CDCTrajectorySZ getTrajectorySZ () const
 Getter for the sz trajectory.
 
PerigeeCircle getGlobalCircle () const
 Getter for the circle in global coordinates.
 
UncertainPerigeeCircle getLocalCircle () const
 Getter for the circle in local coordinates.
 
UncertainSZLine getLocalSZLine () const
 Getter for the sz line starting from the local origin.
 
double getLocalCovariance (EHelixParameter iRow, EHelixParameter iCol) const
 Getter for an individual element of the covariance matrix of the local helix parameters.
 
double getLocalVariance (EHelixParameter i) const
 Getter for an individual diagonal element of the covariance matrix of the local helix parameters.
 
double getTanLambda () const
 Getter for the slope of z over the transverse travel distance s.
 
double getCurvatureXY () const
 Getter for the curvature as seen from the xy projection.
 
double getPValue () const
 Getter for p-value.
 
double getChi2 () const
 Getter for the chi2 value of the fit.
 
void setChi2 (const double chi2)
 Setter for the chi square value of the helix fit.
 
size_t getNDF () const
 Getter for the number of degrees of freedom of the helix fit.
 
void setNDF (std::size_t ndf)
 Setter for the number of degrees of freedom of the helix fit.
 
const UncertainHelixgetLocalHelix () const
 Getter for the helix in local coordinates.
 
void setLocalHelix (const UncertainHelix &localHelix)
 Setter for the helix that describes the trajectory in local coordinates.
 
const ROOT::Math::XYZVector & getLocalOrigin () const
 Getter for the origin of the local coordinate system.
 
double setLocalOrigin (const ROOT::Math::XYZVector &localOrigin)
 Setter for the origin of the local coordinate system.
 
double getFlightTime () const
 Getter for the time when the particle reached the support point position.
 
void setFlightTime (double flightTime)
 Setter for the time when the particle reached the support point position.
 

Private Attributes

ROOT::Math::XYZVector m_localOrigin
 Memory for local coordinate origin of the circle representing the trajectory in global coordinates.
 
UncertainHelix m_localHelix
 Memory for the generalized circle describing the trajectory in coordinates from the local origin.
 
double m_flightTime = NAN
 Memory for the estimation of the time at which the particle arrived at the support point.
 

Detailed Description

Particle full three dimensional trajectory.

Definition at line 46 of file CDCTrajectory3D.h.

Constructor & Destructor Documentation

◆ CDCTrajectory3D() [1/12]

CDCTrajectory3D ( )
inline

Default constructor for ROOT compatibility.

Definition at line 50 of file CDCTrajectory3D.h.

51 : m_localOrigin()
52 , m_localHelix()
53 {
54 }

◆ CDCTrajectory3D() [2/12]

CDCTrajectory3D ( const UncertainHelix & helix)
inlineexplicit

Constructs a trajectory from a helix with reference point equivalent to the origin.

Definition at line 57 of file CDCTrajectory3D.h.

58 : m_localOrigin(0.0, 0.0, 0.0)
59 , m_localHelix(helix)
60 , m_flightTime(0.0)
61 {
62 }

◆ CDCTrajectory3D() [3/12]

CDCTrajectory3D ( const Helix & helix)
inlineexplicit

conversion constructor to make that one stupid test work

Definition at line 65 of file CDCTrajectory3D.h.

65 : CDCTrajectory3D(UncertainHelix(helix))
66 {
67 }

◆ CDCTrajectory3D() [4/12]

CDCTrajectory3D ( const ROOT::Math::XYZVector & localOrigin,
const UncertainHelix & localHelix,
double flightTime = NAN )
inline

Constructs a trajectory from a local helix taken as relative to the given origin.

Definition at line 70 of file CDCTrajectory3D.h.

73 : m_localOrigin(localOrigin)
74 , m_localHelix(localHelix)
75 , m_flightTime(flightTime)
76 {
77 }

◆ CDCTrajectory3D() [5/12]

CDCTrajectory3D ( const CDCTrajectory2D & trajectory2D,
const CDCTrajectorySZ & trajectorySZ )

Construct a three dimensional trajectory from a two dimensional circular trajectory and sz linear trajectory.

Definition at line 48 of file CDCTrajectory3D.cc.

50 : m_localHelix(trajectory2D.getLocalCircle(), trajectorySZ.getSZLine())
51 , m_flightTime(trajectory2D.getFlightTime())
52{
53 const auto& tmp = trajectory2D.getLocalOrigin();
54 m_localOrigin = ROOT::Math::XYZVector(tmp.X(), tmp.Y(), 0.0);
55}
double getFlightTime() const
Getter for the time when the particle reached the support point position.
const ROOT::Math::XYVector & getLocalOrigin() const
Getter for the origin of the local coordinate system.
const UncertainPerigeeCircle & getLocalCircle() const
Getter for the circle in local coordinates.
ROOT::Math::XYZVector m_localOrigin
Memory for local coordinate origin of the circle representing the trajectory in global coordinates.
UncertainHelix m_localHelix
Memory for the generalized circle describing the trajectory in coordinates from the local origin.
double m_flightTime
Memory for the estimation of the time at which the particle arrived at the support point.
const UncertainSZLine & getSZLine() const
Getter for the line in sz space.

◆ CDCTrajectory3D() [6/12]

CDCTrajectory3D ( const CDCTrajectory2D & trajectory2D)
explicit

Construct a trajectory from a two dimensional circular trajectory filling the remaining two parameters and covariance matrix with default values.

Definition at line 57 of file CDCTrajectory3D.cc.

59{
60}
CDCTrajectory3D()
Default constructor for ROOT compatibility.
static CDCTrajectorySZ basicAssumption()
Constructs a basic assumption, what the z0 start position and the sz slope are, including some broad ...

◆ CDCTrajectory3D() [7/12]

CDCTrajectory3D ( const ROOT::Math::XYZVector & pos3D,
double time,
const ROOT::Math::XYZVector & mom3D,
double charge,
double bZ )

Construct a trajectory with given start point, momentum at the start point and given charge.

Additionally this can takes an explicit bZ value instead of a field value from the instance BFieldMap.

Definition at line 62 of file CDCTrajectory3D.cc.

67 : m_localOrigin(pos3D)
68 , m_localHelix(CDCBFieldUtil::absMom2DToCurvature(mom3D.Rho(), charge, bZ),
69 VectorUtil::unit(VectorUtil::getXYVector(mom3D)),
70 0.0,
71 (mom3D.Z() / mom3D.Rho()), // double cotTheta() const { return z() / Rho(); }
72 0.0)
73 , m_flightTime(time)
74{
75}
static double absMom2DToCurvature(double absMom2D, double charge, double bZ)
Conversion helper for momenta to two dimensional curvature.

◆ CDCTrajectory3D() [8/12]

CDCTrajectory3D ( const ROOT::Math::XYZVector & pos3D,
double time,
const ROOT::Math::XYZVector & mom3D,
double charge )

Construct a trajectory with given start point, momentum at the start point and given charge.

Definition at line 77 of file CDCTrajectory3D.cc.

81 : CDCTrajectory3D(pos3D, time, mom3D, charge, CDCBFieldUtil::getBFieldZ(pos3D))
82{
83}
static double getBFieldZ()
Getter for the signed magnetic field strength in z direction at the origin ( in Tesla )

◆ CDCTrajectory3D() [9/12]

CDCTrajectory3D ( const MCParticle & mcParticle,
double bZ )

Construct a trajectory from the MCParticles vertex and momentum.

Definition at line 85 of file CDCTrajectory3D.cc.

86 : CDCTrajectory3D(ROOT::Math::XYZVector{mcParticle.getProductionVertex()},
87 mcParticle.getProductionTime(),
88 ROOT::Math::XYZVector{mcParticle.getMomentum()},
89 mcParticle.getCharge(),
90 bZ)
91{
92}
ROOT::Math::XYZVector getProductionVertex() const
Return production vertex position.
Definition MCParticle.h:178
float getCharge() const
Return the particle charge defined in TDatabasePDG.
Definition MCParticle.cc:36
float getProductionTime() const
Return production time in ns.
Definition MCParticle.h:148
ROOT::Math::XYZVector getMomentum() const
Return momentum.
Definition MCParticle.h:187

◆ CDCTrajectory3D() [10/12]

CDCTrajectory3D ( const MCParticle & mcParticle)
explicit

Construct a trajectory from the MCParticles vertex and momentum.

Definition at line 94 of file CDCTrajectory3D.cc.

95 : CDCTrajectory3D(ROOT::Math::XYZVector{mcParticle.getProductionVertex()},
96 mcParticle.getProductionTime(),
97 ROOT::Math::XYZVector{mcParticle.getMomentum()},
98 mcParticle.getCharge())
99{
100}

◆ CDCTrajectory3D() [11/12]

CDCTrajectory3D ( const genfit::TrackCand & gfTrackCand,
double bZ )

Construct a trajectory by extracting the seed position of the genfit::TrackCand.

Definition at line 102 of file CDCTrajectory3D.cc.

103 : CDCTrajectory3D(ROOT::Math::XYZVector{gfTrackCand.getPosSeed()},
104 gfTrackCand.getTimeSeed(),
105 ROOT::Math::XYZVector{gfTrackCand.getMomSeed()},
106 gfTrackCand.getChargeSeed(),
107 bZ)
108{
109 // Maybe push these out of this function:
110 // Indices of the cartesian coordinates
111 const int iX = 0;
112 const int iY = 1;
113 const int iZ = 2;
114 const int iPx = 3;
115 const int iPy = 4;
116 const int iPz = 5;
117
118 const TMatrixDSym& seedCov = gfTrackCand.getCovSeed();
119 CovarianceMatrix<6> cov6 = TMatrixConversion::fromTMatrix<6>(seedCov);
120
121 // 1. Rotate to a system where phi0 = 0
122 JacobianMatrix<6, 6> jacobianRot = JacobianMatrixUtil::zero<6, 6>();
123
124 const double px = gfTrackCand.getStateSeed()[iPx];
125 const double py = gfTrackCand.getStateSeed()[iPy];
126 const double pt = hypot2(px, py);
127
128 const double cosPhi0 = px / pt;
129 const double sinPhi0 = py / pt;
130
131 // Passive rotation matrix by phi0:
132 jacobianRot(iX, iX) = cosPhi0;
133 jacobianRot(iX, iY) = sinPhi0;
134 jacobianRot(iY, iX) = -sinPhi0;
135 jacobianRot(iY, iY) = cosPhi0;
136 jacobianRot(iZ, iZ) = 1.0;
137
138 jacobianRot(iPx, iPx) = cosPhi0;
139 jacobianRot(iPx, iPy) = sinPhi0;
140 jacobianRot(iPy, iPx) = -sinPhi0;
141 jacobianRot(iPy, iPy) = cosPhi0;
142 jacobianRot(iPz, iPz) = 1.0;
143
144 // Apply transformation inplace
145 CovarianceMatrixUtil::transport(jacobianRot, cov6);
146
147 // 2. Translate to perigee parameters
148 JacobianMatrix<5, 6> jacobianReduce = JacobianMatrixUtil::zero<5, 6>();
149
150 const double invPt = 1 / pt;
151 const double invPtSquared = invPt * invPt;
152 const double pz = gfTrackCand.getStateSeed()[iPz];
153 const double alpha = CDCBFieldUtil::getAlphaFromBField(bZ);
154 const double charge = gfTrackCand.getChargeSeed();
155
156 using namespace NHelixParameterIndices;
157 jacobianReduce(c_Curv, iPx) = charge * invPtSquared / alpha ;
158 jacobianReduce(c_Phi0, iPy) = invPt;
159 jacobianReduce(c_I, iY) = 1;
160 jacobianReduce(c_TanL, iPx) = - pz * invPtSquared;
161 jacobianReduce(c_TanL, iPz) = invPt;
162 jacobianReduce(c_Z0, iZ) = 1;
163 // Note the column corresponding to iX is completely zero as expectable.
164
165 CovarianceMatrix<5> cov5 = CovarianceMatrixUtil::transported(jacobianReduce, cov6);
166 const HelixCovariance& helixCovariance = cov5;
167
168 // The covariance should now be the correct 5x5 covariance matrix.
169 m_localHelix.setHelixCovariance(helixCovariance);
170}
static double getAlphaFromBField(double bField)
Translator from magnetic field strength in Tesla to the alpha value.
static CovarianceMatrix< M > transported(const JacobianMatrix< M, N > &jacobian, const CovarianceMatrix< N > &cov)
Return a copy of the covariance matrix transported with the given jacobian matrix.
static void transport(const JacobianMatrix< N, N > &jacobian, CovarianceMatrix< N > &cov)
Transport the covariance matrix inplace with the given jacobian matrix.
static JacobianMatrix< M, N > zero()
Construct a zero matrix.
static CovarianceMatrix< N > fromTMatrix(const TMatrixDSym &tCov)
Create a covariance matrix from a TMatrix representation.

◆ CDCTrajectory3D() [12/12]

CDCTrajectory3D ( const genfit::TrackCand & gfTrackCand)
explicit

Construct a trajectory by extracting the seed position of the genfit::TrackCand.

Definition at line 172 of file CDCTrajectory3D.cc.

173 : CDCTrajectory3D(gfTrackCand, CDCBFieldUtil::getBFieldZ(ROOT::Math::XYZVector{gfTrackCand.getPosSeed()}))
174{
175}

Member Function Documentation

◆ calcArcLength2D()

double calcArcLength2D ( const ROOT::Math::XYZVector & point) const
inline

Calculate the travel distance from the start position of the trajectory.

Returns the travel distance on the trajectory from the start point to
the given point. This is subjected to a discontinuity at the far point
of the circle. Hence the value return is in the range from -pi*radius to pi*radius
If you have a heavily curling track you have care about the feasibility of this
calculation.

Definition at line 179 of file CDCTrajectory3D.h.

180 {
181 return getLocalHelix()->circleXY().arcLengthTo(VectorUtil::getXYVector(point - getLocalOrigin()));
182 }

◆ clear()

void clear ( )
inline

Clears all information from this trajectoy.

Definition at line 131 of file CDCTrajectory3D.h.

132 {
133 m_localOrigin.SetXYZ(0.0, 0.0, 0.0);
134 m_localHelix.invalidate();
135 m_flightTime = NAN;
136 }

◆ fillInto() [1/2]

bool fillInto ( genfit::TrackCand & gfTrackCand,
double bZ ) const

Copies the trajectory information to the Genfit track candidate.

Definition at line 268 of file CDCTrajectory3D.cc.

269{
270 // Set the start parameters
271 ROOT::Math::XYZVector position = getSupport();
272 ROOT::Math::XYZVector momentum = bZ == 0 ? getFlightDirection3DAtSupport() : getMom3DAtSupport(bZ);
273 ESign charge = getChargeSign();
274
275 // Do not propagate invalid fits, signal that the fit is invalid to the caller.
276 if (not ESignUtil::isValid(charge) or VectorUtil::hasNAN(momentum) or VectorUtil::hasNAN(position)) {
277 return false;
278 }
279
280 gfTrackCand.setPosMomSeed(XYZToTVector(position), XYZToTVector(momentum), charge);
281
282 const CovarianceMatrix<6> cov6 = calculateCovarianceMatrix(getLocalHelix(), momentum, charge, bZ);
283 TMatrixDSym covSeed = TMatrixConversion::toTMatrix(cov6);
284
285 gfTrackCand.setCovSeed(covSeed);
286
287 return true;
288}
ESign getChargeSign() const
Gets the charge sign of the trajectory.
ROOT::Math::XYZVector getMom3DAtSupport(const double bZ) const
Get the momentum at the start point of the trajectory.
const UncertainHelix & getLocalHelix() const
Getter for the helix in local coordinates.
ROOT::Math::XYZVector getFlightDirection3DAtSupport() const
Get the unit momentum at the start point of the trajectory.
ROOT::Math::XYZVector getSupport() const
Getter for the support point of the trajectory in global coordinates, where arcLength2D = 0.
static constexpr auto XYZToTVector
Helper function to convert XYZVector to TVector3.
Definition VectorUtil.h:26
ESign
Enumeration for the distinct sign values of floating point variables.
Definition ESign.h:27
bool isValid(ESign s)
Returns true if sign is ESign::c_Plus, ESign::c_Minus or ESign::c_Zero.
Definition ESign.h:46
static TMatrixDSym toTMatrix(const CovarianceMatrix< N > &cov)
Translate the covariance matrix to the TMatrix representation.

◆ fillInto() [2/2]

bool fillInto ( genfit::TrackCand & trackCand) const

Copies the trajectory information to the Genfit track candidate.

Definition at line 262 of file CDCTrajectory3D.cc.

263{
264 ROOT::Math::XYZVector position = getSupport();
265 return fillInto(trackCand, CDCBFieldUtil::getBFieldZ(position));
266}
bool fillInto(genfit::TrackCand &trackCand) const
Copies the trajectory information to the Genfit track candidate.

◆ getAbsMom3D() [1/2]

double getAbsMom3D ( ) const

Get the estimation for the absolute value of the transvers momentum.

Definition at line 318 of file CDCTrajectory3D.cc.

319{
320 ROOT::Math::XYZVector position = getSupport();
321 double tanLambda = getLocalHelix()->tanLambda();
322 double factor2DTo3D = hypot2(1, tanLambda);
323 double curvatureXY = getLocalHelix()->curvatureXY();
324 double absMom2D = CDCBFieldUtil::curvatureToAbsMom2D(curvatureXY, position);
325 return factor2DTo3D * absMom2D;
326}
static double curvatureToAbsMom2D(double curvature, double bZ)
Conversion helper for two dimensional curvature to momenta.
double tanLambda() const
Getter for the proportinality factor from arc length in xy space to z.
Definition Helix.h:245
double curvatureXY() const
Getter for the signed curvature in the xy projection.
Definition Helix.h:208

◆ getAbsMom3D() [2/2]

double getAbsMom3D ( double bZ) const

Get the estimation for the absolute value of the transvers momentum.

Definition at line 309 of file CDCTrajectory3D.cc.

310{
311 double tanLambda = getLocalHelix()->tanLambda();
312 double factor2DTo3D = hypot2(1, tanLambda);
313 double curvatureXY = getLocalHelix()->curvatureXY();
314 double absMom2D = CDCBFieldUtil::curvatureToAbsMom2D(curvatureXY, bZ);
315 return factor2DTo3D * absMom2D;
316}

◆ getArcLength2DPeriod()

double getArcLength2DPeriod ( ) const
inline

Getter for the arc length for one round trip around the trajectory.

Definition at line 185 of file CDCTrajectory3D.h.

186 {
187 return getLocalHelix()->arcLength2DPeriod();
188 }

◆ getCartesianCovariance()

CovarianceMatrix< 6 > getCartesianCovariance ( double bZ) const

Convert the helix parameters to the cartesian coordinates x,y,z,px,py,pz.

Definition at line 290 of file CDCTrajectory3D.cc.

291{
292 // Set the start parameters
293 ROOT::Math::XYZVector momentum = bZ == 0 ? getFlightDirection3DAtSupport() : getMom3DAtSupport(bZ);
294 ESign charge = getChargeSign();
295 return calculateCovarianceMatrix(getLocalHelix(), momentum, charge, bZ);
296}

◆ getChargeSign()

ESign getChargeSign ( ) const

Gets the charge sign of the trajectory.

Definition at line 304 of file CDCTrajectory3D.cc.

305{
306 return CDCBFieldUtil::ccwInfoToChargeSign(getLocalHelix()->circleXY().orientation());
307}
static ESign ccwInfoToChargeSign(ERotation ccwInfo)
Conversion helper from clockwise or counterclockwise travel to the charge sign.

◆ getChi2()

double getChi2 ( ) const
inline

Getter for the chi2 value of the fit.

Definition at line 316 of file CDCTrajectory3D.h.

317 {
318 return getLocalHelix().chi2();
319 }

◆ getCurvatureXY()

double getCurvatureXY ( ) const
inline

Getter for the curvature as seen from the xy projection.

Definition at line 304 of file CDCTrajectory3D.h.

305 {
306 return getLocalHelix()->curvatureXY();
307 }

◆ getFlightDirection3DAtSupport()

ROOT::Math::XYZVector getFlightDirection3DAtSupport ( ) const
inline

Get the unit momentum at the start point of the trajectory.

Definition at line 221 of file CDCTrajectory3D.h.

222 {
223 return getLocalHelix()->tangential();
224 }

◆ getFlightTime()

double getFlightTime ( ) const
inline

Getter for the time when the particle reached the support point position.

Definition at line 365 of file CDCTrajectory3D.h.

366 {
367 return m_flightTime;
368 }

◆ getGlobalCenter()

ROOT::Math::XYVector getGlobalCenter ( ) const
inline

Getter for the center of the helix in global coordinates.

Definition at line 240 of file CDCTrajectory3D.h.

241 {
242 return getLocalHelix()->centerXY() + VectorUtil::getXYVector(m_localOrigin);
243 }

◆ getGlobalCircle()

PerigeeCircle getGlobalCircle ( ) const

Getter for the circle in global coordinates.

Definition at line 350 of file CDCTrajectory3D.cc.

351{
352 // Down cast since we do not necessarily won't the covariance matrix transformed as well
353 PerigeeCircle result(getLocalHelix()->circleXY());
354 result.passiveMoveBy(-VectorUtil::getXYVector(getLocalOrigin()));
355 return result;
356}
const ROOT::Math::XYZVector & getLocalOrigin() const
Getter for the origin of the local coordinate system.

◆ getGlobalImpact()

double getGlobalImpact ( ) const
inline

Getter for the signed impact parameter of the trajectory.

Definition at line 263 of file CDCTrajectory3D.h.

264 {
265 return getLocalHelix()->distanceXY(-VectorUtil::getXYVector(m_localOrigin));
266 }

◆ getGlobalPerigee()

ROOT::Math::XYZVector getGlobalPerigee ( ) const
inline

Getter for the closest approach on the trajectory to the global origin.

Definition at line 234 of file CDCTrajectory3D.h.

235 {
236 return getLocalHelix()->closestXY(-VectorUtil::getXYVector(m_localOrigin)) + m_localOrigin;
237 }

◆ getLocalCircle()

UncertainPerigeeCircle getLocalCircle ( ) const

Getter for the circle in local coordinates.

Definition at line 358 of file CDCTrajectory3D.cc.

359{
361}
UncertainPerigeeCircle uncertainCircleXY() const
Projects the helix into the xy plain carrying over the relevant parts of the convariance matrix.

◆ getLocalCovariance()

double getLocalCovariance ( EHelixParameter iRow,
EHelixParameter iCol ) const
inline

Getter for an individual element of the covariance matrix of the local helix parameters.

Definition at line 285 of file CDCTrajectory3D.h.

286 {
287 return getLocalHelix().covariance(iRow, iCol);
288 }

◆ getLocalHelix()

const UncertainHelix & getLocalHelix ( ) const
inline

Getter for the helix in local coordinates.

Definition at line 340 of file CDCTrajectory3D.h.

341 {
342 return m_localHelix;
343 }

◆ getLocalOrigin()

const ROOT::Math::XYZVector & getLocalOrigin ( ) const
inline

Getter for the origin of the local coordinate system.

Definition at line 352 of file CDCTrajectory3D.h.

353 {
354 return m_localOrigin;
355 }

◆ getLocalSZLine()

UncertainSZLine getLocalSZLine ( ) const

Getter for the sz line starting from the local origin.

Definition at line 363 of file CDCTrajectory3D.cc.

364{
366}
UncertainSZLine uncertainSZLine() const
Reduces the helix to an sz line carrying over the relevant parts of the convariance matrix.

◆ getLocalVariance()

double getLocalVariance ( EHelixParameter i) const
inline

Getter for an individual diagonal element of the covariance matrix of the local helix parameters.

Definition at line 292 of file CDCTrajectory3D.h.

293 {
294 return getLocalHelix().variance(i);
295 }

◆ getMaximalCylindricalR()

double getMaximalCylindricalR ( ) const
inline

Getter for the maximal distance from the origin.

Definition at line 251 of file CDCTrajectory3D.h.

252 {
253 return std::fabs(getGlobalImpact() + 2 * getLocalHelix()->radiusXY());
254 }

◆ getMinimalCylindricalR()

double getMinimalCylindricalR ( ) const
inline

Getter for the minimal distance from the origin.

Definition at line 257 of file CDCTrajectory3D.h.

258 {
259 return std::fabs(getGlobalImpact());
260 }

◆ getMom3DAtSupport() [1/2]

ROOT::Math::XYZVector getMom3DAtSupport ( ) const
inline

Get the momentum at the start point of the trajectory.

Definition at line 215 of file CDCTrajectory3D.h.

216 {
217 return getFlightDirection3DAtSupport() * getAbsMom3D();
218 }

◆ getMom3DAtSupport() [2/2]

ROOT::Math::XYZVector getMom3DAtSupport ( const double bZ) const
inline

Get the momentum at the start point of the trajectory.

Definition at line 209 of file CDCTrajectory3D.h.

210 {
211 return getFlightDirection3DAtSupport() * getAbsMom3D(bZ);
212 }

◆ getNDF()

size_t getNDF ( ) const
inline

Getter for the number of degrees of freedom of the helix fit.

Definition at line 328 of file CDCTrajectory3D.h.

329 {
330 return getLocalHelix().ndf();
331 }

◆ getPValue()

double getPValue ( ) const
inline

Getter for p-value.

Definition at line 310 of file CDCTrajectory3D.h.

311 {
312 return TMath::Prob(getChi2(), getNDF());
313 }

◆ getSupport()

ROOT::Math::XYZVector getSupport ( ) const
inline

Getter for the support point of the trajectory in global coordinates, where arcLength2D = 0.

Definition at line 228 of file CDCTrajectory3D.h.

229 {
230 return getLocalHelix()->perigee() + getLocalOrigin();
231 }

◆ getTanLambda()

double getTanLambda ( ) const
inline

Getter for the slope of z over the transverse travel distance s.

Definition at line 298 of file CDCTrajectory3D.h.

299 {
300 return getLocalHelix()->tanLambda();
301 }

◆ getTrajectory2D()

CDCTrajectory2D getTrajectory2D ( ) const

Getter for the two dimensional trajectory.

Definition at line 335 of file CDCTrajectory3D.cc.

336{
337 return CDCTrajectory2D(VectorUtil::getXYVector(getLocalOrigin()),
338 getLocalHelix().uncertainCircleXY(),
339 getFlightTime());
340}
double getFlightTime() const
Getter for the time when the particle reached the support point position.

◆ getTrajectorySZ()

CDCTrajectorySZ getTrajectorySZ ( ) const

Getter for the sz trajectory.

Definition at line 342 of file CDCTrajectory3D.cc.

343{
344 UncertainSZLine globalSZLine = getLocalHelix().uncertainSZLine();
345 globalSZLine.passiveMoveBy(ROOT::Math::XYVector(0, -getLocalOrigin().z()));
346 return CDCTrajectorySZ(globalSZLine);
347}
void passiveMoveBy(const ROOT::Math::XYVector &bySZ)
Moves the coordinate system by the vector by and calculates the new sz line and its covariance matrix...

◆ isCurler()

bool isCurler ( double factor = 1) const

Checks if the trajectory leaves the outer radius of the CDC times the given tolerance factor.

Definition at line 298 of file CDCTrajectory3D.cc.

299{
300 const CDCWireTopology& topology = CDCWireTopology::getInstance();
301 return getMaximalCylindricalR() < factor * topology.getOuterCylindricalR();
302}
static CDCWireTopology & getInstance()
Getter for the singleton instance of the wire topology.
double getOuterCylindricalR() const
Getter for the outer radius of the outer most wire layer.
double getMaximalCylindricalR() const
Getter for the maximal distance from the origin.

◆ isFitted()

bool isFitted ( ) const
inline

Checks if the trajectory has already been set to a valid value.

Definition at line 125 of file CDCTrajectory3D.h.

126 {
127 return not isInvalid();
128 }

◆ isInvalid()

bool isInvalid ( ) const
inline

Checks if the trajectory is already set to a valid value.

Definition at line 119 of file CDCTrajectory3D.h.

120 {
121 return m_localHelix->isInvalid();
122 }

◆ reconstruct3D()

ROOT::Math::XYZVector reconstruct3D ( const CDC::WireLine & wireLine,
double distance = 0.0 ) const

Gives the three dimensional point which is on the dirft circle away from the wire line.

This method makes the reconstruction of the z coordinate possible by using the skewness
stereo layer of the stereo wires. The point is determined such that it is at the (signed) distance to the wire line.

◆ reverse()

void reverse ( )
inline

Reverses the trajectory in place.

Definition at line 150 of file CDCTrajectory3D.h.

151 {
152 m_localHelix.reverse();
153 m_flightTime = -m_flightTime;
154 }

◆ reversed()

CDCTrajectory3D reversed ( ) const
inline

Returns the reverse trajectory as a copy.

Definition at line 157 of file CDCTrajectory3D.h.

158 {
159 return CDCTrajectory3D(getLocalOrigin(), getLocalHelix().reversed(), -getFlightTime());
160 }
EForwardBackward reversed(EForwardBackward eForwardBackward)
Return the reversed forward backward indicator. Leaves EForwardBackward::c_Invalid the same.

◆ setChi2()

void setChi2 ( const double chi2)
inline

Setter for the chi square value of the helix fit.

Definition at line 322 of file CDCTrajectory3D.h.

323 {
324 return m_localHelix.setChi2(chi2);
325 }

◆ setFlightTime()

void setFlightTime ( double flightTime)
inline

Setter for the time when the particle reached the support point position.

Definition at line 371 of file CDCTrajectory3D.h.

372 {
373 m_flightTime = flightTime;
374 }

◆ setLocalHelix()

void setLocalHelix ( const UncertainHelix & localHelix)
inline

Setter for the helix that describes the trajectory in local coordinates.

Definition at line 346 of file CDCTrajectory3D.h.

347 {
348 m_localHelix = localHelix;
349 }

◆ setLocalOrigin()

double setLocalOrigin ( const ROOT::Math::XYZVector & localOrigin)

Setter for the origin of the local coordinate system.

This sets the origin point the local helix representation is subjected. The local helix is changed such that the set of points in global space is not changed.

Definition at line 368 of file CDCTrajectory3D.cc.

369{
370 double arcLength2D = calcArcLength2D(localOrigin);
371 double factor2DTo3D = hypot2(1, getTanLambda());
372 double arcLength3D = arcLength2D * factor2DTo3D;
373 m_flightTime += arcLength3D / Const::speedOfLight;
374 m_localHelix.passiveMoveBy(localOrigin - m_localOrigin);
375 m_localOrigin = localOrigin;
376 return arcLength2D;
377}
static const double speedOfLight
[cm/ns]
Definition Const.h:695
double getTanLambda() const
Getter for the slope of z over the transverse travel distance s.
double calcArcLength2D(const ROOT::Math::XYZVector &point) const
Calculate the travel distance from the start position of the trajectory.

◆ setNDF()

void setNDF ( std::size_t ndf)
inline

Setter for the number of degrees of freedom of the helix fit.

Definition at line 334 of file CDCTrajectory3D.h.

335 {
336 return m_localHelix.setNDF(ndf);
337 }

◆ shiftPeriod()

double shiftPeriod ( int nPeriods)

Adjusts the z0 to the one that lies n periods forward.

Returns
The two dimensional arc length needed to travel from the old to the new support point.

Definition at line 328 of file CDCTrajectory3D.cc.

329{
330 double arcLength2D = m_localHelix.shiftPeriod(nPeriods);
331 m_flightTime += arcLength2D / Const::speedOfLight;
332 return arcLength2D;
333}

Member Data Documentation

◆ m_flightTime

double m_flightTime = NAN
private

Memory for the estimation of the time at which the particle arrived at the support point.

Definition at line 385 of file CDCTrajectory3D.h.

◆ m_localHelix

UncertainHelix m_localHelix
private

Memory for the generalized circle describing the trajectory in coordinates from the local origin.

Definition at line 382 of file CDCTrajectory3D.h.

◆ m_localOrigin

ROOT::Math::XYZVector m_localOrigin
private

Memory for local coordinate origin of the circle representing the trajectory in global coordinates.

Definition at line 378 of file CDCTrajectory3D.h.


The documentation for this class was generated from the following files: