Belle II Software  release-08-01-10
pxdDataReduction.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 pxdROIFinder = b2.register_module('PXDROIFinder')
32 pxdROIFinder.logging.log_level = b2.LogLevel.DEBUG
33 # pxdROIFinder.logging.debug_level = 2
34 param_pxdROIFinder = {
35  'recoTrackListName': 'RecoTracks',
36  'PXDInterceptListName': 'PXDIntercepts',
37  'ROIListName': 'ROIs',
38 }
39 pxdROIFinder.param(param_pxdROIFinder)
40 
41 pxdROIFinderAnalysis = b2.register_module('PXDROIFinderAnalysis')
42 pxdROIFinderAnalysis.logging.log_level = b2.LogLevel.RESULT
43 pxdROIFinderAnalysis.logging.debug_level = 1
44 param_pxdROIFinderAnalysis = {
45  'recoTrackListName': 'RecoTracks',
46  'PXDInterceptListName': 'PXDIntercepts',
47  'ROIListName': 'ROIs',
48  'writeToRoot': True,
49  'rootFileName': 'pxdDataRedAnalysis_SVDCDC_MCTF_test',
50 }
51 pxdROIFinderAnalysis.param(param_pxdROIFinderAnalysis)
52 
53 # Create paths
54 main = b2.create_path()
55 
56 # Add modules to paths
57 main.add_module(eventinfosetter)
58 main.add_module(eventinfoprinter)
59 main.add_module(evtgeninput)
60 add_simulation(main, components=['SVD', 'CDC'], forceSetPXDDataReduction=True, usePXDDataReduction=False)
61 add_tracking_reconstruction(main, ['SVD', 'CDC'], mcTrackFinding=True)
62 main.add_module(pxdROIFinder)
63 main.add_module(pxdROIFinderAnalysis)
64 # display = register_module("Display")
65 # main.add_module(display)
66 
67 # Process events
68 b2.process(main)
69 
70 print(b2.statistics)