ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
DetectorDescription
ReadoutGeometryBase
src
DetectorDesign.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
ReadoutGeometryBase/DetectorDesign.h
"
6
#include "
ReadoutGeometryBase/SiIntersect.h
"
7
8
namespace
InDetDD
{
9
10
// Constructor with parameters:
11
DetectorDesign::DetectorDesign
(
double
thickness
,
12
bool
phiSymmetric
,
13
bool
etaSymmetric
,
14
bool
depthSymmetric
,
15
InDetDD::CarrierType
carrierType
,
16
int
readoutSide
):
17
m_etaAxis
(
zAxis
),
18
m_phiAxis
(
yAxis
),
19
m_depthAxis
(
xAxis
),
20
m_thickness
(
thickness
),
21
m_carrierType
(
carrierType
),
22
m_phiSymmetric
(
phiSymmetric
),
23
m_etaSymmetric
(
etaSymmetric
),
24
m_depthSymmetric
(
depthSymmetric
),
25
m_readoutSidePosDepth
(
readoutSide
> 0) {
26
}
27
28
// Constructor with axis parameters:
29
DetectorDesign::DetectorDesign
(
double
thickness
,
30
bool
phiSymmetric
,
31
bool
etaSymmetric
,
32
bool
depthSymmetric
,
33
InDetDD::CarrierType
carrierType
,
34
int
readoutSide
,
35
Axis
stripDirection,
36
Axis
thicknessDirection):
37
m_etaAxis
(stripDirection),
38
m_depthAxis
(thicknessDirection),
39
m_thickness
(
thickness
),
40
m_carrierType
(
carrierType
),
41
m_phiSymmetric
(
phiSymmetric
),
42
m_etaSymmetric
(
etaSymmetric
),
43
m_depthSymmetric
(
depthSymmetric
),
44
m_readoutSidePosDepth
(
readoutSide
> 0) {
45
if
(stripDirection == thicknessDirection) {
46
throw
std::runtime_error(
47
"ERROR: DetectorDesign called with phi and thickness directions equal"
);
48
}
49
// phiAxis is "the other one"
50
m_phiAxis
=
static_cast<
Axis
>
((
xAxis
+
yAxis
+
zAxis
) - (stripDirection + thicknessDirection));
51
52
53
54
}
55
56
DetectorDesign::~DetectorDesign
()=
default
;
57
58
59
60
Amg::Vector3D
DetectorDesign::sensorCenter
()
const
{
61
return
Amg::Vector3D
(0., 0., 0.);
62
}
63
64
//For future: Should update to use appropriate message streams in place of cout
65
void
DetectorDesign::setSymmetry
(
bool
phiSymmetric
,
bool
etaSymmetric
,
66
bool
depthSymmetric
) {
67
// Flags can be changed from true to false but not false to true.
68
if
(
m_phiSymmetric
) {
69
m_phiSymmetric
=
phiSymmetric
;
70
}
71
else
if
(
phiSymmetric
) {
72
std::cout <<
73
"SiDetectorDesign: WARNING! Attempt to allow swapping of xPhi axis direction ignored."
74
<< std::endl;
75
}
76
77
if
(
m_etaSymmetric
) {
78
m_etaSymmetric
=
etaSymmetric
;
79
}
80
else
if
(
etaSymmetric
) {
81
std::cout <<
82
"SiDetectorDesign: WARNING! Attempt to allow swapping of xEta axis direction ignored."
83
<< std::endl;
84
}
85
86
if
(
m_depthSymmetric
) {
87
m_depthSymmetric
=
depthSymmetric
;
88
}
89
else
if
(
depthSymmetric
) {
90
std::cout <<
91
"SiDetectorDesign: WARNING! Attempt to allow swapping of xDepth axis direction ignored."
92
<< std::endl;
93
}
94
}
95
96
DetectorShape
DetectorDesign::shape
()
const
{
97
// Default is Box.
98
return
InDetDD::Box
;
99
}
100
101
DetectorType
DetectorDesign::type
()
const
{
102
// Default is Undefined.
103
return
InDetDD::Undefined
;
104
}
105
106
SiIntersect
DetectorDesign::inDetector
(
const
SiLocalPosition
&localPosition,
107
double
phiTol,
double
etaTol)
const
{
108
double
etaDist = 0;
109
double
phiDist = 0;
110
111
distanceToDetectorEdge
(localPosition, etaDist, phiDist);
112
113
SiIntersect
state;
114
115
if
(phiDist < -phiTol || etaDist < -etaTol) {
116
state.
setOut
();
117
return
state;
118
}
119
120
if
(phiDist > phiTol && etaDist > etaTol) {
121
state.
setIn
();
122
return
state;
123
}
124
125
// Near boundary.
126
state.
setNearBoundary
();
127
return
state;
128
}
129
130
const
Amg::Transform3D
DetectorDesign::moduleShift
()
const
{
131
return
Amg::Transform3D::Identity();
132
}
133
134
}
// namespace InDetDD
DetectorDesign.h
SiIntersect.h
InDetDD::DetectorDesign::shape
virtual DetectorShape shape() const
Shape of element.
Definition
DetectorDesign.cxx:96
InDetDD::DetectorDesign::type
virtual DetectorType type() const
Type of element.
Definition
DetectorDesign.cxx:101
InDetDD::DetectorDesign::distanceToDetectorEdge
virtual void distanceToDetectorEdge(const SiLocalPosition &localPosition, double &etaDist, double &phiDist) const =0
Returns distance to nearest detector active edge +ve = inside -ve = outside.
InDetDD::DetectorDesign::Axis
Axis
Definition
DetectorDesign.h:59
InDetDD::DetectorDesign::yAxis
@ yAxis
Definition
DetectorDesign.h:60
InDetDD::DetectorDesign::zAxis
@ zAxis
Definition
DetectorDesign.h:60
InDetDD::DetectorDesign::xAxis
@ xAxis
Definition
DetectorDesign.h:60
InDetDD::DetectorDesign::m_depthSymmetric
bool m_depthSymmetric
Definition
DetectorDesign.h:244
InDetDD::DetectorDesign::m_readoutSidePosDepth
bool m_readoutSidePosDepth
Definition
DetectorDesign.h:246
InDetDD::DetectorDesign::setSymmetry
void setSymmetry(bool phiSymmetric, bool etaSymmetric, bool depthSymmetric)
Override default symmetries to prevent swapping of axes.
Definition
DetectorDesign.cxx:65
InDetDD::DetectorDesign::m_etaAxis
Axis m_etaAxis
Definition
DetectorDesign.h:236
InDetDD::DetectorDesign::~DetectorDesign
~DetectorDesign()
InDetDD::DetectorDesign::m_phiAxis
Axis m_phiAxis
Definition
DetectorDesign.h:237
InDetDD::DetectorDesign::m_thickness
double m_thickness
Definition
DetectorDesign.h:239
InDetDD::DetectorDesign::m_depthAxis
Axis m_depthAxis
Definition
DetectorDesign.h:238
InDetDD::DetectorDesign::m_etaSymmetric
bool m_etaSymmetric
Definition
DetectorDesign.h:243
InDetDD::DetectorDesign::moduleShift
virtual const Amg::Transform3D moduleShift() const
Definition
DetectorDesign.cxx:130
InDetDD::DetectorDesign::depthSymmetric
bool depthSymmetric() const
Definition
DetectorDesign.h:287
InDetDD::DetectorDesign::thickness
double thickness() const
Method which returns thickness of the silicon wafer.
Definition
DetectorDesign.h:271
InDetDD::DetectorDesign::DetectorDesign
DetectorDesign()
InDetDD::DetectorDesign::m_phiSymmetric
bool m_phiSymmetric
Definition
DetectorDesign.h:242
InDetDD::DetectorDesign::sensorCenter
virtual Amg::Vector3D sensorCenter() const
Return the centre of a sensor in the local reference frame.
Definition
DetectorDesign.cxx:60
InDetDD::DetectorDesign::etaSymmetric
bool etaSymmetric() const
Definition
DetectorDesign.h:283
InDetDD::DetectorDesign::phiSymmetric
bool phiSymmetric() const
Definition
DetectorDesign.h:279
InDetDD::DetectorDesign::carrierType
InDetDD::CarrierType carrierType() const
Return carrier type (ie electrons or holes).
Definition
DetectorDesign.h:275
InDetDD::DetectorDesign::readoutSide
int readoutSide() const
ReadoutSide.
Definition
DetectorDesign.h:291
InDetDD::DetectorDesign::m_carrierType
InDetDD::CarrierType m_carrierType
Definition
DetectorDesign.h:240
InDetDD::DetectorDesign::inDetector
virtual SiIntersect inDetector(const SiLocalPosition &localPosition, double phiTol, double etaTol) const
Test if point is in the active part of the detector with specified tolerances.
Definition
DetectorDesign.cxx:106
InDetDD::SiIntersect
class to run intersection tests
Definition
SiIntersect.h:23
InDetDD::SiIntersect::setNearBoundary
void setNearBoundary()
Definition
SiIntersect.h:86
InDetDD::SiIntersect::setIn
void setIn()
Definition
SiIntersect.h:76
InDetDD::SiIntersect::setOut
void setOut()
Definition
SiIntersect.h:81
InDetDD::SiLocalPosition
Class to represent a position in the natural frame of a silicon sensor, for Pixel and SCT For Pixel: ...
Definition
SiLocalPosition.h:31
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition
GeoPrimitives.h:46
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition
GeoPrimitives.h:47
InDetDD
Message Stream Member.
Definition
FakeTrackBuilder.h:8
InDetDD::DetectorShape
DetectorShape
Definition
DetectorDesign.h:41
InDetDD::Box
@ Box
Definition
DetectorDesign.h:42
InDetDD::CarrierType
CarrierType
Definition
InDetDD_Defs.h:17
InDetDD::DetectorType
DetectorType
Definition
DetectorDesign.h:45
InDetDD::Undefined
@ Undefined
Definition
DetectorDesign.h:46
Generated on
for ATLAS Offline Software by
1.17.0