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