ATLAS Offline Software
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 
10 namespace InDetDD {
11 
12 // Constructor with parameters:
13 HGTD_ModuleDesign::HGTD_ModuleDesign(const double thickness,
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,
21  InDetDD::CarrierType carrierType,
22  int readoutSide,
23  DetectorDesign::Axis yDirection,
24  DetectorDesign::Axis depthDirection):
25  DetectorDesign(thickness,
26  false, false, true, // phi,eta,depth axes symmetric
27  carrierType,
28  readoutSide,
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
45 void
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
89 double 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
100 double 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
111 double
113 {
114  // Average pitch.
115  return width() / rows();
116 }
117 
118 // Pitch in phi direction
119 double
121 {
122  // Cheat since we know its constant.
123  return phiPitch();
124 }
125 
126 // Pitch in eta direction
127 double
129 {
130  // Average pitch
131  return length() / columns();
132 }
133 
134 const 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 
155 SiCellId
157 {
158  return m_readoutScheme.connectedCell(readoutId, number);
159 }
160 
163 {
164  return m_readoutScheme.readoutIdOfCell(cellId);
165 }
166 
169 {
171 }
172 
174 {
175  return m_diodeMap.cellIdOfPosition(localPosition);
176 }
177 
178 SiCellId
180 {
181  return m_diodeMap.cellIdInRange(cellId);
182 }
183 
184 } // namespace InDetDD
InDetDD::HGTD_ModuleDesign::parameters
virtual SiDiodesParameters parameters(const SiCellId &cellId) const
readout or diode id -> position, size
Definition: HGTD_ModuleDesign.cxx:140
Trk::RectangleBounds
Definition: RectangleBounds.h:38
InDetDD::HGTD_ModuleDesign::minWidth
virtual double minWidth() const
Method to calculate minimum width of a module.
Definition: HGTD_ModuleDesign.cxx:77
RectangleBounds.h
InDetDD::SiDiodesParameters::xPhiMax
double xPhiMax() const
Definition: SiDiodesParameters.h:121
InDetDD::PixelDiodeMap::parameters
SiDiodesParameters parameters(const SiCellId &diodeId) const
Get diodes parameters (position and size):
Definition: PixelDiodeMap.cxx:73
Trk::SurfaceBounds
Definition: SurfaceBounds.h:47
InDetDD::PixelReadoutScheme::numberOfConnectedCells
int numberOfConnectedCells(const SiReadoutCellId &readoutId) const
number of cells connected to this readout.
Definition: PixelReadoutScheme.cxx:45
InDetDD::PixelDiodeMap::width
double width() const
Definition: PixelDiodeMap.h:149
InDetDD::HGTD_ModuleDesign::m_bounds
Trk::RectangleBounds m_bounds
Definition: HGTD_ModuleDesign.h:202
InDetDD::HGTD_ModuleDesign::localPositionOfCell
virtual SiLocalPosition localPositionOfCell(const SiCellId &cellId) const
readout or diode id -> position.
Definition: HGTD_ModuleDesign.cxx:145
InDetDD::DetectorDesign::Axis
Axis
Definition: DetectorDesign.h:59
InDetDD::HGTD_ModuleDesign::maxWidth
virtual double maxWidth() const
Method to calculate maximum width of a module.
Definition: HGTD_ModuleDesign.cxx:83
InDetDD::HGTD_ModuleDesign::length
virtual double length() const
Method to calculate length of a module.
Definition: HGTD_ModuleDesign.cxx:65
InDetDD::HGTD_ModuleDesign::readoutIdOfCell
virtual SiReadoutCellId readoutIdOfCell(const SiCellId &cellId) const
diode id -> readout id
Definition: HGTD_ModuleDesign.cxx:162
InDetDD::SiDiodesParameters::xEtaMax
double xEtaMax() const
Definition: SiDiodesParameters.h:111
InDetDD::HGTD_ModuleDesign::cellIdInRange
virtual SiCellId cellIdInRange(const SiCellId &cellId) const
Check if cell is in range.
Definition: HGTD_ModuleDesign.cxx:179
InDetDD::HGTD_ModuleDesign::rows
int rows() const
Number of cell rows per module:
Definition: HGTD_ModuleDesign.h:265
PUfitVar::maxEta
constexpr float maxEta
Definition: GepMETPufitAlg.cxx:13
InDetDD::SiLocalPosition
Definition: SiLocalPosition.h:31
InDetDD::SiLocalPosition::xPhi
double xPhi() const
position along phi direction:
Definition: SiLocalPosition.h:123
InDetDD::PixelReadoutScheme::readoutIdOfCell
SiReadoutCellId readoutIdOfCell(const SiCellId &cellId) const
Readout id of this diode.
Definition: PixelReadoutScheme.cxx:76
InDetDD::HGTD_ModuleDesign::cellIdOfPosition
virtual SiCellId cellIdOfPosition(const SiLocalPosition &localPos) const
position -> id
Definition: HGTD_ModuleDesign.cxx:173
InDetDD::SiDiodesParameters::centre
SiLocalPosition centre() const
position of the diodes centre:
Definition: SiDiodesParameters.h:91
InDetDD::PixelReadoutScheme::connectedCell
SiCellId connectedCell(const SiReadoutCellId &readoutId, unsigned int number) const
Cell ids of cell connected to this readout.
Definition: PixelReadoutScheme.cxx:59
InDetDD::SiLocalPosition::xEta
double xEta() const
position along eta direction:
Definition: SiLocalPosition.h:118
InDetDD::SiDiodesParameters::xPhiMin
double xPhiMin() const
Definition: SiDiodesParameters.h:116
InDetDD::DetectorDesign
Definition: DetectorDesign.h:57
InDetDD::HGTD_ModuleDesign::columns
int columns() const
Number of cell columns per module:
Definition: HGTD_ModuleDesign.h:260
InDetDD::HGTD_ModuleDesign::widthFromRowRange
double widthFromRowRange(const int rowMin, const int rowMax) const
Method to calculate phi width from a row range.
Definition: HGTD_ModuleDesign.cxx:100
InDetDD::HGTD_ModuleDesign::etaPitch
virtual double etaPitch() const
Pitch in eta direction.
Definition: HGTD_ModuleDesign.cxx:128
InDetDD::HGTD_ModuleDesign::HGTD_ModuleDesign
HGTD_ModuleDesign()
SiLocalPosition.h
InDetDD::HGTD_ModuleDesign::m_diodeMap
PixelDiodeMap m_diodeMap
Definition: HGTD_ModuleDesign.h:200
python.selection.number
number
Definition: selection.py:20
InDetDD::HGTD_ModuleDesign::m_readoutScheme
PixelReadoutScheme m_readoutScheme
Definition: HGTD_ModuleDesign.h:201
InDetDD::HGTD_ModuleDesign::bounds
virtual const Trk::SurfaceBounds & bounds() const
Element boundary.
Definition: HGTD_ModuleDesign.cxx:135
InDetDD::SiCellId
Definition: SiCellId.h:29
InDetDD::PixelDiodeMap::length
double length() const
Definition: PixelDiodeMap.h:144
InDetDD::HGTD_ModuleDesign::widthFromColumnRange
double widthFromColumnRange(const int colMin, const int colMax) const
Method to calculate eta width from a column range.
Definition: HGTD_ModuleDesign.cxx:89
python.testIfMatch.matrix
matrix
Definition: testIfMatch.py:66
InDetDD::HGTD_ModuleDesign::distanceToDetectorEdge
virtual void distanceToDetectorEdge(const SiLocalPosition &localPosition, double &etaDist, double &phiDist) const
Returns distance to nearest detector active edge +ve = inside -ve = outside.
Definition: HGTD_ModuleDesign.cxx:46
InDetDD::HGTD_ModuleDesign::phiPitch
virtual double phiPitch() const
Pitch in phi direction.
Definition: HGTD_ModuleDesign.cxx:112
InDetDD::CarrierType
CarrierType
Definition: InDetDD_Defs.h:17
HGTD_ModuleDesign.h
InDetDD
Message Stream Member.
Definition: FakeTrackBuilder.h:8
InDetDD::SiDiodesParameters::xEtaMin
double xEtaMin() const
boundaries of the diodes:
Definition: SiDiodesParameters.h:106
InDetDD::HGTD_ModuleDesign::~HGTD_ModuleDesign
virtual ~HGTD_ModuleDesign()
Definition: HGTD_ModuleDesign.cxx:40
InDetDD::HGTD_ModuleDesign::connectedCell
virtual SiCellId connectedCell(const SiReadoutCellId &readoutId, int number) const
readout id -> id of connected diodes.
Definition: HGTD_ModuleDesign.cxx:156
InDetDD::SiReadoutCellId
Definition: SiReadoutCellId.h:42
InDetDD::HGTD_ModuleDesign::width
virtual double width() const
Method to calculate average width of a module.
Definition: HGTD_ModuleDesign.cxx:71
InDetDD::HGTD_ModuleDesign::readoutIdOfPosition
virtual SiReadoutCellId readoutIdOfPosition(const SiLocalPosition &localPos) const
position -> id
Definition: HGTD_ModuleDesign.cxx:168
InDetDD::PixelDiodeMap::cellIdOfPosition
SiCellId cellIdOfPosition(const Amg::Vector2D &localPosition) const
cell id for a given local position
Definition: PixelDiodeMap.cxx:38
InDetDD::PixelDiodeMap::cellIdInRange
SiCellId cellIdInRange(const SiCellId &cellId) const
Check if cellId is within range.
Definition: PixelDiodeMap.h:189
InDetDD::HGTD_ModuleDesign::numberOfConnectedCells
virtual int numberOfConnectedCells(const SiReadoutCellId &readoutId) const
readout id -> id of connected diodes
Definition: HGTD_ModuleDesign.cxx:150
InDetDD::SiDiodesParameters
Definition: SiDiodesParameters.h:25