ATLAS Offline Software
Loading...
Searching...
No Matches
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
7
8namespace InDetDD {
9
10// Constructor with parameters:
27
28// Constructor with axis parameters:
30 bool phiSymmetric,
31 bool etaSymmetric,
32 bool depthSymmetric,
34 int readoutSide,
35 Axis stripDirection,
36 Axis thicknessDirection):
37 m_etaAxis(stripDirection),
38 m_depthAxis(thicknessDirection),
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
57
58
59
61 return Amg::Vector3D(0., 0., 0.);
62}
63
64//For future: Should update to use appropriate message streams in place of cout
66 bool depthSymmetric) {
67 // Flags can be changed from true to false but not false to true.
68 if (m_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) {
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) {
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
97 // Default is Box.
98 return InDetDD::Box;
99}
100
102 // Default is Undefined.
103 return InDetDD::Undefined;
104}
105
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
131 return Amg::Transform3D::Identity();
132 }
133
134} // namespace InDetDD
virtual DetectorShape shape() const
Shape of element.
virtual DetectorType type() const
Type of element.
virtual void distanceToDetectorEdge(const SiLocalPosition &localPosition, double &etaDist, double &phiDist) const =0
Returns distance to nearest detector active edge +ve = inside -ve = outside.
void setSymmetry(bool phiSymmetric, bool etaSymmetric, bool depthSymmetric)
Override default symmetries to prevent swapping of axes.
virtual const Amg::Transform3D moduleShift() const
double thickness() const
Method which returns thickness of the silicon wafer.
virtual Amg::Vector3D sensorCenter() const
Return the centre of a sensor in the local reference frame.
InDetDD::CarrierType carrierType() const
Return carrier type (ie electrons or holes)
int readoutSide() const
ReadoutSide.
InDetDD::CarrierType m_carrierType
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.
class to run intersection tests
Definition SiIntersect.h:23
Class to represent a position in the natural frame of a silicon sensor, for Pixel and SCT For Pixel: ...
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 3, 1 > Vector3D
Message Stream Member.