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