diff --git a/PWGLF/TableProducer/Nuspex/particleCompositionCorrection.cxx b/PWGLF/TableProducer/Nuspex/particleCompositionCorrection.cxx index d9e868afca9..a7ca20ded7d 100644 --- a/PWGLF/TableProducer/Nuspex/particleCompositionCorrection.cxx +++ b/PWGLF/TableProducer/Nuspex/particleCompositionCorrection.cxx @@ -149,11 +149,7 @@ std::tuple ParticleCompositionCorrection::getWeights(aod::M static constexpr int kXi0PDG = 3322; - /* if (skipAll || std::abs(particle.eta()) > etaCut || particle.pt() < ptMinCut || particle.pt() > ptMaxCut) { - return noWeights; - } */ - - if (skipAll) { + if (skipAll || std::abs(particle.eta()) > etaCut || particle.pt() < ptMinCut || particle.pt() > ptMaxCut) { return noWeights; } @@ -179,14 +175,6 @@ std::tuple ParticleCompositionCorrection::getWeights(aod::M return noWeights; } - if (!particle.has_daughters()) { - - if (particle.eta() > etaCut || particle.pt() > ptMaxCut || particle.pt() < ptMinCut) { - - return noWeights; - } - } - // translate abs PDG code to PID variable of neural networks (0: pion, 1: kaon, 2: proton, 3: sigma) static const std::map mapPID = { @@ -213,8 +201,10 @@ std::tuple ParticleCompositionCorrection::getWeights(aod::M // calculate particle fractions and corresponding weight for given reference particle std::vector> input = {{dNdEta}, {particle.pt()}, {iterMapPID->second}}; + float fracData = particleFractionsData.evalModel(input)[0]; float fracMC = particleFractionsMC.evalModel(input)[0]; + float weight = (fracMC != 0.f) ? fracData / fracMC : 1.f; std::tuple weights = {weight, weight, weight}; if (!skipSec && particle.has_daughters()) { @@ -258,10 +248,6 @@ std::tuple ParticleCompositionCorrection::getWeights(aod::M } } - if (particle.eta() > etaCut || particle.pt() > ptMaxCut || particle.pt() < ptMinCut) { - return noWeights; - } - while (particles.iteratorAt(refParticleID).has_mothers()) { auto motherID = particles.iteratorAt(refParticleID).mothersIds()[0] - particles.offset();