HPS-MC
beam_gen_sample_job.py
Go to the documentation of this file.
1 """!
2 @file beam_gen_sample_job.py
3 
4 Generate beam events, transform them to beam coodinates and randomly sample them.
5 """
6 from hpsmc.generators import EGS5
7 from hpsmc.tools import BeamCoords, RandomSample
8 
9 
10 inputs = list(job.input_files.values())
11 
12 if 'nevents' in job.params:
13  nevents = job.params['nevents']
14 else:
15  nevents = 250000
16 
17 
18 egs5 = EGS5(name="beam_v7_%s" % job.params['run_params'])
19 
20 
21 rot = BeamCoords()
22 
23 
24 sample = RandomSample()
25 
26 
27 job.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