Skip to content

Commit a657810

Browse files
authored
ALICE3-TRK: several fixes in the digitization code (#14733)
* ALICE3-TRK: deal with ML/OT L4 mixed lenght and shape * ALICE3-TRK: adjust ML/OT staves length according to the current geometry * ALICE3-TRK: increase number of steps into silicon to 25. Setting temporarly the threshold to 1 electron * ALICE3-TRK: fix digits distribution along columns by removing the rescaling of the silicon depth * ALICE3-TRK: considering the OT half-stave as the smallest elemenent for the digitization in the OT
1 parent 24d15d0 commit a657810

File tree

5 files changed

+80
-64
lines changed

5 files changed

+80
-64
lines changed

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

Lines changed: 46 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,18 @@ class SegmentationChip
3535
// The "detector coordinate system" refers to the hit position in row,col inside the sensor
3636
// This class provides the transformations from the local and detector coordinate systems
3737
// The conversion between global and local coordinate systems is operated by the transformation matrices
38-
// For the curved VD layers there exist three coordinate systems and one is transient.
38+
// For the curved VD layers there exist four coordinate systems.
3939
// 1. The global (curved) coordinate system. The chip's center of coordinate system is
4040
// defined at the the mid-point of the detector.
41-
// 2. The local (flat) coordinate system. This is the tube segment projected onto a flat
42-
// surface. In the projection we implicitly assume that the inner and outer
43-
// stretch does not depend on the radius.
44-
// 3. The detector coordinate system. Defined by the row and column segmentation
45-
// defined at the upper edge in the flat coord.
41+
// 2. The local (curved) coordinate system, centered in 0,0,0.
42+
// 3. The local (flat) coordinate system. This is the tube segment projected onto a flat
43+
// surface, centered in the middle of the chip, with the y axis pointing towards the interaction point.
44+
// In the projection we implicitly assume that the inner and outer stretch does not depend on the radius.
45+
// 4. The detector coordinate system. Defined by the row and column segmentation.
4646
// For the flat ML and OT layers, there exist two coordinate systems:
4747
// 1. The global (flat) coordinate system. The chip's center of coordinate system is
4848
// defined at the the mid-point of the detector.
49-
// 2. The detector coordinate system. Defined by the row and column segmentation
49+
// 2. The detector coordinate system. Defined by the row and column segmentation.
5050
// TODO: add segmentation for VD disks
5151

5252
public:
@@ -121,15 +121,20 @@ class SegmentationChip
121121
pitchCol = PitchColMLOT;
122122
maxWidth = constants::ML::width;
123123
maxLength = constants::ML::length;
124-
} else if (subDetID == 1 && layer >= 4) { // OT
124+
} else if (subDetID == 1 && layer == 4) { // ML/OT (mixed layer, length = ML but staggered as OT)
125125
pitchRow = PitchRowMLOT;
126126
pitchCol = PitchColMLOT;
127-
maxWidth = constants::OT::width;
128-
maxLength = constants::OT::length;
127+
maxWidth = constants::OT::halfstave::width;
128+
maxLength = constants::ML::length;
129+
} else if (subDetID == 1 && layer > 4) { // OT
130+
pitchRow = PitchRowMLOT;
131+
pitchCol = PitchColMLOT;
132+
maxWidth = constants::OT::halfstave::width;
133+
maxLength = constants::OT::halfstave::length;
129134
}
130135
// convert to row/col
131-
iRow = static_cast<int>(std::floor((maxWidth / 2 - xRow) / pitchRow));
132-
iCol = static_cast<int>(std::floor((zCol + maxLength / 2) / pitchCol));
136+
iRow = static_cast<int>(((maxWidth / 2 - xRow) / pitchRow));
137+
iCol = static_cast<int>(((zCol + maxLength / 2) / pitchCol));
133138
};
134139

135140
// Check local coordinates (cm) validity.
@@ -143,9 +148,12 @@ class SegmentationChip
143148
} else if (subDetID == 1 && layer <= 3) { // ML
144149
maxWidth = constants::ML::width;
145150
maxLength = constants::ML::length;
146-
} else if (subDetID == 1 && layer >= 4) { // OT
147-
maxWidth = constants::OT::width;
148-
maxLength = constants::OT::length;
151+
} else if (subDetID == 1 && layer == 4) { // ML/OT (mixed layer, length = ML but staggered as OT)
152+
maxWidth = constants::OT::halfstave::width;
153+
maxLength = constants::ML::length;
154+
} else if (subDetID == 1 && layer > 4) { // OT
155+
maxWidth = constants::OT::halfstave::width;
156+
maxLength = constants::OT::halfstave::length;
149157
}
150158
return (-maxWidth / 2 < x && x < maxWidth / 2 && -maxLength / 2 < z && z < maxLength / 2);
151159
}
@@ -162,9 +170,12 @@ class SegmentationChip
162170
} else if (subDetID == 1 && layer <= 3) { // ML
163171
nRows = constants::ML::nRows;
164172
nCols = constants::ML::nCols;
165-
} else if (subDetID == 1 && layer >= 4) { // OT
166-
nRows = constants::OT::nRows;
167-
nCols = constants::OT::nCols;
173+
} else if (subDetID == 1 && layer == 4) { // ML/OT (mixed layer, length = ML but staggered as OT)
174+
nRows = constants::OT::halfstave::nRows;
175+
nCols = constants::ML::nCols;
176+
} else if (subDetID == 1 && layer > 4) { // OT
177+
nRows = constants::OT::halfstave::nRows;
178+
nCols = constants::OT::halfstave::nCols;
168179
}
169180
return (row >= 0 && row < static_cast<float>(nRows) && col >= 0 && col < static_cast<float>(nCols));
170181
}
@@ -210,9 +221,12 @@ class SegmentationChip
210221
} else if (subDetID == 1 && layer <= 3) { // ML
211222
xRow = 0.5 * (constants::ML::width - PitchRowMLOT) - (row * PitchRowMLOT);
212223
zCol = col * PitchRowMLOT + 0.5 * (PitchRowMLOT - constants::ML::length);
213-
} else if (subDetID == 1 && layer >= 4) { // OT
214-
xRow = 0.5 * (constants::OT::width - PitchRowMLOT) - (row * PitchRowMLOT);
215-
zCol = col * PitchColMLOT + 0.5 * (PitchColMLOT - constants::OT::length);
224+
} else if (subDetID == 1 && layer == 4) { // ML/OT (mixed layer, length = ML but staggered as OT)
225+
xRow = 0.5 * (constants::OT::halfstave::width - PitchRowMLOT) - (row * PitchRowMLOT);
226+
zCol = col * PitchRowMLOT + 0.5 * (PitchRowMLOT - constants::ML::length);
227+
} else if (subDetID == 1 && layer > 4) { // OT
228+
xRow = 0.5 * (constants::OT::halfstave::width - PitchRowMLOT) - (row * PitchRowMLOT);
229+
zCol = col * PitchColMLOT + 0.5 * (PitchColMLOT - constants::OT::halfstave::length);
216230
}
217231
}
218232

@@ -263,17 +277,25 @@ class SegmentationChip
263277
}
264278

265279
/// Print segmentation info
266-
static const void Print() noexcept
280+
static void Print() noexcept
267281
{
268282
LOG(info) << "Number of rows:\nVD L0: " << constants::VD::petal::layer::nRows[0]
269283
<< "\nVD L1: " << constants::VD::petal::layer::nRows[1]
270284
<< "\nVD L2: " << constants::VD::petal::layer::nRows[2]
271285
<< "\nML stave: " << constants::ML::nRows
272-
<< "\nOT stave: " << constants::OT::nRows;
286+
<< "\nOT half stave: " << constants::OT::halfstave::nRows;
273287

274288
LOG(info) << "Number of cols:\nVD: " << constants::VD::petal::layer::nCols
275289
<< "\nML stave: " << constants::ML::nCols
276-
<< "\nOT stave: " << constants::OT::nCols;
290+
<< "\nOT half stave: " << constants::OT::halfstave::nCols;
291+
292+
LOG(info) << "Pitch rows [cm]:\nVD: " << PitchRowVD
293+
<< "\nML stave: " << PitchRowMLOT
294+
<< "\nOT stave: " << PitchRowMLOT;
295+
296+
LOG(info) << "Pitch cols [cm]:\nVD: " << PitchColVD
297+
<< "\nML stave: " << PitchColMLOT
298+
<< "\nOT stave: " << PitchColMLOT;
277299
}
278300
};
279301

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

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,16 +102,25 @@ constexpr int nCols{static_cast<int>(length / chip::pitchZ)};
102102

103103
namespace ML
104104
{
105-
constexpr double width{constants::moduleMLOT::width * 1}; // width of the stave
106-
constexpr double length{constants::moduleMLOT::length * 10}; // length of the stave
105+
constexpr double width{constants::moduleMLOT::width * 1}; // width of the stave
106+
// constexpr double length{constants::moduleMLOT::length * 10}; // length of the stave
107+
constexpr double length{124 * cm}; // length of the stave, hardcoded to fit the implemented geometry
107108
constexpr int nRows{static_cast<int>(width / constants::moduleMLOT::chip::pitchX)}; // number of rows in the stave
108109
constexpr int nCols{static_cast<int>(length / constants::moduleMLOT::chip::pitchZ)}; // number of columns in the stave
109110
} // namespace ML
110111

111112
namespace OT
112-
{ //// TODO: add shorter lenght of the stave of L4
113-
constexpr double width{moduleMLOT::width * 2}; // width of the stave
114-
constexpr double length{moduleMLOT::length * 20}; // length of the stave
113+
{
114+
namespace halfstave
115+
{
116+
constexpr double width{moduleMLOT::width * 1}; // width of the half stave
117+
// constexpr double length{moduleMLOT::length * 20}; // length of the halfstave
118+
constexpr double length{258 * cm}; // length of the halfstave, hardcoded to fit the implemented geometry
119+
constexpr int nRows{static_cast<int>(width / moduleMLOT::chip::pitchX)}; // number of rows in the halfstave
120+
constexpr int nCols{static_cast<int>(length / moduleMLOT::chip::pitchZ)}; // number of columns in the halfstave
121+
} // namespace halfstave
122+
constexpr double width{halfstave::width * 2}; // width of the stave
123+
constexpr double length{halfstave::length}; // length of the stave
115124
constexpr int nRows{static_cast<int>(width / moduleMLOT::chip::pitchX)}; // number of rows in the stave
116125
constexpr int nCols{static_cast<int>(length / moduleMLOT::chip::pitchZ)}; // number of columns in the stave
117126
} // namespace OT

Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/DPLDigitizerParam.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ struct DPLDigitizerParam : public o2::conf::ConfigurableParamHelper<DPLDigitizer
3737
float strobeQRiseTime0 = 450.; ///< q @ which strobe rise time is 0
3838

3939
double timeOffset = 0.; ///< time offset (in seconds!) to calculate ROFrame from hit time
40-
int chargeThreshold = 150; ///< charge threshold in Nelectrons
41-
int minChargeToAccount = 15; ///< minimum charge contribution to account
42-
int nSimSteps = 18; ///< number of steps in response simulation
40+
int chargeThreshold = 1; ///< charge threshold in Nelectrons
41+
int minChargeToAccount = 1; ///< minimum charge contribution to account
42+
int nSimSteps = 25; ///< number of steps in response simulation
4343
float energyToNElectrons = 1. / 3.6e-9; // conversion of eloss to Nelectrons
4444

4545
float Vbb = 0.0; ///< back bias absolute value for MFT (in Volt)

Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/DigiParams.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ class DigiParams
109109
float mStrobeLength = 0; ///< length of the strobe in ns (sig. over threshold checked in this window only)
110110
double mTimeOffset = -2 * infTime; ///< time offset (in seconds!) to calculate ROFrame from hit time
111111
int mROFrameBiasInBC = 0; ///< misalignment of the ROF start in BC
112-
int mChargeThreshold = 150; ///< charge threshold in Nelectrons
113-
int mMinChargeToAccount = 15; ///< minimum charge contribution to account
114-
int mNSimSteps = 18; ///< number of steps in response simulation
112+
int mChargeThreshold = 1; ///< charge threshold in Nelectrons
113+
int mMinChargeToAccount = 1; ///< minimum charge contribution to account
114+
int mNSimSteps = 25; ///< number of steps in response simulation
115115
float mNSimStepsInv = 0; ///< its inverse
116116

117117
float mEnergyToNElectrons = 1. / 3.6e-9; // conversion of eloss to Nelectrons

Detectors/Upgrades/ALICE3/TRK/simulation/src/Digitizer.cxx

Lines changed: 14 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -62,29 +62,29 @@ void Digitizer::init()
6262

6363
/// setting scale factors to adapt to the APTS response function (adjusting pitch and Y shift)
6464
// TODO: adjust Y shift when the geometry is improved
65-
LOG(debug) << " Depth max: " << mChipSimRespVD->getDepthMax();
66-
LOG(debug) << " Depth min: " << mChipSimRespVD->getDepthMin();
65+
LOG(info) << " Depth max VD: " << mChipSimRespVD->getDepthMax();
66+
LOG(info) << " Depth min VD: " << mChipSimRespVD->getDepthMin();
67+
68+
LOG(info) << " Depth max MLOT: " << mChipSimRespMLOT->getDepthMax();
69+
LOG(info) << " Depth min MLOT: " << mChipSimRespMLOT->getDepthMin();
6770

6871
float thicknessVD = 0.0095; // cm --- hardcoded based on geometry currently present
6972
float thicknessMLOT = 0.1; // cm --- hardcoded based on geometry currently present
7073

7174
mSimRespVDScaleX = o2::trk::constants::apts::pitchX / o2::trk::SegmentationChip::PitchRowVD;
7275
mSimRespVDScaleZ = o2::trk::constants::apts::pitchZ / o2::trk::SegmentationChip::PitchColVD;
73-
mSimRespVDScaleDepth = o2::trk::constants::apts::thickness / (thicknessVD); /// introducing this scaling factor because the silicon thickness for the moment is 1 mm -> rescale to 45 um which is the depth of the APTS response
74-
// mSimRespVDShift = mChipSimRespVD->getDepthMax() - thicknessVD * mSimRespVDScaleDepth / 2.f; // the shift should be done considering the rescaling done to adapt to the wrong silicon thickness. TODO: remove the scaling factor for the depth when the silicon thickness match the simulated response
75-
mSimRespVDShift = mChipSimRespVD->getDepthMax(); // the curved, rescaled, sensors have a width from 0 to -45. Must add 10 um (= max depth) to match the APTS response.
76+
mSimRespVDShift = -mChipSimRespVD->getDepthMax(); // the curved, rescaled, sensors have a width from 0 to -45. Must add 10 um (= max depth) to match the APTS response.
7677
mSimRespMLOTScaleX = o2::trk::constants::apts::pitchX / o2::trk::SegmentationChip::PitchRowMLOT;
7778
mSimRespMLOTScaleZ = o2::trk::constants::apts::pitchZ / o2::trk::SegmentationChip::PitchColMLOT;
78-
mSimRespMLOTScaleDepth = o2::trk::constants::apts::thickness / (thicknessMLOT); /// introducing this scaling factor because the silicon thickness for the moment is 1 mm -> rescale to 45 um which is the depth of the APTS response
79-
mSimRespMLOTShift = mChipSimRespMLOT->getDepthMax() - thicknessMLOT * mSimRespMLOTScaleDepth / 2.f; // the shift should be done considering the rescaling done to adapt to the wrong silicon thickness. TODO: remove the scaling factor for the depth when the silicon thickness match the simulated response
79+
mSimRespMLOTShift = mChipSimRespMLOT->getDepthMax() - thicknessMLOT / 2.f; // the shift should be done considering the rescaling done to adapt to the wrong silicon thickness. TODO: remove the scaling factor for the depth when the silicon thickness match the simulated response
8080
mSimRespOrientation = false;
8181

8282
// importing the parameters from DPLDigitizerParam.h
8383
auto& dOptTRK = DPLDigitizerParam<o2::detectors::DetID::TRK>::Instance();
8484

8585
LOGP(info, "TRK Digitizer is initialised.");
8686
mParams.print();
87-
LOGP(info, "VD shift = {} ; ML/OT shift = {} = {} - {}", mSimRespVDShift, mSimRespMLOTShift, mChipSimRespMLOT->getDepthMax(), thicknessMLOT * mSimRespMLOTScaleDepth / 2.f);
87+
LOGP(info, "VD shift = {} ; ML/OT shift = {} = {} - {}", mSimRespVDShift, mSimRespMLOTShift, mChipSimRespMLOT->getDepthMax(), thicknessMLOT / 2.f);
8888
LOGP(info, "VD pixel scale on x = {} ; z = {}", mSimRespVDScaleX, mSimRespVDScaleZ);
8989
LOGP(info, "ML/OT pixel scale on x = {} ; z = {}", mSimRespMLOTScaleX, mSimRespMLOTScaleZ);
9090
LOGP(info, "Response orientation: {}", mSimRespOrientation ? "flipped" : "normal");
@@ -115,8 +115,8 @@ void Digitizer::process(const std::vector<Hit>* hits, int evID, int srcID)
115115
<< " cont.mode: " << isContinuous()
116116
<< " Min/Max ROFrames " << mROFrameMin << "/" << mROFrameMax;
117117

118-
std::cout << "Printing segmentation info: " << std::endl;
119-
SegmentationChip::Print();
118+
// std::cout << "Printing segmentation info: " << std::endl;
119+
// SegmentationChip::Print();
120120

121121
// // is there something to flush ?
122122
if (mNewROFrame > mROFrameMin) {
@@ -335,13 +335,9 @@ void Digitizer::processHit(const o2::itsmft::Hit& hit, uint32_t& maxFr, int evID
335335

336336
//// adapting the depth (Y) of the chip to the APTS response maximum depth
337337
LOG(debug) << "local original: startPos = " << xyzLocS << ", endPos = " << xyzLocE << std::endl;
338-
if (subDetID == 0) {
339-
xyzLocS.SetY(xyzLocS.Y() * mSimRespVDScaleDepth);
340-
xyzLocE.SetY(xyzLocE.Y() * mSimRespVDScaleDepth);
341-
} else {
342-
xyzLocS.SetY(xyzLocS.Y() * mSimRespMLOTScaleDepth);
343-
xyzLocE.SetY(xyzLocE.Y() * mSimRespMLOTScaleDepth);
344-
}
338+
xyzLocS.SetY(xyzLocS.Y());
339+
xyzLocE.SetY(xyzLocE.Y());
340+
345341
LOG(debug) << "rescaled Y: startPos = " << xyzLocS << ", endPos = " << xyzLocE << std::endl;
346342

347343
math_utils::Vector3D<float> step(xyzLocE);
@@ -449,17 +445,6 @@ void Digitizer::processHit(const o2::itsmft::Hit& hit, uint32_t& maxFr, int evID
449445
rspmat = resp->getResponse(mSimRespMLOTScaleX * (xyzLocS.X() - cRowPix), mSimRespMLOTScaleZ * (xyzLocS.Z() - cColPix), xyzLocS.Y(), flipRow, flipCol, rowMax, colMax);
450446
}
451447

452-
float tempPitchX = 0, tempPitchZ = 0;
453-
if (subDetID == 0) {
454-
tempPitchX = Segmentation::PitchRowVD;
455-
tempPitchZ = Segmentation::PitchColVD;
456-
} else {
457-
tempPitchX = Segmentation::PitchRowMLOT;
458-
tempPitchZ = Segmentation::PitchColMLOT;
459-
}
460-
LOG(debug) << "X and Z inside pixel at start = " << (xyzLocS.X() - cRowPix) << " , " << (xyzLocS.Z() - cColPix) << ", rescaled: " << mSimRespMLOTScaleX * (xyzLocS.X() - cRowPix) << " , " << mSimRespMLOTScaleZ * (xyzLocS.Z() - cColPix);
461-
LOG(debug) << "Hit inside pitch? X: " << ((xyzLocS.X() - cRowPix) < tempPitchX) << " Z: " << ((xyzLocS.Z() - cColPix) < tempPitchZ);
462-
463448
xyzLocS += step;
464449

465450
if (rspmat == nullptr) {
@@ -479,7 +464,7 @@ void Digitizer::processHit(const o2::itsmft::Hit& hit, uint32_t& maxFr, int evID
479464
if (colDest < 0 || colDest >= colSpan) {
480465
continue;
481466
}
482-
respMatrix[rowDest][colDest] += rspmat->getValue(irow, icol, mSimRespOrientation ? !flipRow : flipRow, flipCol);
467+
respMatrix[rowDest][colDest] += rspmat->getValue(irow, icol, mSimRespOrientation ? !flipRow : flipRow, !flipCol);
483468
}
484469
}
485470
}

0 commit comments

Comments
 (0)