Skip to content

Commit aac51aa

Browse files
committed
[MC] Correctly report stability of particles
Fixes ROOT-6889
1 parent 6d6be1a commit aac51aa

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

montecarlo/eg/src/TDatabasePDG.cxx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,13 @@ TParticlePDG* TDatabasePDG::AddParticle(const char *name, const char *title,
168168
return 0;
169169
}
170170

171+
// Fix ROOT-6889. If the antiparticle is stable,
172+
if (PDGcode < 0 && stable) {
173+
// We verify the antiparticle is stable and this is not an artifact of the PDG Table
174+
auto nonAntiParticle = GetParticle(-1*PDGcode);
175+
stable = nonAntiParticle->Stable();
176+
}
177+
171178
TParticlePDG* p = new TParticlePDG(name, title, mass, stable, width,
172179
charge, ParticleClass, PDGcode, Anti,
173180
TrackingCode);

montecarlo/eg/test/pdg.cxx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,11 @@ TEST(TDatabasePDGMT, GetParticleByCodeAndName)
8383
}
8484

8585
#endif
86+
87+
// ROOT-6889
88+
TEST(TDatabasePDG, AntiParticleStability)
89+
{
90+
auto db = TDatabasePDG::Instance();
91+
// W- is unstable
92+
EXPECT_FALSE(db->GetParticle(-24)->Stable());
93+
}

0 commit comments

Comments
 (0)