ATLAS Offline Software
SiLocalPosition.cxx
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.cxx
7 // Implementation file for class SiLocalPosition
9 // (c) ATLAS Detector software
11 // Version 2.1 01/08/2001 David Calvet
13 
15 
16 namespace InDetDD {
17 
18 // Implicit constructor:
20  m_xEta(0),
21  m_xPhi(0),
22  m_xDepth(0)
23 {}
24 
25 // Copy constructor:
27 
28 = default;
29 
30 // Constructor with parameters:
31 SiLocalPosition::SiLocalPosition(const double xEta,const double xPhi,
32  const double xDepth) :
33  m_xEta(xEta),
34  m_xPhi(xPhi),
35  m_xDepth(xDepth)
36 {}
37 
39  : m_xEta(position[Trk::distEta]),
40  m_xPhi(position[Trk::distPhi]),
41  m_xDepth(0)
42 {}
43 
44 
45 SiLocalPosition::operator Amg::Vector2D(void) const
46 {
47  return Amg::Vector2D(m_xPhi, m_xEta);
48 }
49 
50 // Assignment operator:
52 {
53  if (this!=&position) {
54  m_xEta=position.m_xEta;
55  m_xPhi=position.m_xPhi;
56  m_xDepth=position.m_xDepth;
57  } else {}
58  return *this;
59 }
60 
61 // addition of positions:
63 {
64  m_xEta+=position.m_xEta;
65  m_xPhi+=position.m_xPhi;
66  m_xDepth+=position.m_xDepth;
67  return *this;
68 }
69 
70 // scaling:
72 {
73  m_xEta*=factor;
74  m_xPhi*=factor;
75  m_xDepth*=factor;
76  return *this;
77 }
78 
79 // scaling:
81 {
82  if (0!=factor) {
83  m_xEta/=factor;
84  m_xPhi/=factor;
85  m_xDepth/=factor;
86  } else {}
87  return *this;
88 }
89 
91  const SiLocalPosition &position2)
92 {
93  SiLocalPosition result(position1);
94  result+=position2;
95  return result;
96 }
97 
98 SiLocalPosition operator*(const SiLocalPosition &position,const double factor)
99 {
100  SiLocalPosition result(position);
101  result*=factor;
102  return result;
103 }
104 
105 SiLocalPosition operator/(const SiLocalPosition &position,const double factor)
106 {
107  SiLocalPosition result(position);
108  result/=factor;
109  return result;
110 }
111 
112 } // namespace InDetDD
get_generator_info.result
result
Definition: get_generator_info.py:21
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
InDetDD::operator/
SiLocalPosition operator/(const SiLocalPosition &position, const double factor)
Definition: SiLocalPosition.cxx:105
InDetDD::SiLocalPosition
Definition: SiLocalPosition.h:31
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
Trk::distEta
@ distEta
readout for silicon
Definition: ParamDefs.h:51
InDetDD::SiLocalPosition::operator*=
SiLocalPosition & operator*=(const double factor)
Definition: SiLocalPosition.cxx:71
SiLocalPosition.h
InDetDD::operator+
SiLocalPosition operator+(const SiLocalPosition &position1, const SiLocalPosition &position2)
Definition: SiLocalPosition.cxx:90
Trk::distPhi
@ distPhi
Definition: ParamDefs.h:50
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