25 bool trackAlongPlaneDir)
const 27 const double& sinalpha = trigCache.
fSinA;
28 const double& cosalpha = trigCache.
fCosA;
29 const double& sinbeta = trigCache.
fSinB;
30 const double& cosbeta = trigCache.
fCosB;
33 par5d[4] * std::sqrt(1. + par5d[2] * par5d[2] + par5d[3] * par5d[3]) :
34 -par5d[4] * std::sqrt(1. + par5d[2] * par5d[2] + par5d[3] * par5d[3]));
36 par6d[0] = planePos.X() + par5d[0] * cosalpha;
37 par6d[1] = planePos.Y() + par5d[0] * sinalpha * sinbeta + par5d[1] * cosbeta;
38 par6d[2] = planePos.Z() - par5d[0] * sinalpha * cosbeta + par5d[1] * sinbeta;
39 par6d[3] = (par5d[2] * cosalpha + 1. * sinalpha) / denom;
40 par6d[4] = (par5d[2] * sinalpha * sinbeta + par5d[3] * cosbeta - cosalpha * sinbeta) / denom;
41 par6d[5] = (-par5d[2] * sinalpha * cosbeta + par5d[3] * sinbeta + cosalpha * cosbeta) / denom;
50 const double& sinalpha = trigCache.
fSinA;
51 const double& cosalpha = trigCache.
fCosA;
52 const double& sinbeta = trigCache.
fSinB;
53 const double& cosbeta = trigCache.
fCosB;
55 par6d[3] * cosalpha + par6d[4] * sinalpha * sinbeta - par6d[5] * sinalpha * cosbeta;
56 const double pv = par6d[4] * cosbeta + par6d[5] * sinbeta;
58 par6d[3] * sinalpha - par6d[4] * cosalpha * sinbeta + par6d[5] * cosalpha * cosbeta;
59 const double pval = sqrt(par6d[3] * par6d[3] + par6d[4] * par6d[4] + par6d[5] * par6d[5]);
61 par5d[0] = (par6d[0] - planePos.X()) * cosalpha +
62 (par6d[1] - planePos.Y()) * sinalpha * sinbeta -
63 (par6d[2] - planePos.Z()) * sinalpha * cosbeta;
64 par5d[1] = (par6d[1] - planePos.Y()) * cosbeta + (par6d[2] - planePos.Z()) * sinbeta;
67 par5d[4] = (pval > 0 ? 1. / pval : 1.);
76 bool trackAlongPlaneDir = trackMomOrDir.Dot(planeDir) > 0;
77 const double& sinalpha = trigCache.
fSinA;
78 const double& cosalpha = trigCache.
fCosA;
79 const double& sinbeta = trigCache.
fSinB;
80 const double& cosbeta = trigCache.
fCosB;
81 const double pu = trackMomOrDir.X() * cosalpha + trackMomOrDir.Y() * sinalpha * sinbeta -
82 trackMomOrDir.Z() * sinalpha * cosbeta;
83 const double pv = trackMomOrDir.Y() * cosbeta + trackMomOrDir.Z() * sinbeta;
84 const double pw = trackMomOrDir.X() * sinalpha - trackMomOrDir.Y() * cosalpha * sinbeta +
85 trackMomOrDir.Z() * cosalpha * cosbeta;
87 const double l2 = pu / pw;
88 const double l3 = pv / pw;
89 const double p2 = trackMomOrDir.X() * trackMomOrDir.X() +
90 trackMomOrDir.Y() * trackMomOrDir.Y() +
91 trackMomOrDir.Z() * trackMomOrDir.Z();
92 const double l4 = (hasMomentum ? 1. / sqrt(p2) : 1.);
94 (trackAlongPlaneDir ? l4 * (l2 * l2 + l3 * l3 + 1.) * sqrt(l2 * l2 + l3 * l3 + 1.) :
95 -l4 * (l2 * l2 + l3 * l3 + 1.) * sqrt(l2 * l2 + l3 * l3 + 1.));
96 const double den4 = l4 * l4 * sqrt(l2 * l2 + l3 * l3 + 1.);
105 j(1, 0) = sinalpha * sinbeta;
111 j(2, 0) = -sinalpha * cosbeta;
119 j(3, 2) = (cosalpha * (l3 * l3 + 1.) - sinalpha * l2) / den23;
120 j(3, 3) = -l3 * (l2 * cosalpha + sinalpha) / den23;
121 j(3, 4) = (hasMomentum ? -(l2 * cosalpha + sinalpha) / den4 : 0.);
126 (cosalpha * sinbeta * l2 - cosbeta * l2 * l3 + sinalpha * sinbeta * (l3 * l3 + 1.)) / den23;
127 j(4, 3) = (sinbeta * l3 * (cosalpha - sinalpha * l2) + cosbeta * (l2 * l2 + 1.)) / den23;
129 (hasMomentum ? (cosalpha * sinbeta - cosbeta * l3 - sinalpha * sinbeta * l2) / den4 : 0.);
133 j(5, 2) = -(cosalpha * cosbeta * l2 + cosbeta * sinalpha * l3 * l3 + cosbeta * sinalpha +
137 (-cosalpha * cosbeta * l3 + cosbeta * sinalpha * l2 * l3 + sinbeta * l2 * l2 + sinbeta) /
140 (hasMomentum ? (-cosalpha * cosbeta + cosbeta * sinalpha * l2 - sinbeta * l3) / den4 : 0.);
150 const double& sinalpha = trigCache.
fSinA;
151 const double& cosalpha = trigCache.
fCosA;
152 const double& sinbeta = trigCache.
fSinB;
153 const double& cosbeta = trigCache.
fCosB;
154 const double den23 = (cosalpha * (cosbeta * trackMomOrDir.Z() - sinbeta * trackMomOrDir.Y()) +
155 sinalpha * trackMomOrDir.X()) *
156 (cosalpha * (cosbeta * trackMomOrDir.Z() - sinbeta * trackMomOrDir.Y()) +
157 sinalpha * trackMomOrDir.X());
159 sqrt(trackMomOrDir.X() * trackMomOrDir.X() + trackMomOrDir.Y() * trackMomOrDir.Y() +
160 trackMomOrDir.Z() * trackMomOrDir.Z()) *
161 (trackMomOrDir.X() * trackMomOrDir.X() + trackMomOrDir.Y() * trackMomOrDir.Y() +
162 trackMomOrDir.Z() * trackMomOrDir.Z());
166 j(0, 1) = sinalpha * sinbeta;
167 j(0, 2) = -sinalpha * cosbeta;
182 j(2, 3) = ((cosalpha * cosalpha + sinalpha * sinalpha) *
183 (cosbeta * trackMomOrDir.Z() - sinbeta * trackMomOrDir.Y())) /
185 j(2, 4) = (sinbeta * trackMomOrDir.X() * (cosalpha * cosalpha + sinalpha * sinalpha)) / den23;
187 -(cosbeta * trackMomOrDir.X() * (cosalpha * cosalpha + sinalpha * sinalpha)) / den23;
192 j(3, 3) = -(sinalpha * (cosbeta * trackMomOrDir.Y() + sinbeta * trackMomOrDir.Z())) / den23;
193 j(3, 4) = (cosalpha * trackMomOrDir.Z() * (cosbeta * cosbeta + sinbeta * sinbeta) +
194 cosbeta * sinalpha * trackMomOrDir.X()) /
196 j(3, 5) = (-cosalpha * cosbeta * cosbeta * trackMomOrDir.Y() -
197 cosalpha * sinbeta * sinbeta * trackMomOrDir.Y() +
198 sinalpha * sinbeta * trackMomOrDir.X()) /
204 j(4, 3) = (hasMomentum ? -trackMomOrDir.X() / den4 : 0.);
205 j(4, 4) = (hasMomentum ? -trackMomOrDir.Y() / den4 : 0.);
206 j(4, 5) = (hasMomentum ? -trackMomOrDir.Z() / den4 : 0.);
214 const double& sinalpha = trigCache.
fSinA;
215 const double& cosalpha = trigCache.
fCosA;
216 const double& sinbeta = trigCache.
fSinB;
217 const double& cosbeta = trigCache.
fCosB;
221 -sinalpha * cosbeta ,
226 -cosalpha * sinbeta ,
234 const double& sinalpha = trigCache.
fSinA;
235 const double& cosalpha = trigCache.
fCosA;
236 const double& sinbeta = trigCache.
fSinB;
237 const double& cosbeta = trigCache.
fCosB;
244 -cosalpha * sinbeta ,
245 -sinalpha * cosbeta ,
SMatrix65 Local5DToGlobal6DJacobian(bool hasMomentum, const Vector_t &trackMomOrDir) const
Compute the jacobian to translate track covariance from local to global coordinates. The track momentum (or direction) is needed to compute the jacobian. Local coordinates are on the plane orthogonal to planeDir (it may be the same direction as the momentum, but the function is generic).
Struct caching trigonometric function results.
Reconstruction base classes.
Rotation_t Global3DToLocal3DRotation() const
Calculate rotation matrices from global (x,y,z) to local (u,v,w) coordinates.
SVector5 Global6DToLocal5DParameters(const SVector6 &par6d) const
Function to convert parameters from global to local coordinates. Local coordinates are on the plane w...
ROOT::Math::SMatrix< Double32_t, 6, 5 > SMatrix65
ROOT::Math::SVector< Double32_t, 6 > SVector6
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< Coord_t >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space. See recob::tracking::Coord_t for more details on the ...
SVector6 Local5DToGlobal6DParameters(const SVector5 &par5d, bool trackAlongPlaneDir=true) const
Function to convert parameters from local to global coordinates. Local coordinates are on the plane w...
ROOT::Math::Rotation3D Rotation_t
Type for representation of space rotations.
ROOT::Math::SVector< Double32_t, 5 > SVector5
ROOT::Math::SMatrix< Double32_t, 5, 6 > SMatrix56
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< Coord_t >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space. See recob::tracking::Coord_t for more detai...
Rotation_t Local3DToGlobal3DRotation() const
Calculate rotation matrices from local (u,v,w) to global (x,y,z) coordinates.
SMatrix56 Global6DToLocal5DJacobian(bool hasMomentum, const Vector_t &trackMomOrDir) const
Compute the jacobian to translate track covariance from global to local coordinates. The track momentum (or direction) is needed to compute the jacobian. Local coordinates are on the plane orthogonal to planeDir (it may be the same direction as the momentum, but the function is generic). Warning: some information may be lost in degenerate cases, e.g. the unceratinty along z position when converting to a x-y plane (fixed z)