diff options
author | Anthony LaTorre <tlatorre9@gmail.com> | 2011-08-11 16:43:09 -0400 |
---|---|---|
committer | Anthony LaTorre <tlatorre9@gmail.com> | 2011-08-11 16:43:09 -0400 |
commit | 00aa07a12f8f00e29a3a04f2850ccd4fc91cc951 (patch) | |
tree | 50c76a5661693f2335278db2d6cc924d3cc60e20 /g4gen.py | |
parent | 9d68f8ea2b6a64e83195f16aa066caac5eeb8fae (diff) | |
parent | 1b9aef380e629c136e045412621483ebb4a4164f (diff) | |
download | chroma-00aa07a12f8f00e29a3a04f2850ccd4fc91cc951.tar.gz chroma-00aa07a12f8f00e29a3a04f2850ccd4fc91cc951.tar.bz2 chroma-00aa07a12f8f00e29a3a04f2850ccd4fc91cc951.zip |
merge heads
Diffstat (limited to 'g4gen.py')
-rw-r--r-- | g4gen.py | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -18,7 +18,7 @@ except: import G4chroma class G4Generator(object): - def __init__(self, material): + def __init__(self, material, seed=None): '''Create generator to produce photons inside the specified material. material: chroma.geometry.Material object with density, @@ -26,7 +26,12 @@ class G4Generator(object): composition dictionary should be { element_symbol : fraction_by_weight, ... }. + seed: Random number generator seed for HepRandom. If None, + generator is not seeded. ''' + if seed is not None: + HepRandom.setTheSeed(seed) + g4py.NISTmaterials.Construct() g4py.ezgeom.Construct() self.physics_list = G4chroma.ChromaPhysicsList() |