HPS-MC
wab_gen_sample_job.py
Go to the documentation of this file.
1 """!
2 @file wab_gen_sample_job.py
3 
4 Python script for generating sampled WAB events in StdHep format from an input LHE file.
5 
6 The output events can be used as input to 'merge_job.py' with a beam StdHep file to for creating a
7 wab-beam sample file.
8 """
9 
10 from hpsmc.generators import MG4
11 from hpsmc.tools import BeamCoords, MergePoisson
12 from hpsmc.generators import StdHepConverter
13 
14 job.description = 'WAB gen and sampling'
15 
16 
17 mg = MG4(name="wab")
18 
19 # check that at least 80% of the requested events were generated or fail the job
20 # check = LHECount(minevents=params.nevents*0.8, inputs=["wab_unweighted_events.lhe.gz"])
21 
22 
23 cnv = StdHepConverter(inputs=mg.output_files(), outputs=['wab_events.stdhep'])
24 
25 
26 rot = BeamCoords()
27 
28 
29 sample = MergePoisson(input_filter='wab',
30  input_files=['wab_unweighted_events_rot.stdhep'],
31  output_files=['wab_unweighted_events_rot_sampled.stdhep'],
32  xsec=7.55e10)
33 
34 
35 job.add([mg, cnv, rot, sample])
Run the MadGraph 4 event generator.
Definition: generators.py:329
Convert LHE files to StdHep using EGS5.
Definition: generators.py:135
Transform StdHep events into beam coordinates.
Definition: tools.py:516
Merge StdHep files, applying poisson sampling.
Definition: tools.py:769
Tools that can be used in HPSMC jobs.
Definition: tools.py:1