ATLAS Offline Software
CurvilinearCovarianceHelper.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 #ifndef ACTSTRK_CURVILINEARCOVARIANCEHELPER_H
5 #define ACTSTRK_CURVILINEARCOVARIANCEHELPER_H 1
6 
7 #include "Acts/Geometry/GeometryContext.hpp"
8 #include "Acts/EventData/TrackParameters.hpp"
9 #include "Acts/Propagator/detail/JacobianEngine.hpp"
10 
11 namespace ActsTrk {
15  inline double computeDtDs(const Acts::ParticleHypothesis &hypothesis, double qop) {
16  return std::hypot(1.,hypothesis.mass() / hypothesis.extractMomentum(qop));
17  }
18 
26  inline Acts::FreeToPathMatrix computeFreeToPathDerivatives( const Acts::Vector3 &direction,
27  double qop,
28  const Acts::Vector3 &bfield,
29  const Acts::ParticleHypothesis &particle_hypothesis)
30  {
31  Acts::FreeToPathMatrix path_length_deriv;
32  static_assert(path_length_deriv.cols() == 8); // ensure that all elements are initialized
33  path_length_deriv.segment<3>(Acts::eFreePos0) = direction;
34  path_length_deriv(0,Acts::eFreeTime) = computeDtDs(particle_hypothesis,qop);
35  path_length_deriv.segment<3>(Acts::eFreeDir0) = (qop * direction.cross(bfield)).transpose();
36  path_length_deriv(0,Acts::eFreeQOverP) = 0.;
37  return path_length_deriv;
38  }
39 
40 
60  inline std::optional<Acts::BoundMatrix> convertActsBoundCovToCurvilinearParam(const Acts::GeometryContext &tgContext,
61  const Acts::BoundTrackParameters &param,
62  const Acts::Vector3 &magnFieldVect,
63  const Acts::ParticleHypothesis &particle_hypothesis)
64  {
65  if (param.covariance().has_value()) {
66  Acts::FreeVector freeParams = Acts::transformBoundToFreeParameters(
67  param.referenceSurface(), tgContext, param.parameters());
68  Acts::Vector3 position = freeParams.segment<3>(Acts::eFreePos0);
69  Acts::Vector3 direction = freeParams.segment<3>(Acts::eFreeDir0);
70  Acts::BoundMatrix b2c;
71  Acts::detail::boundToCurvilinearTransportJacobian(direction, // magnFieldVect.normalized(),
72  param.referenceSurface().boundToFreeJacobian(tgContext, position, direction),
73  Acts::FreeMatrix::Identity(),
75  param.parameters()[Acts::eBoundQOverP],
76  magnFieldVect,
77  particle_hypothesis),
78  b2c);
79 
80  return b2c * param.covariance().value() * b2c.transpose();
81  }
82  else {
83  return {};
84  }
85  }
86 }
87 #endif
ActsTrk::computeDtDs
double computeDtDs(const Acts::ParticleHypothesis &hypothesis, double qop)
Helper function to compute dt/ds Helper function to compute the derivative of the time as function of...
Definition: CurvilinearCovarianceHelper.h:15
xAOD::ParticleHypothesis
ParticleHypothesis
Definition: TrackingPrimitives.h:192
ActsTrk::convertActsBoundCovToCurvilinearParam
std::optional< Acts::BoundMatrix > convertActsBoundCovToCurvilinearParam(const Acts::GeometryContext &tgContext, const Acts::BoundTrackParameters &param, const Acts::Vector3 &magnFieldVect, const Acts::ParticleHypothesis &particle_hypothesis)
Convert the covariance of the given Acts track parameters into curvilinear parameterisation.
Definition: CurvilinearCovarianceHelper.h:60
ActsTrk
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Definition: MuonDetectorBuilderTool.cxx:34
ActsTrk::computeFreeToPathDerivatives
Acts::FreeToPathMatrix computeFreeToPathDerivatives(const Acts::Vector3 &direction, double qop, const Acts::Vector3 &bfield, const Acts::ParticleHypothesis &particle_hypothesis)
Compute the path length derivatives for the free/bound to curvilinear paramter transform.
Definition: CurvilinearCovarianceHelper.h:26