summaryrefslogtreecommitdiff
path: root/generator/g4gen.py
diff options
context:
space:
mode:
authorAnthony LaTorre <tlatorre9@gmail.com>2011-09-12 16:41:17 -0400
committerAnthony LaTorre <tlatorre9@gmail.com>2011-09-12 16:41:17 -0400
commit6f0703602270d03f4025221f13fee21aa842a863 (patch)
tree2d227fbc236e647e3d6c96113f1d6b93a4113793 /generator/g4gen.py
parent4b5d9c633bd01ce8b2819d92eaf3e01d881fb996 (diff)
downloadchroma-6f0703602270d03f4025221f13fee21aa842a863.tar.gz
chroma-6f0703602270d03f4025221f13fee21aa842a863.tar.bz2
chroma-6f0703602270d03f4025221f13fee21aa842a863.zip
add chroma-sim script. get rid of GPU class; contexts should now be created with create_cuda_context().
Diffstat (limited to 'generator/g4gen.py')
-rw-r--r--generator/g4gen.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/generator/g4gen.py b/generator/g4gen.py
index 8dca086..3836897 100644
--- a/generator/g4gen.py
+++ b/generator/g4gen.py
@@ -120,7 +120,9 @@ class G4Generator(object):
self.particle_gun.SetParticleEnergy(total_energy)
self.particle_gun.SetParticlePosition(G4ThreeVector(*vertex.pos)*m)
self.particle_gun.SetParticleMomentumDirection(G4ThreeVector(*vertex.dir).unit())
-
+ if vertex.pol is not None:
+ self.particle_gun.SetParticlePolarization(G4ThreeVector(*vertex.pol).unit())
+
self.tracking_action.Clear()
gRunManager.BeamOn(1)