From 1b0519eede16a2679af5a50654eb8fd8ee3b05bc Mon Sep 17 00:00:00 2001
From: Andre Sailer <andre.philippe.sailer@cern.ch>
Date: Fri, 4 Mar 2016 17:09:16 +0000
Subject: [PATCH] DDSim: Fix for overwriting variable values in dumped Steering
 file

previously only the main variable values were overwritten, now dumpSteeringFile and dumpParameters will also display the proper value
---
 DDSim/DD4hepSimulation.py | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/DDSim/DD4hepSimulation.py b/DDSim/DD4hepSimulation.py
index d135b0198..76b16c856 100644
--- a/DDSim/DD4hepSimulation.py
+++ b/DDSim/DD4hepSimulation.py
@@ -209,6 +209,14 @@ class DD4hepSimulation(object):
       if not self.inputFiles and not self.enableGun:
         self._errorMessages.append("ERROR: Batch mode requested, but did not set inputFile(s) or gun")
 
+    #self.__treatUnknownArgs( parsed, unknown )
+    self.__parseAllHelper( parsed )
+    if self._errorMessages:
+      parser.epilog = "\n".join(self._errorMessages)
+      parser.print_help()
+      exit(1)
+
+
     if self._dumpParameter:
       from pprint import pprint
       print "="*80
@@ -220,13 +228,6 @@ class DD4hepSimulation(object):
       self.__printSteeringFile( parser )
       exit(1)
 
-    #self.__treatUnknownArgs( parsed, unknown )
-    self.__parseAllHelper( parsed )
-    if self._errorMessages:
-      parser.epilog = "\n".join(self._errorMessages)
-      parser.print_help()
-      exit(1)
-
   @staticmethod
   def getDetectorLists( lcdd ):
     ''' get lists of trackers and calorimeters that are defined in lcdd (the compact xml file)'''
-- 
GitLab