File indexing completed on 2025-01-18 09:10:47
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "Acts/EventData/GenericBoundTrackParameters.hpp"
0012 #include "Acts/EventData/TrackParametersConcept.hpp"
0013 #include "Acts/Surfaces/CurvilinearSurface.hpp"
0014
0015 namespace Acts {
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027 template <typename particle_hypothesis_t>
0028 class GenericCurvilinearTrackParameters
0029 : public GenericBoundTrackParameters<particle_hypothesis_t> {
0030 using Base = GenericBoundTrackParameters<particle_hypothesis_t>;
0031
0032 public:
0033 using ParametersVector = BoundVector;
0034 using CovarianceMatrix = BoundSquareMatrix;
0035 using ParticleHypothesis = particle_hypothesis_t;
0036
0037
0038
0039
0040
0041
0042
0043
0044 GenericCurvilinearTrackParameters(const Vector4& pos4, const Vector3& dir,
0045 double qOverP,
0046 std::optional<CovarianceMatrix> cov,
0047 ParticleHypothesis particleHypothesis)
0048 : Base(CurvilinearSurface(pos4.segment<3>(ePos0), dir).surface(),
0049 transformFreeToCurvilinearParameters(pos4[eTime], dir, qOverP),
0050 std::move(cov), std::move(particleHypothesis)) {}
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060 GenericCurvilinearTrackParameters(const Vector4& pos4, double phi,
0061 double theta, double qOverP,
0062 std::optional<CovarianceMatrix> cov,
0063 ParticleHypothesis particleHypothesis)
0064 : Base(CurvilinearSurface(pos4.segment<3>(ePos0),
0065 makeDirectionFromPhiTheta(phi, theta))
0066 .surface(),
0067 transformFreeToCurvilinearParameters(pos4[eTime], phi, theta,
0068 qOverP),
0069 std::move(cov), std::move(particleHypothesis)) {}
0070
0071
0072 template <typename other_particle_hypothesis_t>
0073 GenericCurvilinearTrackParameters(
0074 const GenericCurvilinearTrackParameters<other_particle_hypothesis_t>&
0075 other)
0076 : GenericCurvilinearTrackParameters(other.fourPosition(),
0077 other.particleHypothesis(),
0078 other.covariance()) {}
0079
0080
0081 template <typename other_track_parameter_t>
0082 static GenericCurvilinearTrackParameters create(
0083 const other_track_parameter_t& other) {
0084 static_assert(BoundTrackParametersConcept<other_track_parameter_t>);
0085
0086 return GenericCurvilinearTrackParameters(
0087 other.fourPosition(), other.particleHypothesis(), other.covariance());
0088 }
0089
0090
0091 GenericCurvilinearTrackParameters() = delete;
0092 GenericCurvilinearTrackParameters(const GenericCurvilinearTrackParameters&) =
0093 default;
0094 GenericCurvilinearTrackParameters(GenericCurvilinearTrackParameters&&) =
0095 default;
0096 ~GenericCurvilinearTrackParameters() = default;
0097 GenericCurvilinearTrackParameters& operator=(
0098 const GenericCurvilinearTrackParameters&) = default;
0099 GenericCurvilinearTrackParameters& operator=(
0100 GenericCurvilinearTrackParameters&&) = default;
0101
0102 using GenericBoundTrackParameters<ParticleHypothesis>::fourPosition;
0103 using GenericBoundTrackParameters<ParticleHypothesis>::position;
0104
0105
0106 Vector4 fourPosition() const {
0107 return GenericBoundTrackParameters<ParticleHypothesis>::fourPosition({});
0108 }
0109
0110 Vector3 position() const {
0111 return GenericBoundTrackParameters<ParticleHypothesis>::position({});
0112 }
0113
0114
0115
0116 GenericCurvilinearTrackParameters<ParticleHypothesis> reflect() const {
0117 GenericCurvilinearTrackParameters<ParticleHypothesis> reflected = *this;
0118 reflected.reflectInPlace();
0119 return reflected;
0120 }
0121 };
0122
0123 }