2 @file tritrig_beam_job.py
4 Merge tritrig and beam events, simulate signal events, and detector readout.
7 from hpsmc.tools import SLIC, JobManager, LCIOCount, LCIOMerge, ExtractEventsWithHitAtHodoEcal
10 inputs = list(job.input_files.values())
12 job.description =
'tritrig beam slic to reco'
14 if 'nevents' in job.params:
15 nevents = job.params[
'nevents']
20 tritrig_file_name =
'tritrig_events.stdhep'
24 beam_slic_file_names = []
25 for i
in range(len(inputs)):
26 if inputs[i] != tritrig_file_name:
27 beam_file_names.append(inputs[i])
28 filename, file_extension = os.path.splitext(inputs[i])
29 beam_slic_file = filename +
'.slcio'
30 beam_slic_file_names.append(beam_slic_file)
33 tritrig_name =
'tritrig'
39 tritrig_beam_name =
'tritrig_beam'
42 slic =
SLIC(inputs=[tritrig_file_name],
43 outputs=[
'%s.slcio' % tritrig_name])
47 outputs=[
'%s_filt.slcio' % tritrig_name],
48 event_interval=250, num_hodo_hits=0)
51 count_filter =
LCIOCount(inputs=filter_bunches.output_files())
55 for i
in range(len(beam_file_names)):
56 slic_beams.append(
SLIC(inputs=[beam_file_names[i]],
57 outputs=[beam_slic_file_names[i]],
58 nevents=nevents * 250,
59 ignore_job_params=[
'nevents'])
64 outputs=[
'beam_cat.slcio'],
65 event_interval=0, num_hodo_hits=0)
68 merge =
LCIOMerge(inputs=[filter_bunches.output_files()[0],
69 slic_beam_cat.outputs[0]],
70 outputs=[
'%s.slcio' % tritrig_beam_name],
71 ignore_job_params=[
'nevents'])
74 count_merge =
LCIOCount(inputs=merge.output_files())
78 inputs=merge.output_files(),
79 outputs=[
'%s_readout.slcio' % tritrig_beam_name])
82 count_readout =
LCIOCount(inputs=readout.output_files())
86 inputs=readout.output_files(),
87 outputs=[
'%s_recon.slcio' % tritrig_beam_name])
90 count_recon =
LCIOCount(inputs=recon.output_files())
92 comps = [slic, filter_bunches, count_filter]
93 for i
in range(len(slic_beams)):
94 comps.append(slic_beams[i])
95 comps.extend([slic_beam_cat, merge, count_merge, readout, count_readout, recon, count_recon])