Skip to content

Commit e97cf5d

Browse files
committed
ITS3: remove unneeded variables + make segmentation fully float
Signed-off-by: Felix Schlepper <[email protected]>
1 parent d2e060b commit e97cf5d

File tree

2 files changed

+18
-22
lines changed

2 files changed

+18
-22
lines changed

Detectors/Upgrades/ITS3/base/include/ITS3Base/SegmentationMosaix.h

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,10 @@
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

2524
namespace 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

Detectors/Upgrades/ITS3/base/include/ITS3Base/SpecsV2.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,9 @@ constexpr std::array<unsigned int, nLayers> nSegments{3, 4, 5};
121121
constexpr double epitaxialThickness{10 * mu}; // eptixial layer (charge collection)
122122
constexpr double psubThickness{40 * mu}; // silicon substrate
123123
constexpr double thickness{epitaxialThickness + psubThickness}; // physical thickness of chip
124-
constexpr double effThickness{epitaxialThickness / 2.0 + psubThickness}; // effective physical thickness
125-
constexpr double corrThickness{effThickness - thickness / 2.0}; // correction to get into the epitxial layer
126-
constexpr std::array<double, nLayers> radii{19.0006 * mm, 25.228 * mm, 31.4554 * mm}; // middle radius e.g. inner radius+thickness/2.
127-
constexpr std::array<float, nLayers> radiiF{19.0006 * mm, 25.228 * mm, 31.4554 * mm}; // middle radius e.g. inner radius+thickness/2.
124+
constexpr std::array<double, nLayers> radii{19.0006 * mm, 25.228 * mm, 31.4554 * mm}; // middle radius
128125
constexpr std::array<double, nLayers> radiiInner{radii[0] - thickness / 2.0, radii[1] - thickness / 2.0, radii[2] - thickness / 2.0}; // inner radius
129-
constexpr std::array<double, nLayers> radiiOuter{radii[0] + thickness / 2.0, radii[1] + thickness / 2.0, radii[2] + thickness / 2.0}; // inner radius
126+
constexpr std::array<double, nLayers> radiiOuter{radii[0] + thickness / 2.0, radii[1] + thickness / 2.0, radii[2] + thickness / 2.0}; // outer radius
130127
namespace detID
131128
{
132129
constexpr unsigned int mDetIDs{2 * 12 * 12 * 12}; //< 2 Hemispheres * (3,4,5=12 segments in a layer) * 12 RSUs in a segment * 12 Tiles in a RSU

0 commit comments

Comments
 (0)