ATLAS Offline Software
ParametersCommon.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 /* @brief ParametersCommon common base class
6  * for ParametersT, CurvilinearParameters and PatternTrackParameters
7  */
8 
9 #ifndef TRKPARAMETERSCOMMON_PARAMETERSCOMMON_H
10 #define TRKPARAMETERSCOMMON_PARAMETERSCOMMON_H
11 //
14 // Amg
18 //
19 #include <optional>
20 #include <limits>
21 
22 namespace Trk {
23 class Surface;
24 
30 
31 namespace InvalidParam {
32 constexpr double INVALID = std::numeric_limits<double>::quiet_NaN();
33 constexpr double INVALID_P(10e9);
34 constexpr double INVALID_QOP(10e-9);
35 }
36 
44 template <int DIM, class T>
46  public:
47  static_assert((std::is_same<T, Trk::Charged>::value ||
49  "Parameters must be Charged or Neutral");
50  static constexpr int dim = DIM;
51 
53  const AmgVector(DIM) & parameters() const;
55 
58  const AmgSymMatrix(DIM) * covariance() const;
59  AmgSymMatrix(DIM) * covariance();
60 
63  constexpr bool isCharged() const;
67 
69  void setParameters(const AmgVector(DIM) & param);
70 
72  void setCovariance(const AmgSymMatrix(DIM) & cov);
73 
83  void updateParameters(const AmgVector(DIM) &, const AmgSymMatrix(DIM) &);
84 
91  void updateParameters(const AmgVector(DIM) &);
92 
94  virtual bool hasSurface() const = 0;
95 
97  virtual const Surface& associatedSurface() const = 0;
98 
104 
107  virtual ParametersCommon<DIM, T>* clone() const = 0;
108 
110  constexpr virtual ParametersType type() const = 0;
111 
114  virtual SurfaceType surfaceType() const = 0;
115 
117  virtual ~ParametersCommon() = default;
118 
119  protected:
120  /*
121  * This is an abstract class and we can not instantiate objects directly.
122  * In the other hand derived classed can use ctors
123  */
124  ParametersCommon() = default;
126  ParametersCommon& operator=(ParametersCommon&&) noexcept = default;
129  /* Helper ctors for derived classes*/
131  std::optional<AmgSymMatrix(DIM)>&& covariance,
132  const T chargeDef);
133 
134  ParametersCommon(std::optional<AmgSymMatrix(DIM)>&& covariance);
135 
137  std::optional<AmgSymMatrix(DIM)>&& covariance = std::nullopt);
138 
139 
140  /* Helper implementing the specific per derived class logic for
141  * the update of parameters*/
142  virtual void updateParametersHelper(const AmgVector(DIM) &) = 0;
143 
145  AmgVector(DIM) m_parameters;
147  std::optional<AmgSymMatrix(DIM)> m_covariance = std::nullopt;
150 };
151 } // end of namespace Trk
152 
154 
155 #endif
Trk::ParametersCommon::AmgVector
const AmgVector(DIM) &parameters() const
Access methods for the parameters.
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
Trk::ParametersCommon::m_covariance
std::optional< AmgSymMatrix(DIM)> m_covariance
charge definition for this track
Definition: ParametersCommon.h:147
Trk::ParametersCommon::updateParameters
void updateParameters(const AmgVector(DIM) &)
Update parameters.
Trk::ParametersCommon::ParametersCommon
ParametersCommon(ParametersCommon &&) noexcept=default
Trk::InvalidParam::INVALID_P
constexpr double INVALID_P(10e9)
SurfaceTypes.h
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
Trk::ParametersCommon::~ParametersCommon
virtual ~ParametersCommon()=default
virtual Destructor
plotBeamSpotVxVal.cov
cov
Definition: plotBeamSpotVxVal.py:201
Surface
Definition: Trigger/TrigAccel/TrigCudaFitter/src/Surface.h:8
Trk::ParametersCommon::AmgSymMatrix
const AmgSymMatrix(DIM) *covariance() const
Access method for the covariance matrix - returns nullptr if no covariance matrix is given.
Trk::ParametersCommon::setParameters
void setParameters(const AmgVector(DIM) &param)
set parameters
athena.value
value
Definition: athena.py:124
Trk::SurfaceType
SurfaceType
Definition: SurfaceTypes.h:17
Trk::Curvilinear
@ Curvilinear
Definition: ParametersCommon.h:29
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
Neutral.h
Trk::ParametersCommon::updateParameters
void updateParameters(const AmgVector(DIM) &, const AmgSymMatrix(DIM) &)
Update parameters and covariance , passing covariance by ref.
Trk::InvalidParam::INVALID_QOP
constexpr double INVALID_QOP(10e-9)
ParametersCommon.icc
Trk::ParametersCommon::dim
static constexpr int dim
Definition: ParametersCommon.h:50
Trk::ParametersCommon::hasSurface
virtual bool hasSurface() const =0
Test to see if there's a not null surface ptr.
Trk::ParametersCommon::isCharged
constexpr bool isCharged() const
Returns true if Charged or false if Neutral.
Trk::ParametersCommon::AmgVector
AmgVector(DIM) &parameters()
GeoPrimitives.h
Trk::ParametersCommon::type
constexpr virtual ParametersType type() const =0
Return the ParametersType enum.
Trk::ParametersCommon::m_chargeDef
T m_chargeDef
charge definition for this track
Definition: ParametersCommon.h:149
Charged.h
Trk::ParametersCommon::surfaceType
virtual SurfaceType surfaceType() const =0
Returns the Surface Type enum for the surface used to define the derived class.
Trk::ParametersCommon::localPosition
Amg::Vector2D localPosition() const
Access method for the local coordinates, local parameter definitions differ for each surface type.
EventPrimitives.h
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Trk::ParametersCommon::ParametersCommon
ParametersCommon()=default
Trk::ParametersCommon::measurementFrame
virtual Amg::RotationMatrix3D measurementFrame() const =0
Return the measurement frame - this is needed for alignment, in particular for StraightLine and Perig...
Trk::AtaSurface
@ AtaSurface
Definition: ParametersCommon.h:29
Trk::ParametersCommon::AmgSymMatrix
AmgSymMatrix(DIM) *covariance()
Trk::Pattern
@ Pattern
Definition: ParametersCommon.h:29
Amg::RotationMatrix3D
Eigen::Matrix< double, 3, 3 > RotationMatrix3D
Definition: GeoPrimitives.h:49
Trk::ParametersCommon::associatedSurface
virtual const Surface & associatedSurface() const =0
Access to the Surface associated to the Parameters.
Trk::ParametersCommon
Definition: ParametersCommon.h:45
physics_parameters.parameters
parameters
Definition: physics_parameters.py:144
Trk::InvalidParam::INVALID
constexpr double INVALID
Definition: ParametersCommon.h:32
Trk::ParametersCommon::clone
virtual ParametersCommon< DIM, T > * clone() const =0
clone method for polymorphic deep copy
python.CaloScaleNoiseConfig.default
default
Definition: CaloScaleNoiseConfig.py:79
Trk::ParametersCommon::setCovariance
void setCovariance(const AmgSymMatrix(DIM) &cov)
set covariance
Trk::ParametersType
ParametersType
Definition: ParametersCommon.h:29
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
Trk::ParametersCommon::updateParametersHelper
virtual void updateParametersHelper(const AmgVector(DIM) &)=0
contains the n parameters