Belle II Software  release-06-02-00
evaluatePerformance.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 import basf2 as b2
13 from simulation import add_simulation
14 from svd import add_svd_reconstruction
15 from tracking import add_tracking_reconstruction
16 import glob
17 
18 numEvents = 2000
19 
20 bkgFiles = glob.glob('/sw/belle2/bkg/*.root') # Phase3 background
21 bkgFiles = None # uncomment to remove background
22 simulateJitter = False
23 
24 ROIfinding = False
25 Phase2 = False
26 MCTracking = True
27 # set this string to identify the output rootfiles
28 tag = "_Y4S_noJitter_noBKG_noROI_MCTF.root"
29 
30 main = b2.create_path()
31 
32 b2.set_random_seed(1)
33 
34 expList = [0]
35 if Phase2:
36  expList = [1002]
37 
38 eventinfosetter = b2.register_module('EventInfoSetter')
39 eventinfosetter.param('expList', expList)
40 eventinfosetter.param('runList', [0])
41 eventinfosetter.param('evtNumList', [numEvents])
42 main.add_module(eventinfosetter)
43 main.add_module('EventInfoPrinter')
44 main.add_module('EvtGenInput')
45 
46 add_simulation(
47  main,
48  bkgfiles=bkgFiles,
49  usePXDDataReduction=ROIfinding,
50  simulateT0jitter=simulateJitter)
51 
52 add_svd_reconstruction(main)
53 
54 '''
55 add_tracking_reconstruction(
56  main,
57  components=["SVD"],
58  mcTrackFinding=MCTracking,
59  trackFitHypotheses=[211],
60  skipHitPreparerAdding=True)
61 
62 
63 tag = "_Y4S_jitter10ns_wBKG_noROI_MCTF.root"
64 clseval = b2.register_module('SVDClusterEvaluationTrueInfo')
65 clseval.param('outputFileName', "ClusterEvaluationTrueInfo" + str(tag))
66 main.add_module(clseval)
67 
68 svdperf = b2.register_module('SVDPerformance')
69 svdperf.param('outputFileName', "SVDPerformance" + str(tag))
70 main.add_module(svdperf)
71 '''
72 # main.add_module('RootOutput')
73 main.add_module('Progress')
74 
75 b2.print_path(main)
76 
77 b2.process(main)
78 
79 print(b2.statistics)