From d90e47c98d5af5bec609478b786f4305721d0cec Mon Sep 17 00:00:00 2001
From: Markus Frank <Markus.Frank@cern.ch>
Date: Fri, 8 Mar 2019 14:42:39 +0100
Subject: [PATCH] Fix bug for G4 version <= 10.03

---
 DDCore/src/plugins/StandardPlugins.cpp | 4 ++++
 DDG4/plugins/Geant4CerenkovPhysics.cpp | 4 +++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/DDCore/src/plugins/StandardPlugins.cpp b/DDCore/src/plugins/StandardPlugins.cpp
index c383d7556..b2971ce38 100644
--- a/DDCore/src/plugins/StandardPlugins.cpp
+++ b/DDCore/src/plugins/StandardPlugins.cpp
@@ -1394,6 +1394,8 @@ template <int flag> long dump_detelement_tree(Detector& description, int argc, c
            << (flag==0 ? "DD4hep_DetectorDump" : "DD4hep_DetectorVolumeDump") << " -arg [-arg]     \n"
         "    --sensitive            Process only sensitive volumes.                                \n"
         "    -sensitive             dto.                                                           \n"
+        "    --no-sensitive         Invert sensitive only flag.                                    \n"
+        "    -no-sensitive          dto.                                                           \n"
         "    --shapes               Print shape information.                                       \n"
         "    -shapes                dto.                                                           \n"
         "    --positions            Print position information.                                    \n"
@@ -1402,6 +1404,8 @@ template <int flag> long dump_detelement_tree(Detector& description, int argc, c
         "    -materials             dto.                                                           \n"
         "    --detector   <path>    Process elements only if <path> is part of the DetElement path.\n"
         "    -detector    <path>    dto.                                                           \n"
+        "    -level       <number>  Maximal depth to be explored by the scan                       \n"
+        "    --level       <number> dto.                                                           \n"
         "\tArguments given: " << arguments(argc,argv) << endl << flush;        
       ::exit(EINVAL);
     }
diff --git a/DDG4/plugins/Geant4CerenkovPhysics.cpp b/DDG4/plugins/Geant4CerenkovPhysics.cpp
index a2eedcf3f..f8de7ccfd 100644
--- a/DDG4/plugins/Geant4CerenkovPhysics.cpp
+++ b/DDG4/plugins/Geant4CerenkovPhysics.cpp
@@ -33,6 +33,7 @@
 #include "G4ParticleTypes.hh"
 #include "G4ParticleTable.hh"
 #include "G4ProcessManager.hh"
+#include "G4Version.hh"
 
 #include "G4Cerenkov.hh"
 
@@ -78,8 +79,9 @@ namespace dd4hep {
         process->SetMaxNumPhotonsPerStep(m_maxNumPhotonsPerStep);
         process->SetMaxBetaChangePerStep(m_maxBetaChangePerStep);
         process->SetTrackSecondariesFirst(m_trackSecondariesFirst);
+#if G4VERSION_NUMBER>1030
         process->SetStackPhotons(m_stackPhotons);
-
+#endif
         auto pit = G4ParticleTable::GetParticleTable()->GetIterator();
         pit->reset();
         while( (*pit)() ){
-- 
GitLab