16#ifndef ALICEO2_IOTOF_SEGMENTATION_H
17#define ALICEO2_IOTOF_SEGMENTATION_H
35 static std::unique_ptr<o2::iotof::Segmentation> sInstance;
53 bool localToDetector(
float x,
float z,
int& iRow,
int& iCol,
const int subDetectorID);
69 template <
typename T =
float,
typename L =
float>
72 if (subDetectorID != 0 && subDetectorID != 1) {
80 template <
typename T =
float,
typename L =
float>
83 if (subDetectorID != 0 && subDetectorID != 1) {
90 template <
typename T =
float,
typename L =
float>
93 if (subDetectorID != 0 && subDetectorID != 1) {
105 template <
typename T =
float,
typename L =
float>
108 if (subDetectorID != 0 && subDetectorID != 1) {
113 if (row < 0 || row >= specsConfig.NRows || col < 0 || col >= specsConfig.NCols) {
120 template <
typename T =
float,
typename L =
float>
123 if (subDetectorID != 0 && subDetectorID != 1) {
128 if (row < 0 || row >= specsConfig.NRows || col < 0 || col >= specsConfig.NCols) {
134 template <
typename T =
float,
typename L =
float>
137 if (subDetectorID != 0 && subDetectorID != 1) {
142 if (row < 0 || row >= specsConfig.NRows || col < 0 || col >= specsConfig.NCols) {
152 return 0.5 * ((specsConfig.ActiveMatrixSizeRows() - specsConfig.PassiveEdgeTop + specsConfig.PassiveEdgeReadOut) - specsConfig.PitchRow);
157 return 0.5 * (specsConfig.PitchCol - specsConfig.ActiveMatrixSizeCols());
167 if (subDetectorID != 0 && subDetectorID != 1) {
172 xRow = 0.5 * (specsConfig.ActiveMatrixSizeRows() - specsConfig.PassiveEdgeTop + specsConfig.PassiveEdgeReadOut) - xRow;
173 zCol += 0.5 * specsConfig.ActiveMatrixSizeCols();
174 iRow =
int(xRow / specsConfig.PitchRow);
175 iCol =
int(zCol / specsConfig.PitchCol);
177 if (std::abs(xRow - (iRow + 0.5) * specsConfig.PitchRow) > (0.5 * specsConfig.PitchRow - specsConfig.PixelPassiveEdgeX) || std::abs(zCol - (iCol + 0.5) * specsConfig.PitchCol) > (0.5 * specsConfig.PitchCol - specsConfig.PixelPassiveEdgeZ)) {
193 if (subDetectorID != 0 && subDetectorID != 1) {
198 xRow = 0.5 * (specsConfig.ActiveMatrixSizeRows() - specsConfig.PassiveEdgeTop + specsConfig.PassiveEdgeReadOut) - xRow;
199 zCol += 0.5 * specsConfig.ActiveMatrixSizeCols();
200 if (xRow < 0 || xRow >= specsConfig.ActiveMatrixSizeRows() || zCol < 0 || zCol >= specsConfig.ActiveMatrixSizeCols()) {
204 iRow =
int(xRow / specsConfig.PitchRow);
205 iCol =
int(zCol / specsConfig.PitchCol);
207 if (std::abs(xRow - (iRow + 0.5) * specsConfig.PitchRow) > (0.5 * specsConfig.PitchRow - specsConfig.PixelPassiveEdgeX) || std::abs(zCol - (iCol + 0.5) * specsConfig.PitchCol) > (0.5 * specsConfig.PitchCol - specsConfig.PixelPassiveEdgeZ)) {
float getFirstColCoordinate(const int subDetectorID)
bool detectorToLocal(L row, L col, std::array< T, 3 > &loc, const int subDetectorID)
float getFirstRowCoordinate(const int subDetectorID)
void localToDetectorUnchecked(float xRow, float zCol, int &iRow, int &iCol, const int subDetectorID)
same but w/o check for row/column range
void detectorToLocalUnchecked(L row, L col, T &xRow, T &zCol, const int subDetectorID)
static Segmentation * Instance()
void detectorToLocalUnchecked(L row, L col, math_utils::Point3D< T > &loc, const int subDetectorID)
void detectorToLocalUnchecked(L row, L col, std::array< T, 3 > &loc, const int subDetectorID)
bool detectorToLocal(L row, L col, math_utils::Point3D< T > &loc, const int subDetectorID)
bool detectorToLocal(L row, L col, T &xRow, T &zCol, const int subDetectorID)
bool localToDetector(float x, float z, int &iRow, int &iCol, const int subDetectorID)
ClassDefNV(Segmentation, 1)
static bool localToDetector(float x, float z, int &iRow, int &iCol)
static void localToDetectorUnchecked(float xRow, float zCol, int &iRow, int &iCol)
same but w/o check for row/column range
GLdouble GLdouble GLdouble z
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...