From 21147ea0c5d76e827c3ef3d269cd641319f27c87 Mon Sep 17 00:00:00 2001
From: John Chapman <John.Chapman@cern.ch>
Date: Thu, 10 Apr 2025 14:30:58 +0200
Subject: [PATCH] MCTruthClassifier::defOrigOfTau: highlight potentially
 inconsistent pdg_id variable

---
 .../MCTruthClassifier/Root/MCTruthClassifierGen.cxx         | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/PhysicsAnalysis/MCTruthClassifier/Root/MCTruthClassifierGen.cxx b/PhysicsAnalysis/MCTruthClassifier/Root/MCTruthClassifierGen.cxx
index 507697d3faf..8b9ac57fae7 100644
--- a/PhysicsAnalysis/MCTruthClassifier/Root/MCTruthClassifierGen.cxx
+++ b/PhysicsAnalysis/MCTruthClassifier/Root/MCTruthClassifierGen.cxx
@@ -754,7 +754,7 @@ ParticleOrigin MCTruthClassifier::defOrigOfMuon(const xAOD::TruthParticleContain
 
 ParticleOrigin MCTruthClassifier::defOrigOfTau(const xAOD::TruthParticleContainer& xTruthParticleContainer,
                                 const xAOD::TruthParticle* thePart,
-                                int motherPDG,
+                                int motherPDGin,
                                 MCTruthPartClassifier::Info& info) const
 {
   ATH_MSG_DEBUG("Executing DefOrigOfTau ");
@@ -780,7 +780,7 @@ ParticleOrigin MCTruthClassifier::defOrigOfTau(const xAOD::TruthParticleContaine
 
   const xAOD::TruthParticle* MotherParent(nullptr);
 
-  if (MC::isW(motherPDG) && mothOriVert != nullptr) {
+  if (MC::isW(motherPDGin) && mothOriVert != nullptr) { // FIXME motherPDGin here could in principle be inconsistent with mothOriVert
     MotherParent = MC::findMother(mother);
     int pPDG(0);
 
@@ -793,7 +793,7 @@ ParticleOrigin MCTruthClassifier::defOrigOfTau(const xAOD::TruthParticleContaine
     }
   }
 
-  motherPDG = mother->pdgId(); // FIXME assigning to non-reference function argument.
+  int motherPDG = mother->pdgId();
   info.setMotherProperties(mother);
   mothOriVert = mother->hasProdVtx() ? mother->prodVtx() : nullptr;
   partOriVert = mother->decayVtx();
-- 
GitLab