ATLAS Offline Software
PixelDiodeMap.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 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
25 
26 namespace InDetDD {
27 
28 class SiCellId;
29 class PixelDiodeMatrix;
30 
43  class PixelDiodeMap {
44 
45  public:
46 
48  PixelDiodeMap(std::shared_ptr<const PixelDiodeMatrix> diodeMatrix);
49 
52 
55 
58 
60  // Const methods:
62 
64  SiDiodesParameters parameters(const SiCellId & diodeId) const;
65 
67  SiCellId cellIdOfPosition(const Amg::Vector2D & localPosition) const;
68 
70  SiCellId cellIdInRange(const SiCellId & cellId) const;
71 
75  void neighboursOfCell(const SiCellId & cellId,
76  std::vector<SiCellId> &neighbours) const;
77 
82  double intersectionLength(const SiCellId &diode1, const SiCellId &diode2) const;
83 
84  // Global sensor size:
85  double leftColumn() const;
86  double rightColumn() const;
87  double leftRow() const;
88  double rightRow() const;
89 
90  double width() const;
91  double length() const;
92 
93  // Number of cells in each direction.
94  int phiDiodes() const;
95  int etaDiodes() const;
96 
97  // Total number of diodes:
98  int diodes() const;
99 
101  // Non-const methods:
103 
107 
109  std::string debugStringRepr() const;
110 
112  // Private methods:
114  private:
115 
120  static double intersectionLength1D(const double x1,const double dx1,
121  const double x2,const double dx2) ;
122 
124  void neighboursOfCellGeneral(const SiCellId & cellId,
125  std::vector<SiCellId> &neighbours) const;
126 
128  double intersectionLengthGeneral(const SiCellId &diode1,
129  const SiCellId &diode2) const;
130 
131 
133  // Private data:
135  private:
136  std::shared_ptr<const PixelDiodeMatrix> m_matrix;
138  };
139 
141  // Inline methods:
143 
144  inline double PixelDiodeMap::length() const
145  {
146  return m_matrix->etaWidth();
147  }
148 
149  inline double PixelDiodeMap::width() const
150  {
151  return m_matrix->phiWidth();
152  }
153 
154  inline double PixelDiodeMap::leftColumn() const
155  {
156  return -0.5*length();
157  }
158 
159  inline double PixelDiodeMap::rightColumn() const
160  {
161  return 0.5*length();
162  }
163 
164  inline double PixelDiodeMap::leftRow() const
165  {
166  return -0.5*width();
167  }
168 
169  inline double PixelDiodeMap::rightRow() const
170  {
171  return 0.5*width();
172  }
173 
174  inline int PixelDiodeMap::diodes() const
175  {
176  return phiDiodes() * etaDiodes();
177  }
178 
179  inline int PixelDiodeMap::phiDiodes() const
180  {
181  return m_matrix->phiCells();
182  }
183 
184  inline int PixelDiodeMap::etaDiodes() const
185  {
186  return m_matrix->etaCells();
187  }
188 
189  inline SiCellId PixelDiodeMap::cellIdInRange(const SiCellId & cellId) const
190  {
191  if (!cellId.isValid() ||
192  cellId.phiIndex() <0 || cellId.phiIndex() >= phiDiodes() ||
193  cellId.etaIndex() <0 || cellId.etaIndex() >= etaDiodes()) return SiCellId(); // Invalid
194  return cellId;
195  }
196 
197  inline std::string PixelDiodeMap::debugStringRepr() const
198  {
199  return m_matrix->createDebugStringRepr();
200  }
201 
202 } // namespace InDetDD
203 
204 #endif // READOUTGEOMETRYBASE_PIXELDIODEMAP_H
plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:216
InDetDD::PixelDiodeMap::PixelDiodeMap
PixelDiodeMap(const PixelDiodeMap &map)
Copy constructor:
InDetDD::PixelDiodeMap::diodes
int diodes() const
Definition: PixelDiodeMap.h:174
InDetDD::PixelDiodeMap::intersectionLength
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...
Definition: PixelDiodeMap.cxx:218
InDetDD::PixelDiodeMap::debugStringRepr
std::string debugStringRepr() const
Debug representation.
Definition: PixelDiodeMap.h:197
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
InDetDD::PixelDiodeMap::parameters
SiDiodesParameters parameters(const SiCellId &diodeId) const
Get diodes parameters (position and size):
Definition: PixelDiodeMap.cxx:73
InDetDD::PixelDiodeMap::m_matrix
std::shared_ptr< const PixelDiodeMatrix > m_matrix
diode matrix
Definition: PixelDiodeMap.h:136
InDetDD::PixelDiodeMap::width
double width() const
Definition: PixelDiodeMap.h:149
plotBeamSpotCompare.x2
x2
Definition: plotBeamSpotCompare.py:218
InDetDD::SiCellId::isValid
bool isValid() const
Test if its in a valid state.
Definition: SiCellId.h:136
InDetDD::PixelDiodeMap::intersectionLength1D
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,...
Definition: PixelDiodeMap.cxx:273
InDetDD::PixelDiodeMap
Definition: PixelDiodeMap.h:43
InDetDD::PixelDiodeMap::m_generalLayout
bool m_generalLayout
Flag set to allow for dealing wth more general layouts.
Definition: PixelDiodeMap.h:137
InDetDD::SiCellId::phiIndex
int phiIndex() const
Get phi index. Equivalent to strip().
Definition: SiCellId.h:122
InDetDD::PixelDiodeMap::~PixelDiodeMap
~PixelDiodeMap()
Destructor.
InDetDD::PixelDiodeMap::etaDiodes
int etaDiodes() const
Definition: PixelDiodeMap.h:184
InDetDD::SiCellId::etaIndex
int etaIndex() const
Get eta index.
Definition: SiCellId.h:114
InDetDD::PixelDiodeMap::rightColumn
double rightColumn() const
Definition: PixelDiodeMap.h:159
InDetDD::PixelDiodeMap::phiDiodes
int phiDiodes() const
Definition: PixelDiodeMap.h:179
InDetDD::PixelDiodeMap::rightRow
double rightRow() const
Definition: PixelDiodeMap.h:169
InDetDD::PixelDiodeMap::neighboursOfCellGeneral
void neighboursOfCellGeneral(const SiCellId &cellId, std::vector< SiCellId > &neighbours) const
Slower method.
Definition: PixelDiodeMap.cxx:152
InDetDD::PixelDiodeMap::PixelDiodeMap
PixelDiodeMap(std::shared_ptr< const PixelDiodeMatrix > diodeMatrix)
Constructor from Diode matrix description.
Definition: PixelDiodeMap.cxx:28
InDetDD::SiCellId
Definition: SiCellId.h:29
InDetDD::PixelDiodeMap::leftColumn
double leftColumn() const
Definition: PixelDiodeMap.h:154
InDetDD::PixelDiodeMap::length
double length() const
Definition: PixelDiodeMap.h:144
SiDiodesParameters.h
PixelDiodeMatrix.h
InDetDD
Message Stream Member.
Definition: FakeTrackBuilder.h:8
InDetDD::PixelDiodeMap::neighboursOfCell
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...
Definition: PixelDiodeMap.cxx:107
InDetDD::PixelDiodeMap::operator=
PixelDiodeMap & operator=(const PixelDiodeMap &map)
Assignment operator.
InDetDD::PixelDiodeMap::intersectionLengthGeneral
double intersectionLengthGeneral(const SiCellId &diode1, const SiCellId &diode2) const
Slower method.
Definition: PixelDiodeMap.cxx:240
InDetDD::PixelDiodeMap::setGeneralLayout
void setGeneralLayout()
Set general layout flag.
Definition: PixelDiodeMap.h:106
SiCellId.h
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::PixelDiodeMap::leftRow
double leftRow() const
Definition: PixelDiodeMap.h:164
InDetDD::SiDiodesParameters
Definition: SiDiodesParameters.h:25