HPS-MC
beam_prep_and_slic_job.py
Go to the documentation of this file.
1 """!
2 @file beam_prep_and_slic_job.py
3 
4 Transform events to beam coodinates, randomly sample them and simulating detector response using slic.
5 """
6 from hpsmc.tools import BeamCoords, RandomSample, SLIC
7 
8 if 'nevents' in job.params:
9  nevents = job.params['nevents']
10 else:
11  nevents = 10000
12 
13 if 'event_interval' in job.params:
14  event_interval = job.params['event_interval']
15 else:
16  event_interval = 1
17 
18 
19 inputs = list(job.input_files.values())
20 
21 
22 rot = BeamCoords()
23 
24 
25 sample = RandomSample()
26 
27 
28 slic = SLIC(nevents=nevents * event_interval, ignore_job_params=['nevents'])
29 
30 
31 job.add([rot, sample, slic])
Transform StdHep events into beam coordinates.
Definition: tools.py:516
Randomly sample StdHep events into a new file.
Definition: tools.py:589
Run the SLIC Geant4 simulation.
Definition: tools.py:15
Tools that can be used in HPSMC jobs.
Definition: tools.py:1