ATLAS Offline Software
SiLocalPosition.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // SiLocalPosition.h
8 // (c) ATLAS Detector software
10 
11 #ifndef INDETREADOUTGEOMETRY_SILOCALPOSITION_H
12 #define INDETREADOUTGEOMETRY_SILOCALPOSITION_H
13 
16 #include <cmath>
17 
18 namespace Trk {
19  enum ExtraLocalPosParam {distDepth = 2}; // These will be defined in Trk soon.
20 }
21 
22 namespace InDetDD {
23 
32 
33 
35  // Public methods:
37  public:
38 
41 
43  SiLocalPosition(const SiLocalPosition &position);
44 
46  SiLocalPosition(const Amg::Vector2D &position);
47 
52  SiLocalPosition(const double xEta,const double xPhi,
53  const double xDepth=0);
54 
56  SiLocalPosition &operator=(const SiLocalPosition &position);
57 
59  // Const methods:
61 
63  double xEta() const;
64 
66  double xPhi() const;
67 
69  double r() const;
70 
72  double phi() const;
73 
75  double xDepth() const;
76 
78  double xColumn() const;
79  double xRow() const;
80 
82  // Non-const methods:
84 
85  void xEta(const double xEta);
86 
87  void xPhi(const double xPhi);
88 
89  void xDepth(const double xDepth);
90 
91  // for Pixel:
92  void xColumn(const double xColumn);
93  void xRow(const double xRow);
94 
95  // addition of positions:
96  SiLocalPosition &operator+=(const SiLocalPosition &position);
97 
98  // so we can go from SiLocalPosition to Trk::LocalPosition
99  operator Amg::Vector2D(void) const;
100 
101  // scaling:
102  SiLocalPosition &operator*=(const double factor);
103  SiLocalPosition &operator/=(const double factor);
104 
106  // Private data:
108 
109  private:
110  double m_xEta;
111  double m_xPhi;
112  double m_xDepth;
113  };
114 
116 // Inline methods:
118 inline double SiLocalPosition::xEta() const
119 {
120  return m_xEta;
121 }
122 
123 inline double SiLocalPosition::xPhi() const
124 {
125  return m_xPhi;
126 }
127 
128 inline double SiLocalPosition::xDepth() const
129 {
130  return m_xDepth;
131 }
132 
133 inline double SiLocalPosition::r() const
134 {
135  return std::sqrt(m_xEta * m_xEta + m_xPhi * m_xPhi);
136 }
137 
138 inline double SiLocalPosition::phi() const
139 {
140  return std::atan2(m_xPhi, m_xEta);
141 }
142 
143 inline double SiLocalPosition::xColumn() const
144 {
145  return m_xEta;
146 }
147 
148 inline double SiLocalPosition::xRow() const
149 {
150  return m_xPhi;
151 }
152 
153 inline void SiLocalPosition::xEta(const double xEta)
154 {
155  m_xEta=xEta;
156 }
157 
158 inline void SiLocalPosition::xPhi(const double xPhi)
159 {
160  m_xPhi=xPhi;
161 }
162 
163 inline void SiLocalPosition::xDepth(const double xDepth)
164 {
166 }
167 
168 inline void SiLocalPosition::xColumn(const double xColumn)
169 {
170  m_xEta=xColumn;
171 }
172 
173 inline void SiLocalPosition::xRow(const double xRow)
174 {
175  m_xPhi=xRow;
176 }
177 
179 // Binary operators:
181 SiLocalPosition operator+(const SiLocalPosition &position1,
182  const SiLocalPosition &position2);
183 
184 SiLocalPosition operator*(const SiLocalPosition &position,const double factor);
185 
186 inline SiLocalPosition operator*(const double factor,const SiLocalPosition &position)
187 {
188  return position*factor;
189 }
190 
191 SiLocalPosition operator/(const SiLocalPosition &position,const double factor);
192 
193 } // namespace InDetDD
194 
195 #endif // INDETREADOUTGEOMETRY_SILOCALPOSITION_H
InDetDD::SiLocalPosition::phi
double phi() const
Cylindrical coordinate phi:
Definition: SiLocalPosition.h:138
InDetDD::SiLocalPosition::m_xEta
double m_xEta
position along eta direction
Definition: SiLocalPosition.h:110
InDetDD::SiLocalPosition::m_xDepth
double m_xDepth
position along depth direction
Definition: SiLocalPosition.h:112
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
Trk::distDepth
@ distDepth
Definition: SiLocalPosition.h:19
Trk::ExtraLocalPosParam
ExtraLocalPosParam
Definition: SiLocalPosition.h:19
InDetDD::operator/
SiLocalPosition operator/(const SiLocalPosition &position, const double factor)
Definition: SiLocalPosition.cxx:105
ParamDefs.h
InDetDD::SiLocalPosition::r
double r() const
Cylindrical coordinate r:
Definition: SiLocalPosition.h:133
InDetDD::SiLocalPosition::xColumn
double xColumn() const
positions for Pixel:
Definition: SiLocalPosition.h:143
InDetDD::SiLocalPosition
Definition: SiLocalPosition.h:31
InDetDD::SiLocalPosition::xPhi
double xPhi() const
position along phi direction:
Definition: SiLocalPosition.h:123
GeoPrimitives.h
InDetDD::SiLocalPosition::m_xPhi
double m_xPhi
position along phi direction
Definition: SiLocalPosition.h:111
InDetDD::operator*
SiLocalPosition operator*(const SiLocalPosition &position, const double factor)
Definition: SiLocalPosition.cxx:98
InDetDD::SiLocalPosition::SiLocalPosition
SiLocalPosition(const SiLocalPosition &position)
Copy constructor:
InDetDD::SiLocalPosition::xEta
double xEta() const
position along eta direction:
Definition: SiLocalPosition.h:118
InDetDD::SiLocalPosition::xRow
double xRow() const
Definition: SiLocalPosition.h:148
InDetDD::SiLocalPosition::operator*=
SiLocalPosition & operator*=(const double factor)
Definition: SiLocalPosition.cxx:71
InDetDD::operator+
SiLocalPosition operator+(const SiLocalPosition &position1, const SiLocalPosition &position2)
Definition: SiLocalPosition.cxx:90
InDetDD::SiLocalPosition::xDepth
double xDepth() const
position along depth direction:
Definition: SiLocalPosition.h:128
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
InDetDD::SiLocalPosition::operator/=
SiLocalPosition & operator/=(const double factor)
Definition: SiLocalPosition.cxx:80
InDetDD
Message Stream Member.
Definition: FakeTrackBuilder.h:8
InDetDD::SiLocalPosition::SiLocalPosition
SiLocalPosition()
Implicit constructor:
Definition: SiLocalPosition.cxx:19
InDetDD::SiLocalPosition::operator+=
SiLocalPosition & operator+=(const SiLocalPosition &position)
Definition: SiLocalPosition.cxx:62
InDetDD::SiLocalPosition::operator=
SiLocalPosition & operator=(const SiLocalPosition &position)
Assignment operator:
Definition: SiLocalPosition.cxx:51