ATLAS Offline Software
Loading...
Searching...
No Matches
HGTD_ModuleDesign.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
6
9
10namespace InDetDD {
11
12// Constructor with parameters:
14 const int circuitsPerColumn,
15 const int circuitsPerRow,
16 const int cellColumnsPerCircuit,
17 const int cellRowsPerCircuit,
18 const int diodeColumnsPerCircuit,
19 const int diodeRowsPerCircuit,
20 std::shared_ptr<const PixelDiodeMatrix> matrix,
22 int readoutSide,
23 DetectorDesign::Axis yDirection,
24 DetectorDesign::Axis depthDirection):
26 false, false, true, // phi,eta,depth axes symmetric
29 yDirection,
30 depthDirection),
31 m_diodeMap(std::move(matrix)),
32 m_readoutScheme(circuitsPerColumn,circuitsPerRow,
33 cellColumnsPerCircuit,cellRowsPerCircuit,
34 diodeColumnsPerCircuit,diodeRowsPerCircuit)
35{
37}
38
39// Destructor:
41
42// Returns distance to nearest detector edge
43// +ve = inside
44// -ve = outside
45void
47 double & etaDist, double & phiDist) const
48{
49 // This assume element is centered at 0,0
50 // As the calculation is symmetric around 0,0 we only have to test it for one side.
51 double xEta = abs(localPosition.xEta());
52 double xPhi = abs(localPosition.xPhi());
53
54 double xEtaEdge = 0.5*length();
55 double xPhiEdge = 0.5*width();
56
57 // Distance to top/bottom
58 etaDist = xEtaEdge - xEta;
59
60 // Distance to right/left edge
61 phiDist = xPhiEdge - xPhi;
62}
63
64// Methods to calculate length of a module
66{
67 return m_diodeMap.length();
68}
69
70// Methods to calculate average width of a module
72{
73 return m_diodeMap.width();
74}
75
76// Methods to calculate minimum width of a module
78{
79 return width();
80}
81
82// Methods to calculate maximum width of a module
84{
85 return width();
86}
87
88// Method to calculate eta width from a column range
89double HGTD_ModuleDesign::widthFromColumnRange(const int colMin, const int colMax) const
90{
91 SiCellId idMin(0, colMin);
92 SiCellId idMax(0, colMax);
93 double minEta = parameters(idMin).xEtaMin();
94 double maxEta = parameters(idMax).xEtaMax();
95
96 return std::abs(maxEta-minEta);
97}
98
99// Method to calculate phi width from a row range
100double HGTD_ModuleDesign::widthFromRowRange(const int rowMin, const int rowMax) const
101{
102 SiCellId idMin(rowMin, 0);
103 SiCellId idMax(rowMax, 0);
104 double minPhi = parameters(idMin).xPhiMin();
105 double maxPhi = parameters(idMax).xPhiMax();
106
107 return std::abs(maxPhi-minPhi);
108}
109
110// Pitch in phi direction
111double
113{
114 // Average pitch.
115 return width() / rows();
116}
117
118// Pitch in phi direction
119double
121{
122 // Cheat since we know its constant.
123 return phiPitch();
124}
125
126// Pitch in eta direction
127double
129{
130 // Average pitch
131 return length() / columns();
132}
133
134const Trk::SurfaceBounds &
136{
137 return m_bounds;
138}
139
141{
142 return m_diodeMap.parameters(cellId);
143}
144
146{
147 return m_diodeMap.parameters(cellId).centre();
148}
149
151{
152 return m_readoutScheme.numberOfConnectedCells(readoutId);
153}
154
157{
158 return m_readoutScheme.connectedCell(readoutId, number);
159}
160
163{
164 return m_readoutScheme.readoutIdOfCell(cellId);
165}
166
169{
170 return m_readoutScheme.readoutIdOfCell(m_diodeMap.cellIdOfPosition(localPos));
171}
172
174{
175 return m_diodeMap.cellIdOfPosition(localPosition);
176}
177
180{
181 return m_diodeMap.cellIdInRange(cellId);
182}
183
184} // namespace InDetDD
DetectorDesign(double thickness, bool phiSymmetric, bool etaSymmetric, bool depthSymmetric, InDetDD::CarrierType carrierType, int readoutSide)
Constructor.
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.
virtual SiCellId connectedCell(const SiReadoutCellId &readoutId, int number) const
readout id -> id of connected diodes.
virtual SiReadoutCellId readoutIdOfPosition(const SiLocalPosition &localPos) const
position -> id
virtual double width() const
Method to calculate average width of a module.
virtual SiCellId cellIdOfPosition(const SiLocalPosition &localPos) const
position -> id
int rows() const
Number of cell rows per module:
virtual SiReadoutCellId readoutIdOfCell(const SiCellId &cellId) const
diode id -> readout id
virtual SiDiodesParameters parameters(const SiCellId &cellId) const
readout or diode id -> position, size
int columns() const
Number of cell columns per module:
virtual const Trk::SurfaceBounds & bounds() const
Element boundary.
PixelReadoutScheme m_readoutScheme
double widthFromColumnRange(const int colMin, const int colMax) const
Method to calculate eta width from a column range.
virtual double etaPitch() const
Pitch in eta direction.
Trk::RectangleBounds m_bounds
double widthFromRowRange(const int rowMin, const int rowMax) const
Method to calculate phi width from a row range.
virtual double phiPitch() const
Pitch in phi direction.
virtual double maxWidth() const
Method to calculate maximum width of a module.
virtual double length() const
Method to calculate length of a module.
virtual SiLocalPosition localPositionOfCell(const SiCellId &cellId) const
readout or diode id -> position.
virtual double minWidth() const
Method to calculate minimum width of a module.
virtual SiCellId cellIdInRange(const SiCellId &cellId) const
Check if cell is in range.
virtual int numberOfConnectedCells(const SiReadoutCellId &readoutId) const
readout id -> id of connected diodes
virtual void distanceToDetectorEdge(const SiLocalPosition &localPosition, double &etaDist, double &phiDist) const
Returns distance to nearest detector active edge +ve = inside -ve = outside.
Identifier for the strip or pixel cell.
Definition SiCellId.h:29
Class to handle the position of the centre and the width of a diode or a cluster of diodes Version 1....
double xEtaMin() const
boundaries of the diodes:
Class to represent a position in the natural frame of a silicon sensor, for Pixel and SCT For Pixel: ...
double xPhi() const
position along phi direction:
double xEta() const
position along eta direction:
Identifier for the strip or pixel readout cell.
Bounds for a rectangular, planar surface.
Abstract base class for surface bounds to be specified.
Message Stream Member.
STL namespace.
std::string number(const double &d, const std::string &s)
Definition utils.cxx:186