Skip to content
This repository was archived by the owner on May 6, 2024. It is now read-only.

Commit ce00acb

Browse files
add in backwards positron generator
1 parent 55e69f5 commit ce00acb

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

python/generators.py.in

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,3 +309,29 @@ def single_8gev_e_upstream_tagger():
309309
[ 434.59663056485 , 0.0, 7988.698356992288],
310310
8.0
311311
)
312+
313+
314+
def single_backwards_positron(energy: float):
315+
"""A particle gun configured to shoot positrons backwards (i.e. upstream)
316+
from the target at the input energy.
317+
318+
This generator is helpful for studying where electron guns of different energies should
319+
be started from if they should end up at the center of the target.
320+
321+
Parameters
322+
----------
323+
energy: float
324+
energy in GeV of the positron
325+
326+
Returns
327+
-------
328+
gun:
329+
configured particle gun to shoot positrons backwards at the input energy
330+
"""
331+
beam = gun(f'backwards-positron-{energy}GeV')
332+
beam.particle = 'e+'
333+
beam.position = [0., 0., 0.]
334+
beam.direction = [0., 0., -1.]
335+
beam.energy = energy
336+
return beam
337+

0 commit comments

Comments
 (0)