Skip to content

Commit fb22569

Browse files
Merge pull request #8 from maciacco/tf3_dev
fix stepping for both passive and active pixel edges + revert change in central framework + add macro test in cmake list
2 parents 94eb37a + 0c29c73 commit fb22569

3 files changed

Lines changed: 22 additions & 17 deletions

File tree

‎Detectors/Upgrades/ALICE3/IOTOF/macros/CMakeLists.txt‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,6 @@ o2_add_test_root_macro(CheckDigitsIOTOF.C
2828

2929
o2_add_test_root_macro(CheckClustersIOTOF.C
3030
LABELS iotof COMPILE_ONLY)
31+
32+
o2_add_test_root_macro(CheckTopologiesIOTOF.C
33+
LABELS iotof COMPILE_ONLY)

‎Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Digitizer.cxx‎

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,12 @@ void Digitizer::stepping(const o2::itsmft::Hit& hit, float**& respMatrix, float*
221221
}
222222
LOG(debug) << "Hit end position in sensor frame after adjustment: (" << xyzPositionEnd.X() << ", " << xyzPositionEnd.Y() << ", " << xyzPositionEnd.Z() << ")";
223223

224+
LOG(debug) << "Starting stepping through the hit with " << nSteps << " steps";
225+
if (nSkip) {
226+
nSteps -= nSkip;
227+
}
228+
LOG(debug) << "Adjusted number of steps after skipping: " << nSteps;
229+
224230
std::set<int> crossedRows, crossedCols;
225231
for (int iStep = nSteps; iStep--;) {
226232
auto pixelCurrentPosLocal = xyzPositionStart + stepVector * iStep;
@@ -276,21 +282,17 @@ void Digitizer::stepping(const o2::itsmft::Hit& hit, float**& respMatrix, float*
276282
if (!respMatrix || !avgHitLocalX || !avgHitLocalZ) {
277283
return;
278284
}
279-
LOG(debug) << "Starting stepping through the hit with " << nSteps << " steps";
280-
if (nSkip) {
281-
nSteps -= nSkip;
282-
}
283-
LOG(debug) << "Adjusted number of steps after skipping: " << nSteps;
284285

285-
int rowPrev = -1, colPrev = -1, row = 0, col = 0;
286-
auto pixelCurrentPosLocal = xyzPositionStart;
286+
int rowPrev = -1, colPrev = -1, row = 0, col = 0, nSkipPassive = 0;
287287
auto pixelStartPosLocal = xyzPositionStart;
288-
for (int iStep = nSteps; iStep--;) {
288+
auto pixelCurrentPosLocal = xyzPositionStart;
289+
for (int iStep{0}; iStep < nSteps; ++iStep) {
290+
pixelCurrentPosLocal = xyzPositionStart + iStep * stepVector;
289291

290292
// Step does not contribute if it is in the passive area
291293
if (!sSegmentation->localToDetector(pixelCurrentPosLocal.X(), pixelCurrentPosLocal.Z(), row, col, subdetectorID)) {
292294
LOG(debug) << "Step is in passive area: (" << pixelCurrentPosLocal.X() << ", " << pixelCurrentPosLocal.Z() << ") is outside the active area of chip " << subdetectorID;
293-
pixelCurrentPosLocal += stepVector;
295+
nSkipPassive++;
294296
continue;
295297
}
296298

@@ -303,18 +305,18 @@ void Digitizer::stepping(const o2::itsmft::Hit& hit, float**& respMatrix, float*
303305
if (rowPrev != -1 && colPrev != -1) {
304306
const int irow = rowPrev - rowStart;
305307
const int icol = colPrev - colStart;
306-
avgHitLocalX[irow][icol] = 0.5f * (pixelStartPosLocal.X() + pixelCurrentPosLocal.X() - stepVector.X());
307-
avgHitLocalZ[irow][icol] = 0.5f * (pixelStartPosLocal.Z() + pixelCurrentPosLocal.Z() - stepVector.Z());
308+
avgHitLocalX[irow][icol] = 0.5f * (pixelStartPosLocal.X() + pixelCurrentPosLocal.X() - (nSkipPassive + 1) * stepVector.X());
309+
avgHitLocalZ[irow][icol] = 0.5f * (pixelStartPosLocal.Z() + pixelCurrentPosLocal.Z() - (nSkipPassive + 1) * stepVector.Z());
310+
LOG(debug) << "avgHitLocalX = " << avgHitLocalX[irow][icol] << ", avgHitLocalZ = " << avgHitLocalZ[irow][icol];
311+
pixelStartPosLocal = pixelCurrentPosLocal;
312+
nSkipPassive = 0;
308313
}
309314

310315
// Start the new pixel
311316
rowPrev = row;
312317
colPrev = col;
313-
pixelStartPosLocal = pixelCurrentPosLocal;
314318
}
315319

316-
pixelCurrentPosLocal += stepVector; // Move to the next step position
317-
318320
for (int irow = digitizerParams.responseMatrixSize; irow--;) {
319321
int rowDest = row + irow - (digitizerParams.responseMatrixSize / 2) - rowStart; // destination row in the respMatrix
320322
if (rowDest < 0 || rowDest >= rowSpan) {
@@ -340,8 +342,8 @@ void Digitizer::stepping(const o2::itsmft::Hit& hit, float**& respMatrix, float*
340342
LOG(debug) << "avgHitLocalX dimensions: " << rowSpan << " x " << colSpan;
341343
LOG(debug) << "avgHitLocalZ dimensions: " << rowSpan << " x " << colSpan;
342344
LOG(debug) << "Finalizing last pixel at (row,col) = (" << rowPrev << ", " << colPrev << ") with indices (irow,icol) = (" << irow << ", " << icol << ")";
343-
avgHitLocalX[irow][icol] = 0.5f * (pixelStartPosLocal.X() + pixelCurrentPosLocal.X() - stepVector.X());
344-
avgHitLocalZ[irow][icol] = 0.5f * (pixelStartPosLocal.Z() + pixelCurrentPosLocal.Z() - stepVector.Z());
345+
avgHitLocalX[irow][icol] = 0.5f * (pixelStartPosLocal.X() + pixelCurrentPosLocal.X() - nSkipPassive * stepVector.X());
346+
avgHitLocalZ[irow][icol] = 0.5f * (pixelStartPosLocal.Z() + pixelCurrentPosLocal.Z() - nSkipPassive * stepVector.Z());
345347
LOG(debug) << "Finalized last pixel average positions: avgHitLocalX = " << avgHitLocalX[irow][icol] << ", avgHitLocalZ = " << avgHitLocalZ[irow][icol];
346348
}
347349
LOG(debug) << "Finalized last pixel for detector ID: " << chipID;

‎Framework/Core/src/CommonServices.cxx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ o2::framework::ServiceSpec CommonServices::monitoringSpec()
143143
// covers devices that quit themselves via readyToQuit().
144144
.stop = [](ServiceRegistryRef, void* service) {
145145
auto* monitoring = reinterpret_cast<Monitoring*>(service);
146-
monitoring->enableProcessMonitoring(); },
146+
monitoring->finalizeProcessMonitoring(); },
147147
.exit = [](ServiceRegistryRef registry, void* service) {
148148
auto* monitoring = reinterpret_cast<Monitoring*>(service);
149149
monitoring->flushBuffer();

0 commit comments

Comments
 (0)