/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Public Member Functions | Public Attributes
DybAlg::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.


Constructor & Destructor Documentation

def DybAlg::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.

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


Member Data Documentation

Definition at line 17 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 Fri May 16 2014 10:09:44 for DybAlg by doxygen 1.7.4