diff --git a/PWGLF/Tasks/Strangeness/phik0shortanalysis.cxx b/PWGLF/Tasks/Strangeness/phik0shortanalysis.cxx index b51803cdef0..1aab66ac84e 100644 --- a/PWGLF/Tasks/Strangeness/phik0shortanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/phik0shortanalysis.cxx @@ -141,6 +141,9 @@ struct Phik0shortanalysis { // Configurable for RecMC Configurable cfgiskNoITSROFrameBorder{"cfgiskNoITSROFrameBorder", false, "kNoITSROFrameBorder request on RecMC collisions"}; + // Configurable for MC closure + Configurable cfgisGenMCForClosure{"cfgisGenMCForClosure", false, "isGenMCForClosure"}; + // Constants double massKa = o2::constants::physics::MassKPlus; double massPi = o2::constants::physics::MassPiPlus; @@ -1657,6 +1660,20 @@ struct Phik0shortanalysis { for (const auto& mcParticle2 : mcParticles) { if (mcParticle2.pdgCode() != 333) continue; + if (cfgisGenMCForClosure) { + auto kDaughters = mcParticle2.daughters_as(); + if (kDaughters.size() != 2) + continue; + bool isPosKaon = false, isNegKaon = false; + for (const auto& kDaughter : kDaughters) { + if (kDaughter.pdgCode() == 321) + isPosKaon = true; + if (kDaughter.pdgCode() == -321) + isNegKaon = true; + } + if (!isPosKaon || !isNegKaon) + continue; + } if (std::abs(mcParticle2.y()) > cfgYAcceptance) continue; @@ -1723,6 +1740,20 @@ struct Phik0shortanalysis { for (const auto& mcParticle2 : mcParticles) { if (mcParticle2.pdgCode() != 333) continue; + if (cfgisGenMCForClosure) { + auto kDaughters = mcParticle2.daughters_as(); + if (kDaughters.size() != 2) + continue; + bool isPosKaon = false, isNegKaon = false; + for (const auto& kDaughter : kDaughters) { + if (kDaughter.pdgCode() == 321) + isPosKaon = true; + if (kDaughter.pdgCode() == -321) + isNegKaon = true; + } + if (!isPosKaon || !isNegKaon) + continue; + } if (std::abs(mcParticle2.y()) > cfgYAcceptance) continue;