diff --git a/PWGLF/Tasks/Strangeness/cascadecorrelations.cxx b/PWGLF/Tasks/Strangeness/cascadecorrelations.cxx index 05d7c23b63d..56354e1502f 100644 --- a/PWGLF/Tasks/Strangeness/cascadecorrelations.cxx +++ b/PWGLF/Tasks/Strangeness/cascadecorrelations.cxx @@ -502,9 +502,14 @@ struct CascadeSelector { } // processCandidate - void processGenMC(aod::McCollision const&, soa::SmallGroups> const& collisions, aod::McParticles const& mcParticles) + void processGenMC(aod::McCollision const& mcCollision, soa::SmallGroups> const& collisions, aod::McParticles const& mcParticles) { - // N gen events without any event selection or matched reco event + // evsel + if (INEL < 0 || pwglf::isINELgtNmc(mcParticles, INEL, pdgDB)) + return; + if (std::abs(mcCollision.posZ()) > maxVertexZ) + return; + registry.fill(HIST("gen/hNevents"), 0); for (auto const& mcPart : mcParticles) {