ATLAS Offline Software
Loading...
Searching...
No Matches
PixelDiodeMatrix.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// PixelDiodeMatrix.h
8
9#ifndef READOUTGEOMETRYBASE_PIXELDIODEMATRIX_H
10#define READOUTGEOMETRYBASE_PIXELDIODEMATRIX_H
11
15
16#include <memory>
17
18namespace InDetDD {
19
92
94
95 public:
96
98
100 ~PixelDiodeMatrix() = default;
101
103 static std::shared_ptr<const PixelDiodeMatrix> construct(double phiWidth, double etaWidth);
104
110 static std::shared_ptr<const PixelDiodeMatrix> construct(Direction direction, // phi or eta
111 std::shared_ptr<const PixelDiodeMatrix> lowerCell,
112 std::shared_ptr<const PixelDiodeMatrix> middleCells,
113 int numCells,
114 std::shared_ptr<const PixelDiodeMatrix> upperCells);
115
121 const PixelDiodeMatrix *cellIdOfPosition(const Amg::Vector2D & position, SiCellId & cellId) const;
122
130 const PixelDiodeMatrix *positionOfCell(const SiCellId & cellId, Amg::Vector2D & position) const;
131
133 double phiWidth() const;
134 double phiHalfWidth() const;
135
137 double phiWidthInverse() const;
138
140 double etaWidth() const;
141 double etaHalfWidth() const;
142
144 double etaWidthInverse() const;
145
147 int phiCells() const;
148
150 int etaCells() const;
151
153 bool singleCell() const;
154
156 std::string createDebugStringRepr() const;
157
158
159 private:
162
164 void initialize(double phiWidth, double etaWidth);
165
171 void initialize(Direction direction, // phi or eta
172 std::shared_ptr<const PixelDiodeMatrix> lowerCell,
173 std::shared_ptr<const PixelDiodeMatrix> middleCells,
174 int numCells,
175 std::shared_ptr<const PixelDiodeMatrix> upperCells);
176
178 std::string createDebugStringRepr(unsigned int level) const;
179
186 static const PixelDiodeMatrix *
187 positionOfCell(const PixelDiodeMatrix *matrix, const SiCellId & cellId, Amg::Vector2D & position);
188
189 double m_phiWidth = 0;
191 double m_etaWidth = 0;
193 int m_phiCells = 0;
194 int m_etaCells = 0;
196 int m_numCells = 0; // number of MiddleCells along m_direction direction.
197 std::shared_ptr<const PixelDiodeMatrix> m_lowerCell;
198 std::shared_ptr<const PixelDiodeMatrix> m_middleCells;
199 std::shared_ptr<const PixelDiodeMatrix> m_upperCell;
200 bool m_singleCell = false;
201
202 };
203
204 inline double PixelDiodeMatrix::phiWidth() const
205 {
206 return m_phiWidth;
207 }
208
209 inline double PixelDiodeMatrix::phiHalfWidth() const
210 {
211 return m_phiWidth*0.5;
212 }
213
215 {
216 return m_phiWidthInverse;
217 }
218
219 inline double PixelDiodeMatrix::etaWidth() const
220 {
221 return m_etaWidth;
222 }
223
224 inline double PixelDiodeMatrix::etaHalfWidth() const
225 {
226 return m_etaWidth*0.5;
227 }
228
230 {
231 return m_etaWidthInverse;
232 }
233
234 inline int PixelDiodeMatrix::phiCells() const
235 {
236 return m_phiCells;
237 }
238
239 inline int PixelDiodeMatrix::etaCells() const
240 {
241 return m_etaCells;
242 }
243
245 {
246 return m_singleCell;
247 }
248
250 {
251 return this->createDebugStringRepr(0);
252 }
253
254 inline const PixelDiodeMatrix *
255 PixelDiodeMatrix::positionOfCell(const SiCellId & cellId, Amg::Vector2D & position) const {
256 return InDetDD::PixelDiodeMatrix::positionOfCell(this, cellId, position);
257 }
258} // end namespace
259
260#endif //READOUTGEOMETRYBASE_PIXELDIODEMATRIX_H
Class used to describe the segmentation of the pixel and allow for conversion between cell id and pos...
double etaWidthInverse() const
Inverse of width in eta (y) direction.
std::shared_ptr< const PixelDiodeMatrix > m_upperCell
const PixelDiodeMatrix * cellIdOfPosition(const Amg::Vector2D &position, SiCellId &cellId) const
Return cell Id corresponding to a relative position within the matrix.
~PixelDiodeMatrix()=default
Destructor.
std::shared_ptr< const PixelDiodeMatrix > m_middleCells
std::string createDebugStringRepr() const
Create debug representation.
PixelDiodeMatrix()
Hidden constructor.
bool singleCell() const
Query wether the matrix is just a single cell.
static std::shared_ptr< const PixelDiodeMatrix > construct(double phiWidth, double etaWidth)
Construct method for just a single cell.
int phiCells() const
Number of cells in phi (x) direction.
int etaCells() const
Number of cells in eta (y) direction.
const PixelDiodeMatrix * positionOfCell(const SiCellId &cellId, Amg::Vector2D &position) const
Search diode matching the given cell id and compute its position.
double etaWidth() const
Width in eta (y) direction.
double phiWidth() const
Width in phi (x) direction.
double phiWidthInverse() const
Inverse of width in phi (x) direction.
std::shared_ptr< const PixelDiodeMatrix > m_lowerCell
Identifier for the strip or pixel cell.
Definition SiCellId.h:29
Eigen::Matrix< double, 2, 1 > Vector2D
Message Stream Member.
void initialize()