HPS-MC
signal_beam_merge_to_recon_2016_job.py
Go to the documentation of this file.
1 from hpsmc.tools import FilterBunches, JobManager, LCIOCount, LCIOMerge
2 
3 job.description = 'signal-beam from merge to recon'
4 
5 
6 inputs = list(job.input_files.values())
7 
8 
9 signal_file_name = []
10 
11 
12 beam_file_name = []
13 
14 for input in inputs:
15  if "signal" in input:
16  signal_file_name.append(input)
17  if "beam" in input:
18  beam_file_name.append(input)
19 
20 
21 if len(signal_file_name) == 0:
22  raise Exception("Missing required input file(s) for signal")
23 if len(beam_file_name) == 0:
24  raise Exception("Missing required input file(s) for beam")
25 
26 
27 signal_name = 'signal'
28 
29 
30 beam_name = 'beam'
31 
32 
33 signal_beam_name = 'signal-beam'
34 
35 
36 filter_events = FilterBunches(inputs=signal_file_name,
37  outputs=['%s_filt.slcio' % signal_name],
38  filter_event_interval=250, filter_ecal_pairs=True,
39  filter_ecal_hit_ecut=0.1)
40 
41 
42 count_filter = LCIOCount(inputs=filter_events.output_files())
43 
44 
45 catenate_beam = FilterBunches(inputs=beam_file_name,
46  outputs=['%s_filt.slcio' % beam_name],
47  filter_event_interval=0, filter_ecal_pairs=False,
48  filter_no_cuts=True, filter_ecal_hit_ecut=-0.1)
49 
50 
51 count_beam = LCIOCount(inputs=catenate_beam.output_files())
52 
53 
54 merge = LCIOMerge(inputs=[filter_events.output_files()[0],
55  catenate_beam.output_files()[0]],
56  outputs=['%s.slcio' % signal_beam_name],
57  ignore_job_params=['nevents'])
58 
59 
60 count_merge = LCIOCount(inputs=merge.output_files())
61 
62 
63 readout = JobManager(steering='readout',
64  inputs=merge.output_files(),
65  outputs=['%s_readout.slcio' % signal_beam_name])
66 
67 
68 count_readout = LCIOCount(inputs=readout.output_files())
69 
70 
71 recon = JobManager(steering='recon',
72  inputs=readout.output_files(),
73  outputs=['%s_recon.slcio' % signal_beam_name])
74 
75 
76 count_recon = LCIOCount(inputs=recon.output_files())
77 
78 
79 job.add([filter_events, count_filter, catenate_beam, count_beam, merge,
80  count_merge, readout, count_readout, recon, count_recon])
Space MC events and apply energy filters to process before readout.
Definition: tools.py:1048
Run the hps-java JobManager class.
Definition: tools.py:160
Count events in LCIO files.
Definition: tools.py:1487
Merge LCIO files.
Definition: tools.py:1530
Tools that can be used in HPSMC jobs.
Definition: tools.py:1