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