From decd90bf83227d55528e22e519e98b99204fe736 Mon Sep 17 00:00:00 2001
From: Markus Frank <Markus.Frank@cern.ch>
Date: Tue, 11 Apr 2017 17:53:39 +0200
Subject: [PATCH] Improve debugging of G4 conversion mechanism

---
 DDG4/python/DDG4.py                          | 6 +++---
 DDG4/src/Geant4Converter.cpp                 | 2 +-
 DDG4/src/Geant4PhysicsList.cpp               | 2 +-
 examples/ClientTests/scripts/SiliconBlock.py | 8 +++++++-
 4 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/DDG4/python/DDG4.py b/DDG4/python/DDG4.py
index 558750f6d..84a4c6747 100644
--- a/DDG4/python/DDG4.py
+++ b/DDG4/python/DDG4.py
@@ -395,9 +395,9 @@ class Geant4:
 
      \author  M.Frank
   """
-  def addDetectorConstruction(self, name_type,
-                              field=None, field_args=None,
-                              geometry=None, geometry_args=None,
+  def addDetectorConstruction(self,            name_type,
+                              field=None,      field_args=None,
+                              geometry=None,   geometry_args=None,
                               sensitives=None, sensitives_args=None,
                               allow_threads=False):
     init_seq = self.master().detectorConstruction(True)
diff --git a/DDG4/src/Geant4Converter.cpp b/DDG4/src/Geant4Converter.cpp
index 1a8efc922..ccf36a5e9 100644
--- a/DDG4/src/Geant4Converter.cpp
+++ b/DDG4/src/Geant4Converter.cpp
@@ -394,7 +394,7 @@ void* Geant4Converter::handleMaterial(const string& name, Material medium) const
       }
       stringstream str;
       str << (*mat);
-      printout(lvl, "Geant4Converter", "++ Created G4 Material %s", str.str().c_str());
+      printout(lvl, "Geant4Converter", "++ Created G4 %s", str.str().c_str());
     }
     data().g4Materials[medium] = mat;
   }
diff --git a/DDG4/src/Geant4PhysicsList.cpp b/DDG4/src/Geant4PhysicsList.cpp
index a1208b6ab..53668b389 100644
--- a/DDG4/src/Geant4PhysicsList.cpp
+++ b/DDG4/src/Geant4PhysicsList.cpp
@@ -243,7 +243,7 @@ void Geant4PhysicsList::constructParticles(G4VUserPhysicsList* physics_pointer)
         except("Failed to create particle type '%s' result=%d", ctor.c_str(), result);
       }
     }
-    info("Constructed Geant4 particle %s",ctor.c_str());
+    info("Constructed Geant4 particle %s [using signature long (*)()]",ctor.c_str());
   }
 }
 
diff --git a/examples/ClientTests/scripts/SiliconBlock.py b/examples/ClientTests/scripts/SiliconBlock.py
index fedfd1cf4..fc1f5bd2a 100644
--- a/examples/ClientTests/scripts/SiliconBlock.py
+++ b/examples/ClientTests/scripts/SiliconBlock.py
@@ -37,12 +37,18 @@ def run():
 
   generator_output_level = Output.INFO
 
+  # Configure G4 geometry setup
+  seq,act = geant4.addDetectorConstruction("Geant4DetectorGeometryConstruction/ConstructGeo")
+  act.DebugMaterials = True
+  act.DebugElements  = False
+  act.DebugVolumes   = False
+
   # Configure I/O
   evt_root = geant4.setupROOTOutput('RootOutput','SiliconBlock_'+time.strftime('%Y-%m-%d_%H-%M'))
 
   # Setup particle gun
   gun = geant4.setupGun("Gun",particle='mu-',energy=20*GeV,multiplicity=1)
-  gun.output_level = generator_output_level
+  gun.OutputLevel = generator_output_level
 
   # And handle the simulation particles.
   part = DDG4.GeneratorAction(kernel,"Geant4ParticleHandler/ParticleHandler")
-- 
GitLab