Belle II Software development
a03_trackingEfficiency_runTracking.py
1#!/usr/bin/env python
2
3
10
11
20
21import sys
22import basf2 as b2
23from tracking import add_tracking_reconstruction
24
25mcTrackFinding = False
26
27release = sys.argv[1]
28
29# roi = {noROI, vxdtf1, vxdtf2}
30# bkg = {noBkg, stdBKG, std2GBKG}
31# vxdtf = {vxdtf1, vxdtf2}
32
33roi = sys.argv[2]
34bkg = sys.argv[3]
35vxdtf = sys.argv[4]
36
37input_root_files = './' + release + '/TV_sim_' + bkg + '_' + roi + '_' + release + '.root'
38output_file_name = './' + release + '/TV_reco_' + bkg + '_' + roi + '_' + vxdtf + '_' + release + '.root'
39
40print('Tracking will run over these files: ')
41print(input_root_files)
42print('simulation: ' + roi + ' ' + bkg)
43print('reconstruction ' + vxdtf)
44print()
45
46path = b2.create_path()
47
48root_input = b2.register_module('RootInput')
49root_input.param('inputFileNames', input_root_files)
50path.add_module(root_input)
51
52gearbox = b2.register_module('Gearbox')
53path.add_module(gearbox)
54
55geometry = b2.register_module('Geometry')
56path.add_module(geometry)
57
58add_tracking_reconstruction(
59 path,
60 components=None,
61 pruneTracks=False,
62 mcTrackFinding=mcTrackFinding,
63 skipGeometryAdding=False
64)
65
66modList = path.modules()
67for modItem in modList:
68 if modItem.name() == 'V0Finder':
69 modItem.param('Validation', True)
70
71
72v0matcher = b2.register_module('MCV0Matcher')
73v0matcher.param('V0ColName', 'V0ValidationVertexs')
74v0matcher.logging.log_level = b2.LogLevel.INFO
75path.add_module(v0matcher)
76
77
78path.add_module('Progress')
79
80root_output = b2.register_module('RootOutput')
81root_output.param('outputFileName', output_file_name)
82path.add_module(root_output)
83
84b2.process(path)
85
86print(b2.statistics)