Belle II Software development
test_sim_reco.py
1#!/usr/bin/env python3
2
3
10
11import basf2 as b2
12from simulation import add_simulation
13from reconstruction import add_reconstruction
14
15numEvents = 2000
16
17# first register the modules
18
19b2.set_random_seed(1)
20
21eventinfosetter = b2.register_module('EventInfoSetter')
22eventinfosetter.param('expList', [0])
23eventinfosetter.param('runList', [1])
24eventinfosetter.param('evtNumList', [numEvents])
25
26eventinfoprinter = b2.register_module('EventInfoPrinter')
27
28evtgeninput = b2.register_module('EvtGenInput')
29evtgeninput.logging.log_level = b2.LogLevel.INFO
30
31# Create paths
32main = b2.create_path()
33
34# Add modules to paths
35main.add_module(eventinfosetter)
36main.add_module(eventinfoprinter)
37main.add_module(evtgeninput)
38add_simulation(main, components=['MagneticField', 'PXD'], usePXDDataReduction=False)
39add_reconstruction(main, components=['MagneticField', 'PXD'])
40
41
42main.add_module('RootOutput')
43
44# Process events
45b2.process(main)
46
47print(b2.statistics)