From e72fde83ca8fb2a644ead57cbcc67f303f68102c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Wed, 15 Jul 2026 15:26:23 +0200 Subject: [PATCH] Update PDG check to avoid zero comparison --- ALICE3/Tasks/alice3-qa-singleparticle.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ALICE3/Tasks/alice3-qa-singleparticle.cxx b/ALICE3/Tasks/alice3-qa-singleparticle.cxx index 3dd4ef429f9..25d21fcc7cd 100644 --- a/ALICE3/Tasks/alice3-qa-singleparticle.cxx +++ b/ALICE3/Tasks/alice3-qa-singleparticle.cxx @@ -249,7 +249,7 @@ struct Alice3SingleParticle { } else { histos.get(HIST("particle/PDGsSecondaries"))->Fill(pdgString, pdgCharge, 1.f); } - if (mcParticle.pdgCode() != PDG) { + if (PDG != 0 && mcParticle.pdgCode() != PDG) { continue; } if (mcParticle.y() < yMin || mcParticle.y() > yMax) { @@ -417,7 +417,7 @@ struct Alice3SingleParticle { LOG(info) << "Track " << track.globalIndex() << " comes from a " << mothers[0].pdgCode() << " and is a " << mcParticle.pdgCode(); } } else { - if (mcParticle.pdgCode() != PDG) { + if (PDG != 0 && mcParticle.pdgCode() != PDG) { continue; } histos.fill(HIST("track/Pt"), track.pt() * charge); @@ -469,7 +469,7 @@ struct Alice3SingleParticle { } else { histos.get(HIST("particle/PDGsSecondaries"))->Fill(pdgString, pdgCharge, 1.f); } - if (mcParticle.pdgCode() != PDG) { + if (PDG != 0 && mcParticle.pdgCode() != PDG) { continue; } if (mcParticle.y() < yMin || mcParticle.y() > yMax) { @@ -609,7 +609,7 @@ struct Alice3SingleParticle { } else { histos.get(HIST("particle/PDGsSecondaries"))->Fill(pdgString, pdgCharge, 1.f); } - if (mcParticle.pdgCode() != PDG) { + if (PDG != 0 && mcParticle.pdgCode() != PDG) { continue; } if (mcParticle.y() < yMin || mcParticle.y() > yMax) { @@ -734,7 +734,7 @@ struct Alice3SingleParticle { LOG(info) << "Track " << track.globalIndex() << " comes from a " << mothers[0].pdgCode() << " and is a " << mcParticle.pdgCode(); } } else { - if (mcParticle.pdgCode() != PDG) { + if (PDG != 0 && mcParticle.pdgCode() != PDG) { continue; } histos.fill(HIST("track/Pt"), track.pt() * charge);