Belle II Software  release-08-01-10
test_sim_reco.py
1 #!/usr/bin/env python3
2 
3 
10 
11 import basf2 as b2
12 from simulation import add_simulation
13 from reconstruction import add_reconstruction
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 # Create paths
32 main = b2.create_path()
33 
34 # Add modules to paths
35 main.add_module(eventinfosetter)
36 main.add_module(eventinfoprinter)
37 main.add_module(evtgeninput)
38 add_simulation(main, components=['MagneticField', 'PXD'], usePXDDataReduction=False)
39 add_reconstruction(main, components=['MagneticField', 'PXD'])
40 
41 
42 main.add_module('RootOutput')
43 
44 # Process events
45 b2.process(main)
46 
47 print(b2.statistics)