EIC Software
Reference for
EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
AnnulusBounds.hpp
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file AnnulusBounds.hpp
1
// This file is part of the Acts project.
2
//
3
// Copyright (C) 2020 CERN for the benefit of the Acts project
4
//
5
// This Source Code Form is subject to the terms of the Mozilla Public
6
// License, v. 2.0. If a copy of the MPL was not distributed with this
7
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
9
#pragma once
10
11
#include "
Acts/Surfaces/DiscBounds.hpp
"
12
#include "
Acts/Utilities/Definitions.hpp
"
13
#include "
Acts/Utilities/ParameterDefinitions.hpp
"
14
#include "
Acts/Utilities/detail/periodic.hpp
"
15
16
#include <array>
17
#include <exception>
18
#include <vector>
19
20
namespace
Acts {
21
32
class
AnnulusBounds
:
public
DiscBounds
{
33
public
:
34
enum
BoundValues
:
int
{
35
eMinR
= 0,
36
eMaxR
= 1,
37
eMinPhiRel
= 2,
38
eMaxPhiRel
= 3,
39
eAveragePhi
= 4,
40
eOriginX
= 5,
41
eOriginY
= 6,
42
eSize
= 7
43
};
44
45
AnnulusBounds
() =
delete
;
46
57
AnnulusBounds
(
double
minR,
double
maxR,
double
minPhiRel,
double
maxPhiRel,
58
const
Vector2D
&
moduleOrigin
= {0, 0},
59
double
avgPhi = 0) noexcept(
false
)
60
:
AnnulusBounds
({minR, maxR, minPhiRel, maxPhiRel, avgPhi,
61
moduleOrigin
.x(),
moduleOrigin
.y()}) {}
62
66
AnnulusBounds
(
const
std::array<double, eSize>&
values
) noexcept(
false
);
67
68
AnnulusBounds
(
const
AnnulusBounds
& source) =
default
;
69
70
SurfaceBounds::BoundsType
type
() const final;
71
75
std::
vector
<
double
>
values
() const final;
76
84
virtual
bool
inside
(const
Vector2D
& lposition,
85
const BoundaryCheck& bcheck) const final;
86
90
std::ostream&
toStream
(std::ostream& sl) const final;
91
94
double
get
(
BoundValues
bValue)
const
{
return
m_values
[bValue]; }
95
98
double
phiMin
()
const
;
99
102
double
phiMax
()
const
;
103
105
bool
coversFullAzimuth
() const final;
106
109
bool
insideRadialBounds
(
double
R
,
double
tolerance
= 0.) const final;
110
112
double
binningValueR
() const final;
113
115
double
binningValuePhi
() const final;
116
121
Vector2D
moduleOrigin
() const;
122
127
std::
vector
<
Vector2D
>
corners
() const;
128
142
std::
vector
<
Vector2D
>
vertices
(
unsigned
int
lseg) const;
143
145
double
rMin
() const final;
146
148
double
rMax
() const final;
149
150
private:
151
std::array<
double
,
eSize
>
m_values
;
152
153
// @TODO: Does this need to be in bound values?
154
Vector2D
m_moduleOrigin
;
155
Vector2D
m_shiftXY
;
// == -m_moduleOrigin
156
Vector2D
m_shiftPC
;
157
double
m_phiAvg
;
158
Transform2D
m_rotationStripPC
;
159
Transform2D
m_translation
;
160
161
// Vectors needed for inside checking
162
Vector2D
m_outLeftStripPC
;
163
Vector2D
m_inLeftStripPC
;
164
Vector2D
m_outRightStripPC
;
165
Vector2D
m_inRightStripPC
;
166
167
Vector2D
m_outLeftModulePC
;
168
Vector2D
m_inLeftModulePC
;
169
Vector2D
m_outRightModulePC
;
170
Vector2D
m_inRightModulePC
;
171
172
Vector2D
m_outLeftStripXY
;
173
Vector2D
m_inLeftStripXY
;
174
Vector2D
m_outRightStripXY
;
175
Vector2D
m_inRightStripXY
;
176
179
void
checkConsistency
() noexcept(
false
);
180
189
virtual
bool
inside
(const
Vector2D
& lposition,
double
tolR,
190
double
tolPhi) const final;
191
197
Vector2D
stripXYToModulePC
(const
Vector2D
& vStripXY) const;
198
200
Vector2D
closestOnSegment
(const
Vector2D
& a, const
Vector2D
& b,
201
const
Vector2D
&
p
,
202
const Eigen::Matrix<
double
, 2, 2>& weight) const;
203
205
double
squaredNorm
(const
Vector2D
&
v
,
206
const Eigen::Matrix<
double
, 2, 2>& weight) const;
207
};
208
209
inline
SurfaceBounds
::
BoundsType
AnnulusBounds
::
type
()
const
{
210
return
SurfaceBounds::eAnnulus
;
211
}
212
213
inline
double
AnnulusBounds::rMin
()
const
{
214
return
get
(
eMinR
);
215
}
216
217
inline
double
AnnulusBounds::rMax
()
const
{
218
return
get
(
eMaxR
);
219
}
220
221
inline
double
AnnulusBounds::phiMin
()
const
{
222
return
get
(
eMinPhiRel
) +
get
(
eAveragePhi
);
223
}
224
225
inline
double
AnnulusBounds::phiMax
()
const
{
226
return
get
(
eMaxPhiRel
) +
get
(
eAveragePhi
);
227
}
228
229
inline
bool
AnnulusBounds::coversFullAzimuth
()
const
{
230
return
(
std::abs
((
get
(
eMinPhiRel
) -
get
(
eMaxPhiRel
)) -
M_PI
) <
231
s_onSurfaceTolerance
);
232
}
233
234
inline
bool
AnnulusBounds::insideRadialBounds
(
double
R
,
235
double
tolerance
)
const
{
236
return
((R + tolerance) >
get
(
eMinR
) and (R - tolerance) <
get
(
eMaxR
));
237
}
238
239
inline
double
AnnulusBounds::binningValueR
()
const
{
240
return
0.5 * (
get
(
eMinR
) +
get
(
eMaxR
));
241
}
242
243
inline
double
AnnulusBounds::binningValuePhi
()
const
{
244
return
get
(
eAveragePhi
);
245
}
246
247
inline
std::vector<double>
AnnulusBounds::values
()
const
{
248
std::vector<double> valvector;
249
valvector.insert(valvector.begin(),
m_values
.begin(),
m_values
.end());
250
return
valvector;
251
}
252
253
inline
void
AnnulusBounds::checkConsistency
() noexcept(
false
) {
254
if
(
get
(
eMinR
) < 0. or
get
(
eMaxR
) < 0. or
get
(
eMinR
) >
get
(
eMaxR
) or
255
std::abs
(
get
(
eMinR
) -
get
(
eMaxR
)) <
s_epsilon
) {
256
throw
std::invalid_argument(
"AnnulusBounds: invalid radial setup."
);
257
}
258
if
(
get
(
eMinPhiRel
) !=
detail::radian_sym
(
get
(
eMinPhiRel
)) or
259
get
(
eMaxPhiRel
) !=
detail::radian_sym
(
get
(
eMaxPhiRel
)) or
260
get
(
eMinPhiRel
) >
get
(
eMaxPhiRel
)) {
261
throw
std::invalid_argument(
"AnnulusBounds: invalid phi boundary setup."
);
262
}
263
if
(
get
(
eAveragePhi
) !=
detail::radian_sym
(
get
(
eAveragePhi
))) {
264
throw
std::invalid_argument(
"AnnulusBounds: invalid phi positioning."
);
265
}
266
}
267
268
}
// namespace Acts
acts
blob
sPHENIX
Core
include
Acts
Surfaces
AnnulusBounds.hpp
Built by
Jin Huang
. updated:
Mon Jan 22 2024 12:43:23
using
1.8.2 with
EIC GitHub integration