HPS-MC
readout_recon_job.py
Go to the documentation of this file.
1 """!
2 @file readout_recon_job.py
3 
4 Simulate pile-up, run readout, hps-java recon, and analysis.
5 """
6 import os
7 import logging
8 from hpsmc.tools import JobManager, FilterBunches, LCIOCount, HPSTR
9 
10 
11 logger = logging.getLogger('hpsmc.job')
12 
13 job.description = 'Simulate pile-up, run readout, hps-java recon, and analysis'
14 
15 if 'filter_bunches' in job.params:
16  filter_bunches = job.params['filter_bunches']
17 else:
18  filter_bunches = False
19 
20 
21 input_files = list(job.input_files.values())
22 if len(input_files) > 1:
23  raise Exception('This script accepts only one input file.')
24 output_base = os.path.splitext(os.path.basename(input_files[0]))[0]
25 job.ptag('filt', '%s_filt.slcio' % output_base)
26 job.ptag('readout', '%s_filt_readout.slcio' % output_base)
27 job.ptag('lcio_recon', '%s_filt_readout_recon.slcio' % output_base)
28 job.ptag('hpstr_recon', '%s_filt_readout_recon.root' % output_base)
29 job.ptag('hpstr_ana', '%s_filt_readout_recon_ana.root' % output_base)
30 
31 
32 if filter_bunches:
33  filtered = FilterBunches()
34  job.add([filtered])
35 
36 
37 readout = JobManager(steering='readout')
38 
39 count_readout = LCIOCount()
40 
41 
42 reco = JobManager(steering='recon')
43 
44 count_reco = LCIOCount()
45 
46 
47 cnv = HPSTR(cfg='recon')
48 
49 
50 ana = HPSTR(cfg='ana')
51 
52 job.add([readout, count_readout, reco, count_reco, cnv])
53 # , ana])
Space MC events and apply energy filters to process before readout.
Definition: tools.py:1048
Run the hpstr analysis tool.
Definition: tools.py:344
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