1616#ifndef ALICEO2_ITS3_SEGMENTATIONMOSAIX_H_
1717#define ALICEO2_ITS3_SEGMENTATIONMOSAIX_H_
1818
19+ #include < type_traits>
20+
1921#include " MathUtils/Cartesian.h"
2022#include " ITS3Base/SpecsV2.h"
21- #include " Rtypes.h"
22-
23- #include < type_traits>
2423
2524namespace o2 ::its3
2625{
@@ -68,9 +67,6 @@ class SegmentationMosaix
6867 static constexpr float mPitchCol {constants::pixelarray::length / static_cast <float >(mNCols )};
6968 static constexpr float mPitchRow {constants::pixelarray::width / static_cast <float >(mNRows )};
7069 static constexpr float mSensorLayerThickness {constants::thickness};
71- static constexpr float mSensorLayerThicknessEff {constants::effThickness};
72- static constexpr float mSensorLayerThicknessCorr {constants::corrThickness};
73- static constexpr std::array<float , constants::nLayers> mRadii {constants::radiiF};
7470
7571 // / Transformation from the curved surface to a flat surface
7672 // / \param xCurved Detector local curved coordinate x in cm with respect to
@@ -86,8 +82,8 @@ class SegmentationMosaix
8682 // MUST align the flat surface with the curved surface with the original pixel array is on
8783 float dist = std::hypot (xCurved, yCurved);
8884 float phi = std::atan2 (yCurved, xCurved);
89- xFlat = (mRadii [ mLayer ] * phi) - constants::pixelarray::width / 2 .;
90- yFlat = dist - mRadii [ mLayer ] ;
85+ xFlat = (getRadius () * phi) - mWidth / 2 .f ;
86+ yFlat = dist - getRadius () ;
9187 }
9288
9389 // / Transformation from the flat surface to a curved surface
@@ -103,9 +99,9 @@ class SegmentationMosaix
10399 void flatToCurved (float xFlat, float yFlat, float & xCurved, float & yCurved) const noexcept
104100 {
105101 // MUST align the flat surface with the curved surface with the original pixel array is on
106- float dist = yFlat + mRadii [ mLayer ] ;
107- xCurved = dist * std::cos ((xFlat + constants::pixelarray::width / 2 .) / mRadii [ mLayer ] );
108- yCurved = dist * std::sin ((xFlat + constants::pixelarray::width / 2 .) / mRadii [ mLayer ] );
102+ float dist = yFlat + getRadius () ;
103+ xCurved = dist * std::cos ((xFlat + mWidth / 2 .f ) / getRadius () );
104+ yCurved = dist * std::sin ((xFlat + mWidth / 2 .f ) / getRadius () );
109105 }
110106
111107 // / Transformation from Geant detector centered local coordinates (cm) to
@@ -132,9 +128,8 @@ class SegmentationMosaix
132128 // Same as localToDetector w.o. checks.
133129 void localToDetectorUnchecked (float const xRow, float const zCol, int & iRow, int & iCol) const noexcept
134130 {
135- namespace cp = constants::pixelarray;
136- iRow = std::floor ((cp::width / 2 . - xRow) / mPitchRow );
137- iCol = std::floor ((zCol + cp::length / 2 .) / mPitchCol );
131+ iRow = std::floor ((mWidth / 2 . - xRow) / mPitchRow );
132+ iCol = std::floor ((zCol + mLength / 2 .) / mPitchCol );
138133 }
139134
140135 // / Transformation from Detector cell coordinates to Geant detector centered
@@ -160,9 +155,8 @@ class SegmentationMosaix
160155 // We position ourself in the middle of the pixel.
161156 void detectorToLocalUnchecked (int const iRow, int const iCol, float & xRow, float & zCol) const noexcept
162157 {
163- namespace cp = constants::pixelarray;
164- xRow = -(iRow + 0.5 ) * mPitchRow + cp::width / 2 .;
165- zCol = (iCol + 0.5 ) * mPitchCol - cp::length / 2 .;
158+ xRow = -(static_cast <float >(iRow) + 0 .5f ) * mPitchRow + mWidth / 2 .f ;
159+ zCol = (static_cast <float >(iCol) + 0 .5f ) * mPitchCol - mLength / 2 .f ;
166160 }
167161
168162 bool detectorToLocal (int const row, int const col, math_utils::Point3D<float >& loc) const noexcept
@@ -194,6 +188,11 @@ class SegmentationMosaix
194188 }
195189 }
196190
191+ float getRadius () const noexcept
192+ {
193+ return static_cast <float >(constants::radii[mLayer ]);
194+ }
195+
197196 int mLayer {0 }; // /< chip layer
198197};
199198
0 commit comments