File indexing completed on 2025-01-18 09:11:27
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include "Acts/Propagator/detail/JacobianEngine.hpp"
0010
0011 #include "Acts/Definitions/Algebra.hpp"
0012 #include "Acts/Definitions/TrackParametrization.hpp"
0013 #include "Acts/Geometry/GeometryContext.hpp"
0014 #include "Acts/Surfaces/CurvilinearSurface.hpp"
0015 #include "Acts/Surfaces/Surface.hpp"
0016 #include "Acts/Utilities/AlgebraHelpers.hpp"
0017
0018 namespace Acts {
0019
0020 void detail::boundToBoundTransportJacobian(
0021 const GeometryContext& geoContext, const Surface& surface,
0022 const FreeVector& freeParameters,
0023 const BoundToFreeMatrix& boundToFreeJacobian,
0024 const FreeMatrix& freeTransportJacobian,
0025 const FreeVector& freeToPathDerivatives,
0026 BoundMatrix& fullTransportJacobian) {
0027 const Vector3 position = freeParameters.segment<3>(eFreePos0);
0028 const Vector3 direction = freeParameters.segment<3>(eFreeDir0);
0029
0030
0031 const FreeToPathMatrix freeToPath =
0032 surface.freeToPathDerivative(geoContext, position, direction);
0033
0034 FreeToBoundMatrix freeToBoundJacobian =
0035 surface.freeToBoundJacobian(geoContext, position, direction);
0036
0037
0038
0039
0040
0041 fullTransportJacobian =
0042 freeToBoundJacobian *
0043 (FreeMatrix::Identity() + freeToPathDerivatives * freeToPath) *
0044 freeTransportJacobian * boundToFreeJacobian;
0045 }
0046
0047 BoundMatrix detail::boundToBoundTransportJacobian(
0048 const GeometryContext& geoContext, const FreeVector& freeParameters,
0049 const BoundToFreeMatrix& boundToFreeJacobian,
0050 const FreeMatrix& freeTransportJacobian,
0051 const FreeVector& freeToPathDerivatives, const Surface& surface) {
0052 BoundMatrix result;
0053 detail::boundToBoundTransportJacobian(
0054 geoContext, surface, freeParameters, boundToFreeJacobian,
0055 freeTransportJacobian, freeToPathDerivatives, result);
0056 return result;
0057 }
0058
0059 void detail::boundToCurvilinearTransportJacobian(
0060 const Vector3& direction, const BoundToFreeMatrix& boundToFreeJacobian,
0061 const FreeMatrix& freeTransportJacobian,
0062 const FreeVector& freeToPathDerivatives,
0063 BoundMatrix& fullTransportJacobian) {
0064
0065 FreeToBoundMatrix freeToBoundJacobian =
0066 CurvilinearSurface(direction).freeToBoundJacobian();
0067
0068
0069
0070 freeToBoundJacobian.topLeftCorner<6, 3>() +=
0071 (freeToBoundJacobian * freeToPathDerivatives) *
0072 (-1.0 * direction).transpose();
0073
0074
0075
0076
0077
0078 fullTransportJacobian =
0079 freeToBoundJacobian * freeTransportJacobian * boundToFreeJacobian;
0080 }
0081
0082 BoundToFreeMatrix detail::boundToFreeTransportJacobian(
0083 const BoundToFreeMatrix& boundToFreeJacobian,
0084 const FreeMatrix& freeTransportJacobian) {
0085
0086
0087 return freeTransportJacobian * boundToFreeJacobian;
0088 }
0089
0090 void detail::freeToBoundTransportJacobian(
0091 const GeometryContext& geoContext, const Surface& surface,
0092 const FreeVector& freeParameters, const FreeMatrix& freeTransportJacobian,
0093 const FreeVector& freeToPathDerivatives,
0094 FreeToBoundMatrix& fullTransportJacobian) {
0095 const Vector3 position = freeParameters.segment<3>(eFreePos0);
0096 const Vector3 direction = freeParameters.segment<3>(eFreeDir0);
0097
0098 FreeToBoundMatrix freeToBoundJacobian =
0099 surface.freeToBoundJacobian(geoContext, position, direction);
0100 FreeToPathMatrix sVec =
0101 surface.freeToPathDerivative(geoContext, position, direction);
0102
0103 fullTransportJacobian = freeToBoundJacobian * (freeTransportJacobian +
0104 freeToPathDerivatives * sVec *
0105 freeTransportJacobian);
0106 }
0107
0108 FreeToBoundMatrix detail::freeToCurvilinearTransportJacobian(
0109 const Vector3& direction, const FreeMatrix& freeTransportJacobian,
0110 const FreeVector& freeToPathDerivatives) {
0111 auto sfactors = direction.transpose() *
0112 freeTransportJacobian.template topLeftCorner<3, 8>();
0113
0114
0115
0116 return CurvilinearSurface(direction).freeToBoundJacobian() *
0117 (freeTransportJacobian - freeToPathDerivatives * sfactors);
0118 }
0119
0120 Result<void> detail::reinitializeJacobians(
0121 const GeometryContext& geoContext, const Surface& surface,
0122 FreeMatrix& freeTransportJacobian, FreeVector& freeToPathDerivatives,
0123 BoundToFreeMatrix& boundToFreeJacobian, const FreeVector& freeParameters) {
0124
0125 freeTransportJacobian = FreeMatrix::Identity();
0126 freeToPathDerivatives = FreeVector::Zero();
0127
0128
0129 const Vector3 position = freeParameters.segment<3>(eFreePos0);
0130 const Vector3 direction = freeParameters.segment<3>(eFreeDir0);
0131 auto lpResult = surface.globalToLocal(geoContext, position, direction);
0132 if (!lpResult.ok()) {
0133 return lpResult.error();
0134 }
0135
0136 boundToFreeJacobian =
0137 surface.boundToFreeJacobian(geoContext, position, direction);
0138 return Result<void>::success();
0139 }
0140
0141 void detail::reinitializeJacobians(FreeMatrix& freeTransportJacobian,
0142 FreeVector& freeToPathDerivatives,
0143 BoundToFreeMatrix& boundToFreeJacobian,
0144 const Vector3& direction) {
0145
0146 freeTransportJacobian = FreeMatrix::Identity();
0147 freeToPathDerivatives = FreeVector::Zero();
0148 boundToFreeJacobian = CurvilinearSurface(direction).boundToFreeJacobian();
0149 }
0150
0151 }