Skip to content

Commit e501845

Browse files
authored
[PWGLF] PWGLF/Tasks/Nuspex/spectraTOF.cxx : Bug Fixes (#11734)
1 parent 3d4e672 commit e501845

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

PWGLF/Tasks/Nuspex/spectraTOF.cxx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1206,7 +1206,7 @@ struct tofSpectra {
12061206
return false;
12071207
}
12081208
}
1209-
return (std::abs(track.dcaXY()) <= (maxDcaXYFactor.value * (0.0105f + 0.0350f / pow(track.pt(), 1.1f))));
1209+
return (std::abs(track.dcaXY()) <= (maxDcaXYFactor.value * (0.0105f + 0.0350f / std::pow(track.pt(), 1.1f))));
12101210
}
12111211
return track.isGlobalTrack();
12121212
}
@@ -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)