summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Seibert <stan@mtrr.org>2011-10-17 10:20:36 -0400
committertlatorre <tlatorre@uchicago.edu>2021-05-09 08:42:38 -0700
commit516a28761bdfbb20624d8aef48b86d331cc1f78b (patch)
tree190b1d23923601180ea25aaac66f23d327d65608
parent391ac356158d8c807e282b0438e9581321ac97fd (diff)
downloadchroma-516a28761bdfbb20624d8aef48b86d331cc1f78b.tar.gz
chroma-516a28761bdfbb20624d8aef48b86d331cc1f78b.tar.bz2
chroma-516a28761bdfbb20624d8aef48b86d331cc1f78b.zip
constant_particle_gun now can generate pi0 decays
-rw-r--r--chroma/generator/vertex.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/chroma/generator/vertex.py b/chroma/generator/vertex.py
index 0ec4b31..e138e80 100644
--- a/chroma/generator/vertex.py
+++ b/chroma/generator/vertex.py
@@ -71,4 +71,8 @@ def pi0_gun(pos_iter, dir_iter, ke_iter, t0_iter=constant(0.0), start_id=0):
def constant_particle_gun(particle_name, pos, dir, ke, t0=0.0, start_id=0):
'''Convenience wrapper around particle gun that assumes all
arguments are constants, rather than generators.'''
- return particle_gun(constant(particle_name), constant(pos), constant(dir), constant(ke), constant(t0), start_id=start_id)
+ if particle_name == 'pi0':
+ return pi0_gun(constant(pos), constant(dir), constant(ke),
+ constant(t0), start_id=start_id)
+ else:
+ return particle_gun(constant(particle_name), constant(pos), constant(dir), constant(ke), constant(t0), start_id=start_id)