ATLAS Offline Software
StripBoxDesign.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef INDETREADOUTGEOMETRY_STRIPBOXDESIGN_H
6 #define INDETREADOUTGEOMETRY_STRIPBOXDESIGN_H
7 
8 //
9 // Upgrade strip barrel sensor with several rows of strips
10 //
11 
12 // Base class
14 
15 #include "GeoModelKernel/GeoDefinitions.h"
18 
19 #include "CLHEP/Geometry/Vector3D.h" // For unused phiMeasureSegment
20 
21 #include <stdexcept> // For throw stuff
22 #include <vector>
23 
24 namespace Trk {
25  class SurfaceBounds;
26 }
27 
28 namespace InDetDD {
29 class SiDiodesParameters;
30 
32 public:
33  StripBoxDesign(); // Just for access to Axis; or can it be private?
34 
35  StripBoxDesign(const SiDetectorDesign::Axis stripDirection,
36  const SiDetectorDesign::Axis thicknessDirection,
37  const double thickness,
38  const int readoutSide,
39  const InDetDD::CarrierType carrier,
40  const int nRows,
41  const int nStrips,
42  const double pitch,
43  const double length,
45  const double zShift=0.0);
46 
47  ~StripBoxDesign() = default;
48 
49  // Copy constructor and assignment:
52 //
53 // I make a one-dimensional strip number to store in the SiCellId, so etaIndex is always 0,
54 // even with multi-row detectors. This was an easier way to get digitization than doing
55 // the more natural 2D (strip, row) identifier. The following methods convert 1D to 2D and v.v.
56 //
57  std::pair<int,int> getStripRow(SiCellId id) const final;
58  virtual int strip1Dim(int strip, int row) const override;
59  int diodes() const;
60  virtual int diodesInRow(const int row) const override;
61 //
62 // Pure virtual methods in base class:
63 //
64  // Distance to nearest detector active edge (+ve = inside, -ve = outside)
65  virtual void distanceToDetectorEdge(const SiLocalPosition &localPosition, double &etaDist,
66  double &phiDist) const override;
67 
68  // check if the position is in active area
69  virtual bool inActiveArea(const SiLocalPosition &chargePos, bool checkBondGap = true) const override;
70 
71  // Element boundary
72  virtual const Trk::SurfaceBounds &bounds() const override;
73 
74  // Retrieve the two ends of a "strip"
75  virtual std::pair<SiLocalPosition, SiLocalPosition> endsOfStrip(
76  const SiLocalPosition &position) const override;
77 
78  // Phi-pitch (strip-width). Two names for same thing
79  virtual double stripPitch(const SiLocalPosition &localPosition) const override;
80  double stripPitch(const SiCellId &cellId) const;
81  virtual double stripPitch() const override;
82  virtual double phiPitch(const SiLocalPosition &localPosition) const override;
83  double phiPitch(const SiCellId &cellId) const;
84  virtual double phiPitch() const override;
85 
86  // distance to the nearest diode in units of pitch, from 0.0 to 0.5,
87  // this method should be fast as it is called for every surface charge
88  // in the SCT_SurfaceChargesGenerator
89  // an active area check, done in the Generator anyway, is removed here
90  virtual double scaledDistanceToNearestDiode(const SiLocalPosition &chargePos) const override;
91 
92  // readout or diode id -> position, size
93  virtual SiDiodesParameters parameters(const SiCellId &cellId) const override;
94  virtual SiLocalPosition localPositionOfCell(const SiCellId &cellId) const override;
95  virtual SiLocalPosition localPositionOfCluster(const SiCellId &cellId, int clusterSize) const override;
96 
97  // position -> id
98  virtual SiCellId cellIdOfPosition(const SiLocalPosition &localPos) const override;
99  // id to position
100  SiLocalPosition positionFromStrip(const SiCellId &cellId) const;
101  virtual SiLocalPosition positionFromStrip(const int stripNumber) const override;
102 
103  // row and strip from 1-dim strip number
104  virtual int row(int stripId1Dim) const override;
105  virtual int strip(int stripId1Dim) const override;
106 
107  // Find and fill a vector with all neighbour strips of a given cell
108  virtual void neighboursOfCell(const SiCellId &cellId,
109  std::vector<SiCellId> &neighbours) const override;
110  virtual SiCellId cellIdInRange(const SiCellId &) const override;
111 
112  // For Strip sensors, readout cell == diode cell. Overload the SCT_ModuleSideDesign
113  // member
114  virtual SiReadoutCellId readoutIdOfCell(const SiCellId &cellId) const override;
115 
116  virtual const Amg::Transform3D moduleShift() const override final;
117 
118  virtual InDetDD::DetectorType type() const override final;
119 
120  // ---------------------------------------------------------------------------------------
121  // DEPRECATED at least for Strips
122  virtual HepGeom::Vector3D<double> phiMeasureSegment(const SiLocalPosition &position) const override;
123 
124  // Method to calculate length of a strip. Which strip??
125  virtual double length() const override;
126 
127  // Method to calculate average width of a module. What is it used for??
128  virtual double width() const override;
129 
130  // Method to calculate minimum width of a module
131  virtual double minWidth() const override;
132 
133  // Method to calculate maximum width of a module
134  virtual double maxWidth() const override;
135 
136  // Pitch in eta direction Deprecated for strips: it varies in endcap
137  virtual double etaPitch() const override;
138 
139  // Return true if hit local direction is the same as readout direction.
140  virtual bool swapHitPhiReadoutDirection() const override;
141  virtual bool swapHitEtaReadoutDirection() const override;
142 
143  virtual bool nearBondGap(const SiLocalPosition &, double) const override;
144 
145  // ------------------------------------------------------------------------------------------
146 
147 //
148 // Accessors
149 //
150  double pitch(const SiCellId &cellId) const;
151  double stripLength(const SiCellId &cellId) const;
152 
153  // Give upper and lower boundaries, and length, of dead area
154  virtual double deadAreaUpperBoundary() const override;
155  virtual double deadAreaLowerBoundary() const override;
156  virtual double deadAreaLength() const override;
157 private:
158  int m_nRows;
160  double m_pitch;
161  double m_length;
162  double m_zShift;
163  Trk::RectangleBounds m_bounds;
164 };
165 
167 // Inline methods:
169 inline int StripBoxDesign::diodes() const { // Total diodes
170  return m_nRows * m_nStrips;
171 }
172 
173 inline int StripBoxDesign::diodesInRow(const int /* row */) const {
174  return m_nStrips;
175 }
176 
177 // Unfortunately SCT introduced the name stripPitch as an alternative to phiPitch so
178 // everything gets doubled
179 
180 inline double StripBoxDesign::stripPitch(const SiLocalPosition & /*pos not used */) const {
181  return m_pitch;
182 }
183 
184 inline double StripBoxDesign::stripPitch(const SiCellId & /*cellId not used */) const {
185  return m_pitch;
186 }
187 
188 inline double StripBoxDesign::stripPitch() const {
189  return m_pitch;
190 }
191 
192 inline double StripBoxDesign::phiPitch(const SiLocalPosition & /*pos not used */) const {
193  return m_pitch;
194 }
195 
196 inline double StripBoxDesign::phiPitch(const SiCellId & /*cellId not used */) const {
197  return m_pitch;
198 }
199 
200 inline double StripBoxDesign::phiPitch() const {
201  return m_pitch;
202 }
203 
204 inline bool StripBoxDesign::nearBondGap(const SiLocalPosition &, double) const {
205 // No bond gap in strip modules
206  return false;
207 }
208 
210  int strip = cellId.phiIndex(); /* Gets a 1D strip id */
211  int row = cellId.etaIndex(); /* is junk or 0 in 1D scheme */
212 
213  return SiReadoutCellId(strip, row);
214 }
215 
216 inline int StripBoxDesign::row(int stripId1Dim) const {
217  return stripId1Dim / m_nStrips;
218 }
219 
220 inline int StripBoxDesign::strip(int stripId1Dim) const {
221  return stripId1Dim % m_nStrips;
222 }
223 
225  return m_detectorType;
226 }
227 
230  return 0.;
231 }
232 
234  return 0.;
235 }
236 
238  return 0.;
239 }
240 
242  return false;
243 }
244 
246  return false;
247 }
248 
249 } // namespace InDetDD
250 #endif // INDETREADOUTGEOMETRY_STRIPBOXDESIGN_H
InDetDD::StripBoxDesign::positionFromStrip
SiLocalPosition positionFromStrip(const SiCellId &cellId) const
Definition: StripBoxDesign.cxx:184
InDetDD::StripBoxDesign::m_bounds
Trk::RectangleBounds m_bounds
Definition: StripBoxDesign.h:163
InDetDD::StripBoxDesign::scaledDistanceToNearestDiode
virtual double scaledDistanceToNearestDiode(const SiLocalPosition &chargePos) const override
give distance to the nearest diode in units of pitch, from 0.0 to 0.5, this method should be fast as ...
Definition: StripBoxDesign.cxx:169
InDetDD::StripBoxDesign::StripBoxDesign
StripBoxDesign(const StripBoxDesign &design)
InDetDD::StripBoxDesign::parameters
virtual SiDiodesParameters parameters(const SiCellId &cellId) const override
Return strip width, centre, length etc. Hard to find if this is used or not.
Definition: StripBoxDesign.cxx:179
InDetDD::DetectorDesign::thickness
double thickness() const
Method which returns thickness of the silicon wafer.
Definition: DetectorDesign.h:271
InDetDD::StripBoxDesign::cellIdOfPosition
virtual SiCellId cellIdOfPosition(const SiLocalPosition &localPos) const override
position -> id
Definition: StripBoxDesign.cxx:91
InDetDD::StripBoxDesign::readoutIdOfCell
virtual SiReadoutCellId readoutIdOfCell(const SiCellId &cellId) const override
diode id -> readout id
Definition: StripBoxDesign.h:209
RectangleBounds.h
SCT_ModuleSideDesign.h
InDetDD::SCT_ModuleSideDesign
Definition: SCT_ModuleSideDesign.h:40
Trk::SurfaceBounds
Definition: SurfaceBounds.h:47
InDetDD::StripBoxDesign::m_nRows
int m_nRows
Definition: StripBoxDesign.h:158
InDetDD::StripBoxDesign::length
virtual double length() const override
Method to calculate length of a module.
Definition: StripBoxDesign.cxx:209
InDetDD::StripBoxDesign::swapHitEtaReadoutDirection
virtual bool swapHitEtaReadoutDirection() const override
Definition: StripBoxDesign.h:245
InDetDD::StripBoxDesign::minWidth
virtual double minWidth() const override
Method to calculate minimum width of a module.
Definition: StripBoxDesign.cxx:217
InDetDD::StripBoxDesign
Definition: StripBoxDesign.h:31
InDetDD::StripBoxDesign::localPositionOfCell
virtual SiLocalPosition localPositionOfCell(const SiCellId &cellId) const override
id -> position
Definition: StripBoxDesign.cxx:113
InDetDD::StripBoxDesign::m_pitch
double m_pitch
Definition: StripBoxDesign.h:160
InDetDD::StripBoxDesign::StripBoxDesign
StripBoxDesign()
InDetDD::DetectorDesign::readoutSide
int readoutSide() const
ReadoutSide.
Definition: DetectorDesign.h:291
InDetDD::DetectorDesign::Axis
Axis
Definition: DetectorDesign.h:59
InDetDD::SiCellId::phiIndex
int phiIndex() const
Get phi index. Equivalent to strip().
Definition: SiCellId.h:122
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:562
InDetDD::StripBoxDesign::diodesInRow
virtual int diodesInRow(const int row) const override
Definition: StripBoxDesign.h:173
InDetDD::StripBoxDesign::width
virtual double width() const override
Method to calculate average width of a module.
Definition: StripBoxDesign.cxx:213
InDetDD::SiLocalPosition
Definition: SiLocalPosition.h:31
InDetDD::StripBoxDesign::etaPitch
virtual double etaPitch() const override
Definition: StripBoxDesign.cxx:225
InDetDD::SiCellId::etaIndex
int etaIndex() const
Get eta index.
Definition: SiCellId.h:114
InDetDD::StripBoxDesign::m_length
double m_length
Definition: StripBoxDesign.h:161
InDetDD::StripBoxDesign::swapHitPhiReadoutDirection
virtual bool swapHitPhiReadoutDirection() const override
Return true if hit local direction is the same as readout direction.
Definition: StripBoxDesign.h:241
InDetDD::DetectorType
DetectorType
Definition: DetectorDesign.h:45
InDetDD::SCT_ModuleSideDesign::m_detectorType
InDetDD::DetectorType m_detectorType
Definition: SCT_ModuleSideDesign.h:197
InDetDD::StripBoxDesign::m_nStrips
int m_nStrips
Definition: StripBoxDesign.h:159
InDetDD::StripBoxDesign::diodes
int diodes() const
Definition: StripBoxDesign.h:169
InDetDD::StripBoxDesign::type
virtual InDetDD::DetectorType type() const override final
Type of element.
Definition: StripBoxDesign.h:224
InDetDD::StripBoxDesign::~StripBoxDesign
~StripBoxDesign()=default
InDetDD::StripBoxDesign::phiMeasureSegment
virtual HepGeom::Vector3D< double > phiMeasureSegment(const SiLocalPosition &position) const override
Helper method for stereo angle computation, DEPRECATED.
Definition: StripBoxDesign.cxx:229
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
InDetDD::StripBoxDesign::deadAreaUpperBoundary
virtual double deadAreaUpperBoundary() const override
DEPRECATED for StripBoxDesign; no dead area.
Definition: StripBoxDesign.h:229
InDetDD::StripBoxDesign::phiPitch
virtual double phiPitch() const override
Pitch in phi direction.
Definition: StripBoxDesign.h:200
InDetDD::StripBoxDesign::getStripRow
std::pair< int, int > getStripRow(SiCellId id) const final
Get the strip and row number of the cell.
Definition: StripBoxDesign.cxx:51
InDetDD::StripBoxDesign::row
virtual int row(int stripId1Dim) const override
Definition: StripBoxDesign.h:216
InDetDD::StripBoxDesign::distanceToDetectorEdge
virtual void distanceToDetectorEdge(const SiLocalPosition &localPosition, double &etaDist, double &phiDist) const override
DEPRECATED: Unused (2014)
Definition: StripBoxDesign.cxx:235
InDetDD::StripBoxDesign::stripLength
double stripLength(const SiCellId &cellId) const
MuonGM::nStrips
int nStrips(const MuonGM::TgcReadoutElement &readoutEle, int layer)
Definition: MuonDetDescr/MuonGeoModelTest/src/GeoModelTgcTest.cxx:46
InDetDD::StripBoxDesign::bounds
virtual const Trk::SurfaceBounds & bounds() const override
Element boundary.
Definition: StripBoxDesign.cxx:85
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
InDetDD::StripBoxDesign::operator=
StripBoxDesign & operator=(const StripBoxDesign &design)
private
#define private
Definition: DetDescrConditionsDict_dict_fixes.cxx:13
InDetDD::StripBoxDesign::localPositionOfCluster
virtual SiLocalPosition localPositionOfCluster(const SiCellId &cellId, int clusterSize) const override
Definition: StripBoxDesign.cxx:124
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
InDetDD::StripBoxDesign::m_zShift
double m_zShift
Definition: StripBoxDesign.h:162
InDetDD::StripBoxDesign::cellIdInRange
virtual SiCellId cellIdInRange(const SiCellId &) const override
DEPRECATED: only used in a stupid example (2014) Check if cell is in range.
Definition: StripBoxDesign.cxx:197
HepGeom
Definition: VP1String.h:30
InDetDD::SiCellId
Definition: SiCellId.h:29
InDetDD::StripBoxDesign::pitch
double pitch(const SiCellId &cellId) const
InDetDD::StripBoxDesign::neighboursOfCell
virtual void neighboursOfCell(const SiCellId &cellId, std::vector< SiCellId > &neighbours) const override
Get the neighbouring diodes of a given diode: Cell for which the neighbours must be found List of cel...
Definition: StripBoxDesign.cxx:62
InDetDD::StripBoxDesign::maxWidth
virtual double maxWidth() const override
Method to calculate maximum width of a module.
Definition: StripBoxDesign.cxx:221
InDetDD::StripBoxDesign::inActiveArea
virtual bool inActiveArea(const SiLocalPosition &chargePos, bool checkBondGap=true) const override
check if the position is in active area
Definition: StripBoxDesign.cxx:159
InDetDD::CarrierType
CarrierType
Definition: InDetDD_Defs.h:17
InDetDD
Message Stream Member.
Definition: FakeTrackBuilder.h:8
InDetDD::StripBoxDesign::nearBondGap
virtual bool nearBondGap(const SiLocalPosition &, double) const override
Test if near bond gap within tolerances, only relevant for SCT.
Definition: StripBoxDesign.h:204
InDetDD::StripBoxDesign::deadAreaLowerBoundary
virtual double deadAreaLowerBoundary() const override
give lower boundary of dead area
Definition: StripBoxDesign.h:233
InDetDD::StripBoxDesign::strip
virtual int strip(int stripId1Dim) const override
Definition: StripBoxDesign.h:220
InDetDD::StripBoxDesign::deadAreaLength
virtual double deadAreaLength() const override
give length of dead area
Definition: StripBoxDesign.h:237
InDetDD::StripBoxDesign::moduleShift
virtual const Amg::Transform3D moduleShift() const override final
Definition: StripBoxDesign.cxx:255
InDetDD::Undefined
@ Undefined
Definition: DetectorDesign.h:46
InDetDD::SiReadoutCellId
Definition: SiReadoutCellId.h:42
SiCellId.h
InDetDD::StripBoxDesign::strip1Dim
virtual int strip1Dim(int strip, int row) const override
only relevant for SCT.
Definition: StripBoxDesign.cxx:58
InDetDD::StripBoxDesign::endsOfStrip
virtual std::pair< SiLocalPosition, SiLocalPosition > endsOfStrip(const SiLocalPosition &position) const override
Give end points of the strip that covers the given position.
Definition: StripBoxDesign.cxx:140
InDetDD::StripBoxDesign::stripPitch
virtual double stripPitch() const override
give the strip pitch (For Forward returns pitch at center)
Definition: StripBoxDesign.h:188
InDetDD::SiDiodesParameters
Definition: SiDiodesParameters.h:25