Belle II Software  release-05-02-19
example.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 
15 
16 from basf2 import *
17 from simulation import add_simulation
18 from L1trigger import add_tsim
19 from reconstruction import add_reconstruction, add_cdst_output
20 from mdst import add_mdst_output
21 
22 # create path
23 main = create_path()
24 
25 # specify number of events to be generated
26 main.add_module('EventInfoSetter', evtNumList=[10])
27 
28 # print event numbers
29 main.add_module('EventInfoPrinter')
30 
31 # generate BBbar events
32 main.add_module('EvtGenInput')
33 
34 # detector simulation
35 add_simulation(main)
36 # or add_simulation(main, components) to simulate a selection of detectors
37 
38 # trigger simulation
39 add_tsim(main)
40 
41 # reconstruction
42 add_reconstruction(main)
43 # or add_reconstruction(main, components) to run the reconstruction of a selection of detectors
44 
45 # full output
46 main.add_module('RootOutput', outputFileName='output.root')
47 
48 # mdst output
49 add_mdst_output(main)
50 
51 # cdst output (for calibration)
52 # add_cdst_output(main)
53 
54 # process events and print call statistics
55 process(main)
56 print(statistics)