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) {
126 iRow =
static_cast<int>(std::floor((maxWidth / 2 - xRow) / pitchRow));
127 iCol =
static_cast<int>(std::floor((zCol + maxLength / 2) / pitchCol));
133 float maxWidth(0), maxLength(0);
135 maxWidth = constants::VD::petal::layer::width[
layer];
136 maxLength = constants::VD::petal::layer::length;
138 }
else if (subDetID == 1) {
142 return (-maxWidth / 2 <
x &&
x < maxWidth / 2 && -maxLength / 2 <
z &&
z < maxLength / 2);
149 int nRows(0), nCols(0);
151 nRows = constants::VD::petal::layer::nRows[
layer];
152 nCols = constants::VD::petal::layer::nCols;
154 }
else if (subDetID == 1) {
158 return (
row >= 0 && row < nRows && col >= 0 &&
col < nCols);
174 static constexpr bool detectorToLocal(
int iRow,
int iCol,
float& xRow,
float& zCol,
int subDetID,
int layer,
int disk)
noexcept
177 LOGP(
debug,
"Detector coordinates not valid: iRow = {}, iCol = {}", iRow, iCol);
181 LOG(
debug) <<
"Result from detectorToLocalUnchecked: iRow " << iRow <<
" -> xRow " << xRow <<
", iCol " << iCol <<
" -> zCol " << zCol <<
" on subDetID, layer, disk: " << subDetID <<
" " <<
layer <<
" " << disk;
184 LOGP(
debug,
"Local coordinates not valid: row = {} cm, col = {} cm", xRow, zCol);
199 }
else if (subDetID == 1) {
220 float dist = std::hypot(xCurved, yCurved);
221 float phi = std::atan2(yCurved, xCurved);
225 float xFlat = constants::VD::petal::layer::radii[
layer] * phi;
226 float yFlat = constants::VD::petal::layer::radii[
layer] - dist;
242 float dist = constants::VD::petal::layer::radii[
layer] - yFlat;
243 float phi = xFlat / constants::VD::petal::layer::radii[
layer];
246 float xCurved = dist * std::cos(phi);
247 float yCurved = dist * std::sin(phi);
254 LOG(info) <<
"Number of rows:\nVD L0: " << constants::VD::petal::layer::nRows[0]
255 <<
"\nVD L1: " << constants::VD::petal::layer::nRows[1]
256 <<
"\nVD L2: " << constants::VD::petal::layer::nRows[2]
259 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 float PitchColVD
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 void Print() noexcept
Print segmentation info.
static constexpr float PitchRowVD
constexpr SegmentationChip & operator=(const SegmentationChip &)=default
static constexpr bool isValidDet(int row, int col, int subDetID, int layer) noexcept
static constexpr bool isValidLoc(float x, float z, int subDetID, int layer) noexcept
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"