HPS-MC
tritrig_beam_job.py
Go to the documentation of this file.
1 """!
2 @file tritrig_beam_job.py
3 
4 Merge tritrig and beam events.
5 """
6 from hpsmc.tools import LCIOMerge, ExtractEventsWithHitAtHodoEcal
7 
8 
9 inputs = list(job.input_files.values())
10 
11 job.description = 'tritrig beam'
12 
13 if 'event_interval' in job.params:
14  event_interval = job.params['event_interval']
15 else:
16  event_interval = 1
17 
18 
19 tritrig_file_name = 'tritrig_events.slcio'
20 
21 
22 beam_file_names = []
23 for i in range(len(inputs)):
24  if inputs[i] != tritrig_file_name:
25  beam_file_names.append(inputs[i])
26 
27 
28 tritrig_name = 'tritrig'
29 
30 
31 tritrig_beam_name = 'tritrig_beam'
32 
33 
34 filter_bunches = ExtractEventsWithHitAtHodoEcal(inputs=[tritrig_file_name],
35  outputs=['%s_filt.slcio' % tritrig_name],
36  event_interval=event_interval, num_hodo_hits=0)
37 
38 
39 slic_beam_cat = ExtractEventsWithHitAtHodoEcal(inputs=beam_file_names,
40  outputs=['beam_cat.slcio'],
41  ignore_job_params=['event_interval'],
42  event_interval=0, num_hodo_hits=0)
43 
44 
45 merge = LCIOMerge(inputs=[filter_bunches.output_files()[0],
46  slic_beam_cat.outputs[0]],
47  outputs=['%s.slcio' % tritrig_beam_name],
48  ignore_job_params=['nevents'])
49 
50 comps = [filter_bunches, slic_beam_cat, merge]
51 job.add(comps)
Apply hodo-hit filter and space MC events to process before readout.
Definition: tools.py:1160
Merge LCIO files.
Definition: tools.py:1530
Tools that can be used in HPSMC jobs.
Definition: tools.py:1