HPS-MC
signal_pulser_overlay_to_recon_job.py
Go to the documentation of this file.
1 """!
2 @file signal_pulser_overlay_to_recon_job.py
3 
4 No idea what this is supposed to do.
5 """
6 
7 from hpsmc.tools import ExtractEventsWithHitAtHodoEcal, EvioToLcio, JobManager, FilterBunches, LCIOCount
8 
9 job.description = 'signal-pulse from overlay to recon'
10 
11 
12 inputs = list(job.input_files.values())
13 
14 
15 signal_file_name = []
16 
17 
18 pulser_file_name = []
19 
20 for input in inputs:
21  if "signal" in input:
22  signal_file_name.append(input)
23  if "pulser" in input:
24  pulser_file_name.append(input)
25 
26 
27 if len(signal_file_name) == 0:
28  raise Exception("Missing required input file(s) for signal")
29 if len(pulser_file_name) == 0:
30  raise Exception("Missing required input file(s) for pulser data")
31 
32 
33 signal_name = 'signal'
34 
35 
36 pulser_name = 'pulser'
37 
38 
39 signal_pulser_name = 'signal_pulser'
40 
41 
42 filter_events = ExtractEventsWithHitAtHodoEcal(inputs=signal_file_name,
43  outputs=['%s_filt.slcio' % signal_name],
44  event_interval=0, num_hodo_hits=1)
45 
46 
47 count_filter = LCIOCount(inputs=filter_events.output_files())
48 
49 
50 evio_to_lcio = EvioToLcio(steering='evio_to_lcio', inputs=pulser_file_name, output=['%s.slcio' % pulser_name])
51 
52 
53 count_pulser = LCIOCount(inputs=evio_to_lcio.output_files())
54 
55 
56 overlay = JobManager(steering='overlay',
57  inputs=filter_events.output_files(),
58  overlay_file=evio_to_lcio.output_files()[0],
59  outputs=['%s.slcio' % signal_pulser_name])
60 
61 
62 space_overlay = FilterBunches(inputs=overlay.output_files(),
63  filter_no_cuts=True,
64  outputs=['%s_spaced.slcio' % signal_pulser_name],
65  filter_event_interval=250)
66 
67 
68 count_space_overlay = LCIOCount(inputs=space_overlay.output_files())
69 
70 
71 readout = JobManager(steering='readout',
72  inputs=space_overlay.output_files(),
73  outputs=['%s_readout.slcio' % signal_pulser_name])
74 
75 
76 count_readout = LCIOCount(inputs=readout.output_files())
77 
78 
79 recon = JobManager(steering='recon',
80  inputs=readout.output_files(),
81  outputs=['%s_recon.slcio' % signal_pulser_name])
82 
83 
84 count_recon = LCIOCount(inputs=recon.output_files())
85 
86 
87 job.add([filter_events, count_filter, evio_to_lcio, count_pulser, overlay, space_overlay,
88  count_space_overlay, readout, count_readout, recon, count_recon])
Convert EVIO events to LCIO using the hps-java EvioToLcio command line tool.
Definition: tools.py:957
Apply hodo-hit filter and space MC events to process before readout.
Definition: tools.py:1160
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
Tools that can be used in HPSMC jobs.
Definition: tools.py:1