ATLAS Offline Software
ParametersBase.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // ParametersBase.h, (c) ATLAS Detector software
8 
9 #ifndef TRKPARAMETERSBASE_PARAMETERSBASE_H
10 #define TRKPARAMETERSBASE_PARAMETERSBASE_H
11 //
13 //system
14 #include <memory>
15 #include <type_traits>
16 #include <optional>
17 #include <iosfwd>
18 
19 class MsgStream;
20 
21 template<typename T>
25 template<class SURFACE_CNV, class ATA_SURFACE>
27 
28 namespace Trk {
29 class Surface;
30 class MaterialEffectsEngine;
31 
32 
53 template<int DIM, class T>
54 class ParametersBase : public ParametersCommon<DIM,T>
55 {
56 public:
58  virtual ~ParametersBase() = default;
59 
61  double charge() const;
62 
64  const Amg::Vector3D& position() const;
65 
67  const Amg::Vector3D& momentum() const;
68 
70  double pT() const;
71 
73  double eta() const;
74 
76  virtual bool operator==(const ParametersBase<DIM, T>&) const;
77 
79  virtual bool hasSurface() const override = 0;
80 
82  virtual const Surface& associatedSurface() const override = 0;
83 
88  virtual Amg::RotationMatrix3D measurementFrame() const override = 0;
89 
92  virtual ParametersBase<DIM, T>* clone() const override = 0;
93 
97  std::unique_ptr<ParametersBase<DIM, T>> uniqueClone() const{
98  return std::unique_ptr<ParametersBase<DIM, T>>(this->clone());
99  }
100 
102  constexpr virtual ParametersType type() const override = 0;
103 
106  constexpr virtual SurfaceType surfaceType() const override = 0;
107 
109  virtual MsgStream& dump(MsgStream& out) const;
110  virtual std::ostream& dump(std::ostream& out) const;
111 
112 protected:
113  /*
114  * This is an abstract class and we can not instantiate objects directly.
115  * In the other hand derived classed can use ctors
116  */
117  ParametersBase() = default;
119  ParametersBase& operator=(ParametersBase&&) noexcept = default;
122 
123  /* Helper ctors for derived classes*/
125  std::optional<AmgSymMatrix(DIM)>&& covariance,
126  const T chargeDef);
127 
128  ParametersBase(std::optional<AmgSymMatrix(DIM)>&& covariance);
129 
131  std::optional<AmgSymMatrix(DIM)>&& covariance = std::nullopt);
132 
133  virtual void updateParametersHelper(const AmgVector(DIM) &) override = 0;
134  /*
135  * Add dependent names into scope
136  */
137  using ParametersCommon<DIM, T>::m_parameters;
138  using ParametersCommon<DIM, T>::m_covariance;
139  using ParametersCommon<DIM, T>::m_chargeDef;
142 };
143 
146 template<int DIM, class T>
147 MsgStream&
148 operator<<(MsgStream& sl, const Trk::ParametersBase<DIM, T>& tp);
149 
150 template<int DIM, class T>
151 std::ostream&
152 operator<<(std::ostream& sl, const Trk::ParametersBase<DIM, T>& tp);
153 
154 } // end of namespace Trk
155 
156 #include "TrkParametersBase/ParametersBase.icc"
157 
158 #endif
Trk::ParametersCommon::AmgVector
const AmgVector(DIM) &parameters() const
Access methods for the parameters.
Trk::ParametersBase::operator==
virtual bool operator==(const ParametersBase< DIM, T > &) const
equality operator
Trk::ParametersCommon::m_covariance
std::optional< AmgSymMatrix(DIM)> m_covariance
charge definition for this track
Definition: ParametersCommon.h:147
Trk::ParametersBase::charge
double charge() const
Returns the charge.
MeasuredPerigeeCnv_p1
Definition: MeasuredPerigeeCnv_p1.h:27
Trk::ParametersBase::position
const Amg::Vector3D & position() const
Access method for the position.
Trk::ParametersBase::associatedSurface
virtual const Surface & associatedSurface() const override=0
Access to the Surface associated to the Parameters.
Trk::ParametersBase::uniqueClone
std::unique_ptr< ParametersBase< DIM, T > > uniqueClone() const
clone method for polymorphic deep copy returning unique_ptr; it is not overriden, but uses the existi...
Definition: ParametersBase.h:97
Trk::ParametersBase::dump
virtual std::ostream & dump(std::ostream &out) const
TrackParametersCnv_p2
New convertor which handles all track parameters in one go - i.e.
Definition: TrackParametersCnv_p2.h:30
Trk::ParametersBase::surfaceType
constexpr virtual SurfaceType surfaceType() const override=0
Returns the Surface Type enum for the surface used to define the derived class.
taskman.template
dictionary template
Definition: taskman.py:317
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
Surface
Definition: Trigger/TrigAccel/TrigCudaFitter/src/Surface.h:7
ParticleTest.tp
tp
Definition: ParticleTest.py:25
Trk::ParametersCommon::AmgSymMatrix
const AmgSymMatrix(DIM) *covariance() const
Access method for the covariance matrix - returns nullptr if no covariance matrix is given.
Trk::SurfaceType
SurfaceType
Definition: SurfaceTypes.h:17
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:562
Trk::ParametersCommon::m_chargeDef
T m_chargeDef
charge definition for this track
Definition: ParametersCommon.h:149
Trk::ParametersBase::measurementFrame
virtual Amg::RotationMatrix3D measurementFrame() const override=0
Return the measurement frame - this is needed for alignment, in particular for StraightLine and Perig...
Trk::ParametersBase::hasSurface
virtual bool hasSurface() const override=0
Test to see if there's a not null surface ptr.
AtaSurfaceCnv_p1
Definition: ParametersBase.h:26
Trk::ParametersBase::dump
virtual MsgStream & dump(MsgStream &out) const
Dumps relevant information about the track parameters into the ostream.
Trk::ParametersBase::m_position
Amg::Vector3D m_position
point on track
Definition: ParametersBase.h:140
TrackParametersCovarianceCnv
Definition: ParametersBase.h:22
Trk::ParametersBase
Definition: ParametersBase.h:55
Trk::ParametersBase::type
constexpr virtual ParametersType type() const override=0
Return the ParametersType enum.
Trk::ParametersBase::ParametersBase
ParametersBase()=default
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Trk::ParametersBase::pT
double pT() const
Access method for transverse momentum.
Amg
Definition of ATLAS Math & Geometry primitives (Amg)
Definition: AmgStringHelpers.h:19
ParametersCommon.h
Trk::ParametersBase::~ParametersBase
virtual ~ParametersBase()=default
virtual Destructor
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Trk::ParametersBase::momentum
const Amg::Vector3D & momentum() const
Access method for the momentum.
Trk::ParametersBase::updateParametersHelper
virtual void updateParametersHelper(const AmgVector(DIM) &) override=0
contains the n parameters
Amg::RotationMatrix3D
Eigen::Matrix< double, 3, 3 > RotationMatrix3D
Definition: GeoPrimitives.h:49
Trk::ParametersBase::ParametersBase
ParametersBase(ParametersBase &&) noexcept=default
Trk::ParametersCommon
Definition: ParametersCommon.h:45
Trk::ParametersBase::m_momentum
Amg::Vector3D m_momentum
momentum at this point on track
Definition: ParametersBase.h:141
physics_parameters.parameters
parameters
Definition: physics_parameters.py:144
Trk::ParametersBase::eta
double eta() const
Access method for pseudorapidity - from momentum.
python.CaloScaleNoiseConfig.default
default
Definition: CaloScaleNoiseConfig.py:79
Trk::ParametersType
ParametersType
Definition: ParametersCommon.h:29
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
Trk::ParametersBase::clone
virtual ParametersBase< DIM, T > * clone() const override=0
clone method for polymorphic deep copy