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