ATLAS Offline Software
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 
18 namespace InDetDD {
19 
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;
190  double m_phiWidthInverse = 0;
191  double m_etaWidth = 0;
192  double m_etaWidthInverse = 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 
214  inline double PixelDiodeMatrix::phiWidthInverse() const
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 
229  inline double PixelDiodeMatrix::etaWidthInverse() const
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 
244  inline bool PixelDiodeMatrix::singleCell() const
245  {
246  return m_singleCell;
247  }
248 
249  inline std::string PixelDiodeMatrix::createDebugStringRepr() const
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
InDetDD::PixelDiodeMatrix::phiWidth
double phiWidth() const
Width in phi (x) direction.
Definition: PixelDiodeMatrix.h:204
InDetDD::PixelDiodeMatrix::phiWidthInverse
double phiWidthInverse() const
Inverse of width in phi (x) direction.
Definition: PixelDiodeMatrix.h:214
TrkDetElementBase.h
InDetDD::PixelDiodeMatrix::m_upperCell
std::shared_ptr< const PixelDiodeMatrix > m_upperCell
Definition: PixelDiodeMatrix.h:199
InDetDD::PixelDiodeMatrix::m_etaCells
int m_etaCells
Definition: PixelDiodeMatrix.h:194
InDetDD::PixelDiodeMatrix::m_singleCell
bool m_singleCell
Definition: PixelDiodeMatrix.h:200
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
InDetDD::PixelDiodeMatrix::etaWidth
double etaWidth() const
Width in eta (y) direction.
Definition: PixelDiodeMatrix.h:219
InDetDD::PixelDiodeMatrix::etaWidthInverse
double etaWidthInverse() const
Inverse of width in eta (y) direction.
Definition: PixelDiodeMatrix.h:229
InDetDD::PixelDiodeMatrix::createDebugStringRepr
std::string createDebugStringRepr() const
Create debug representation.
Definition: PixelDiodeMatrix.h:249
InDetDD::PixelDiodeMatrix::~PixelDiodeMatrix
~PixelDiodeMatrix()=default
Destructor.
InDetDD::PixelDiodeMatrix::construct
static std::shared_ptr< const PixelDiodeMatrix > construct(double phiWidth, double etaWidth)
Construct method for just a single cell.
Definition: PixelDiodeMatrix.cxx:14
InDetDD::PixelDiodeMatrix::PixelDiodeMatrix
PixelDiodeMatrix()
Hidden constructor.
Definition: PixelDiodeMatrix.h:161
InDetDD::PixelDiodeMatrix::phiCells
int phiCells() const
Number of cells in phi (x) direction.
Definition: PixelDiodeMatrix.h:234
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
InDetDD::PixelDiodeMatrix::phiDir
@ phiDir
Definition: PixelDiodeMatrix.h:97
InDetDD::PixelDiodeMatrix::cellIdOfPosition
const PixelDiodeMatrix * cellIdOfPosition(const Amg::Vector2D &position, SiCellId &cellId) const
Return cell Id corresponding to a relative position within the matrix.
Definition: PixelDiodeMatrix.cxx:131
GeoPrimitives.h
InDetDD::PixelDiodeMatrix::m_lowerCell
std::shared_ptr< const PixelDiodeMatrix > m_lowerCell
Definition: PixelDiodeMatrix.h:197
InDetDD::PixelDiodeMatrix::phiHalfWidth
double phiHalfWidth() const
Definition: PixelDiodeMatrix.h:209
InDetDD::PixelDiodeMatrix::m_phiWidthInverse
double m_phiWidthInverse
Definition: PixelDiodeMatrix.h:190
InDetDD::PixelDiodeMatrix::m_phiCells
int m_phiCells
Definition: PixelDiodeMatrix.h:193
InDetDD::PixelDiodeMatrix::positionOfCell
const PixelDiodeMatrix * positionOfCell(const SiCellId &cellId, Amg::Vector2D &position) const
Search diode matching the given cell id and compute its position.
Definition: PixelDiodeMatrix.h:255
InDetDD::PixelDiodeMatrix::etaHalfWidth
double etaHalfWidth() const
Definition: PixelDiodeMatrix.h:224
InDetDD::PixelDiodeMatrix::m_etaWidth
double m_etaWidth
Definition: PixelDiodeMatrix.h:191
InDetDD::PixelDiodeMatrix::m_phiWidth
double m_phiWidth
Definition: PixelDiodeMatrix.h:189
InDetDD::PixelDiodeMatrix::m_numCells
int m_numCells
Definition: PixelDiodeMatrix.h:196
InDetDD::PixelDiodeMatrix::etaCells
int etaCells() const
Number of cells in eta (y) direction.
Definition: PixelDiodeMatrix.h:239
InDetDD::SiCellId
Definition: SiCellId.h:29
InDetDD::PixelDiodeMatrix::m_middleCells
std::shared_ptr< const PixelDiodeMatrix > m_middleCells
Definition: PixelDiodeMatrix.h:198
python.testIfMatch.matrix
matrix
Definition: testIfMatch.py:63
InDetDD::PixelDiodeMatrix::initialize
void initialize(double phiWidth, double etaWidth)
Initialize for just a single cell.
Definition: PixelDiodeMatrix.cxx:22
xAOD::TauJetParameters::numCells
@ numCells
Definition: TauDefs.h:171
InDetDD
Message Stream Member.
Definition: FakeTrackBuilder.h:8
InDetDD::PixelDiodeMatrix::m_direction
Direction m_direction
Definition: PixelDiodeMatrix.h:195
InDetDD::PixelDiodeMatrix::m_etaWidthInverse
double m_etaWidthInverse
Definition: PixelDiodeMatrix.h:192
InDetDD::PixelDiodeMatrix::singleCell
bool singleCell() const
Query wether the matrix is just a single cell.
Definition: PixelDiodeMatrix.h:244
SiCellId.h
InDetDD::PixelDiodeMatrix::Direction
Direction
Definition: PixelDiodeMatrix.h:97
InDetDD::PixelDiodeMatrix
Definition: PixelDiodeMatrix.h:93
InDetDD::PixelDiodeMatrix::etaDir
@ etaDir
Definition: PixelDiodeMatrix.h:97