Skip to content

Commit 44ac16a

Browse files
authored
Add wide angle events in generators.py
Added wide angle event generator. Shots single (mono-energetic) electrons downstream at a configurable angle with respect to the z axis.
1 parent c2b7c58 commit 44ac16a

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

SimCore/python/generators.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,3 +359,32 @@ def single_backwards_positron(energy: float):
359359
beam.energy = energy
360360
return beam
361361

362+
def single_e_wide_angle_downstream_target(minTheta = 30, maxTheta = 70, minPhi = 0, maxPhi = 360):
363+
"""A general particle source configured to shoot electrons downstream from after the target at wide angles such that they hit the side hcal.
364+
365+
This generator is helpful to study the matching criteria between tracks and signals in the (side) hcal. Theta is the angle with respect to the downstream z axis. Note that the angular distribution and energy of the beam electrons can easily be modified. The particle source starts behind the target.
366+
367+
Returns
368+
-------
369+
gun:
370+
configured general particle source to shoot electrons downstream the target at wide angles
371+
"""
372+
myGPS = gps( 'myGPS' , [
373+
"/gps/particle e-",
374+
"/gps/number 1",
375+
"/gps/pos/type Plane",
376+
"/gps/pos/shape Rectangle",
377+
"/gps/pos/centre 0 0 0 mm",
378+
"/gps/pos/halfx 10 mm",
379+
"/gps/pos/halfy 40 mm",
380+
"/gps/ang/type iso",
381+
f"/gps/ang/mintheta {minTheta} deg",
382+
f"/gps/ang/maxtheta {maxTheta} deg",
383+
f"/gps/ang/minphi {minPhi} deg",
384+
f"/gps/ang/maxphi {maxPhi} deg",
385+
f"/gps/ang/rot1 0 1 0", # These have been determined by trial and error so that theta is the angle from the ldmx z axis and
386+
f"/gps/ang/rot2 1 0 0", # phi is rotates clockwise in the XY plane starting from the negative Y axis
387+
"/gps/ene/mono 8 GeV",
388+
] )
389+
return myGPS
390+

0 commit comments

Comments
 (0)