Belle II Software  release-08-01-10
svdROIFinding.py
1 #!/usr/bin/env python3
2 
3 
10 
11 import basf2 as b2
12 from tracking import add_tracking_reconstruction
13 from simulation import add_simulation
14 
15 numEvents = 2000
16 
17 # first register the modules
18 
19 b2.set_random_seed(1)
20 
21 eventinfosetter = b2.register_module('EventInfoSetter')
22 eventinfosetter.param('expList', [0])
23 eventinfosetter.param('runList', [1])
24 eventinfosetter.param('evtNumList', [numEvents])
25 
26 eventinfoprinter = b2.register_module('EventInfoPrinter')
27 
28 evtgeninput = b2.register_module('EvtGenInput')
29 evtgeninput.logging.log_level = b2.LogLevel.INFO
30 
31 svdROIFinder = b2.register_module('SVDROIFinder')
32 svdROIFinder.logging.log_level = b2.LogLevel.DEBUG
33 # svdROIFinder.logging.debug_level = 2
34 param_svdROIFinder = {
35  'recoTrackListName': 'RecoTracks',
36  'SVDInterceptListName': 'SVDIntercepts',
37  'ROIListName': 'ROIs',
38  'tolerancePhi': 0.15,
39  'toleranceZ': 0.5,
40  # optimized performance
41  # 'sigmaSystU': 0.1,
42  # 'sigmaSystV': 0.1,
43  # 'numSigmaTotU': 10,
44  # 'numSigmaTotV': 10,
45  # 'maxWidthU': 2,
46  # 'maxWidthV': 6,
47  # official simulation
48  'sigmaSystU': 0.02,
49  'sigmaSystV': 0.02,
50  'numSigmaTotU': 10,
51  'numSigmaTotV': 10,
52  'maxWidthU': 0.5,
53  'maxWidthV': 0.5,
54 }
55 svdROIFinder.param(param_svdROIFinder)
56 
57 svdROIFinderAnalysis = b2.register_module('SVDROIFinderAnalysis')
58 svdROIFinderAnalysis.logging.log_level = b2.LogLevel.RESULT
59 svdROIFinderAnalysis.logging.debug_level = 1
60 param_svdROIFinderAnalysis = {
61  'recoTrackListName': 'RecoTracks',
62  'SVDInterceptListName': 'SVDIntercepts',
63  'ROIListName': 'ROIs',
64  'writeToRoot': True,
65  'rootFileName': 'svdDataRedAnalysis_SVDCDC_MCTF_test',
66 }
67 svdROIFinderAnalysis.param(param_svdROIFinderAnalysis)
68 
69 # Create paths
70 main = b2.create_path()
71 
72 # Add modules to paths
73 main.add_module(eventinfosetter)
74 main.add_module(eventinfoprinter)
75 main.add_module(evtgeninput)
76 add_simulation(main, components=['MagneticField', 'SVD', 'CDC'], usePXDDataReduction=False)
77 add_tracking_reconstruction(main, ['CDC'], mcTrackFinding=True)
78 main.add_module(svdROIFinder)
79 # main.add_module(svdROIFinderAnalysis)
80 # display = register_module("Display")
81 # main.add_module(display)
82 
83 # Process events
84 b2.process(main)
85 
86 print(b2.statistics)