ATLAS Offline Software
SCT_ModuleSideDesign.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // SCT_ModuleSideDesign.h
8 // (c) ATLAS Detector software
10 
11 
12 #ifndef INDETREADOUTGEOMETRY_SCT_MODULESIDEDESIGN_H
13 #define INDETREADOUTGEOMETRY_SCT_MODULESIDEDESIGN_H
14 
15 // Base class
17 
18 // Data member class
20 
21 // Other includes
22 #include "ReadoutGeometryBase/InDetDD_Defs.h" //InDetDD::CarrierType enum
23 #include <vector>
24 #include <utility> //std::pair
25 #include <map> //data member
26 
27 namespace InDetDD{
28  class SiCellId;
29 }
30 
31 namespace InDetDD {
41 public:
51  SCT_ModuleSideDesign(const double thickness,
52  const bool phiSymmetric,
53  const bool etaSymmetric,
54  const bool depthSymmetric,
55  const int crystals,
56  const int diodes,
57  const int cells,
58  const int shift,
59  const bool swapStripReadout,
61  int readoutSide);
62 
72  SCT_ModuleSideDesign(const double thickness,
73  const bool phiSymmetric,
74  const bool etaSymmetric,
75  const bool depthSymmetric,
76  const int crystals,
77  const int diodes,
78  const int cells,
79  const int shift,
80  const bool swapStripReadout,
82  int readoutSide,
83  const SiDetectorDesign::Axis stripDirection,
84  const SiDetectorDesign::Axis thicknessDirection);
85 
86 
88  virtual ~SCT_ModuleSideDesign() = default;
89 
93  virtual int numberOfConnectedCells(const SiReadoutCellId &readoutId) const override;
94  virtual SiCellId connectedCell(const SiReadoutCellId &readoutId, int number) const override;
95 
99  virtual SiCellId gangedCell(const SiCellId &cellId) const override;
100 
102  virtual SiReadoutCellId readoutIdOfCell(const SiCellId &cellId) const override;
103 
105  virtual SiReadoutCellId readoutIdOfPosition(const SiLocalPosition &localPos) const override;
106 
108  virtual SiLocalPosition localPositionOfCell(const SiCellId &cellId) const override = 0;
110  int cluserSize) const = 0;
111 
114  virtual SiCellId cellIdInRange(const SiCellId &cellId) const override;
115 
119  virtual void neighboursOfCell(const SiCellId &cellId,
120  std::vector<SiCellId> &neighbours) const override;
121 
123  virtual bool inActiveArea(const SiLocalPosition &chargePos, bool checkBondGap =
124  true) const = 0;
125 
129  virtual double scaledDistanceToNearestDiode(const SiLocalPosition &chargePos) const =
130  0;
131 
133  virtual double stripPitch(const SiLocalPosition &chargePos) const = 0;
134 
136  virtual double stripPitch() const = 0;
137 
139  virtual std::pair<SiLocalPosition, SiLocalPosition>
140  endsOfStrip(const SiLocalPosition &position) const override = 0;
141 
146  virtual SiLocalPosition positionFromStrip(const int stripNumber) const;
147 
149  virtual double deadAreaLength() const = 0;
150 
152  virtual double deadAreaUpperBoundary() const = 0;
153 
155  virtual double deadAreaLowerBoundary() const = 0;
156 
158  int crystals() const;
159 
161  int diodes() const;
162  virtual int diodesInRow(const int row) const; // Introduced for upgrade sensors which have several rows
163 
165  int cells() const;
166 
168  int shift() const;
169 
171  virtual bool swapHitPhiReadoutDirection() const override;
172  virtual bool swapHitEtaReadoutDirection() const override;
173 
174  virtual int row(int stripId1Dim) const; // For SCT, is 0; otherwise takes a 1-dim strip ID and returns its row
175  virtual int strip(int stripId1Dim) const; // For SCT, returns stripId1Dim; otherwise returns strip within row.
176  virtual int strip1Dim(int strip, int row) const override; // For SCT, returns strip. Else inverse of above two.
177 
178  void setMother(SCT_ModuleSideDesign* mother);
179  const SCT_ModuleSideDesign * getMother() const;
180  std::map<int, const SCT_ModuleSideDesign *> getChildren() const;
181  void addChildDesign(int index, const SCT_ModuleSideDesign * element);
182  virtual std::pair<int,int> getStripRow(SiCellId id) const;
184  virtual SiIntersect inDetector(const SiLocalPosition &localPosition, double phiTol, double etaTol) const override;
185 
186 private:
188 
189  // Copy constructor:
191 
192  // Assignment operator:
194 
195 protected:
196  SCT_ReadoutScheme m_scheme; // !< connection between diodes and readout cells
198 
199 
201  // Private data:
203 private:
204  bool m_swapStripReadout; // !< Flag to indicate if readout direction is opposite
205  // !< to hit local phi direction
206 
207  //container design for split sensors - owned by DetectorManager
209  //if this design *is* a mother design, these are its children
210  std::map<int, const SCT_ModuleSideDesign *> m_childDesigns;
211 };
212 
214 // Inline methods:
216 inline int SCT_ModuleSideDesign::crystals() const {
217  return m_scheme.crystals();
218 }
219 
220 inline int SCT_ModuleSideDesign::diodes() const {
221  return m_scheme.diodes();
222 }
223 
224 inline int SCT_ModuleSideDesign::diodesInRow(const int /* row */) const {
225  return m_scheme.diodes();
226 }
227 
228 inline int SCT_ModuleSideDesign::cells() const {
229  return m_scheme.cells();
230 }
231 
232 inline int SCT_ModuleSideDesign::shift() const {
233  return m_scheme.shift();
234 }
235 
237 const {
238  return m_scheme.numberOfConnectedCells(readoutId);
239 }
240 
242  int number) const {
243  return m_scheme.connectedCell(readoutId, number);
244 }
245 
247  // No ganged cells in SCT so always return invalid id.
248  return SiCellId();
249 }
250 
252 {
253  return m_scheme.readoutIdOfCell(cellId);
254 }
255 
257  const SiLocalPosition &localPos) const {
258  // Get the cellId then convert it to a readoutId.
259  // NEED to think about active area and bond gap check
260  return readoutIdOfCell(cellIdOfPosition(localPos));
261 }
262 
264  return m_swapStripReadout;
265 }
266 
268  return false;
269 }
270 
271 inline int SCT_ModuleSideDesign::row(int /*stripId1Dim not used */) const {
272  return -1; // Use -1 to realise this is an SCT module without rows
273 }
274 
275 inline int SCT_ModuleSideDesign::strip(int stripId1Dim) const {
276  return stripId1Dim;
277 }
278 
279 inline int SCT_ModuleSideDesign::strip1Dim(int strip, int /*row not used */) const {
280  return strip;
281 }
282 
284  return m_motherDesign;
285  }
286 
287  inline std::map<int, const SCT_ModuleSideDesign *> SCT_ModuleSideDesign::getChildren() const {
288  return m_childDesigns;
289  }
290 
291 
293  m_childDesigns.emplace(index,child);
294  }
295 
296 } // namespace InDetDD
297 #endif // INDETREADOUTGEOMETRY_SCT_MODULESIDEDESIGN_H
InDetDD::SCT_ReadoutScheme::cells
int cells() const
Definition: SCT_ReadoutScheme.h:123
InDetDD::SCT_ReadoutScheme::diodes
int diodes() const
Definition: SCT_ReadoutScheme.h:118
InDetDD::SCT_ModuleSideDesign::stripPitch
virtual double stripPitch(const SiLocalPosition &chargePos) const =0
give the strip pitch (dependence on position needed for forward)
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::etaSymmetric
bool etaSymmetric() const
Definition: DetectorDesign.h:283
InDetDD::SCT_ModuleSideDesign::setMother
void setMother(SCT_ModuleSideDesign *mother)
Definition: SCT_ModuleSideDesign.cxx:109
index
Definition: index.py:1
InDetDD::SCT_ModuleSideDesign
Definition: SCT_ModuleSideDesign.h:40
InDetDD::SCT_ModuleSideDesign::m_childDesigns
std::map< int, const SCT_ModuleSideDesign * > m_childDesigns
Definition: SCT_ModuleSideDesign.h:210
InDetDD::SCT_ModuleSideDesign::m_swapStripReadout
bool m_swapStripReadout
Definition: SCT_ModuleSideDesign.h:204
InDetDD::SCT_ModuleSideDesign::strip
virtual int strip(int stripId1Dim) const
Definition: SCT_ModuleSideDesign.h:275
InDetDD::SCT_ModuleSideDesign::getMother
const SCT_ModuleSideDesign * getMother() const
Definition: SCT_ModuleSideDesign.h:283
InDetDD::SCT_ModuleSideDesign::stripPitch
virtual double stripPitch() const =0
give the strip pitch (For Forward returns pitch at center)
InDetDD::SCT_ModuleSideDesign::inActiveArea
virtual bool inActiveArea(const SiLocalPosition &chargePos, bool checkBondGap=true) const =0
check if the position is in active area
InDetDD::SCT_ReadoutScheme
Definition: SCT_ReadoutScheme.h:29
InDetDD::SCT_ModuleSideDesign::deadAreaLength
virtual double deadAreaLength() const =0
give length of dead area
InDetDD::SCT_ReadoutScheme::shift
int shift() const
Definition: SCT_ReadoutScheme.h:128
InDetDD::DetectorDesign::readoutSide
int readoutSide() const
ReadoutSide.
Definition: DetectorDesign.h:291
InDetDD::DetectorDesign::carrierType
InDetDD::CarrierType carrierType() const
Return carrier type (ie electrons or holes)
Definition: DetectorDesign.h:275
InDetDD::DetectorDesign::Axis
Axis
Definition: DetectorDesign.h:59
InDetDD::SCT_ModuleSideDesign::crystals
int crystals() const
number of crystals within module side:
Definition: SCT_ModuleSideDesign.h:216
InDetDD::SCT_ModuleSideDesign::shift
int shift() const
number of edge strips before first readout strip.
Definition: SCT_ModuleSideDesign.h:232
SCT_ReadoutScheme.h
InDetDD::SCT_ModuleSideDesign::scaledDistanceToNearestDiode
virtual double scaledDistanceToNearestDiode(const SiLocalPosition &chargePos) const =0
give distance to the nearest diode in units of pitch, from 0.0 to 0.5, this method should be fast as ...
InDetDD::SCT_ModuleSideDesign::cells
int cells() const
number of readout stips within module side:
Definition: SCT_ModuleSideDesign.h:228
InDetDD::SCT_ModuleSideDesign::SCT_ModuleSideDesign
SCT_ModuleSideDesign(const SCT_ModuleSideDesign &design)
InDetDD::SCT_ModuleSideDesign::numberOfConnectedCells
virtual int numberOfConnectedCells(const SiReadoutCellId &readoutId) const override
readout id -> id of connected diodes Not particularly useful for the SCT but implemented to keep a un...
Definition: SCT_ModuleSideDesign.h:236
InDetDD::SiLocalPosition
Definition: SiLocalPosition.h:31
InDetDD::SCT_ModuleSideDesign::row
virtual int row(int stripId1Dim) const
Definition: SCT_ModuleSideDesign.h:271
InDetDD::SCT_ModuleSideDesign::diodesInRow
virtual int diodesInRow(const int row) const
Definition: SCT_ModuleSideDesign.h:224
InDetDD::SCT_ModuleSideDesign::getChildren
std::map< int, const SCT_ModuleSideDesign * > getChildren() const
Definition: SCT_ModuleSideDesign.h:287
InDetDD::SCT_ModuleSideDesign::cellIdInRange
virtual SiCellId cellIdInRange(const SiCellId &cellId) const override
Check if cell is in range.
Definition: SCT_ModuleSideDesign.cxx:101
InDetDD_Defs.h
InDetDD::DetectorType
DetectorType
Definition: DetectorDesign.h:45
InDetDD::SCT_ModuleSideDesign::m_detectorType
InDetDD::DetectorType m_detectorType
Definition: SCT_ModuleSideDesign.h:197
InDetDD::SCT_ModuleSideDesign::m_motherDesign
const SCT_ModuleSideDesign * m_motherDesign
Definition: SCT_ModuleSideDesign.h:208
InDetDD::SCT_ReadoutScheme::connectedCell
SiCellId connectedCell(const SiReadoutCellId &readoutId, int number) const
Definition: SCT_ReadoutScheme.h:141
InDetDD::SCT_ModuleSideDesign::deadAreaLowerBoundary
virtual double deadAreaLowerBoundary() const =0
give lower boundary of dead area
InDetDD::SCT_ModuleSideDesign::localPositionOfCell
virtual SiLocalPosition localPositionOfCell(const SiCellId &cellId) const override=0
id -> position
InDetDD::SCT_ModuleSideDesign::positionFromStrip
virtual SiLocalPosition positionFromStrip(const int stripNumber) const
gives position of strip center ALTERNATIVE/PREFERED way is to use localPositionOfCell(const SiCellId ...
Definition: SCT_ModuleSideDesign.cxx:95
InDetDD::SCT_ReadoutScheme::numberOfConnectedCells
int numberOfConnectedCells(const SiReadoutCellId &readoutId) const
Definition: SCT_ReadoutScheme.h:133
InDetDD::SCT_ModuleSideDesign::swapHitEtaReadoutDirection
virtual bool swapHitEtaReadoutDirection() const override
Definition: SCT_ModuleSideDesign.h:267
InDetDD::SCT_ModuleSideDesign::m_scheme
SCT_ReadoutScheme m_scheme
Definition: SCT_ModuleSideDesign.h:196
InDetDD::SCT_ModuleSideDesign::swapHitPhiReadoutDirection
virtual bool swapHitPhiReadoutDirection() const override
Return true if hit local direction is the same as readout direction.
Definition: SCT_ModuleSideDesign.h:263
InDetDD::SCT_ModuleSideDesign::diodes
int diodes() const
number of strips within crystal:
Definition: SCT_ModuleSideDesign.h:220
InDetDD::SCT_ReadoutScheme::crystals
int crystals() const
Definition: SCT_ReadoutScheme.h:113
InDetDD::SCT_ModuleSideDesign::operator=
SCT_ModuleSideDesign & operator=(const SCT_ModuleSideDesign &design)
InDetDD::SCT_ModuleSideDesign::connectedCell
virtual SiCellId connectedCell(const SiReadoutCellId &readoutId, int number) const override
readout id -> id of connected diodes.
Definition: SCT_ModuleSideDesign.h:241
python.selection.number
number
Definition: selection.py:20
InDetDD::SCT_ModuleSideDesign::readoutIdOfPosition
virtual SiReadoutCellId readoutIdOfPosition(const SiLocalPosition &localPos) const override
position -> id
Definition: SCT_ModuleSideDesign.h:256
InDetDD::SCT_ModuleSideDesign::readoutIdOfCell
virtual SiReadoutCellId readoutIdOfCell(const SiCellId &cellId) const override
diode id -> readout id
Definition: SCT_ModuleSideDesign.h:251
InDetDD::SCT_ModuleSideDesign::localPositionOfCluster
virtual SiLocalPosition localPositionOfCluster(const SiCellId &cellId, int cluserSize) const =0
InDetDD::SCT_ModuleSideDesign::addChildDesign
void addChildDesign(int index, const SCT_ModuleSideDesign *element)
Definition: SCT_ModuleSideDesign.h:292
InDetDD::SiIntersect
Definition: SiIntersect.h:23
InDetDD::DetectorDesign::cellIdOfPosition
virtual SiCellId cellIdOfPosition(const SiLocalPosition &localPos) const =0
position -> id
InDetDD::SiCellId
Definition: SiCellId.h:29
InDetDD::SCT_ReadoutScheme::readoutIdOfCell
SiReadoutCellId readoutIdOfCell(const SiCellId &cellId) const
Definition: SCT_ReadoutScheme.cxx:53
InDetDD::SCT_ModuleSideDesign::gangedCell
virtual SiCellId gangedCell(const SiCellId &cellId) const override
If cell is ganged return the other cell, otherwise return an invalid id.
Definition: SCT_ModuleSideDesign.h:246
InDetDD::CarrierType
CarrierType
Definition: InDetDD_Defs.h:17
InDetDD::SCT_ModuleSideDesign::strip1Dim
virtual int strip1Dim(int strip, int row) const override
only relevant for SCT.
Definition: SCT_ModuleSideDesign.h:279
InDetDD
Message Stream Member.
Definition: FakeTrackBuilder.h:8
InDetDD::DetectorDesign::phiSymmetric
bool phiSymmetric() const
Definition: DetectorDesign.h:279
InDetDD::SCT_ModuleSideDesign::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: SCT_ModuleSideDesign.cxx:70
InDetDD::Undefined
@ Undefined
Definition: DetectorDesign.h:46
InDetDD::SiReadoutCellId
Definition: SiReadoutCellId.h:42
InDetDD::SCT_ModuleSideDesign::deadAreaUpperBoundary
virtual double deadAreaUpperBoundary() const =0
give upper boundary of dead area
InDetDD::SiDetectorDesign
Definition: SiDetectorDesign.h:50
InDetDD::SCT_ModuleSideDesign::getStripRow
virtual std::pair< int, int > getStripRow(SiCellId id) const
Get the strip and row number of the cell.
Definition: SCT_ModuleSideDesign.cxx:127
InDetDD::SCT_ModuleSideDesign::~SCT_ModuleSideDesign
virtual ~SCT_ModuleSideDesign()=default
Destructor:
InDetDD::SCT_ModuleSideDesign::endsOfStrip
virtual std::pair< SiLocalPosition, SiLocalPosition > endsOfStrip(const SiLocalPosition &position) const override=0
give the ends of strips
SiDetectorDesign.h
InDetDD::SCT_ModuleSideDesign::SCT_ModuleSideDesign
SCT_ModuleSideDesign()
InDetDD::SCT_ModuleSideDesign::inDetector
virtual SiIntersect inDetector(const SiLocalPosition &localPosition, double phiTol, double etaTol) const override
Test if point is in the active part of the detector with specified tolerances.
Definition: SCT_ModuleSideDesign.cxx:131