1 """Define functions to construct random number services
3 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
5 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
6 from AthenaConfiguration.ComponentFactory
import CompFactory
9 AtDSFMTGenSvc,AtRanluxGenSvc,AtRndmGenSvc,AthRNGSvc=\
10 CompFactory.getComps(
"AtDSFMTGenSvc",
"AtRanluxGenSvc",
"AtRndmGenSvc",
"AthRNGSvc")
14 "dSFMT" :
"AtDSFMTGenSvc",
15 "Ranlux64" :
"AtRanluxGenSvc",
16 "Ranecu" :
"AtRndmGenSvc",
19 def dSFMT(seed, name="AtDSFMTGenSvc"):
20 """Return a ComponentAccumulator containing an AtDSFMTGenSvc with seed"""
23 service.Seeds.append(seed)
24 acc.addService(service, primary=
True)
28 """Return a ComponentAccumulator containing an AtRanluxGenSvc with seed"""
31 service.Seeds.append(seed)
32 acc.addService(service, primary=
True)
35 def Ranecu(seed, name="AtRndmGenSvc"):
36 """Return a ComponentAccumulator containing an AtRndmGenSvc with seed"""
39 service.Seeds.append(seed)
40 acc.addService(service, primary=
True)
43 def RNG(engine="dSFMT", name="AthRNGSvc"):
44 """Return a ComponentAccumulator containing an AthRNGSvc"""
47 service.EngineType = engine
48 acc.addService(service, primary=
True)
52 """Return a ComponentAccumulator containing an AthRNGSvc"""
55 service.EngineType = flags.Random.Engine
56 acc.addService(service, primary=
True)