Skip to content

Commit 7c9cba3

Browse files
authored
Update spectraTOF.cxx
1 parent 3c73bc3 commit 7c9cba3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

PWGLF/Tasks/Nuspex/spectraTOF.cxx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1887,7 +1887,9 @@ struct tofSpectra {
18871887
if (!isParticleEnabled<i>()) { // Check if the particle is enabled
18881888
return;
18891889
}
1890-
1890+
if (!collision.has_mcCollision()) {
1891+
return; // Skips processing if no corresponding MC collision is found (rare case!)
1892+
}
18911893
const auto& mcCollision = collision.mcCollision_as<GenMCCollisions>();
18921894
const float multiplicity = getMultiplicity(collision);
18931895
const int occupancy = collision.trackOccupancyInTimeRange();

0 commit comments

Comments
 (0)