CMS 3D CMS Logo

phase1PixelTopology.h
Go to the documentation of this file.
1 #ifndef Geometry_TrackerGeometryBuilder_phase1PixelTopology_h
2 #define Geometry_TrackerGeometryBuilder_phase1PixelTopology_h
3 
4 #include <cstdint>
5 
6 namespace phase1PixelTopology {
7 
8  constexpr uint16_t numRowsInRoc = 80;
9  constexpr uint16_t numColsInRoc = 52;
10  constexpr uint16_t lastRowInRoc = numRowsInRoc - 1;
11  constexpr uint16_t lastColInRoc = numColsInRoc - 1;
12 
13  constexpr uint16_t numRowsInModule = 2 * numRowsInRoc;
14  constexpr uint16_t numColsInModule = 8 * numColsInRoc;
15  constexpr uint16_t lastRowInModule = numRowsInModule - 1;
16  constexpr uint16_t lastColInModule = numColsInModule - 1;
17 
18  constexpr int16_t xOffset = -81;
19  constexpr int16_t yOffset = -54 * 4;
20 
21  constexpr uint32_t numPixsInModule = uint32_t(numRowsInModule) * uint32_t(numColsInModule);
22 
23  // this is for the ROC n<512 (upgrade 1024)
24  constexpr inline uint16_t divu52(uint16_t n) {
25  n = n >> 2;
26  uint16_t q = (n >> 1) + (n >> 4);
27  q = q + (q >> 4) + (q >> 5);
28  q = q >> 3;
29  uint16_t r = n - q * 13;
30  return q + ((r + 3) >> 4);
31  }
32 
33  constexpr inline bool isEdgeX(uint16_t px) { return (px == 0) | (px == lastRowInModule); }
34  constexpr inline bool isEdgeY(uint16_t py) { return (py == 0) | (py == lastColInModule); }
35 
36  constexpr inline uint16_t toRocX(uint16_t px) { return (px < numRowsInRoc) ? px : px - numRowsInRoc; }
37  constexpr inline uint16_t toRocY(uint16_t py) {
38  auto roc = divu52(py);
39  return py - 52 * roc;
40  }
41 
42  constexpr inline bool isBigPixX(uint16_t px) { return (px == 79) | (px == 80); }
43 
44  constexpr inline bool isBigPixY(uint16_t py) {
45  auto ly = toRocY(py);
46  return (ly == 0) | (ly == lastColInRoc);
47  }
48 
49  constexpr inline uint16_t localX(uint16_t px) {
50  auto shift = 0;
51  if (px > lastRowInRoc)
52  shift += 1;
53  if (px > numRowsInRoc)
54  shift += 1;
55  return px + shift;
56  }
57 
58  constexpr inline uint16_t localY(uint16_t py) {
59  auto roc = divu52(py);
60  auto shift = 2 * roc;
61  auto yInRoc = py - 52 * roc;
62  if (yInRoc > 0)
63  shift += 1;
64  return py + shift;
65  }
66 
67 } // namespace phase1PixelTopology
68 
69 #endif // Geometry_TrackerGeometryBuilder_phase1PixelTopology_h
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
phase1PixelTopology::localY
constexpr uint16_t localY(uint16_t py)
Definition: phase1PixelTopology.h:58
phase1PixelTopology::lastColInModule
constexpr uint16_t lastColInModule
Definition: phase1PixelTopology.h:16
multPhiCorr_741_25nsDY_cfi.py
py
Definition: multPhiCorr_741_25nsDY_cfi.py:12
phase1PixelTopology::toRocY
constexpr uint16_t toRocY(uint16_t py)
Definition: phase1PixelTopology.h:37
phase1PixelTopology::numRowsInRoc
constexpr uint16_t numRowsInRoc
Definition: phase1PixelTopology.h:8
data-class-funcs.q
q
Definition: data-class-funcs.py:169
phase1PixelTopology::lastRowInModule
constexpr uint16_t lastRowInModule
Definition: phase1PixelTopology.h:15
phase1PixelTopology::numColsInModule
constexpr uint16_t numColsInModule
Definition: phase1PixelTopology.h:14
phase1PixelTopology::numRowsInModule
constexpr uint16_t numRowsInModule
Definition: phase1PixelTopology.h:13
phase1PixelTopology::lastColInRoc
constexpr uint16_t lastColInRoc
Definition: phase1PixelTopology.h:11
phase1PixelTopology::isEdgeY
constexpr bool isEdgeY(uint16_t py)
Definition: phase1PixelTopology.h:34
phase1PixelTopology::localX
constexpr uint16_t localX(uint16_t px)
Definition: phase1PixelTopology.h:49
phase1PixelTopology::lastRowInRoc
constexpr uint16_t lastRowInRoc
Definition: phase1PixelTopology.h:10
phase1PixelTopology::xOffset
constexpr int16_t xOffset
Definition: phase1PixelTopology.h:18
phase1PixelTopology::numColsInRoc
constexpr uint16_t numColsInRoc
Definition: phase1PixelTopology.h:9
alignCSCRings.r
r
Definition: alignCSCRings.py:93
multPhiCorr_741_25nsDY_cfi.px
px
Definition: multPhiCorr_741_25nsDY_cfi.py:10
phase1PixelTopology::isBigPixY
constexpr bool isBigPixY(uint16_t py)
Definition: phase1PixelTopology.h:44
edm::shift
static unsigned const int shift
Definition: LuminosityBlockID.cc:7
phase1PixelTopology::toRocX
constexpr uint16_t toRocX(uint16_t px)
Definition: phase1PixelTopology.h:36
phase1PixelTopology::isEdgeX
constexpr bool isEdgeX(uint16_t px)
Definition: phase1PixelTopology.h:33
phase1PixelTopology::yOffset
constexpr int16_t yOffset
Definition: phase1PixelTopology.h:19
PixelMapPlotter.roc
roc
Definition: PixelMapPlotter.py:498
phase1PixelTopology::isBigPixX
constexpr bool isBigPixX(uint16_t px)
Definition: phase1PixelTopology.h:42
phase1PixelTopology::numPixsInModule
constexpr uint32_t numPixsInModule
Definition: phase1PixelTopology.h:21
phase1PixelTopology
Definition: phase1PixelTopology.h:6
phase1PixelTopology::divu52
constexpr uint16_t divu52(uint16_t n)
Definition: phase1PixelTopology.h:24