Belle II Software  release-08-01-10
test_sim_reco.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 import basf2 as b2
13 from simulation import add_simulation
14 from reconstruction import add_reconstruction
15 
16 numEvents = 10000
17 
18 b2.set_random_seed(1)
19 
20 eventinfosetter = b2.register_module('EventInfoSetter')
21 eventinfosetter.param('expList', [0])
22 eventinfosetter.param('runList', [1])
23 eventinfosetter.param('evtNumList', [numEvents])
24 
25 eventinfoprinter = b2.register_module('EventInfoPrinter')
26 
27 evtgeninput = b2.register_module('EvtGenInput')
28 evtgeninput.logging.log_level = b2.LogLevel.INFO
29 
30 # Create paths
31 main = b2.create_path()
32 
33 # Add modules to paths
34 main.add_module(eventinfosetter)
35 main.add_module(eventinfoprinter)
36 main.add_module(evtgeninput)
37 add_simulation(main)
38 add_reconstruction(main)
39 
40 fil = b2.register_module('SVDShaperDigitsFromTracks')
41 fil.param('outputINArrayName', 'SVDShaperDigitsFromTracks')
42 main.add_module(fil)
43 
44 input_branches = [
45  'SVDShaperDigitsFromTracks',
46  'EventT0',
47  'SVDShaperDigits'
48 ]
49 
50 main.add_module("RootOutput", branchNames=input_branches, outputFileName="RootOutput_CoGCalibration_10k.root")
51 
52 b2.print_path(main)
53 
54 # Process events
55 b2.process(main)
56 
57 print(b2.statistics)