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 = 10000
16
17b2.set_random_seed(1)
18
19eventinfosetter = b2.register_module('EventInfoSetter')
20eventinfosetter.param('expList', [0])
21eventinfosetter.param('runList', [1])
22eventinfosetter.param('evtNumList', [numEvents])
23
24eventinfoprinter = b2.register_module('EventInfoPrinter')
25
26evtgeninput = b2.register_module('EvtGenInput')
27evtgeninput.logging.log_level = b2.LogLevel.INFO
28
29# Create paths
30main = b2.create_path()
31
32# Add modules to paths
33main.add_module(eventinfosetter)
34main.add_module(eventinfoprinter)
35main.add_module(evtgeninput)
36add_simulation(main)
37add_reconstruction(main)
38
39fil = b2.register_module('SVDShaperDigitsFromTracks')
40fil.param('outputINArrayName', 'SVDShaperDigitsFromTracks')
41main.add_module(fil)
42
43input_branches = [
44 'SVDShaperDigitsFromTracks',
45 'EventT0',
46 'SVDShaperDigits'
47]
48
49main.add_module("RootOutput", branchNames=input_branches, outputFileName="RootOutput_CoGCalibration_10k.root")
50
51b2.print_path(main)
52
53# Process events
54b2.process(main)
55
56print(b2.statistics)