Skip to content
Snippets Groups Projects
Commit df0f4ad5 authored by Edward Moyse's avatar Edward Moyse
Browse files

Merge branch 'truthdec_infloop' into 'main'

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

See merge request atlas/athena!70131
parents d631eeb7 4b54cddf
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