Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Detectors/Upgrades/ALICE3/IOTOF/macros/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@ o2_add_test_root_macro(CheckDigitsIOTOF.C

o2_add_test_root_macro(CheckClustersIOTOF.C
LABELS iotof COMPILE_ONLY)

o2_add_test_root_macro(CheckTopologiesIOTOF.C
LABELS iotof COMPILE_ONLY)
34 changes: 18 additions & 16 deletions Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Digitizer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,12 @@ void Digitizer::stepping(const o2::itsmft::Hit& hit, float**& respMatrix, float*
}
LOG(debug) << "Hit end position in sensor frame after adjustment: (" << xyzPositionEnd.X() << ", " << xyzPositionEnd.Y() << ", " << xyzPositionEnd.Z() << ")";

LOG(debug) << "Starting stepping through the hit with " << nSteps << " steps";
if (nSkip) {
nSteps -= nSkip;
}
LOG(debug) << "Adjusted number of steps after skipping: " << nSteps;

std::set<int> crossedRows, crossedCols;
for (int iStep = nSteps; iStep--;) {
auto pixelCurrentPosLocal = xyzPositionStart + stepVector * iStep;
Expand Down Expand Up @@ -276,21 +282,17 @@ void Digitizer::stepping(const o2::itsmft::Hit& hit, float**& respMatrix, float*
if (!respMatrix || !avgHitLocalX || !avgHitLocalZ) {
return;
}
LOG(debug) << "Starting stepping through the hit with " << nSteps << " steps";
if (nSkip) {
nSteps -= nSkip;
}
LOG(debug) << "Adjusted number of steps after skipping: " << nSteps;

int rowPrev = -1, colPrev = -1, row = 0, col = 0;
auto pixelCurrentPosLocal = xyzPositionStart;
int rowPrev = -1, colPrev = -1, row = 0, col = 0, nSkipPassive = 0;
auto pixelStartPosLocal = xyzPositionStart;
for (int iStep = nSteps; iStep--;) {
auto pixelCurrentPosLocal = xyzPositionStart;
for (int iStep{0}; iStep < nSteps; ++iStep) {
pixelCurrentPosLocal = xyzPositionStart + iStep * stepVector;

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

Expand All @@ -303,18 +305,18 @@ void Digitizer::stepping(const o2::itsmft::Hit& hit, float**& respMatrix, float*
if (rowPrev != -1 && colPrev != -1) {
const int irow = rowPrev - rowStart;
const int icol = colPrev - colStart;
avgHitLocalX[irow][icol] = 0.5f * (pixelStartPosLocal.X() + pixelCurrentPosLocal.X() - stepVector.X());
avgHitLocalZ[irow][icol] = 0.5f * (pixelStartPosLocal.Z() + pixelCurrentPosLocal.Z() - stepVector.Z());
avgHitLocalX[irow][icol] = 0.5f * (pixelStartPosLocal.X() + pixelCurrentPosLocal.X() - (nSkipPassive + 1) * stepVector.X());
avgHitLocalZ[irow][icol] = 0.5f * (pixelStartPosLocal.Z() + pixelCurrentPosLocal.Z() - (nSkipPassive + 1) * stepVector.Z());
LOG(debug) << "avgHitLocalX = " << avgHitLocalX[irow][icol] << ", avgHitLocalZ = " << avgHitLocalZ[irow][icol];
pixelStartPosLocal = pixelCurrentPosLocal;
nSkipPassive = 0;
}

// Start the new pixel
rowPrev = row;
colPrev = col;
pixelStartPosLocal = pixelCurrentPosLocal;
}

pixelCurrentPosLocal += stepVector; // Move to the next step position

for (int irow = digitizerParams.responseMatrixSize; irow--;) {
int rowDest = row + irow - (digitizerParams.responseMatrixSize / 2) - rowStart; // destination row in the respMatrix
if (rowDest < 0 || rowDest >= rowSpan) {
Expand All @@ -340,8 +342,8 @@ void Digitizer::stepping(const o2::itsmft::Hit& hit, float**& respMatrix, float*
LOG(debug) << "avgHitLocalX dimensions: " << rowSpan << " x " << colSpan;
LOG(debug) << "avgHitLocalZ dimensions: " << rowSpan << " x " << colSpan;
LOG(debug) << "Finalizing last pixel at (row,col) = (" << rowPrev << ", " << colPrev << ") with indices (irow,icol) = (" << irow << ", " << icol << ")";
avgHitLocalX[irow][icol] = 0.5f * (pixelStartPosLocal.X() + pixelCurrentPosLocal.X() - stepVector.X());
avgHitLocalZ[irow][icol] = 0.5f * (pixelStartPosLocal.Z() + pixelCurrentPosLocal.Z() - stepVector.Z());
avgHitLocalX[irow][icol] = 0.5f * (pixelStartPosLocal.X() + pixelCurrentPosLocal.X() - nSkipPassive * stepVector.X());
avgHitLocalZ[irow][icol] = 0.5f * (pixelStartPosLocal.Z() + pixelCurrentPosLocal.Z() - nSkipPassive * stepVector.Z());
LOG(debug) << "Finalized last pixel average positions: avgHitLocalX = " << avgHitLocalX[irow][icol] << ", avgHitLocalZ = " << avgHitLocalZ[irow][icol];
}
LOG(debug) << "Finalized last pixel for detector ID: " << chipID;
Expand Down
2 changes: 1 addition & 1 deletion Framework/Core/src/CommonServices.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ o2::framework::ServiceSpec CommonServices::monitoringSpec()
// covers devices that quit themselves via readyToQuit().
.stop = [](ServiceRegistryRef, void* service) {
auto* monitoring = reinterpret_cast<Monitoring*>(service);
monitoring->enableProcessMonitoring(); },
monitoring->finalizeProcessMonitoring(); },
.exit = [](ServiceRegistryRef registry, void* service) {
auto* monitoring = reinterpret_cast<Monitoring*>(service);
monitoring->flushBuffer();
Expand Down
Loading