HPS-MC
 
Loading...
Searching...
No Matches
beam_gen_sample_job.py
Go to the documentation of this file.
1"""!
2@file beam_gen_sample_job.py
3
4Generate beam events, transform them to beam coodinates and randomly sample them.
5"""
6from hpsmc.generators import EGS5
7from hpsmc.tools import BeamCoords, RandomSample
8
9
10inputs = list(job.input_files.values())
11
12if 'nevents' in job.params:
13 nevents = job.params['nevents']
14else:
15 nevents = 250000
16
17
18egs5 = EGS5(name="beam_v7_%s" % job.params['run_params'])
19
20
22
23
24sample = RandomSample()
25
26
27job.add([egs5, rot, sample])
Run the EGS5 event generator to produce a StdHep file.
Definition generators.py:28
Transform StdHep events into beam coordinates.
Definition tools.py:516
Randomly sample StdHep events into a new file.
Definition tools.py:589
Tools that can be used in HPSMC jobs.
Definition tools.py:1