From 70bcd6169f7d3415836b91e9f5ce092c7bdfaaa1 Mon Sep 17 00:00:00 2001
From: Andre Sailer <andre.philippe.sailer@cern.ch>
Date: Thu, 15 Feb 2018 08:57:03 +0100
Subject: [PATCH] DDG4::ExtraParticles: FIX: particles with width == -1 are
 _NOT_ stable

---
 DDG4/plugins/Geant4ExtraParticles.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/DDG4/plugins/Geant4ExtraParticles.cpp b/DDG4/plugins/Geant4ExtraParticles.cpp
index 6d874e6f0..49b4a6621 100644
--- a/DDG4/plugins/Geant4ExtraParticles.cpp
+++ b/DDG4/plugins/Geant4ExtraParticles.cpp
@@ -97,6 +97,9 @@ void Geant4ExtraParticles::constructParticle(Constructor& ) {
     // do add particles that don't fly
     // if (lifetime == 0) continue;
 
+    //unstable particles with too small lifetime have width -1
+    bool stable = (width > 0 or width < -0.5) ? false : true;
+
     if(width<0) width = 0;
 
     // normalize to G4 units
@@ -143,7 +146,7 @@ void Geant4ExtraParticles::constructParticle(Constructor& ) {
                                      0,          // lepton number
                                      0,          // baryon number
                                      pdg,        // PDG encoding
-                                     width==0?true:false,      // stable
+                                     stable,     // stable
                                      lifetime,   // lifetime
                                      NULL,       // decay table
                                      false);      // short lived
-- 
GitLab