ATLAS Offline Software
PerigeeSurface.icc
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 namespace Trk {
6 
7 inline bool PerigeeSurface::operator==(const PerigeeSurface& persf) const
8 {
9  if (this == &persf){
10  return true;
11  }
12  return (center() == persf.center());
13 }
14 
15 /** Return the surface type */
16 inline constexpr SurfaceType
17 PerigeeSurface::type() const
18 {
19  return PerigeeSurface::staticType;
20 }
21 template<int DIM, class T>
22 std::unique_ptr<ParametersT<DIM, T, PerigeeSurface>>
23 PerigeeSurface::createUniqueParameters(
24  double l1,
25  double l2,
26  double phi,
27  double theta,
28  double qop,
29  std::optional<AmgSymMatrix(DIM)> cov) const
30 {
31  return std::make_unique<ParametersT<DIM, T, PerigeeSurface>>(
32  l1, l2, phi, theta, qop, *this, std::move(cov));
33 }
34 
35 /** Use the Surface as a ParametersBase constructor, from global parameters */
36 template<int DIM, class T>
37 std::unique_ptr<ParametersT<DIM, T, PerigeeSurface>>
38 PerigeeSurface::createUniqueParameters(
39  const Amg::Vector3D& position,
40  const Amg::Vector3D& momentum,
41  double charge,
42  std::optional<AmgSymMatrix(DIM)> cov) const
43 {
44  return std::make_unique<ParametersT<DIM, T, PerigeeSurface>>(
45  position, momentum, charge, *this, std::move(cov));
46 }
47 
48 inline PerigeeSurface*
49 PerigeeSurface::clone() const
50 {
51  return new PerigeeSurface(*this);
52 }
53 
54 inline const Amg::Vector3D&
55 PerigeeSurface::normal() const
56 {
57  return s_xAxis;
58 }
59 
60 inline Amg::Vector3D
61 PerigeeSurface::normal(const Amg::Vector2D&) const
62 {
63  return Amg::Vector3D(normal());
64 }
65 
66 inline bool
67 PerigeeSurface::insideBounds(const Amg::Vector2D&, double, double) const
68 {
69  return true;
70 }
71 
72 inline bool
73 PerigeeSurface::insideBoundsCheck(const Amg::Vector2D&,
74  const BoundaryCheck&) const
75 {
76  return true;
77 }
78 
79 inline bool
80 PerigeeSurface::isOnSurface(const Amg::Vector3D&,
81  const BoundaryCheck&,
82  double,
83  double) const
84 {
85  return true;
86 }
87 
88 inline const NoBounds&
89 PerigeeSurface::bounds() const
90 {
91  return s_perigeeBounds;
92 }
93 
94 inline const Amg::Vector3D&
95 PerigeeSurface::lineDirection() const
96 {
97  if (m_lineDirection.isValid()) {
98  return *(m_lineDirection.ptr());
99  }
100 
101  if (Surface::m_transforms) {
102  if (!m_lineDirection.isValid()) {
103  m_lineDirection.set(transform().linear().col(2));
104  return *(m_lineDirection.ptr());
105  }
106  }
107  return Trk::s_zAxis;
108 }
109 
110 /** the pathCorrection for derived classes with thickness */
111 inline double
112 PerigeeSurface::pathCorrection(const Amg::Vector3D&, const Amg::Vector3D&) const
113 {
114  return 1.;
115 }
116 
117 /** Return properly formatted class name for screen output */
118 inline std::string
119 PerigeeSurface::name() const
120 {
121  return "Trk::PerigeeSurface";
122 }
123 
124 }