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);
52 const double pt = hypot(px, py);
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;
73 const double invPt = 1 / pt;
74 const double invPtSquared = invPt * invPt;
75 const double alpha = getAlpha(bZ);
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();
134 const double& omega = getOmega();
135 const double& tanLambda = getTanLambda();
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);
159 const double&
cosPhi0 = getCosPhi0();
160 const double&
sinPhi0 = getSinPhi0();
162 TMatrixD jacobianRot(6, 6);
167 jacobianRot(iX, iY) = -
sinPhi0;
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);
204 calcPassiveMoveByJacobian(byX, byY, jacobianPassiveMove);
Hep3Vector momentum(double dPhi=0.) const
returns momentum vector after rotating angle dPhi in phi direction.
double cosPhi0(void) const
Return cos phi0.
double sinPhi0(void) const
Return sin phi0.
void reverse()
Reverses the direction of travel of the helix in place.
double passiveMoveBy(const ROOT::Math::XYZVector &by)
Moves origin of the coordinate system (passive transformation) by the given vector.
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.