ATLAS Offline Software
Loading...
Searching...
No Matches
PixelModuleDesign.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
6// PixelModuleDesign.h
8// (c) ATLAS Pixel Detector software
10
11
12#ifndef PIXELREADOUTGEOMETRY_PIXELMODULEDESIGN_H
13#define PIXELREADOUTGEOMETRY_PIXELMODULEDESIGN_H
14
15// Base class
17
18// Data member classes
22
23// Other includes
26
27#include <memory>
28
29namespace Trk{
30 class SurfaceBounds;
31}
32
33namespace InDetDD {
34
46
48 // Public methods:
50 public:
51
53 // Constructors/destructor:
55
67
68 PixelModuleDesign(const double thickness,
69 const int circuitsPerColumn,
70 const int circuitsPerRow,
71 const int cellColumnsPerCircuit,
72 const int cellRowsPerCircuit,
73 const int diodeColumnsPerCircuit,
74 const int diodeRowsPerCircuit,
75 PixelDiodeTree &&diode_tree,
77 int readoutSide /*= -1*/,
78 bool is3D/*=false*/,
79 InDetDD::DetectorType detectorType/* = InDetDD::Undefined*/,
80 PixelReadoutTechnology readoutTechnology);
81
82//Allow also setting of symmetry parameters
83 PixelModuleDesign(const double thickness,
84 const bool phiSymmetric,
85 const bool etaSymmetric,
86 const bool depthSymmetric,
87 const int circuitsPerColumn,
88 const int circuitsPerRow,
89 const int cellColumnsPerCircuit,
90 const int cellRowsPerCircuit,
91 const int diodeColumnsPerCircuit,
92 const int diodeRowsPerCircuit,
93 PixelDiodeTree &&diode_tree,
95 int readoutSide,
96 bool is3D,
97 InDetDD::DetectorType detectorType,
98 PixelReadoutTechnology readoutTechnology);
99
100 // Destructor:
101 virtual ~PixelModuleDesign() = default;
102
104 // Const methods:
106
110 virtual void distanceToDetectorEdge(const SiLocalPosition & localPosition,
111 double & etaDist, double & phiDist) const;
112
114 virtual SiDiodesParameters parameters(const SiCellId & cellId) const;
115 virtual SiLocalPosition localPositionOfCell(const SiCellId & cellId) const;
116
118 virtual int numberOfConnectedCells(const SiReadoutCellId & readoutId) const;
119 virtual SiCellId connectedCell(const SiReadoutCellId & readoutId, int number) const;
120
122 virtual SiCellId gangedCell(const SiCellId & cellId) const;
123
125 virtual SiReadoutCellId readoutIdOfCell(const SiCellId & cellId) const;
126
128 virtual SiReadoutCellId readoutIdOfPosition(const SiLocalPosition & localPos) const;
129 virtual SiCellId cellIdOfPosition(const SiLocalPosition & localPos) const;
130
132 virtual SiCellId cellIdInRange(const SiCellId & cellId) const;
133
135 bool isInsideMatrix(const SiCellId &cellId) const;
137 bool isInsideMatrix(const std::array<InDetDD::PixelDiodeTree::IndexType,2> &idx) const;
139 bool isInsideMatrix(const Amg::Vector2D &local_position) const;
140
142 virtual HepGeom::Vector3D<double> phiMeasureSegment(const SiLocalPosition&) const;
143
145 virtual std::pair<SiLocalPosition,SiLocalPosition> endsOfStrip(const SiLocalPosition &position) const;
146
151 SiLocalPosition positionFromColumnRow(const int column, const int row) const;
152
156 virtual void neighboursOfCell(const SiCellId & cellId,
157 std::vector<SiCellId> &neighbours) const;
158
163 double intersectionLength(const SiCellId &diode1, const SiCellId &diode2) const;
164
166 int numberOfDiodes() const;
167
169 int numberOfCircuits() const;
170
172 int numberOfCircuitsPerColumn() const;
173
175 int numberOfCircuitsPerRow() const;
176
178 int columnsPerCircuit() const;
179
181 int rowsPerCircuit() const;
182
184 int columns() const;
185
187 int rows() const;
188
190 virtual double length() const;
191
193 virtual double width() const;
194
196 virtual double minWidth() const;
197
199 virtual double maxWidth() const;
200
202 virtual double phiPitch() const;
203
205 virtual double phiPitch(const SiLocalPosition & localPosition) const;
206
208 virtual double etaPitch() const;
209
211 double widthFromColumnRange(const int colMin, const int colMax) const;
212
214 double widthFromRowRange(const int rowMin, const int rowMax) const;
215
218 virtual bool nearBondGap(const SiLocalPosition & localPosition, double etaTol) const;
219
221 virtual bool swapHitPhiReadoutDirection() const;
222 virtual bool swapHitEtaReadoutDirection() const;
223
225 virtual const Trk::SurfaceBounds & bounds() const;
226
227 virtual bool is3D() const;
228
230
231 virtual DetectorType type() const final;
232
234 // Non-const methods:
236
237
242 void addMultipleRowConnection(const int lowerRow,
243 const std::vector<int> &connections);
244
246 std::string debugStringRepr() const;
247
248 PixelDiodeTree::DiodeProxy diodeProxyFromIdx(const std::array<PixelDiodeTree::IndexType,2> &idx) const {
249 return m_diodeTree.diodeProxyFromIdx(idx);
250 }
251 PixelDiodeTree::DiodeProxyWithPosition diodeProxyFromIdxCachePosition(const std::array<PixelDiodeTree::IndexType,2> &idx) const {
252 return m_diodeTree.diodeProxyFromIdxCachePosition(idx);
253 }
255 return m_diodeTree.diodeProxyFromPos(pos);
256 }
257
258 static unsigned int getFE(const PixelDiodeTree::DiodeProxy &diode_proxy) {
259 return diode_proxy.subMatrixAttribute();
260 }
262 return static_cast<InDetDD::PixelDiodeType>(diode_proxy.diodeAttribute());
263 }
264
266 // Private methods:
268 private:
269
271
272 // Copy constructor:
274
275 // Assignment operator:
277
278
280 // Private data:
282 private:
288 bool m_is3D;
289 };
290
292 // Inline methods:
294
295 inline void PixelModuleDesign::addMultipleRowConnection(const int lowerRow,
296 const std::vector<int> &connections)
297 {
298 m_readoutScheme.addMultipleRowConnection(lowerRow,connections);
299 }
300
302 {
304 }
305
307 {
308 return m_readoutScheme.numberOfCircuits();
309 }
310
312 {
313 return m_readoutScheme.numberOfCircuitsPerColumn();
314 }
315
317 {
318 return m_readoutScheme.numberOfCircuitsPerRow();
319 }
320
322 {
323 return m_readoutScheme.columnsPerCircuit();
324 }
325
327 {
328 return m_readoutScheme.rowsPerCircuit();
329 }
330
331 inline int PixelModuleDesign::columns() const
332 {
333 return m_readoutScheme.columns();
334 }
335
336 inline int PixelModuleDesign::rows() const
337 {
338 return m_readoutScheme.rows();
339 }
340
341 inline bool PixelModuleDesign::nearBondGap(const SiLocalPosition &, double) const
342 {
343 // No bond gap in pixel module
344 return false;
345 }
346
348 {
349 return true;
350 }
351
353 {
354 return true;
355 }
356
357
359 std::vector<SiCellId> &neighbours) const
360 {
361
362 m_diodeTree.neighboursOfCell(PixelDiodeTree::makeCellIndex(cellId.phiIndex(),cellId.etaIndex()),
364 neighbours);
365 }
366
368 const SiCellId &diode2) const
369 {
371 diode1.etaIndex()));
372 std::array<int,2> abs_delta;
373 abs_delta[0] = std::abs(diode1.phiIndex() - diode2.phiIndex());
374 abs_delta[1] = std::abs(diode1.etaIndex() - diode2.etaIndex());
375
376 if (abs_delta[0]+abs_delta[1]==1) {
377 // i.e. delta[0]=1 or delta[1]=1 since delta[0]>=0 and delta[1]>=0
378 // diode1_proxy.width()[1] for delta[0]==1 && delta[1]==0 <= delta[0]==1 because sum delta[i]=1
379 // diode1_proxy.width()[0] for delta[0]==0 && delta[1]==1 <= delta[0]!=1
380 // ==
381 return diode1_proxy.width() [ abs_delta[0]==1 ];
382 }
383 return 0.;
384 }
385
386 inline bool PixelModuleDesign::is3D() const
387 {
388 return m_is3D;
389 }
390
394
395 inline std::string PixelModuleDesign::debugStringRepr() const
396 {
397 return m_diodeTree.debugStringRepr();
398 }
399
400 inline bool PixelModuleDesign::isInsideMatrix(const SiCellId &cellId) const {
401 return m_diodeTree.isInsideMatrix( std::array<PixelDiodeTree::CellIndexType,2>{cellId.phiIndex(),
402 cellId.etaIndex()});
403 }
404 inline bool PixelModuleDesign::isInsideMatrix(const std::array<PixelDiodeTree::IndexType,2> &idx) const {
405 return m_diodeTree.isInsideMatrix(idx);
406 }
407 inline bool PixelModuleDesign::isInsideMatrix(const Amg::Vector2D &local_position) const {
408 return m_diodeTree.isInsideMatrix(local_position);
409 }
410
411} // namespace InDetDD
412
413#endif // READOUTGEOMETRYBASE_PIXELMODULEDESIGN_H
Cached unique_ptr with atomic update.
double thickness() const
Method which returns thickness of the silicon wafer.
InDetDD::CarrierType carrierType() const
Return carrier type (ie electrons or holes)
int readoutSide() const
ReadoutSide.
Tree structure to find the position, index or pitch of a pixel on a semi-regular grid The grid is con...
static constexpr std::array< PixelDiodeTree::CellIndexType, 2 > makeCellIndex(T local_x_idx, T local_y_idx)
Create a 2D cell index from the indices in local-x (phi, row) and local-y (eta, column) direction.
double intersectionLength(const SiCellId &diode1, const SiCellId &diode2) const
Compute the intersection length of two diodes: return: the intersection length when the two diodes ar...
CxxUtils::CachedUniquePtr< Trk::RectangleBounds > m_bounds
PixelDiodeTree::DiodeProxyWithPosition diodeProxyFromIdxCachePosition(const std::array< PixelDiodeTree::IndexType, 2 > &idx) const
virtual SiLocalPosition localPositionOfCell(const SiCellId &cellId) const
readout or diode id -> position.
virtual ~PixelModuleDesign()=default
virtual SiDiodesParameters parameters(const SiCellId &cellId) const
readout or diode id -> position, size
virtual int numberOfConnectedCells(const SiReadoutCellId &readoutId) const
readout id -> id of connected diodes
virtual bool swapHitEtaReadoutDirection() const
PixelReadoutTechnology m_readoutTechnology
PixelReadoutTechnology getReadoutTechnology() const
bool isInsideMatrix(const SiCellId &cellId) const
Return true if the given index describes a pixel of this matrix.
InDetDD::DetectorType m_detectorType
virtual bool nearBondGap(const SiLocalPosition &localPosition, double etaTol) const
Test if near bond gap within tolerances Only relevant for SCT.
virtual DetectorType type() const final
Type of element.
PixelModuleDesign(const PixelModuleDesign &design)
int columns() const
Number of cell columns per module:
virtual void distanceToDetectorEdge(const SiLocalPosition &localPosition, double &etaDist, double &phiDist) const
Returns distance to nearest detector active edge +ve = inside -ve = outside.
PixelDiodeTree::DiodeProxy diodeProxyFromIdx(const std::array< PixelDiodeTree::IndexType, 2 > &idx) const
virtual double length() const
Method to calculate length of a module.
PixelReadoutScheme m_readoutScheme
int rows() const
Number of cell rows per module:
virtual double maxWidth() const
Method to calculate maximum width of a module.
PixelDiodeTree::DiodeProxy diodeProxyFromPosition(const Amg::Vector2D &pos) const
SiLocalPosition positionFromColumnRow(const int column, const int row) const
Given row and column index of a diode, return position of diode center ALTERNATIVE/PREFERED way is to...
double widthFromRowRange(const int rowMin, const int rowMax) const
Method to calculate phi width from a row range.
PixelModuleDesign & operator=(const PixelModuleDesign &design)
virtual SiReadoutCellId readoutIdOfCell(const SiCellId &cellId) const
diode id -> readout id
virtual bool swapHitPhiReadoutDirection() const
Return true if hit local direction is the same as readout direction.
virtual 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...
static InDetDD::PixelDiodeType getDiodeType(const PixelDiodeTree::DiodeProxy &diode_proxy)
virtual HepGeom::Vector3D< double > phiMeasureSegment(const SiLocalPosition &) const
Helper method for stereo angle computation.
virtual SiCellId cellIdOfPosition(const SiLocalPosition &localPos) const
position -> id
int numberOfCircuitsPerRow() const
Number of circuits per row:
virtual SiCellId gangedCell(const SiCellId &cellId) const
If cell is ganged return the other cell, otherwise return an invalid id.
int numberOfDiodes() const
Total number of diodes:
int rowsPerCircuit() const
Number of cell rows per circuit:
virtual SiCellId cellIdInRange(const SiCellId &cellId) const
Check if cell is in range.
int numberOfCircuitsPerColumn() const
Number of circuits per column:
double widthFromColumnRange(const int colMin, const int colMax) const
Method to calculate eta width from a column range.
virtual double minWidth() const
Method to calculate minimum width of a module.
int numberOfCircuits() const
Total number of circuits:
virtual SiReadoutCellId readoutIdOfPosition(const SiLocalPosition &localPos) const
position -> id
virtual double width() const
Method to calculate average width of a module.
std::string debugStringRepr() const
Debug string representation.
virtual SiCellId connectedCell(const SiReadoutCellId &readoutId, int number) const
readout id -> id of connected diodes.
virtual const Trk::SurfaceBounds & bounds() const
Element boundary.
int columnsPerCircuit() const
Number of cell columns per circuit:
virtual std::pair< SiLocalPosition, SiLocalPosition > endsOfStrip(const SiLocalPosition &position) const
Special method for SCT (irrelevant here):
void addMultipleRowConnection(const int lowerRow, const std::vector< int > &connections)
Add a new multiple connection for rows: lower diode row for which the connection scheme is given vect...
virtual double etaPitch() const
Pitch in eta direction.
static unsigned int getFE(const PixelDiodeTree::DiodeProxy &diode_proxy)
PixelModuleDesign(const double thickness, const int circuitsPerColumn, const int circuitsPerRow, const int cellColumnsPerCircuit, const int cellRowsPerCircuit, const int diodeColumnsPerCircuit, const int diodeRowsPerCircuit, PixelDiodeTree &&diode_tree, InDetDD::CarrierType carrierType, int readoutSide, bool is3D, InDetDD::DetectorType detectorType, PixelReadoutTechnology readoutTechnology)
Constructor with parameters: local axis corresponding to eta direction local axis corresponding to ph...
virtual double phiPitch() const
Pitch in phi direction.
Class used to describe the connection scheme of a diode matrix to a set of readout circuits.
Identifier for the strip or pixel cell.
Definition SiCellId.h:29
int phiIndex() const
Get phi index. Equivalent to strip().
Definition SiCellId.h:122
int etaIndex() const
Get eta index.
Definition SiCellId.h:114
SiDetectorDesign(double thickness, bool phiSymmetric, bool etaSymmetric, bool depthSymmetric, InDetDD::CarrierType carrierType, int readoutSide)
Constructor.
Class to handle the position of the centre and the width of a diode or a cluster of diodes Version 1....
Class to represent a position in the natural frame of a silicon sensor, for Pixel and SCT For Pixel: ...
Identifier for the strip or pixel readout cell.
Abstract base class for surface bounds to be specified.
Eigen::Matrix< double, 2, 1 > Vector2D
CachedUniquePtrT< const T > CachedUniquePtr
Message Stream Member.
Ensure that the ATLAS eigen extensions are properly loaded.
STL namespace.
A diode proxy which caches the position of a diode.
Helper class to access parameters of a diode.
unsigned int diodeAttribute() const
get the attribute associated to this diode (to be interpreted)
unsigned int subMatrixAttribute() const
get the attribute associated to the sub-matrix of this diode (to be interpreted)
const PixelDiodeTree::Vector2D & width() const
get the width stored for this diode.
std::string number(const double &d, const std::string &s)
Definition utils.cxx:186