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