diff options
-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) |