From 532f5e10e43b27ac58e5fcf9d4ba7711a3a9a2a4 Mon Sep 17 00:00:00 2001
From: Andre Sailer <andre.philippe.sailer@cern.ch>
Date: Fri, 5 Mar 2021 11:17:15 +0100
Subject: [PATCH] Geant4InputHandling: add debug printout for particle
 selection/rejection

---
 DDG4/src/Geant4InputHandling.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/DDG4/src/Geant4InputHandling.cpp b/DDG4/src/Geant4InputHandling.cpp
index 43f3782d5..392218856 100644
--- a/DDG4/src/Geant4InputHandling.cpp
+++ b/DDG4/src/Geant4InputHandling.cpp
@@ -391,6 +391,13 @@ getRelevant(set<int>& visited,
       or (primaryConfig.m_rejectPDGs.count(abs(p->pdgID)) != 0) // quarks, gluon, "strings", W, Z etc.
       or (isProperTimeZero and p.definition()->GetPDGStable() ) // initial state electrons, etc.
       or (isProperTimeZero and primaryConfig.m_zeroTimePDGs.count(abs(p->pdgID)) != 0 ) ; // charged 'documentation' leptons, e.g. in lepton pairs w/ FSR
+    printout(dd4hep::DEBUG, "Input",
+	     "Checking rejection: PDG(%-*d), Definition(%s), isProperTimeZero(%s), stable(%s), reject(%s)",
+	     8, p->pdgID,
+	     p.definition() ? "true" : "false",
+	     isProperTimeZero ? "true" : "false",
+	     (bool(p.definition()) ? p.definition()->GetPDGStable() : false)  ? "true" : "false",
+	     rejectParticle ? "true" : "false");
     if (not rejectParticle) {
       map<int,G4PrimaryParticle*>::iterator ip4 = prim.find(p->id);
       G4PrimaryParticle* p4 = (ip4 == prim.end()) ? 0 : (*ip4).second;
-- 
GitLab