ATLAS Offline Software
StripAnnulusDesign.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef INDETREADOUTGEOMETRY_STRIPANNULUSDESIGN_H
6 #define INDETREADOUTGEOMETRY_STRIPANNULUSDESIGN_H
7 
8 //
9 // Annulus shaped sensor design, no stereo angle. Developed (i) as a stepping stone to the more difficult
10 // StripStereoAnnulusDesign (ii) so we can at some time compare performance with one side of a petal radial, the other
11 // stereo. Totally untested as of 17/Feb/2015; I moved on to the StripStereoAnnulusDesign as soon as this
12 // compiled and linked.
13 //
14 // Local reference system is centred on the beamline (i.e. not in the wafer centre; it is made in GeoModel as
15 // an intersection of a tube with a (translated) generic trap. x is along the centre strip; y is in phi direction;
16 // z is the depth direction. Strips are on the +ve z side.
17 //
18 // /) ^ y
19 // / ) |
20 // ) ) --> x
21 // \ )
22 // \‍) z towards you and you are looking at the strip side
23 //
24 //
25 //
26 
27 // Base class
29 
31 #include "CLHEP/Geometry/Vector3D.h" // For unused phiMeasureSegment
32 #include "CLHEP/Geometry/Transform3D.h"
33 
34 #include <stdexcept> // For throw stuff
35 #include <vector>
36 
37 namespace Trk {
38 class RectangleBounds;
39 class SurfaceBounds;
40 }
41 
42 namespace InDetDD {
43 class SiDiodesParameters;
44 
46 public:
47  StripAnnulusDesign(const SiDetectorDesign::Axis &stripDirection,
48  const SiDetectorDesign::Axis &thicknessDirection,
49  const double &thickness,
50  const int &readoutSide,
51  const InDetDD::CarrierType &carrier,
52  const int &nStrips,
53  const double &pitch,
54  const double &stripStart,
55  const double &stripEnd);
56 
57  ~StripAnnulusDesign() = default;
58 
60 
61  // Copy constructor and assignment:
64 
65 //
66 // Pure virtual methods in base class:
67 //
68  // Distance to nearest detector active edge (+ve = inside, -ve = outside)
69  void distanceToDetectorEdge(const SiLocalPosition &localPosition, double &etaDist,
70  double &phiDist) const;
71 
72  // check if the position is in active area
73  bool inActiveArea(const SiLocalPosition &chargePos, bool checkBondGap = false) const;
74 
75  // Element boundary
76  const Trk::SurfaceBounds &bounds() const;
77 
78  // Retrieve the two ends of a "strip"
79  std::pair<SiLocalPosition, SiLocalPosition> endsOfStrip(
80  const SiLocalPosition &position) const;
81 
82  // Phi-pitch (strip-width). Two names for same thing
83  double stripPitch(const SiLocalPosition &localPosition) const;
84  double stripPitch() const;
85  double phiPitch(const SiLocalPosition &localPosition) const;
86  double phiPitch() const;
87 
88  // distance to the nearest diode in units of pitch, from 0.0 to 0.5,
89  // this method should be fast as it is called for every surface charge
90  // in the SCT_SurfaceChargesGenerator
91  // an active area check, done in the Generator anyway, is removed here
92  double scaledDistanceToNearestDiode(const SiLocalPosition &chargePos) const;
93 
94  // readout or diode id -> position, size
95  SiDiodesParameters parameters(const SiCellId &cellId) const;
96  SiLocalPosition localPositionOfCell(const SiCellId &cellId) const;
97  SiLocalPosition localPositionOfCluster(const SiCellId &cellId, int clusterSize) const;
98 
99  // position -> id
100  SiCellId cellIdOfPosition(const SiLocalPosition &localPos) const;
101  // id to position
102  SiLocalPosition positionFromStrip(const SiCellId &cellId) const;
103  SiLocalPosition positionFromStrip(const int stripNumber) const;
104 
105 
106  // Find and fill a vector with all neighbour strips of a given cell
107  void neighboursOfCell(const SiCellId &cellId,
108  std::vector<SiCellId> &neighbours) const;
109  SiCellId cellIdInRange(const SiCellId &) const;
110 
111  // For Strip sensors, readout cell == diode cell. Overload the SCT_ModuleSideDesign
112  // member
113  SiReadoutCellId readoutIdOfCell(const SiCellId &cellId) const;
114 
115  // ---------------------------------------------------------------------------------------
116  // DEPRECATED at least for Strips
117  HepGeom::Vector3D<double> phiMeasureSegment(const SiLocalPosition &position) const;
118 
119  // Method to calculate length of a strip. Which strip??
120  double length() const;
121 
122  // Method to calculate average width of a module. What is it used for??
123  double width() const;
124 
125  // Method to calculate minimum width of a module
126  double minWidth() const;
127 
128  // Method to calculate maximum width of a module
129  double maxWidth() const;
130 
131  // Pitch in eta direction Deprecated for strips: it varies in endcap
132  double etaPitch() const;
133 
134  // Return true if hit local direction is the same as readout direction.
135  bool swapHitPhiReadoutDirection() const;
136  bool swapHitEtaReadoutDirection() const;
137 
138  bool nearBondGap(const SiLocalPosition &, double) const;
139 
140 
141  // Transform from SiHit to GeoModel frame
142  static const Amg::Transform3D SiHitToGeoModel() ;
143 
144  // ------------------------------------------------------------------------------------------
145 
146 //
147 // Accessors
148 //
149  double pitch(const SiCellId &cellId) const;
150  double stripLength(const SiCellId &cellId) const;
151 
152  // Give upper and lower boundaries, and length, of dead area
153  double deadAreaUpperBoundary() const;
154  double deadAreaLowerBoundary() const;
155  double deadAreaLength() const;
156 private:
157  int m_nStrips;
158  double m_pitch;
161  std::unique_ptr<Trk::RectangleBounds> m_bounds;
162 };
163 
165 // Inline methods:
167 
168 // Unfortunately SCT introduced the name stripPitch as an alternative to phiPitch so
169 // everything gets doubled - one of these should be removed!
170 
171 inline double StripAnnulusDesign::stripPitch(const SiLocalPosition &) const {
172  return phiPitch();
173 }
174 
175 inline double StripAnnulusDesign::stripPitch() const {
176  return phiPitch();
177 }
178 
179 inline double StripAnnulusDesign::phiPitch(const SiLocalPosition &) const {
180  return m_pitch;
181 }
182 
183 inline double StripAnnulusDesign::phiPitch() const {
184  return m_pitch;
185 }
186 
187 inline bool StripAnnulusDesign::nearBondGap(const SiLocalPosition &, double) const {
188 // No bond gap in strip modules
189  return false;
190 }
191 
193  int strip1D = cellId.phiIndex();
194  return SiReadoutCellId(strip1D, 0);
195 }
196 
197 HepGeom::Vector3D<double> StripAnnulusDesign::phiMeasureSegment(const SiLocalPosition & /*position*/)
198 const {
199  throw std::runtime_error("Call to phiMeasureSegment, DEPRECATED, not implemented.");
200 }
201 
204  double & /*etaDist*/,
205  double & /*phiDist*/) const {
206  throw std::runtime_error(
207  "Call to distanceToDetectorEdge which is Deprecated and not yet implemented");
208 }
209 
212  return 0.;
213 }
214 
216  return 0.;
217 }
218 
220  return 0.;
221 }
222 
224  return false;
225 }
226 
228  return false;
229 }
230 } // namespace InDetDD
231 #endif // INDETREADOUTGEOMETRY_STRIPANNULUSDESIGN_H
InDetDD::StripAnnulusDesign::swapHitEtaReadoutDirection
bool swapHitEtaReadoutDirection() const
Definition: StripAnnulusDesign.h:227
InDetDD::StripAnnulusDesign
Definition: StripAnnulusDesign.h:45
InDetDD::StripAnnulusDesign::inActiveArea
bool inActiveArea(const SiLocalPosition &chargePos, bool checkBondGap=false) const
check if the position is in active area
Definition: StripAnnulusDesign.cxx:124
InDetDD::DetectorDesign::thickness
double thickness() const
Method which returns thickness of the silicon wafer.
Definition: DetectorDesign.h:271
InDetDD::StripAnnulusDesign::m_bounds
std::unique_ptr< Trk::RectangleBounds > m_bounds
Definition: StripAnnulusDesign.h:161
SCT_ModuleSideDesign.h
InDetDD::SCT_ModuleSideDesign
Definition: SCT_ModuleSideDesign.h:40
InDetDD::StripAnnulusDesign::StripAnnulusDesign
StripAnnulusDesign(const SiDetectorDesign::Axis &stripDirection, const SiDetectorDesign::Axis &thicknessDirection, const double &thickness, const int &readoutSide, const InDetDD::CarrierType &carrier, const int &nStrips, const double &pitch, const double &stripStart, const double &stripEnd)
Definition: StripAnnulusDesign.cxx:15
Trk::SurfaceBounds
Definition: SurfaceBounds.h:47
InDetDD::StripAnnulusDesign::length
double length() const
Method to calculate length of a module.
Definition: StripAnnulusDesign.cxx:173
InDetDD::StripAnnulusDesign::distanceToDetectorEdge
void distanceToDetectorEdge(const SiLocalPosition &localPosition, double &etaDist, double &phiDist) const
DEPRECATED: Unused (2014)
Definition: StripAnnulusDesign.h:203
InDetDD::StripAnnulusDesign::m_pitch
double m_pitch
Definition: StripAnnulusDesign.h:158
InDetDD::DetectorDesign::readoutSide
int readoutSide() const
ReadoutSide.
Definition: DetectorDesign.h:291
InDetDD::StripAnnulusDesign::cellIdOfPosition
SiCellId cellIdOfPosition(const SiLocalPosition &localPos) const
position -> id
Definition: StripAnnulusDesign.cxx:70
InDetDD::DetectorDesign::Axis
Axis
Definition: DetectorDesign.h:59
InDetDD::StripAnnulusDesign::~StripAnnulusDesign
~StripAnnulusDesign()=default
InDetDD::SiCellId::phiIndex
int phiIndex() const
Get phi index. Equivalent to strip().
Definition: SiCellId.h:122
InDetDD::StripAnnulusDesign::operator=
StripAnnulusDesign & operator=(const StripAnnulusDesign &design)
InDetDD::StripAnnulusDesign::cellIdInRange
SiCellId cellIdInRange(const SiCellId &) const
Check if cell is in range.
Definition: StripAnnulusDesign.cxx:161
InDetDD::StripAnnulusDesign::deadAreaUpperBoundary
double deadAreaUpperBoundary() const
DEPRECATED for StripAnnulusDesign; no dead area.
Definition: StripAnnulusDesign.h:211
InDetDD::SiLocalPosition
Definition: SiLocalPosition.h:31
InDetDD::StripAnnulusDesign::phiMeasureSegment
HepGeom::Vector3D< double > phiMeasureSegment(const SiLocalPosition &position) const
Helper method for stereo angle computation, DEPRECATED.
Definition: StripAnnulusDesign.h:197
InDetDD::StripAnnulusDesign::sensorCenter
Amg::Vector3D sensorCenter() const
Return the centre of a sensor in the local reference frame.
Definition: StripAnnulusDesign.cxx:39
InDetDD::StripAnnulusDesign::localPositionOfCluster
SiLocalPosition localPositionOfCluster(const SiCellId &cellId, int clusterSize) const
Definition: StripAnnulusDesign.cxx:89
InDetDD::StripAnnulusDesign::phiPitch
double phiPitch() const
Pitch in phi direction.
Definition: StripAnnulusDesign.h:183
InDetDD::StripAnnulusDesign::m_stripStartRadius
double m_stripStartRadius
Definition: StripAnnulusDesign.h:159
InDetDD::StripAnnulusDesign::readoutIdOfCell
SiReadoutCellId readoutIdOfCell(const SiCellId &cellId) const
diode id -> readout id
Definition: StripAnnulusDesign.h:192
InDetDD::StripAnnulusDesign::scaledDistanceToNearestDiode
double scaledDistanceToNearestDiode(const SiLocalPosition &chargePos) const
give distance to the nearest diode in units of pitch, from 0.0 to 0.5, this method should be fast as ...
Definition: StripAnnulusDesign.cxx:133
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
InDetDD::StripAnnulusDesign::minWidth
double minWidth() const
Method to calculate minimum width of a module.
Definition: StripAnnulusDesign.cxx:181
InDetDD::StripAnnulusDesign::parameters
SiDiodesParameters parameters(const SiCellId &cellId) const
Return strip width, centre, length etc. Hard to find if this is used or not.
Definition: StripAnnulusDesign.cxx:142
InDetDD::StripAnnulusDesign::width
double width() const
Method to calculate average width of a module.
Definition: StripAnnulusDesign.cxx:177
InDetDD::StripAnnulusDesign::neighboursOfCell
void neighboursOfCell(const SiCellId &cellId, std::vector< SiCellId > &neighbours) const
Get the neighbouring diodes of a given diode: Cell for which the neighbours must be found List of cel...
Definition: StripAnnulusDesign.cxx:44
InDetDD::StripAnnulusDesign::etaPitch
double etaPitch() const
Definition: StripAnnulusDesign.cxx:189
MuonGM::nStrips
int nStrips(const MuonGM::TgcReadoutElement &readoutEle, int layer)
Definition: MuonDetDescr/MuonGeoModelTest/src/GeoModelTgcTest.cxx:46
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
InDetDD::StripAnnulusDesign::StripAnnulusDesign
StripAnnulusDesign(const StripAnnulusDesign &design)
InDetDD::StripAnnulusDesign::deadAreaLength
double deadAreaLength() const
give length of dead area
Definition: StripAnnulusDesign.h:219
InDetDD::StripAnnulusDesign::positionFromStrip
SiLocalPosition positionFromStrip(const SiCellId &cellId) const
Definition: StripAnnulusDesign.cxx:147
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
InDetDD::StripAnnulusDesign::m_nStrips
int m_nStrips
Definition: StripAnnulusDesign.h:157
InDetDD::SiCellId
Definition: SiCellId.h:29
InDetDD::StripAnnulusDesign::stripLength
double stripLength(const SiCellId &cellId) const
InDetDD::CarrierType
CarrierType
Definition: InDetDD_Defs.h:17
InDetDD
Message Stream Member.
Definition: FakeTrackBuilder.h:8
InDetDD::StripAnnulusDesign::pitch
double pitch(const SiCellId &cellId) const
InDetDD::StripAnnulusDesign::nearBondGap
bool nearBondGap(const SiLocalPosition &, double) const
Test if near bond gap within tolerances, only relevant for SCT.
Definition: StripAnnulusDesign.h:187
InDetDD::StripAnnulusDesign::endsOfStrip
std::pair< SiLocalPosition, SiLocalPosition > endsOfStrip(const SiLocalPosition &position) const
Give end points of the strip that covers the given position.
Definition: StripAnnulusDesign.cxx:108
InDetDD::StripAnnulusDesign::deadAreaLowerBoundary
double deadAreaLowerBoundary() const
give lower boundary of dead area
Definition: StripAnnulusDesign.h:215
InDetDD::StripAnnulusDesign::SiHitToGeoModel
static const Amg::Transform3D SiHitToGeoModel()
Definition: StripAnnulusDesign.cxx:193
InDetDD::SiReadoutCellId
Definition: SiReadoutCellId.h:42
InDetDD::StripAnnulusDesign::m_stripEndRadius
double m_stripEndRadius
Definition: StripAnnulusDesign.h:160
SiCellId.h
InDetDD::StripAnnulusDesign::stripPitch
double stripPitch() const
give the strip pitch (For Forward returns pitch at center)
Definition: StripAnnulusDesign.h:175
InDetDD::StripAnnulusDesign::bounds
const Trk::SurfaceBounds & bounds() const
Element boundary.
Definition: StripAnnulusDesign.cxx:65
InDetDD::StripAnnulusDesign::maxWidth
double maxWidth() const
Method to calculate maximum width of a module.
Definition: StripAnnulusDesign.cxx:185
InDetDD::StripAnnulusDesign::localPositionOfCell
SiLocalPosition localPositionOfCell(const SiCellId &cellId) const
id -> position
Definition: StripAnnulusDesign.cxx:79
InDetDD::StripAnnulusDesign::swapHitPhiReadoutDirection
bool swapHitPhiReadoutDirection() const
Return true if hit local direction is the same as readout direction.
Definition: StripAnnulusDesign.h:223
InDetDD::SiDiodesParameters
Definition: SiDiodesParameters.h:25