ATLAS Offline Software
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 
8 namespace InDetDD {
9 
10 // Constructor with parameters:
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:
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 
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
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) {
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
InDetDD::DetectorDesign::xAxis
@ xAxis
Definition: DetectorDesign.h:60
InDetDD::SiIntersect::setOut
void setOut()
Definition: SiIntersect.h:81
InDetDD::DetectorDesign::m_etaSymmetric
bool m_etaSymmetric
Definition: DetectorDesign.h:243
InDetDD::DetectorDesign::m_phiSymmetric
bool m_phiSymmetric
Definition: DetectorDesign.h:242
InDetDD::DetectorDesign::depthSymmetric
bool depthSymmetric() const
Definition: DetectorDesign.h:287
InDetDD::DetectorDesign::etaSymmetric
bool etaSymmetric() const
Definition: DetectorDesign.h:283
PlotCalibFromCool.zAxis
zAxis
Definition: PlotCalibFromCool.py:76
InDetDD::DetectorDesign::moduleShift
virtual const Amg::Transform3D moduleShift() const
Definition: DetectorDesign.cxx:130
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::~DetectorDesign
~DetectorDesign()
InDetDD::DetectorDesign::shape
virtual DetectorShape shape() const
Shape of element.
Definition: DetectorDesign.cxx:96
InDetDD::DetectorDesign::yAxis
@ yAxis
Definition: DetectorDesign.h:60
InDetDD::DetectorDesign::m_phiAxis
Axis m_phiAxis
Definition: DetectorDesign.h:237
InDetDD::DetectorDesign::Axis
Axis
Definition: DetectorDesign.h:59
SiIntersect.h
InDetDD::SiLocalPosition
Definition: SiLocalPosition.h:31
InDetDD::SiIntersect::setIn
void setIn()
Definition: SiIntersect.h:76
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::DetectorType
DetectorType
Definition: DetectorDesign.h:45
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
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.
DetectorDesign.h
InDetDD::DetectorDesign::setSymmetry
void setSymmetry(bool phiSymmetric, bool etaSymmetric, bool depthSymmetric)
Override default symmetries to prevent swapping of axes.
Definition: DetectorDesign.cxx:65
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
InDetDD::DetectorShape
DetectorShape
Definition: DetectorDesign.h:41
InDetDD::DetectorDesign::DetectorDesign
DetectorDesign()
InDetDD::SiIntersect
Definition: SiIntersect.h:23
InDetDD::CarrierType
CarrierType
Definition: InDetDD_Defs.h:17
InDetDD
Message Stream Member.
Definition: FakeTrackBuilder.h:8
InDetDD::DetectorDesign::phiSymmetric
bool phiSymmetric() const
Definition: DetectorDesign.h:279
InDetDD::DetectorDesign::m_depthSymmetric
bool m_depthSymmetric
Definition: DetectorDesign.h:244
InDetDD::Box
@ Box
Definition: DetectorDesign.h:42
InDetDD::Undefined
@ Undefined
Definition: DetectorDesign.h:46
InDetDD::SiIntersect::setNearBoundary
void setNearBoundary()
Definition: SiIntersect.h:86
InDetDD::DetectorDesign::zAxis
@ zAxis
Definition: DetectorDesign.h:60