diff --git a/DDG4/python/DDSim/DD4hepSimulation.py b/DDG4/python/DDSim/DD4hepSimulation.py index 05205161162acb35b391e49f56116e6b12c1fafb..5a541e6c5d26999862e0387089936f2b259085b8 100644 --- a/DDG4/python/DDSim/DD4hepSimulation.py +++ b/DDG4/python/DDSim/DD4hepSimulation.py @@ -328,7 +328,7 @@ class DD4hepSimulation(object): self.__setMagneticFieldOptions(geant4) # configure geometry creation - self.geometry.constructGeometry(kernel, geant4) + self.geometry.constructGeometry(kernel, geant4, self.output.geometry) # ---------------------------------------------------------------------------------- # Configure Run actions diff --git a/DDG4/python/DDSim/Helper/Geometry.py b/DDG4/python/DDSim/Helper/Geometry.py index 608c98f02ef67db062925d85779a1bd3b89c24e6..127437c480c667a8e6512359fdd585bc6c46ebbb 100644 --- a/DDG4/python/DDSim/Helper/Geometry.py +++ b/DDG4/python/DDSim/Helper/Geometry.py @@ -33,13 +33,11 @@ class Geometry(ConfigHelper): # unused self.printPlacements = False self.printSensitives = False - # FIXME: get this via output.geoInfoPrintLevel!!! - self.geoInfoPrintLevel = 7 self._dumpDGDML_EXTRA = {"help": "If not empty, filename to dump the Geometry as GDML"} self.dumpGDML = "" - def constructGeometry(self, kernel, geant4, numberOfThreads=1): + def constructGeometry(self, kernel, geant4, geoPrintLevel=2, numberOfThreads=1): """Construct Geant4 geometry.""" from DDG4 import DetectorConstruction @@ -54,11 +52,10 @@ class Geometry(ConfigHelper): act.DebugSurfaces = self.enableDebugSurfaces act.PrintPlacements = self.printPlacements act.PrintSensitives = self.printSensitives - act.GeoInfoPrintLevel = self.geoInfoPrintLevel + act.GeoInfoPrintLevel = geoPrintLevel act.DumpHierarchy = self.dumpHierarchy act.DumpGDML = self.dumpGDML - # Apply sensitive detectors sensitives = DetectorConstruction(kernel, str('Geant4DetectorSensitivesConstruction/ConstructSD')) sensitives.enableUI() diff --git a/DDG4/python/DDSim/Helper/Output.py b/DDG4/python/DDSim/Helper/Output.py index bb7916aca72a80d7fe26b57780f23659faedbe87..3c795fac3bbbc963ae6090a495af4439e37530d5 100644 --- a/DDG4/python/DDSim/Helper/Output.py +++ b/DDG4/python/DDSim/Helper/Output.py @@ -51,6 +51,9 @@ class Output(ConfigHelper): self._random_EXTRA = {'choices': OUTPUT_CHOICES, 'type': outputLevelType} self._random = outputLevel('FATAL') + self._geometry_EXTRA = {'choices': OUTPUT_CHOICES, 'type': outputLevelType} + self._geometry = outputLevel('DEBUG') + @property def inputStage(self): """Output level for input sources""" @@ -86,3 +89,12 @@ class Output(ConfigHelper): @random.setter def random(self, level): self._random = outputLevel(level) + + @property + def geometry(self): + """Output level for geometry.""" + return self._geometry + + @geometry.setter + def geometry(self, level): + self._geometry = outputLevel(level)