Skip to content

Commit 9dfa79b

Browse files
atrioloAndrea Sofia Triolo
andauthored
[ALICE3] VD: fixed digitization for the kIRIS4a and kIRISFullCyl geometries (#16063)
Co-authored-by: Andrea Sofia Triolo <andrea.sofia.triolo@©ern.ch>
1 parent cabb816 commit 9dfa79b

7 files changed

Lines changed: 47 additions & 23 deletions

File tree

‎Detectors/Upgrades/ALICE3/TRKFT3/TRK/base/include/TRKBase/SegmentationChip.h‎

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,20 @@ class SegmentationChip
7272

7373
static constexpr std::array<double, constants::VD::petal::nLayers> radiiVD = constants::VD::petal::layer::radii;
7474

75+
static inline int sNPetalsVD = -1; // not set
76+
static void setNumberOfPetalsVD(int n) { sNPetalsVD = n; }
77+
static float getWidthVD(int layer) // get the width of the petal according to the simulated geometry (supported: kIRIS4 (4 petals), kIRIS4a (3 petals), kIRISFullCyl)
78+
{
79+
if (sNPetalsVD < 1) {
80+
LOGP(fatal, "SegmentationChip: VD number of petals not set. GeometryTGeo::Build() must be called before using the VD segmentation");
81+
}
82+
if (sNPetalsVD == 1) { // FullCyl: 360°, no gap
83+
return 2 * M_PI * constants::VD::petal::layer::radii[layer];
84+
}
85+
return constants::VD::petal::layer::radii[layer] * 2 * M_PI / sNPetalsVD - constants::VD::petal::layer::gaps[layer];
86+
}
87+
static int getNRowsVD(int layer) { return static_cast<int>(getWidthVD(layer) / PitchRowVD); }
88+
7589
/// Transformation from Geant detector centered local coordinates (cm) to
7690
/// Pixel cell numbers iRow and iCol.
7791
/// Returns kTRUE if point x,z is inside sensitive volume, kFALSE otherwise.
@@ -113,7 +127,7 @@ class SegmentationChip
113127
if (subDetID == 0) {
114128
pitchRow = PitchRowVD;
115129
pitchCol = PitchColVD;
116-
maxWidth = constants::VD::petal::layer::width[layer];
130+
maxWidth = getWidthVD(layer);
117131
maxLength = constants::VD::petal::layer::length;
118132
// TODO: change this to use the layer and disk
119133
} else if (subDetID == 1 || subDetID == 2) {
@@ -128,11 +142,11 @@ class SegmentationChip
128142
};
129143

130144
// Check local coordinates (cm) validity.
131-
static constexpr bool isValidLoc(float x, float z, int subDetID, int layer) noexcept
145+
static bool isValidLoc(float x, float z, int subDetID, int layer) noexcept
132146
{
133147
float maxWidth(0), maxLength(0);
134148
if (subDetID == 0) {
135-
maxWidth = constants::VD::petal::layer::width[layer];
149+
maxWidth = getWidthVD(layer);
136150
maxLength = constants::VD::petal::layer::length;
137151
// TODO: change this to use the layer and disk
138152
} else if (subDetID == 1 || subDetID == 2) { // ML/OT
@@ -143,12 +157,12 @@ class SegmentationChip
143157
}
144158

145159
// Check detector coordinates validity.
146-
static constexpr bool isValidDet(int row, int col, int subDetID, int layer) noexcept
160+
static bool isValidDet(int row, int col, int subDetID, int layer) noexcept
147161
{
148162
// Check if the row and column are within the valid range
149163
int nRows(0), nCols(0);
150164
if (subDetID == 0) {
151-
nRows = constants::VD::petal::layer::nRows[layer];
165+
nRows = getNRowsVD(layer);
152166
nCols = constants::VD::petal::layer::nCols;
153167
// TODO: change this to use the layer and disk
154168
} else if (subDetID == 1 || subDetID == 2) {
@@ -171,7 +185,7 @@ class SegmentationChip
171185
/// \param int subDetID Sub-detector ID (0 for VD, 1 for ML/OT)
172186
/// \param int layer Layer number (0 to 2 for VD, 0 to 7 for ML/OT)
173187
/// \param int disk Disk number (0 to 5 for VD)
174-
static constexpr bool detectorToLocal(int iRow, int iCol, float& xRow, float& zCol, int subDetID, int layer, int disk) noexcept
188+
static bool detectorToLocal(int iRow, int iCol, float& xRow, float& zCol, int subDetID, int layer, int disk) noexcept
175189
{
176190
if (!isValidDet(iRow, iCol, subDetID, layer)) {
177191
LOGP(debug, "Detector coordinates not valid: iRow = {}, iCol = {}", iRow, iCol);
@@ -194,7 +208,7 @@ class SegmentationChip
194208
/// xRow = half chip width - iRow(center) * pitch
195209
/// zCol = iCol * pitch - half chip lenght
196210
if (subDetID == 0) {
197-
xRow = 0.5 * (constants::VD::petal::layer::width[layer] - PitchRowVD) - (row * PitchRowVD);
211+
xRow = 0.5 * (getWidthVD(layer) - PitchRowVD) - (row * PitchRowVD);
198212
zCol = col * PitchColVD + 0.5 * (PitchColVD - constants::VD::petal::layer::length);
199213
} else if (subDetID == 1 || subDetID == 2) { // ML/OT
200214
xRow = 0.5 * (constants::moduleMLOT::chip::width - constants::moduleMLOT::chip::passiveEdgeReadOut - PitchRowMLOT) - (row * PitchRowMLOT);
@@ -251,9 +265,9 @@ class SegmentationChip
251265
/// Print segmentation info
252266
static void Print() noexcept
253267
{
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]
268+
LOG(info) << "Number of rows:\nVD L0: " << getNRowsVD(0)
269+
<< "\nVD L1: " << getNRowsVD(1)
270+
<< "\nVD L2: " << getNRowsVD(2)
257271
<< "\nML/OT chip: " << constants::moduleMLOT::chip::nRows;
258272

259273
LOG(info) << "Number of cols:\nVD: " << constants::VD::petal::layer::nCols

‎Detectors/Upgrades/ALICE3/TRKFT3/TRK/base/include/TRKBase/Specs.h‎

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,13 @@ constexpr int nLayers{3}; // number of layers in each VD petal
4848
constexpr int nDisks{6}; // number of disks in each VD petal
4949
namespace layer
5050
{
51-
constexpr double pitchX{10 * mu}; // pitch of the row
52-
constexpr double pitchZ{10 * mu}; // pitch of the column
53-
constexpr double totalThickness{silicon::thickness + metalstack::thickness}; // total thickness of the chip
54-
constexpr std::array<double, nLayers> gaps{1.63 * mm, 1.2 * mm, 1.2 * mm}; // gaps between two consecutive petals
55-
constexpr std::array<double, nLayers> radii{0.5 * cm, 1.2 * cm, 2.5 * cm}; // radius of layer in cm
56-
constexpr std::array<double, nLayers> width{radii[0] * 2 * M_PI / 4 - gaps[0], radii[1] * 2 * M_PI / 4 - gaps[1], radii[2] * 2 * M_PI / 4 - gaps[2]}; // width of the quarter of layer in cm
57-
constexpr double length{50 * cm}; // length of the layer
58-
constexpr int nCols{static_cast<int>(length / pitchZ)}; // number of columns in the chip
59-
constexpr std::array<int, nLayers> nRows{static_cast<int>(width[0] / pitchX), static_cast<int>(width[1] / pitchX), static_cast<int>(width[2] / pitchX)}; // number of rows in the chip. For the moment is different for each layer since a siner segmentation in repetitive units is stil to be implemented
51+
constexpr double pitchX{10 * mu}; // pitch of the row
52+
constexpr double pitchZ{10 * mu}; // pitch of the column
53+
constexpr double totalThickness{silicon::thickness + metalstack::thickness}; // total thickness of the chip
54+
constexpr std::array<double, nLayers> gaps{1.63 * mm, 1.2 * mm, 1.2 * mm}; // gaps between two consecutive petals
55+
constexpr std::array<double, nLayers> radii{0.5 * cm, 1.2 * cm, 2.5 * cm}; // radius of layer in cm
56+
constexpr double length{50 * cm}; // length of the layer
57+
constexpr int nCols{static_cast<int>(length / pitchZ)}; // number of columns in the chip
6058

6159
} // namespace layer
6260
namespace disk
@@ -223,6 +221,14 @@ constexpr double responseYShift{5 * mu}; /// center of the epitaxial layer
223221
constexpr double thickness{20 * mu};
224222
} // namespace alice3resp
225223

224+
namespace alpideresp /// parameters for the alpide chip response
225+
{
226+
constexpr double pitchX{26.88 * mu};
227+
constexpr double pitchZ{29.24 * mu};
228+
constexpr double responseYShift{5 * mu}; /// center of the epitaxial layer
229+
constexpr double thickness{45 * mu};
230+
} // namespace alpideresp
231+
226232
namespace MLOTDisks
227233
{
228234
constexpr int nLayers{12}; // number of disks in the ML and OT

‎Detectors/Upgrades/ALICE3/TRKFT3/TRK/base/src/GeometryTGeo.cxx‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ void GeometryTGeo::Build(int loadTrans)
8484

8585
mNumberOfLayersMLOT = extractNumberOfLayersMLOT();
8686
mNumberOfPetalsVD = extractNumberOfPetalsVD();
87+
SegmentationChip::setNumberOfPetalsVD(mNumberOfPetalsVD);
88+
LOGP(info, "VD segmentation set for {} petals", mNumberOfPetalsVD);
89+
8790
mNumberOfActivePartsVD = extractNumberOfActivePartsVD();
8891
mNumberOfLayersVD = extractNumberOfLayersVD();
8992
mNumberOfDisksVD = extractNumberOfDisksVD();

‎Detectors/Upgrades/ALICE3/TRKFT3/common/macros/CheckTopologyDictionary.C‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#include "SimulationDataFormat/MCCompLabel.h"
4040
#include "SimulationDataFormat/MCTruthContainer.h"
4141
#include "TRKBase/GeometryTGeo.h"
42+
#include "TRKBase/SegmentationChip.h"
4243
#include "TRKBase/Specs.h"
4344
#include "TRKReconstruction/BuildTopologyDictionary.h"
4445
#include <TFile.h>
@@ -190,7 +191,7 @@ void forEachCluster(const std::string& directory, F&& f)
190191
const auto* pattern = candidate.pattern;
191192
// Left out: at the matrix's edge, or one of several pieces of a crossing.
192193
const bool vd = cluster.subDetID == 0;
193-
const int nRows = vd ? o2::trk::constants::VD::petal::layer::nRows[cluster.layer] : o2::trk::constants::moduleMLOT::chip::nRows;
194+
const int nRows = vd ? o2::trk::SegmentationChip::getNRowsVD(cluster.layer) : o2::trk::constants::moduleMLOT::chip::nRows;
194195
const int nCols = vd ? o2::trk::constants::VD::petal::layer::nCols : o2::trk::constants::moduleMLOT::chip::nCols;
195196
if (cluster.row == 0 || cluster.col == 0 || cluster.row + pattern[0] >= nRows || cluster.col + pattern[1] >= nCols ||
196197
nClusters[candidate.key] > static_cast<int>(candidate.segments.size())) {

‎Detectors/Upgrades/ALICE3/TRKFT3/common/reconstruction/src/Clusterer.cxx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ void Clusterer<DetID>::ClustererThread::initChip(gsl::span<const Digit> digits,
181181
if (geom) {
182182
if (geom->getSubDetID(chipID) == 0) { // VD
183183
const int layer = geom->getLayer(chipID);
184-
size = constants::VD::petal::layer::nRows[layer] + 2;
184+
size = SegmentationChip::getNRowsVD(layer) + 2;
185185
}
186186
}
187187

‎Detectors/Upgrades/ALICE3/TRKFT3/common/simulation/include/TRKFT3Simulation/ChipDigitsContainer.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ void o2::trkft3::ChipDigitsContainer::addNoise(UInt_t rofMin, UInt_t rofMax, con
9696
int maxCols = 0;
9797

9898
if (subDetID == 0) {
99-
maxRows = o2::trk::constants::VD::petal::layer::nRows[layer];
99+
maxRows = o2::trk::SegmentationChip::getNRowsVD(layer);
100100
maxCols = o2::trk::constants::VD::petal::layer::nCols;
101101
} else {
102102
maxRows = o2::trk::constants::moduleMLOT::chip::nRows;

‎Detectors/Upgrades/ALICE3/TRKFT3/common/simulation/include/TRKFT3Simulation/Digitizer.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ class Digitizer
130130
int getNRows(int subDetID, int layer)
131131
{
132132
if (subDetID == 0) { // VD
133-
return o2::trk::constants::VD::petal::layer::nRows[layer];
133+
return o2::trk::SegmentationChip::getNRowsVD(layer);
134134
} else if (subDetID == 1 || subDetID == 2) { // ML/OT
135135
return o2::trk::constants::moduleMLOT::chip::nRows;
136136
}

0 commit comments

Comments
 (0)