ATLAS Offline Software
Loading...
Searching...
No Matches
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
18namespace Trk {
19 enum ExtraLocalPosParam {distDepth = 2}; // These will be defined in Trk soon.
20}
21
22namespace InDetDD {
23
30
32
33
35 // Public methods:
37 public:
38
41
44
46 SiLocalPosition(const Amg::Vector2D &position);
47
52 SiLocalPosition(const double xEta,const double xPhi,
53 const double xDepth=0);
54
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:
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:
118inline double SiLocalPosition::xEta() const
119{
120 return m_xEta;
121}
122
123inline double SiLocalPosition::xPhi() const
124{
125 return m_xPhi;
126}
127
128inline double SiLocalPosition::xDepth() const
129{
130 return m_xDepth;
131}
132
133inline double SiLocalPosition::r() const
134{
135 return std::sqrt(m_xEta * m_xEta + m_xPhi * m_xPhi);
136}
137
138inline double SiLocalPosition::phi() const
139{
140 return std::atan2(m_xPhi, m_xEta);
141}
142
143inline double SiLocalPosition::xColumn() const
144{
145 return m_xEta;
146}
147
148inline double SiLocalPosition::xRow() const
149{
150 return m_xPhi;
151}
152
153inline void SiLocalPosition::xEta(const double xEta)
154{
155 m_xEta=xEta;
156}
157
158inline void SiLocalPosition::xPhi(const double xPhi)
159{
160 m_xPhi=xPhi;
161}
162
163inline void SiLocalPosition::xDepth(const double xDepth)
164{
166}
167
168inline void SiLocalPosition::xColumn(const double xColumn)
169{
171}
172
173inline void SiLocalPosition::xRow(const double xRow)
174{
175 m_xPhi=xRow;
176}
177
179// Binary operators:
182 const SiLocalPosition &position2);
183
184SiLocalPosition operator*(const SiLocalPosition &position,const double factor);
185
186inline SiLocalPosition operator*(const double factor,const SiLocalPosition &position)
187{
188 return position*factor;
189}
190
191SiLocalPosition operator/(const SiLocalPosition &position,const double factor);
192
193} // namespace InDetDD
194
195#endif // INDETREADOUTGEOMETRY_SILOCALPOSITION_H
Class to represent a position in the natural frame of a silicon sensor, for Pixel and SCT For Pixel: ...
SiLocalPosition & operator/=(const double factor)
double r() const
Cylindrical coordinate r:
SiLocalPosition(const SiLocalPosition &position)
Copy constructor:
double m_xEta
position along eta direction
double phi() const
Cylindrical coordinate phi:
SiLocalPosition()
Implicit constructor:
double xDepth() const
position along depth direction:
double xPhi() const
position along phi direction:
double m_xPhi
position along phi direction
double xColumn() const
positions for Pixel:
double xEta() const
position along eta direction:
SiLocalPosition & operator=(const SiLocalPosition &position)
Assignment operator:
double m_xDepth
position along depth direction
SiLocalPosition & operator*=(const double factor)
SiLocalPosition & operator+=(const SiLocalPosition &position)
Class to represent a position in the natural frame of a silicon sensor, for Pixel and SCT For Pixel: ...
Eigen::Matrix< double, 2, 1 > Vector2D
Message Stream Member.
SiLocalPosition operator*(const SiLocalPosition &position, const double factor)
SiLocalPosition operator+(const SiLocalPosition &position1, const SiLocalPosition &position2)
SiLocalPosition operator/(const SiLocalPosition &position, const double factor)
Ensure that the ATLAS eigen extensions are properly loaded.
ExtraLocalPosParam