diff --git a/DDG4/src/Geant4InputHandling.cpp b/DDG4/src/Geant4InputHandling.cpp index 3c711c0ef24f0c8ac1b75e3d7a611589f920e808..7e8731c5238ad1e3a0d2c574a3f48a150f13ab20 100644 --- a/DDG4/src/Geant4InputHandling.cpp +++ b/DDG4/src/Geant4InputHandling.cpp @@ -381,9 +381,14 @@ getRelevant(set<int>& visited, double me = en > std::numeric_limits<double>::epsilon() ? p->mass / en : 0.0; // fix by S.Morozov for real != 0 double proper_time = fabs(dp->time-p->time) * me; - - // -- remove original --- if the pdgID is not known (generator "strings") or the particle is quark, gluon, Z, W, etc. - if (p.definition() && rejectPDGs.count(abs(p->pdgID)) == 0) { + double proper_time_Precision = pow(10.,-DBL_DIG)*me*fmax(fabs(p->time),fabs(dp->time)); + bool isProperTimeZero = (proper_time <= proper_time_Precision); + + // -- remove original if --- + bool rejectParticle = not p.definition() // completely unknown to geant4 + or (rejectPDGs.count(abs(p->pdgID)) != 0) // quarks, gluon, "strings", W, Z etc. + or (isProperTimeZero and p.definition()->GetPDGStable()); // initial state electrons, etc. + if (not rejectParticle) { map<int,G4PrimaryParticle*>::iterator ip4 = prim.find(p->id); G4PrimaryParticle* p4 = (ip4 == prim.end()) ? 0 : (*ip4).second; if ( !p4 ) {