HPS-MC
 
Loading...
Searching...
No Matches
slic_to_recon_job.py
Go to the documentation of this file.
1"""!
2@file slic_to_recon_job.py
3
4Simulation of signals in detector (using SLIC) and readout.
5The simulation is followed by reconstruction of the events.
6"""
7import os
8from hpsmc.tools import SLIC, JobManager, ExtractEventsWithHitAtHodoEcal
9
10
11inputs = list(job.input_files.values())
12
13job.description = 'slic to recon'
14
15
16if 'event_interval' in job.params:
17 event_int = job.params['event_interval']
18else:
19 event_int = 1
20
21if 'nevents' in job.params:
22 nevents = job.params['nevents']
23else:
24 nevents = 10000
25
26if 'base_name' in job.params:
27 base_name = job.params['base_name']
28else:
29 base_name = ''
30
31
32slic_file_names = []
33for i in range(len(inputs)):
34 filename, file_extension = os.path.splitext(inputs[i])
35 slic_file = filename + '.slcio'
36 slic_file_names.append(slic_file)
37
38
39slic_comps = []
40for i in range(len(inputs)):
41 slic_comps.append(SLIC(inputs=[inputs[i]],
42 outputs=[slic_file_names[i]],
43 nevents=nevents * event_int,
44 ignore_job_params=['nevents'])
45 )
46
47
48cat_out_name = base_name + '_slic_cat.slcio'
49slic_cat = ExtractEventsWithHitAtHodoEcal(inputs=slic_file_names,
50 outputs=[cat_out_name],
51 event_interval=0, num_hodo_hits=0)
52
53
54readout_out_name = base_name + '_readout.slcio'
55readout = JobManager(steering='readout',
56 inputs=slic_cat.output_files(),
57 outputs=[readout_out_name])
58
59
60recon_out_name = base_name + '_recon.slcio'
61recon = JobManager(steering='recon',
62 inputs=readout.output_files(),
63 outputs=[recon_out_name])
64
65
66comps = slic_comps
67comps.extend([slic_cat, readout, recon])
68job.add(comps)
Apply hodo-hit filter and space MC events to process before readout.
Definition tools.py:1160
Run the hps-java JobManager class.
Definition tools.py:160
Run the SLIC Geant4 simulation.
Definition tools.py:15
Tools that can be used in HPSMC jobs.
Definition tools.py:1