Skip to content
Snippets Groups Projects
Commit 4b54cddf authored by Pierre Antoine Delsart's avatar Pierre Antoine Delsart Committed by Edward Moyse
Browse files

Fix infinite recursion loop in truth helpers where truthparticle == truthparticle->parent()

Fix infinite recursion loop in truth helpers where truthparticle == truthparticle->parent()
parent b920fa3f
No related branches found
No related tags found
No related merge requests found
......@@ -65,6 +65,7 @@ namespace FlavorTagDiscriminants {
}
for (unsigned int p = 0; p < truth_particle->nParents(); p++) {
const auto parent = truth_particle->parent(p);
if(parent == truth_particle) continue;// avoid infinite recursion
const auto parent_hadron = get_parent_hadron(parent, false);
if ( parent_hadron != nullptr ) {
return parent_hadron;
......@@ -147,4 +148,4 @@ namespace FlavorTagDiscriminants {
return seen_vertices.size();
}
}
}
\ No newline at end of file
}
......@@ -202,8 +202,10 @@ namespace InDet {
if( flav == 15 && abs(truth->pdgId()) == 15 ) return true;
for(unsigned int p=0; p<truth->nParents(); p++) {
const xAOD::TruthParticle* parent = truth->parent(p);
if(parent == truth ) continue ; // avoid infinite recursion
if( isFrom(parent, flav) ) return true;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment