8#include <framework/dataobjects/UncertainHelix.h>
15using namespace HelixParameterIndex;
25 const ROOT::Math::XYZVector& momentum,
26 const short int charge,
28 const TMatrixDSym& cartesianCovariance,
29 const double pValue) :
30 Helix(ROOT::Math::XYZVector(0.0, 0.0, position.Z()), momentum, charge, bZ),
31 m_covariance(cartesianCovariance),
47 TMatrixD jacobianRot(6, 6);
50 const double px = momentum.X();
51 const double py = momentum.Y();
52 const double pt = hypot(px, py);
53 const double cosPhi0 = px / pt;
54 const double sinPhi0 = py / pt;
57 jacobianRot(iX, iX) = cosPhi0;
58 jacobianRot(iX, iY) = sinPhi0;
59 jacobianRot(iY, iX) = -sinPhi0;
60 jacobianRot(iY, iY) = cosPhi0;
61 jacobianRot(iZ, iZ) = 1.0;
63 jacobianRot(iPx, iPx) = cosPhi0;
64 jacobianRot(iPx, iPy) = sinPhi0;
65 jacobianRot(iPy, iPx) = -sinPhi0;
66 jacobianRot(iPy, iPy) = cosPhi0;
67 jacobianRot(iPz, iPz) = 1.0;
72 const double pz = momentum.Z();
73 const double invPt = 1 / pt;
74 const double invPtSquared = invPt * invPt;
77 TMatrixD jacobianToHelixParameters(5, 6);
78 jacobianToHelixParameters.Zero();
80 jacobianToHelixParameters(iD0, iY) = -1;
81 jacobianToHelixParameters(iPhi0, iX) = charge * invPt / alpha;
82 jacobianToHelixParameters(iPhi0, iPy) = invPt;
83 jacobianToHelixParameters(iOmega, iPx) = -charge * invPtSquared / alpha;
84 jacobianToHelixParameters(iTanLambda, iPx) = - pz * invPtSquared;
85 jacobianToHelixParameters(iTanLambda, iPz) = invPt;
86 jacobianToHelixParameters(iZ0, iX) = - pz * invPt;
87 jacobianToHelixParameters(iZ0, iZ) = 1;
102 const double& tanLambda,
103 const TMatrixDSym& covariance,
104 const double pValue) :
105 Helix(d0, phi0, omega, z0, tanLambda),
106 m_covariance(covariance),
126 TMatrixD jacobianInflate(6, 5);
127 jacobianInflate.Zero();
133 const double& d0 =
getD0();
137 const double alpha =
getAlpha(bZ_tesla);
138 const double absAlphaOmega = alpha * std::fabs(omega);
139 const double signedAlphaOmega2 = absAlphaOmega * omega;
141 const double invAbsAlphaOmega = 1.0 / absAlphaOmega;
142 const double invSignedAlphaOmega2 = 1.0 / signedAlphaOmega2;
145 jacobianInflate(iX, iPhi0) = d0;
146 jacobianInflate(iY, iD0) = -1.0;
147 jacobianInflate(iZ, iZ0) = 1.0;
150 jacobianInflate(iPx, iOmega) = -invSignedAlphaOmega2;
151 jacobianInflate(iPy, iPhi0) = invAbsAlphaOmega;
152 jacobianInflate(iPz, iOmega) = -tanLambda * invSignedAlphaOmega2;
153 jacobianInflate(iPz, iTanLambda) = invAbsAlphaOmega;
156 cov6.Similarity(jacobianInflate);
162 TMatrixD jacobianRot(6, 6);
166 jacobianRot(iX, iX) = cosPhi0;
167 jacobianRot(iX, iY) = -sinPhi0;
168 jacobianRot(iY, iX) = sinPhi0;
169 jacobianRot(iY, iY) = cosPhi0;
170 jacobianRot(iZ, iZ) = 1.0;
172 jacobianRot(iPx, iPx) = cosPhi0;
173 jacobianRot(iPx, iPy) = -sinPhi0;
174 jacobianRot(iPy, iPx) = sinPhi0;
175 jacobianRot(iPy, iPy) = cosPhi0;
176 jacobianRot(iPz, iPz) = 1.0;
178 cov6.Similarity(jacobianRot);
189 TMatrixD jacobianReverse(5, 5);
190 jacobianReverse.UnitMatrix();
191 jacobianReverse(iD0, iD0) = -1;
192 jacobianReverse(iOmega, iOmega) = -1;
193 jacobianReverse(iTanLambda, iTanLambda) = -1;
203 TMatrixD jacobianPassiveMove(5, 5);
This class represents an ideal helix in perigee parameterization.
double getSinPhi0() const
Getter for the cosine of the azimuth angle of travel direction at the perigee.
void reverse()
Reverses the direction of travel of the helix in place.
double getCosPhi0() const
Getter for the cosine of the azimuth angle of travel direction at the perigee.
static double getAlpha(const double bZ)
Calculates the alpha value for a given magnetic field in Tesla.
double getOmega() const
Getter for omega, which is a signed curvature measure of the track.
double getD0() const
Getter for d0, which is the signed distance to the perigee in the r-phi plane.
double passiveMoveBy(const ROOT::Math::XYZVector &by)
Moves origin of the coordinate system (passive transformation) by the given vector.
double getTanLambda() const
Getter for tan lambda, which is the z over two dimensional arc length slope of the track.
TMatrixD calcPassiveMoveByJacobian(const ROOT::Math::XYZVector &by, const double expandBelowChi=M_PI/8) const
Calculate the 5x5 jacobian matrix for the transport of the helix parameters, when moving the origin o...
UncertainHelix()
Default constuctor initialising all members to zero.
void reverse()
Reverses the direction of travel of the helix in place.
TMatrixDSym getCartesianCovariance(const double bZ_tesla=1.5) const
Getter for the position and momentum covariance matrix.
double passiveMoveBy(const ROOT::Math::XYZVector &by)
Moves origin of the coordinate system (passive transformation) by the given vector.
TMatrixDSym m_covariance
5x5 covariance of the perigee parameters.
Abstract base class for different kinds of events.