15#ifndef ALICEO2_TRK_SEGMENTATIONCHIP_H_
16#define ALICEO2_TRK_SEGMENTATIONCHIP_H_
19#include <fairlogger/Logger.h>
60 static constexpr float PitchColVD{constants::VD::petal::layer::pitchZ};
61 static constexpr float PitchRowVD{constants::VD::petal::layer::pitchX};
73 static constexpr std::array<double, constants::VD::petal::nLayers>
radiiVD = constants::VD::petal::layer::radii;
89 static bool localToDetector(
float xRow,
float zCol,
int& iRow,
int& iCol,
int subDetID,
int layer,
int disk)
noexcept
92 LOGP(
debug,
"Local coordinates not valid: row = {} cm, col = {} cm", xRow, zCol);
97 LOG(
debug) <<
"Result from localToDetectorUnchecked: xRow " << xRow <<
" -> iRow " << iRow <<
", zCol " << zCol <<
" -> iCol " << iCol <<
" on subDetID, layer, disk: " << subDetID <<
" " <<
layer <<
" " << disk;
101 LOGP(
debug,
"Detector coordinates not valid: iRow = {}, iCol = {}", iRow, iCol);
110 float pitchRow(0), pitchCol(0);
111 float maxWidth(0), maxLength(0);
116 maxWidth = constants::VD::petal::layer::width[
layer];
117 maxLength = constants::VD::petal::layer::length;
119 }
else if (subDetID == 1 &&
layer <= 3) {
124 }
else if (subDetID == 1 &&
layer >= 4) {
131 iRow =
static_cast<int>(std::floor((maxWidth / 2 - xRow) / pitchRow));
132 iCol =
static_cast<int>(std::floor((zCol + maxLength / 2) / pitchCol));
138 float maxWidth(0), maxLength(0);
140 maxWidth = constants::VD::petal::layer::width[
layer];
141 maxLength = constants::VD::petal::layer::length;
143 }
else if (subDetID == 1 &&
layer <= 3) {
146 }
else if (subDetID == 1 &&
layer >= 4) {
150 return (-maxWidth / 2 <
x &&
x < maxWidth / 2 && -maxLength / 2 <
z &&
z < maxLength / 2);
157 int nRows(0), nCols(0);
159 nRows = constants::VD::petal::layer::nRows[
layer];
160 nCols = constants::VD::petal::layer::nCols;
162 }
else if (subDetID == 1 &&
layer <= 3) {
165 }
else if (subDetID == 1 &&
layer >= 4) {
169 return (
row >= 0 &&
row <
static_cast<float>(nRows) &&
col >= 0 &&
col <
static_cast<float>(nCols));
185 static constexpr bool detectorToLocal(
int iRow,
int iCol,
float& xRow,
float& zCol,
int subDetID,
int layer,
int disk)
noexcept
188 LOGP(
debug,
"Detector coordinates not valid: iRow = {}, iCol = {}", iRow, iCol);
192 LOG(
debug) <<
"Result from detectorToLocalUnchecked: iRow " << iRow <<
" -> xRow " << xRow <<
", iCol " << iCol <<
" -> zCol " << zCol <<
" on subDetID, layer, disk: " << subDetID <<
" " <<
layer <<
" " << disk;
195 LOGP(
debug,
"Local coordinates not valid: row = {} cm, col = {} cm", xRow, zCol);
210 }
else if (subDetID == 1 &&
layer <= 3) {
213 }
else if (subDetID == 1 &&
layer >= 4) {
234 float dist = std::hypot(xCurved, yCurved);
235 float phi = std::atan2(yCurved, xCurved);
239 float xFlat = constants::VD::petal::layer::radii[
layer] * phi;
240 float yFlat = constants::VD::petal::layer::radii[
layer] - dist;
256 float dist = constants::VD::petal::layer::radii[
layer] - yFlat;
257 float phi = xFlat / constants::VD::petal::layer::radii[
layer];
260 float xCurved = dist * std::cos(phi);
261 float yCurved = dist * std::sin(phi);
268 LOG(info) <<
"Number of rows:\nVD L0: " << constants::VD::petal::layer::nRows[0]
269 <<
"\nVD L1: " << constants::VD::petal::layer::nRows[1]
270 <<
"\nVD L2: " << constants::VD::petal::layer::nRows[2]
274 LOG(info) <<
"Number of cols:\nVD: " << constants::VD::petal::layer::nCols
static void localToDetectorUnchecked(float xRow, float zCol, int &iRow, int &iCol, int subDetID, int layer, int disk) noexcept
same but w/o check for row/column range
static constexpr math_utils::Vector2D< float > flatToCurved(int layer, float xFlat, float yFlat) noexcept
static constexpr float SiliconThicknessVD
static constexpr float SensorLayerThicknessOT
static constexpr bool detectorToLocal(int iRow, int iCol, float &xRow, float &zCol, int subDetID, int layer, int disk) noexcept
constexpr SegmentationChip()=default
static void detectorToLocalUnchecked(int row, int col, float &xRow, float &zCol, int subDetID, int layer, int disk) noexcept
constexpr SegmentationChip(SegmentationChip &&)=delete
~SegmentationChip()=default
static constexpr float SensorLayerThicknessML
static constexpr float SensorLayerThicknessVD
static constexpr bool isValidGlob(float x, float z, int subDetID, int layer) noexcept
static constexpr float PitchColVD
static constexpr bool isValidDet(float row, float col, int subDetID, int layer) noexcept
constexpr SegmentationChip & operator=(SegmentationChip &&)=delete
static bool localToDetector(float xRow, float zCol, int &iRow, int &iCol, int subDetID, int layer, int disk) noexcept
static constexpr float PitchColMLOT
static constexpr float PitchRowMLOT
static constexpr std::array< double, constants::VD::petal::nLayers > radiiVD
static const void Print() noexcept
Print segmentation info.
static constexpr float PitchRowVD
constexpr SegmentationChip & operator=(const SegmentationChip &)=default
constexpr SegmentationChip(const SegmentationChip &)=default
static constexpr float SiliconThicknessMLOT
static math_utils::Vector2D< float > curvedToFlat(const int layer, const float xCurved, const float yCurved) noexcept
GLenum GLuint GLint GLint layer
GLdouble GLdouble GLdouble z
constexpr double thickness
constexpr double totalThickness
constexpr double thickness
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"