Belle II Software  release-05-01-25
phase2_sim_reco_tracking_localDB.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 
8 
9 import os
10 from basf2 import *
11 from tracking import *
12 from svd import *
13 from rawdata import *
14 from ROOT import Belle2
15 from reconstruction import add_reconstruction
16 import os.path
17 import sys
18 
19 print('***')
20 print('*** Used steering script:')
21 with open(sys.argv[0], 'r') as fin:
22  print(fin.read(), end="")
23 print('*** end of the script.')
24 print('***')
25 
26 fileIN = sys.argv[1]
27 fileOUT = sys.argv[2]
28 localdb_dir = sys.argv[3]
29 
30 use_database_chain()
31 # use_central_database("development")
32 use_local_database(localdb_dir + "/database.txt", localdb_dir)
33 
34 main = create_path()
35 main.add_module('RootInput', inputFileName=fileIN)
36 
37 main.add_module('Gearbox')
38 main.add_module('Geometry')
39 
40 # SVD reconstruction
41 main.add_module('SVDCoGTimeEstimator')
42 main.add_module('SVDSimpleClusterizer', Clusters="SVDClusters")
43 
44 # add tracking recontruction
45 add_tracking_reconstruction(main, components=['SVD'])
46 # remove cut on CoG in SpacePointCreator
47 for module in main.modules():
48  if module.name() == 'SVDSpacePointCreator':
49  module.param("MinClusterTime", -999)
50 
51 main.add_module('VXDDedxPID', enableDebugOutput=True)
52 
53 main.add_module(
54  'RootOutput',
55  outputFileName=fileOUT,
56  branchNames=[
57  "SVDShaperDigits",
58  "SVDClusters",
59  "SVDRecoDigits",
60  "Tracks",
61  "RecoTracks",
62  "TracksToRecoTracks",
63  "TrackFitResults",
64  "MCParticles",
65  "SVDTrueHits",
66  "TracksToVXDDedxLikelihoods",
67  "TracksToVXDDedxTracks",
68  "VXDDedxLikelihoods",
69  "VXDDedxTracks"])
70 print_path(main)
71 main.add_module('ProgressBar')
72 # Process events
73 process(main)
74 print(statistics)