diff --git a/DDSim/DD4hepSimulation.py b/DDSim/DD4hepSimulation.py index d26a7ad50c99fe3b5875a126b7bea12ca6492552..dde0460c329d0bafa2675d37096c038d6aaf903a 100644 --- a/DDSim/DD4hepSimulation.py +++ b/DDSim/DD4hepSimulation.py @@ -309,8 +309,10 @@ class DD4hepSimulation(object): kernel.registerGlobalAction(run1) kernel.runAction().add(run1) - # Configure I/O + # Configure the random seed, do it before the I/O because we might change the seed! + _rndm = self.random.initialize( DDG4, kernel, self.output.random ) + # Configure I/O if self.outputFile.endswith(".slcio"): lcOut = simple.setupLCIOOutput('LcioOutput', self.outputFile) lcOut.RunHeader = self.__addParametersToRunHeader() @@ -319,9 +321,6 @@ class DD4hepSimulation(object): actionList = [] - ##configure the random seed - rndm = self.random.initialize( DDG4, kernel, self.output.random ) - if self.enableGun: gun = DDG4.GeneratorAction(kernel,"Geant4ParticleGun/"+"Gun") self.gun.setOptions( gun )