Project
Loading...
Searching...
No Matches
SegmentationAlpide.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
14
15#ifndef ALICEO2_ITSMFT_SEGMENTATIONALPIDE_H_
16#define ALICEO2_ITSMFT_SEGMENTATIONALPIDE_H_
17
18#include <Rtypes.h>
19#include "MathUtils/Cartesian.h"
20
21namespace o2
22{
23namespace itsmft
24{
25
33{
34 public:
35 static constexpr int NCols = 1024;
36 static constexpr int NRows = 512;
37 static constexpr int NPixels = NRows * NCols;
38 static constexpr float PitchCol = 29.24e-4;
39 static constexpr float PitchRow = 26.88e-4;
40 static constexpr float PassiveEdgeReadOut = 0.12f; // width of the readout edge (Passive bottom)
41 static constexpr float PassiveEdgeTop = 37.44e-4; // Passive area on top
42 static constexpr float PassiveEdgeSide = 29.12e-4; // width of Passive area on left/right of the sensor
43 static constexpr float ActiveMatrixSizeCols = PitchCol * NCols; // Active size along columns
44 static constexpr float ActiveMatrixSizeRows = PitchRow * NRows; // Active size along rows
45
46 // effective thickness of sensitive layer, accounting for charge collection non-unifoemity, https://alice.its.cern.ch/jira/browse/AOC-46
47 static constexpr float SensorLayerThicknessEff = 28.e-4;
48 static constexpr float SensorLayerThickness = 30.e-4; // physical thickness of sensitive part
49 static constexpr float SensorSizeCols = ActiveMatrixSizeCols + PassiveEdgeSide + PassiveEdgeSide; // SensorSize along columns
50 static constexpr float SensorSizeRows = ActiveMatrixSizeRows + PassiveEdgeTop + PassiveEdgeReadOut; // SensorSize along rows
51
52 SegmentationAlpide() = default;
54
66 static bool localToDetector(float x, float z, int& iRow, int& iCol);
68 static void localToDetectorUnchecked(float xRow, float zCol, int& iRow, int& iCol);
69
80
81 // w/o check for row/col range
82 template <typename T = float, typename L = float>
83 static void detectorToLocalUnchecked(L row, L col, T& xRow, T& zCol)
84 {
87 }
88 template <typename T = float, typename L = float>
90 {
91 loc.SetCoordinates(getFirstRowCoordinate() - row * PitchRow, T(0.), col * PitchCol + getFirstColCoordinate());
92 }
93 template <typename T = float, typename L = float>
94 static void detectorToLocalUnchecked(L row, L col, std::array<T, 3>& loc)
95 {
96 loc[0] = getFirstRowCoordinate() - row * PitchRow;
97 loc[1] = T(0);
98 loc[2] = col * PitchCol + getFirstColCoordinate();
99 }
100
101 // same but with check for row/col range
102
103 template <typename T = float, typename L = float>
104 static bool detectorToLocal(L row, L col, T& xRow, T& zCol)
105 {
106 if (row < 0 || row >= NRows || col < 0 || col >= NCols) {
107 return false;
108 }
109 detectorToLocalUnchecked(row, col, xRow, zCol);
110 return true;
111 }
112
113 template <typename T = float, typename L = float>
115 {
116 if (row < 0 || row >= NRows || col < 0 || col >= NCols) {
117 return false;
118 }
120 return true;
121 }
122 template <typename T = float, typename L = float>
123 static bool detectorToLocal(L row, L col, std::array<T, 3>& loc)
124 {
125 if (row < 0 || row >= NRows || col < 0 || col >= NCols) {
126 return false;
127 }
129 return true;
130 }
131
132 static constexpr float getFirstRowCoordinate()
133 {
135 }
136 static constexpr float getFirstColCoordinate() { return 0.5 * (PitchCol - ActiveMatrixSizeCols); }
137
138 static void print();
139
140 ClassDefNV(SegmentationAlpide, 1); // Segmentation class upgrade pixels
141};
142
143//_________________________________________________________________________________________________
144inline void SegmentationAlpide::localToDetectorUnchecked(float xRow, float zCol, int& iRow, int& iCol)
145{
146 // convert to row/col w/o over/underflow check
147 xRow = 0.5 * (ActiveMatrixSizeRows - PassiveEdgeTop + PassiveEdgeReadOut) - xRow; // coordinate wrt top edge of Active matrix
148 zCol += 0.5 * ActiveMatrixSizeCols; // coordinate wrt left edge of Active matrix
149 iRow = int(xRow / PitchRow);
150 iCol = int(zCol / PitchCol);
151 if (xRow < 0) {
152 iRow -= 1;
153 }
154 if (zCol < 0) {
155 iCol -= 1;
156 }
157}
158
159//_________________________________________________________________________________________________
160inline bool SegmentationAlpide::localToDetector(float xRow, float zCol, int& iRow, int& iCol)
161{
162 // convert to row/col
163 xRow = 0.5 * (ActiveMatrixSizeRows - PassiveEdgeTop + PassiveEdgeReadOut) - xRow; // coordinate wrt top edge of Active matrix
164 zCol += 0.5 * ActiveMatrixSizeCols; // coordinate wrt left edge of Active matrix
165 if (xRow < 0 || xRow >= ActiveMatrixSizeRows || zCol < 0 || zCol >= ActiveMatrixSizeCols) {
166 iRow = iCol = -1;
167 return false;
168 }
169 iRow = int(xRow / PitchRow);
170 iCol = int(zCol / PitchCol);
171 return true;
172}
173
174} // namespace itsmft
175} // namespace o2
176
177#endif
uint32_t col
Definition RawData.h:4
static constexpr float SensorLayerThickness
static constexpr float getFirstRowCoordinate()
static void detectorToLocalUnchecked(L row, L col, T &xRow, T &zCol)
static constexpr float getFirstColCoordinate()
static bool detectorToLocal(L row, L col, std::array< T, 3 > &loc)
static void detectorToLocalUnchecked(L row, L col, std::array< T, 3 > &loc)
static constexpr float SensorSizeCols
static bool localToDetector(float x, float z, int &iRow, int &iCol)
static constexpr float PitchCol
static constexpr float ActiveMatrixSizeCols
static constexpr float PassiveEdgeReadOut
static bool detectorToLocal(L row, L col, math_utils::Point3D< T > &loc)
static constexpr float PassiveEdgeSide
static constexpr float SensorLayerThicknessEff
static constexpr float SensorSizeRows
ClassDefNV(SegmentationAlpide, 1)
static constexpr float PassiveEdgeTop
static void detectorToLocalUnchecked(L row, L col, math_utils::Point3D< T > &loc)
static constexpr float PitchRow
static bool detectorToLocal(L row, L col, T &xRow, T &zCol)
static void localToDetectorUnchecked(float xRow, float zCol, int &iRow, int &iCol)
same but w/o check for row/column range
static constexpr float ActiveMatrixSizeRows
GLint GLenum GLint x
Definition glcorearb.h:403
GLdouble GLdouble GLdouble z
Definition glcorearb.h:843
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::vector< int > row