ATLAS Offline Software
Loading...
Searching...
No Matches
PixelDiodeMap.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// PixelDiodeMap.h
8// (c) ATLAS Pixel Detector software
10
11#ifndef READOUTGEOMETRYBASE_PIXELDIODEMAP_H
12#define READOUTGEOMETRYBASE_PIXELDIODEMAP_H
13
14// STL classes
15#include <list>
16#include <memory>
17#include <vector>
18
19// Data member classes
21
22// Input/output classes
26
27namespace InDetDD {
28
29class SiCellId;
31
43
45
46 public:
47
49 PixelDiodeMap(std::shared_ptr<const PixelDiodeMatrix> diodeMatrix);
50
53
56
59
61 // Const methods:
63
65 SiDiodesParameters parameters(const SiCellId & diodeId) const;
66
68 SiCellId cellIdOfPosition(const Amg::Vector2D & localPosition) const;
69
71 SiCellId cellIdInRange(const SiCellId & cellId) const;
72
76 void neighboursOfCell(const SiCellId & cellId,
77 std::vector<SiCellId> &neighbours) const;
78
83 double intersectionLength(const SiCellId &diode1, const SiCellId &diode2) const;
84
85 // Global sensor size:
86 double leftColumn() const;
87 double rightColumn() const;
88 double leftRow() const;
89 double rightRow() const;
90
91 double width() const;
92 double length() const;
93
94 // Number of cells in each direction.
95 int phiDiodes() const;
96 int etaDiodes() const;
97
98 // Total number of diodes:
99 int diodes() const;
100
102 // Non-const methods:
104
108
110 std::string debugStringRepr() const;
111
118
120 // Private methods:
122 private:
123
128 static double intersectionLength1D(const double x1,const double dx1,
129 const double x2,const double dx2) ;
130
132 void neighboursOfCellGeneral(const SiCellId & cellId,
133 std::vector<SiCellId> &neighbours) const;
134
136 double intersectionLengthGeneral(const SiCellId &diode1,
137 const SiCellId &diode2) const;
138
139
141 // Private data:
143 private:
144 std::shared_ptr<const PixelDiodeMatrix> m_matrix;
146 };
147
149 // Inline methods:
151
152 inline double PixelDiodeMap::length() const
153 {
154 return m_matrix->etaWidth();
155 }
156
157 inline double PixelDiodeMap::width() const
158 {
159 return m_matrix->phiWidth();
160 }
161
162 inline double PixelDiodeMap::leftColumn() const
163 {
164 return -0.5*length();
165 }
166
167 inline double PixelDiodeMap::rightColumn() const
168 {
169 return 0.5*length();
170 }
171
172 inline double PixelDiodeMap::leftRow() const
173 {
174 return -0.5*width();
175 }
176
177 inline double PixelDiodeMap::rightRow() const
178 {
179 return 0.5*width();
180 }
181
182 inline int PixelDiodeMap::diodes() const
183 {
184 return phiDiodes() * etaDiodes();
185 }
186
187 inline int PixelDiodeMap::phiDiodes() const
188 {
189 return m_matrix->phiCells();
190 }
191
192 inline int PixelDiodeMap::etaDiodes() const
193 {
194 return m_matrix->etaCells();
195 }
196
197 inline SiCellId PixelDiodeMap::cellIdInRange(const SiCellId & cellId) const
198 {
199 if (!cellId.isValid() ||
200 cellId.phiIndex() <0 || cellId.phiIndex() >= phiDiodes() ||
201 cellId.etaIndex() <0 || cellId.etaIndex() >= etaDiodes()) return SiCellId(); // Invalid
202 return cellId;
203 }
204
205 inline std::string PixelDiodeMap::debugStringRepr() const
206 {
207 return m_matrix->createDebugStringRepr();
208 }
209
212 ret.cell_ptr() = m_matrix->positionOfCell(cellId, ret.position());
213 return ret;
214 }
215
216} // namespace InDetDD
217
218#endif // READOUTGEOMETRYBASE_PIXELDIODEMAP_H
std::string debugStringRepr() const
Debug representation.
PixelDiodeMap(const PixelDiodeMap &map)
Copy constructor:
double leftColumn() const
static double intersectionLength1D(const double x1, const double dx1, const double x2, const double dx2)
Compute the intersection length along one direction: return 0 if no intersection x1,...
PixelDiodeParametersProxy parametersProxy(const SiCellId &cellId) const
Search diode for the given cell and return proxy to access its parameters.
PixelDiodeMap(std::shared_ptr< const PixelDiodeMatrix > diodeMatrix)
Constructor from Diode matrix description.
bool m_generalLayout
Flag set to allow for dealing wth more general layouts.
double rightColumn() const
SiCellId cellIdInRange(const SiCellId &cellId) const
Check if cellId is within range.
PixelDiodeMap & operator=(const PixelDiodeMap &map)
Assignment operator.
double rightRow() const
~PixelDiodeMap()
Destructor.
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...
void setGeneralLayout()
Set general layout flag.
double intersectionLengthGeneral(const SiCellId &diode1, const SiCellId &diode2) const
Slower method.
std::shared_ptr< const PixelDiodeMatrix > m_matrix
diode matrix
void neighboursOfCell(const SiCellId &cellId, std::vector< SiCellId > &neighbours) const
Get the neighbouring PixelDiodes of a given PixelDiode: Cell for which the neighbours must be found L...
SiCellId cellIdOfPosition(const Amg::Vector2D &localPosition) const
cell id for a given local position
SiDiodesParameters parameters(const SiCellId &diodeId) const
Get diodes parameters (position and size):
void neighboursOfCellGeneral(const SiCellId &cellId, std::vector< SiCellId > &neighbours) const
Slower method.
Class used to describe the segmentation of the pixel and allow for conversion between cell id and pos...
Helper class to cache a pixel diode position, and provide access to diode parameters.
const Amg::Vector2D & position() const
return the center position of the diode if the proxy is valid.
PixelDiodeMatrixPtr & cell_ptr()
provide access to internal storage for initializing the proxy.
Identifier for the strip or pixel cell.
Definition SiCellId.h:29
int phiIndex() const
Get phi index. Equivalent to strip().
Definition SiCellId.h:122
bool isValid() const
Test if its in a valid state.
Definition SiCellId.h:136
int etaIndex() const
Get eta index.
Definition SiCellId.h:114
Class to handle the position of the centre and the width of a diode or a cluster of diodes Version 1....
STL class.
Eigen::Matrix< double, 2, 1 > Vector2D
Message Stream Member.