From a520ce4397c9eea5ac5f07a99f98a63423086654 Mon Sep 17 00:00:00 2001
From: lintao <lintao51@gmail.com>
Date: Sun, 10 Nov 2019 14:41:26 +0800
Subject: [PATCH] add the seed of random number.

---
 Examples/options/tut_detsim.py | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/Examples/options/tut_detsim.py b/Examples/options/tut_detsim.py
index 516a0075..c9af7e79 100644
--- a/Examples/options/tut_detsim.py
+++ b/Examples/options/tut_detsim.py
@@ -7,6 +7,20 @@ import sys
 
 from Gaudi.Configuration import *
 
+##############################################################################
+# Random Number Svc
+##############################################################################
+from Configurables import RndmGenSvc, HepRndm__Engine_CLHEP__RanluxEngine_
+
+# rndmengine = HepRndm__Engine_CLHEP__RanluxEngine_() # The default engine in Gaudi
+rndmengine = HepRndm__Engine_CLHEP__HepJamesRandom_() # The default engine in Geant4
+rndmengine.SetSingleton = True
+rndmengine.Seeds = [42]
+
+# rndmgensvc = RndmGenSvc("RndmGenSvc")
+# rndmgensvc.Engine = rndmengine.name()
+
+
 ##############################################################################
 # Event Data Svc
 ##############################################################################
@@ -89,5 +103,5 @@ from Configurables import ApplicationMgr
 ApplicationMgr( TopAlg = [genalg, detsimalg, out],
                 EvtSel = 'NONE',
                 EvtMax = 10,
-                ExtSvc = [dsvc],
+                ExtSvc = [rndmengine, dsvc, geosvc],
 )
-- 
GitLab