diff --git a/PhysicsAnalysis/MCTruthClassifier/Root/MCTruthClassifierGen.cxx b/PhysicsAnalysis/MCTruthClassifier/Root/MCTruthClassifierGen.cxx index e7dc6c0d169009d90ddc4ed9d8e7c14b5e08d0a2..507697d3fafb5cbae3d02d1bfa305eb5637155bf 100644 --- a/PhysicsAnalysis/MCTruthClassifier/Root/MCTruthClassifierGen.cxx +++ b/PhysicsAnalysis/MCTruthClassifier/Root/MCTruthClassifierGen.cxx @@ -246,11 +246,9 @@ ParticleOrigin MCTruthClassifier::defOrigOfElectron(const xAOD::TruthParticleCon const xAOD::TruthParticle* mother = MC::findMother(thePriPart); info.setMotherProperties(mother); - if (!mother) { - return NonDefined; - } + if (!mother) { return NonDefined; } // mother is not a nullptr beyond this point + int motherPDG = mother->pdgId(); - info.setMotherProperties(mother); const xAOD::TruthVertex* mothOriVert = mother->hasProdVtx() ? mother->prodVtx() : nullptr; bool samePart = false; @@ -546,9 +544,7 @@ ParticleOrigin MCTruthClassifier::defOrigOfMuon(const xAOD::TruthParticleContain const xAOD::TruthParticle* mother = MC::findMother(thePriPart); info.setMotherProperties(mother); - if (!mother) { - return NonDefined; - } + if (!mother) { return NonDefined; } // mother is not a nullptr beyond this point const xAOD::TruthVertex* mothOriVert = mother->hasProdVtx() ? mother->prodVtx() : nullptr; int motherPDG = mother->pdgId(); @@ -778,9 +774,7 @@ ParticleOrigin MCTruthClassifier::defOrigOfTau(const xAOD::TruthParticleContaine const xAOD::TruthParticle* mother = MC::findMother(thePriPart); info.setMotherProperties(mother); - if (!mother) { - return NonDefined; - } + if (!mother) { return NonDefined; } // mother is not a nullptr beyond this point const xAOD::TruthVertex* mothOriVert = mother->hasProdVtx() ? mother->prodVtx() : nullptr; @@ -799,11 +793,11 @@ ParticleOrigin MCTruthClassifier::defOrigOfTau(const xAOD::TruthParticleContaine } } - motherPDG = mother->pdgId(); + motherPDG = mother->pdgId(); // FIXME assigning to non-reference function argument. info.setMotherProperties(mother); mothOriVert = mother->hasProdVtx() ? mother->prodVtx() : nullptr; partOriVert = mother->decayVtx(); - if (!partOriVert) return NonDefined; + if (!partOriVert) return NonDefined; // FIXME not sure this could ever be true? numOfParents = partOriVert->nIncomingParticles(); auto DP = DecayProducts(partOriVert); @@ -957,10 +951,10 @@ ParticleOrigin MCTruthClassifier::defOrigOfPhoton(const xAOD::TruthParticleConta const xAOD::TruthParticle* mother = MC::findMother(thePriPart); info.setMotherProperties(mother); - if (!mother) return NonDefined; + if (!mother) { return NonDefined; } // mother is not a nullptr beyond this point + int motherPDG = mother->pdgId(); const xAOD::TruthVertex* mothOriVert = mother->hasProdVtx() ? mother->prodVtx() : nullptr; - info.setMotherProperties(mother); partOriVert = mother->decayVtx(); numOfParents = partOriVert->nIncomingParticles(); int numOfDaug = partOriVert->nOutgoingParticles(); @@ -1207,8 +1201,9 @@ MCTruthClassifier::defOrigOfNeutrino(const xAOD::TruthParticleContainer& xTruthP if (numOfParents > 1) ATH_MSG_DEBUG("DefOrigOfNeutrino:: neutrino has more than one mother "); const xAOD::TruthParticle* mother = MC::findMother(thePriPart); - info.mother = mother; // FIXME why isn't info.setMotherProperties(mother) used here?? - if (!mother) return NonDefined; + info.setMotherProperties(mother); + if (!mother) { return NonDefined; } // mother is not a nullptr beyond this point + int motherPDG = mother->pdgId(); const xAOD::TruthVertex* mothOriVert = mother->hasProdVtx() ? mother->prodVtx() : nullptr;