Belle II Software  release-08-01-10
pxdDataReductionDigits.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 = 100
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 # PXD digitization module
42 PXDDIGI = b2.register_module('PXDDigitizer')
43 
44 pxdDigitFilter = b2.register_module('PXDdigiFilter')
45 pxdDigitFilter.param({'ROIidsName': 'ROIs', 'CreateOutside': True, 'overrideDB': True, 'usePXDDataReduction': True})
46 
47 # Create paths
48 main = b2.create_path()
49 
50 # Add modules to paths
51 main.add_module(eventinfosetter)
52 main.add_module(eventinfoprinter)
53 main.add_module(evtgeninput)
54 add_simulation(main, components=['PXD', 'SVD', 'CDC'], forceSetPXDDataReduction=True, usePXDDataReduction=False)
55 add_tracking_reconstruction(main, ['SVD', 'CDC'])
56 main.add_module(pxdROIFinder)
57 main.add_module(PXDDIGI)
58 main.add_module(pxdDigitFilter)
59 # display = register_module("Display")
60 # main.add_module(display)
61 
62 main.add_module('RootOutput')
63 
64 # Process events
65 b2.process(main)
66 
67 print(b2.statistics)