2@file ap_gen_to_slic_job.py
4Job script to generate A-prime events, convert to StdHep, apply transformations,
5and resulting simulate signal events using SLIC.
7There are options to generate prompt and displaced events.
8You can use them by adjusting the StdHepConverter options as seen below.
12from hpsmc.tools import DisplaceUni, Unzip, BeamCoords, AddMotherFullTruth, SLIC
14job.description =
'ap from generation to slic'
17inputs = list(job.input_files.values())
19if 'nevents' in job.params:
20 nevents = job.params[
'nevents']
25mg =
MG5(name=
'ap', event_types=[
'unweighted'])
27if 'ap_decay_dist' in job.params:
28 ap_decay_dist = job.params[
'ap_decay_dist']
30 ap_decay_dist =
"lhe_uniform"
33unzip =
Unzip(inputs=[
"ap_unweighted_events.lhe.gz"], outputs=[
"ap_unweighted_events.lhe"])
35if ap_decay_dist ==
"lhe_uniform":
38elif ap_decay_dist ==
"lhe_prompt":
40 cnv =
StdHepConverter(name=
"lhe_prompt", inputs=[
"ap_unweighted_events.lhe"])
41elif ap_decay_dist ==
"displace_time":
42 if 'ctau' in job.params:
44 cnv =
DisplaceUni(inputs=[
"ap_unweighted_events.lhe"])
46 logger.error(
"Missing parameter ctau")
48 logger.error(
"Invalid ap decay distribution: ap_decay_dist = %s" % ap_decay_dist)
51mom =
AddMotherFullTruth(inputs=[
"ap_unweighted_events.stdhep", unzip.output_files()[0]], outputs=[
"ap_mom.stdhep"])
54rot =
BeamCoords(inputs=mom.output_files(), outputs=[
"ap_rot.stdhep"])
57slic =
SLIC(nevents=nevents + 1, inputs=rot.output_files(), outputs=[
"ap.slcio"])
60job.add([mg, unzip, cnv, mom, rot, slic])
Run the MadGraph 5 event generator.
Target processing and conversion of LHE files to StdHep using EGS5.