diff options
author | Stan Seibert <stan@mtrr.org> | 2011-08-20 15:56:50 -0400 |
---|---|---|
committer | Stan Seibert <stan@mtrr.org> | 2011-08-20 15:56:50 -0400 |
commit | ce646cfa6b9e5c0d46c1f678d39b15a434716412 (patch) | |
tree | 9ec363706dda8cd7a116a9750dace20849fb258a | |
parent | 08d257b12fe69bbf04432903dfab334bcbc651ff (diff) | |
download | chroma-ce646cfa6b9e5c0d46c1f678d39b15a434716412.tar.gz chroma-ce646cfa6b9e5c0d46c1f678d39b15a434716412.tar.bz2 chroma-ce646cfa6b9e5c0d46c1f678d39b15a434716412.zip |
Convenience gun generator when all inputs are constant.
-rw-r--r-- | generator/vertex.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/generator/vertex.py b/generator/vertex.py index 3998e6e..139d675 100644 --- a/generator/vertex.py +++ b/generator/vertex.py @@ -69,3 +69,12 @@ def pi0_gun(pi0_position, pi0_direction, pi0_total_energy, start_id=0): Subtrack(particle_name='gamma', position=ev_position, direction=gamma2_dir, start_time=0.0, total_energy=gamma2_e)] yield ev + + +def constant_particle_gun(particle_name, position, direction, total_energy, + start_id=0): + '''Convenience wrapper around particle gun that assumes all + arguments are constants, rather than generators.''' + return particle_gun(constant(particle_name), constant(position), + constant(direction), constant(total_energy), + start_id=start_id) |