From f232e4e9da08628bb00cdc3ba3b41849a651c367 Mon Sep 17 00:00:00 2001
From: Andre Sailer <andre.philippe.sailer@cern.ch>
Date: Mon, 2 Mar 2020 14:04:00 +0100
Subject: [PATCH] DDSim: bring back the visible printout of dumpSteeringFile

---
 DDG4/python/DDSim/DD4hepSimulation.py    | 5 +++--
 DDG4/python/DDSim/Helper/ConfigHelper.py | 4 ++--
 DDG4/python/DDSim/bin/ddsim.py           | 6 +++---
 3 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/DDG4/python/DDSim/DD4hepSimulation.py b/DDG4/python/DDSim/DD4hepSimulation.py
index ea4895bd2..0e5f584ae 100644
--- a/DDG4/python/DDSim/DD4hepSimulation.py
+++ b/DDG4/python/DDSim/DD4hepSimulation.py
@@ -6,7 +6,7 @@ Based on M. Frank and F. Gaede runSim.py
    @version 0.1
 
 """
-from __future__ import absolute_import, unicode_literals, division
+from __future__ import absolute_import, unicode_literals, division, print_function
 __RCSID__ = "$Id$"
 import sys
 import os
@@ -635,7 +635,8 @@ SIM = DD4hepSimulation()
         else:
           steeringFileBase += "SIM.%s = %s" % (parName, str(parameter))
         steeringFileBase += "\n"
-    logger.info("%s", steeringFileBase)
+    for line in steeringFileBase.splitlines():
+      print(line)
 
   def _consistencyChecks(self):
     """Check if the requested setup makes sense, or if there is something preventing it from working correctly
diff --git a/DDG4/python/DDSim/Helper/ConfigHelper.py b/DDG4/python/DDSim/Helper/ConfigHelper.py
index 8eb4e62c8..d52c3f033 100644
--- a/DDG4/python/DDSim/Helper/ConfigHelper.py
+++ b/DDG4/python/DDSim/Helper/ConfigHelper.py
@@ -53,10 +53,10 @@ class ConfigHelper(object):
     return self.printOptions()
 
   def printOptions(self):
-    """print all paramters"""
+    """print all parameters"""
     options = []
     for opt, val in six.iteritems(self.getOptions()):
-      options.append("\n\t'%s': '%s'" % (opt, val[0]))
+      options.append("\n\t'%s': '%s'" % (opt, val['default']))
     return "".join(options)
 
   def setOption(self, name, val):
diff --git a/DDG4/python/DDSim/bin/ddsim.py b/DDG4/python/DDSim/bin/ddsim.py
index 200ad8d1f..bb5253188 100755
--- a/DDG4/python/DDSim/bin/ddsim.py
+++ b/DDG4/python/DDSim/bin/ddsim.py
@@ -14,12 +14,12 @@ from DDSim.DD4hepSimulation import DD4hepSimulation
 
 
 if __name__ == "__main__":
-  RUNNER = DD4hepSimulation()
-  RUNNER.parseOptions()
-
   logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.INFO)
   logger = logging.getLogger('DDSim')
 
+  RUNNER = DD4hepSimulation()
+  RUNNER.parseOptions()
+
   try:
     RUNNER.run()
   except NameError as e:
-- 
GitLab