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) {
129 }
else if (subDetID == 1 &&
layer > 4) {
136 iRow =
static_cast<int>(((maxWidth / 2 - xRow) / pitchRow));
137 iCol =
static_cast<int>(((zCol + maxLength / 2) / pitchCol));
143 float maxWidth(0), maxLength(0);
145 maxWidth = constants::VD::petal::layer::width[
layer];
146 maxLength = constants::VD::petal::layer::length;
148 }
else if (subDetID == 1 &&
layer <= 3) {
151 }
else if (subDetID == 1 &&
layer == 4) {
154 }
else if (subDetID == 1 &&
layer > 4) {
158 return (-maxWidth / 2 <
x &&
x < maxWidth / 2 && -maxLength / 2 <
z &&
z < maxLength / 2);
165 int nRows(0), nCols(0);
167 nRows = constants::VD::petal::layer::nRows[
layer];
168 nCols = constants::VD::petal::layer::nCols;
170 }
else if (subDetID == 1 &&
layer <= 3) {
173 }
else if (subDetID == 1 &&
layer == 4) {
176 }
else if (subDetID == 1 &&
layer > 4) {
180 return (
row >= 0 &&
row <
static_cast<float>(nRows) &&
col >= 0 &&
col <
static_cast<float>(nCols));
196 static constexpr bool detectorToLocal(
int iRow,
int iCol,
float& xRow,
float& zCol,
int subDetID,
int layer,
int disk)
noexcept
199 LOGP(
debug,
"Detector coordinates not valid: iRow = {}, iCol = {}", iRow, iCol);
203 LOG(
debug) <<
"Result from detectorToLocalUnchecked: iRow " << iRow <<
" -> xRow " << xRow <<
", iCol " << iCol <<
" -> zCol " << zCol <<
" on subDetID, layer, disk: " << subDetID <<
" " <<
layer <<
" " << disk;
206 LOGP(
debug,
"Local coordinates not valid: row = {} cm, col = {} cm", xRow, zCol);
221 }
else if (subDetID == 1 &&
layer <= 3) {
224 }
else if (subDetID == 1 &&
layer == 4) {
227 }
else if (subDetID == 1 &&
layer > 4) {
248 float dist = std::hypot(xCurved, yCurved);
249 float phi = std::atan2(yCurved, xCurved);
253 float xFlat = constants::VD::petal::layer::radii[
layer] * phi;
254 float yFlat = constants::VD::petal::layer::radii[
layer] - dist;
270 float dist = constants::VD::petal::layer::radii[
layer] - yFlat;
271 float phi = xFlat / constants::VD::petal::layer::radii[
layer];
274 float xCurved = dist * std::cos(phi);
275 float yCurved = dist * std::sin(phi);
282 LOG(info) <<
"Number of rows:\nVD L0: " << constants::VD::petal::layer::nRows[0]
283 <<
"\nVD L1: " << constants::VD::petal::layer::nRows[1]
284 <<
"\nVD L2: " << constants::VD::petal::layer::nRows[2]
288 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 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"