| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

DybAlg::__init__::RandomSeeder Class Reference

List of all members.

Public Member Functions

def __init__

Public Attributes

 random_seeder

Detailed Description

Random seed algorithm config

Definition at line 8 of file __init__.py.


Member Function Documentation

def DybAlg::__init__::RandomSeeder::__init__ (   self,
  hostid = 0,
  run = 0,
  execcountoffset = 0,
  burncount = 1000,
  engine = "HepRndm::Engine<CLHEP::Ranlux64Engine>" 
)

Do default configuration of the random seeds, optionally
setting hostid, run, execcountoffset, burncount or random engine

Definition at line 11 of file __init__.py.

00012                                                               :
00013         '''Do default configuration of the random seeds, optionally
00014         setting hostid, run, execcountoffset, burncount or random engine'''
00015 
00016         if hostid&0xffff0000 == int("0x007f0000",16):
00017             print '''
00018 WARNING:  Your hostID corresponds to a localhost/loopback IP number.
00019 This is not very unique and you may sharing random seeds
00020 with other processing nodes.
00021 Check /etc/hosts to make sure your host has a real IP address.
00022 '''
00023         pass
00024 
00025 
00026         from Gaudi.Configuration import ApplicationMgr
00027         theApp = ApplicationMgr()
00028 
00029         from GaudiSvc.GaudiSvcConf import RndmGenSvc
00030         rndSvc = RndmGenSvc()
00031         rndSvc.Engine = engine
00032         theApp.ExtSvc.append(rndSvc)
00033 
00034         def munge(x):
00035             if x == ':' or x == '<' or x == '>': return '_'
00036             return x
00037         engModName = ''.join(map(munge,engine))
00038         exec('from GaudiSvc.GaudiSvcConf import %s'%engModName)
00039         engMod = eval(engModName)
00040         engMod = engMod('RndmGenSvc.Engine') # magic nickname
00041         engMod.SetSingleton = True
00042         #print 'SetSingleton to True for engine %s (%s)'%(engine,engModName)
00043 
00044         from DybAlg.DybAlgConf import DybShuffle
00045         self.random_seeder = DybShuffle("random_seeder")
00046         # truncate hostid to avoid type mismatches.
00047         self.random_seeder.HostID = hostid&0x7fffffff
00048         self.random_seeder.Run = run
00049         self.random_seeder.ExecCountOffset = execcountoffset        
00050         self.random_seeder.BurnCount = burncount
00051         theApp.TopAlg.append(self.random_seeder)
00052         return
00053 
    pass # end RandomSeeder


Member Data Documentation

DybAlg::__init__::RandomSeeder::random_seeder

Definition at line 44 of file __init__.py.


The documentation for this class was generated from the following file:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 20:40:41 2011 for DybAlg by doxygen 1.4.7