ATLAS Offline Software
Loading...
Searching...
No Matches
ParametersBase.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 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
19class MsgStream;
20
21template<typename T>
25template<class SURFACE_CNV, class ATA_SURFACE>
27
28namespace Trk {
29class Surface;
31
32
52
53template<int DIM, class T>
54class ParametersBase : public ParametersCommon<DIM,T>
55{
56public:
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
80 virtual ParametersBase<DIM, T>* clone() const override = 0;
81
85 std::unique_ptr<ParametersBase<DIM, T>> uniqueClone() const{
86 return std::unique_ptr<ParametersBase<DIM, T>>(this->clone());
87 }
88
90 virtual MsgStream& dump(MsgStream& out) const;
91 virtual std::ostream& dump(std::ostream& out) const;
92
93protected:
94 /*
95 * This is an abstract class and we can not instantiate objects directly.
96 * In the other hand derived classed can use ctors
97 */
98 ParametersBase() = default;
99 ParametersBase(ParametersBase&&) noexcept = default;
100 ParametersBase& operator=(ParametersBase&&) noexcept = default;
102 ParametersBase& operator=(const ParametersBase&) = default;
103
104 /* Helper ctors for derived classes*/
106 std::optional<AmgSymMatrix(DIM)>&& covariance,
107 const T chargeDef);
108
109 ParametersBase(std::optional<AmgSymMatrix(DIM)>&& covariance);
110
111 ParametersBase(const AmgVector(DIM) & parameters,
112 std::optional<AmgSymMatrix(DIM)>&& covariance = std::nullopt);
113
114 /*
115 * Add dependent names into scope
116 */
117 using ParametersCommon<DIM, T>::m_parameters;
118 using ParametersCommon<DIM, T>::m_covariance;
119 using ParametersCommon<DIM, T>::m_chargeDef;
122};
123
126template<int DIM, class T>
127MsgStream&
128operator<<(MsgStream& sl, const Trk::ParametersBase<DIM, T>& tp);
129
130template<int DIM, class T>
132operator<<(std::ostream& sl, const Trk::ParametersBase<DIM, T>& tp);
133
134} // end of namespace Trk
135
136#include "TrkParametersBase/ParametersBase.icc"
137
138#endif
Eigen::Matrix< double, 3, 1 > Vector3D
New convertor which handles all track parameters in one go - i.e.
Material effects engine interface for charged and neutral (fast track simulation) ,...
The base class for neutral and charged Track parameters.
virtual MsgStream & dump(MsgStream &out) const
Dumps relevant information about the track parameters into the ostream.
double eta() const
Access method for pseudorapidity - from momentum.
const Amg::Vector3D & momentum() const
Access method for the momentum.
virtual bool operator==(const ParametersBase< DIM, T > &) const
equality operator
ParametersBase(ParametersBase &&) noexcept=default
virtual ~ParametersBase()=default
virtual Destructor
virtual ParametersBase< DIM, T > * clone() const override=0
clone method for polymorphic deep copy
virtual std::ostream & dump(std::ostream &out) const
const Amg::Vector3D & position() const
Access method for the position.
double charge() const
Returns the charge.
double pT() const
Access method for transverse momentum.
ParametersBase()=default
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...
ParametersCommon()=default
Abstract Base Class for tracking surfaces.
Definition Surface.h:79
STL class.
Definition of ATLAS Math & Geometry primitives (Amg).
Eigen::Matrix< double, 3, 1 > Vector3D
Ensure that the ATLAS eigen extensions are properly loaded.
STL namespace.