29{
33 const Trk::PlaneSurface* pla =
dynamic_cast<const Trk::PlaneSurface*
>(& Si->
surface());
34
35 if(!pla) return;
37
38 double x[4],
y[4],
z[4];
39 double Ax[3] = {1., 0., 0.};
40 double Ay[3] = {0., 1., 0.};
41
42
43 const Trk::AnnulusBounds* annulusBounds =
dynamic_cast<const Trk::AnnulusBounds*
>(&Si->
design().bounds());
44
45 if (annulusBounds) {
46
47
48
49
51
52
53
54 auto corners = annulusBounds->
corners();
55
56 x[0] = corners[0].first;
57 y[0] = corners[0].second -
m_dR;
59
60 x[1] = corners[1].first;
61 y[1] = corners[1].second -
m_dR;
63
64 x[2] = corners[2].first;
65 y[2] = corners[2].second -
m_dR;
67
68 x[3] = corners[3].first;
69 y[3] = corners[3].second -
m_dR;
71
72
73
74
75 } else {
76
77
81
82
83
86
87
88
89 x[0] =
AF.x()*Swmax+AE.x()*Sl;
90 y[0] =
AF.y()*Swmax+AE.y()*Sl;
91 z[0] =
AF.z()*Swmax+AE.z()*Sl;
92
93 x[1] =
AF.x()*Swmin-AE.x()*Sl;
94 y[1] =
AF.y()*Swmin-AE.y()*Sl;
95 z[1] =
AF.z()*Swmin-AE.z()*Sl;
96
97 x[2] =-
AF.x()*Swmin-AE.x()*Sl;
98 y[2] =-
AF.y()*Swmin-AE.y()*Sl;
99 z[2] =-
AF.z()*Swmin-AE.z()*Sl;
100
101 x[3] =-
AF.x()*Swmax+AE.x()*Sl;
102 y[3] =-
AF.y()*Swmax+AE.y()*Sl;
103 z[3] =-
AF.z()*Swmax+AE.z()*Sl;
104
109
113 }
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144 constexpr std::array<std::pair<int, int>, 4>
combinations = {
145 {{0, 1}, {1, 2}, {2, 3}, {3, 0}}};
146 for (
unsigned int bound = 0; bound <
combinations.size(); bound++) {
147
148
151
152
153 double x1 =
x[firstCornerIndex]*Ax[0]+
y[firstCornerIndex]*Ax[1]+
z[firstCornerIndex]*Ax[2];
154 double y1 =
x[firstCornerIndex]*Ay[0]+
y[firstCornerIndex]*Ay[1]+
z[firstCornerIndex]*Ay[2];
155 double x2 =
x[secondCornerIndex]*Ax[0]+
y[secondCornerIndex]*Ax[1]+
z[secondCornerIndex]*Ax[2];
156 double y2 =
x[secondCornerIndex]*Ay[0]+
y[secondCornerIndex]*Ay[1]+
z[secondCornerIndex]*Ay[2];
157
158
159 double d = (
x2-
x1)*(x2-x1)+(
y2-
y1)*(y2-y1);
160
161
162 double ax =-(
y2-
y1)*(y1*x2-x1*y2)/
d;
163
164 double ay = (
x2-
x1)*(y1*x2-x1*y2)/
d;
165
166
167 m_bound[bound][2] = sqrt(ax*ax+ay*ay);
168
171 }
172}
virtual double maxWidth() const =0
Method to calculate maximum width of a module.
virtual double minWidth() const =0
Method to calculate minimum width of a module.
virtual double length() const =0
Method to calculate length of a module.
virtual const SiDetectorDesign & design() const override final
access to the local description (inline):
const Amg::Vector3D & etaAxis() const
const Amg::Vector3D & phiAxis() const
Trk::Surface & surface()
Element Surface.
const InDetDD::SiDetectorElement * m_detelement
std::array< std::pair< double, double >, 4 > corners() const
Returns the four corners of the bounds.
const Amg::Transform3D & transform() const
Returns HepGeom::Transform3D by reference.
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 3, 1 > Vector3D