From bcfbd3cfec9b28ed59ae5554e769679eba24aac6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Fri, 24 Jul 2026 08:41:43 +0200 Subject: [PATCH 1/2] Simplify particle validation logic Removed checks for particle charge and validity, retaining only the physical primary check. --- PWGLF/Tasks/QC/mcParticlePrediction.cxx | 36 +------------------------ 1 file changed, 1 insertion(+), 35 deletions(-) diff --git a/PWGLF/Tasks/QC/mcParticlePrediction.cxx b/PWGLF/Tasks/QC/mcParticlePrediction.cxx index c190fe5a525..d2f9eda1231 100644 --- a/PWGLF/Tasks/QC/mcParticlePrediction.cxx +++ b/PWGLF/Tasks/QC/mcParticlePrediction.cxx @@ -496,41 +496,7 @@ struct McParticlePrediction { continue; } - // if (!particle.isPhysicalPrimary()) { - // continue; - // } - - TParticlePDG* p = pdgDB->GetParticle(particle.pdgCode()); - if (p) { - if (std::abs(p->Charge()) > chargetolerance) { - histos.fill(HIST("particles/eta/charged"), particle.eta()); - } else { - histos.fill(HIST("particles/eta/neutral"), particle.eta()); - } - } - - if (std::abs(particle.y()) >= rapidityCut) { - continue; - } - - // Check if particle has daughters (not a final state particle) - auto daughters = particle.daughters_as(); - bool isValid = false; - - if (daughters.size() > 0) { - isValid = true; - for (const auto& daughter : daughters) { - if (!daughter.isPhysicalPrimary()) { - isValid = false; - break; - } - } - } else { - // Final state particle - check if particle itself is physical primary - isValid = particle.isPhysicalPrimary(); - } - - if (!isValid) { + if (!particle.isPhysicalPrimary()) { continue; } From 4515c81f17500a12d32c98d7de573ad73dc88749 Mon Sep 17 00:00:00 2001 From: SCHOTTER Romain <47983209+romainschotter@users.noreply.github.com> Date: Fri, 24 Jul 2026 14:54:54 +0200 Subject: [PATCH 2/2] Add particle charge and rapidity checks in prediction --- PWGLF/Tasks/QC/mcParticlePrediction.cxx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/PWGLF/Tasks/QC/mcParticlePrediction.cxx b/PWGLF/Tasks/QC/mcParticlePrediction.cxx index d2f9eda1231..2c9bd255524 100644 --- a/PWGLF/Tasks/QC/mcParticlePrediction.cxx +++ b/PWGLF/Tasks/QC/mcParticlePrediction.cxx @@ -500,6 +500,19 @@ struct McParticlePrediction { continue; } + TParticlePDG* p = pdgDB->GetParticle(particle.pdgCode()); + if (p) { + if (std::abs(p->Charge()) > chargetolerance) { + histos.fill(HIST("particles/eta/charged"), particle.eta()); + } else { + histos.fill(HIST("particles/eta/neutral"), particle.eta()); + } + } + + if (std::abs(particle.y()) >= rapidityCut) { + continue; + } + histos.fill(HIST("particles/vtx/x"), particle.vx()); histos.fill(HIST("particles/vtx/y"), particle.vy()); histos.fill(HIST("particles/vtx/z"), particle.vz() - mcCollision.posZ());