Пример #1
0
#!/usr/bin/env python
from Gaudi.Configuration import *

from Configurables import k4DataSvc
dsvc = k4DataSvc("EventDataSvc")

from Configurables import RndmGenSvc, HepRndm__Engine_CLHEP__RanluxEngine_
seed = [10]
# rndmengine = HepRndm__Engine_CLHEP__RanluxEngine_() # The default engine in Gaudi
rndmengine = HepRndm__Engine_CLHEP__HepJamesRandom_(
    "RndmGenSvc.Engine")  # The default engine in Geant4
rndmengine.SetSingleton = True
rndmengine.Seeds = seed

rndmgensvc = RndmGenSvc("RndmGenSvc")
rndmgensvc.Engine = rndmengine.name()

# option for standalone tracker study
geometry_option = "CRD_o1_v02/CRD_o1_v02-onlyTracker.xml"
#geometry_option = "CRD_o1_v02/CRD_o1_v02.xml"

if not os.getenv("DETCRDROOT"):
    print("Can't find the geometry. Please setup envvar DETCRDROOT.")
    sys.exit(-1)

geometry_path = os.path.join(os.getenv("DETCRDROOT"), "compact",
                             geometry_option)
if not os.path.exists(geometry_path):
    print("Can't find the compact geometry file: %s" % geometry_path)
    sys.exit(-1)
Пример #2
0
    "saveMCTruthTool")  # need SimG4DRcaloActions

geantsim = SimG4Alg("SimG4Alg",
                    outputs=[
                        "SimG4SaveDRcaloHits/saveDRcaloTool",
                        "SimG4SaveDRcaloMCTruth/saveMCTruthTool"
                    ],
                    eventProvider=edmConverter)

from Configurables import PodioOutput
podiooutput = PodioOutput("PodioOutput", filename="sim.root")
podiooutput.outputCommands = ["keep *"]

from Configurables import RndmGenSvc, HepRndm__Engine_CLHEP__RanluxEngine_
rndmEngine = HepRndm__Engine_CLHEP__RanluxEngine_(
    "RndmGenSvc.Engine",
    SetSingleton=True,
    UseTable=True,
    Column=0,  # 0 or 1
    Row=123  # 0 to 214
)

rndmGenSvc = RndmGenSvc("RndmGenSvc", Engine=rndmEngine.name())

ApplicationMgr(
    TopAlg=[gen, hepmc2edm, geantsim, podiooutput],
    EvtSel='NONE',
    EvtMax=10,
    # order is important, as GeoSvc is needed by SimG4Svc
    ExtSvc=[rndmEngine, rndmGenSvc, dataservice, geoservice, geantservice])