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

Commit

Permalink
add in backwards positron generator
Browse files Browse the repository at this point in the history
  • Loading branch information
tomeichlersmith committed Aug 16, 2023
1 parent 55e69f5 commit ce00acb
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions python/generators.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -309,3 +309,29 @@ def single_8gev_e_upstream_tagger():
[ 434.59663056485 , 0.0, 7988.698356992288],
8.0
)


def single_backwards_positron(energy: float):
"""A particle gun configured to shoot positrons backwards (i.e. upstream)
from the target at the input energy.

This generator is helpful for studying where electron guns of different energies should
be started from if they should end up at the center of the target.

Parameters
----------
energy: float
energy in GeV of the positron

Returns
-------
gun:
configured particle gun to shoot positrons backwards at the input energy
"""
beam = gun(f'backwards-positron-{energy}GeV')
beam.particle = 'e+'
beam.position = [0., 0., 0.]
beam.direction = [0., 0., -1.]
beam.energy = energy
return beam

0 comments on commit ce00acb

Please sign in to comment.