From 516a28761bdfbb20624d8aef48b86d331cc1f78b Mon Sep 17 00:00:00 2001 From: Stan Seibert Date: Mon, 17 Oct 2011 10:20:36 -0400 Subject: constant_particle_gun now can generate pi0 decays --- chroma/generator/vertex.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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) -- cgit