Belle II Software  release-05-02-19
067_generate_mc.py
1 #!/usr/bin/env python3
2 
3 import basf2 as b2
4 import generators as ge
5 import simulation as si
6 import L1trigger as l1
7 import reconstruction as re
8 import mdst
9 
10 # Create the steering path
11 main = b2.Path()
12 
13 # Define number of events and experiment number
14 main.add_module('EventInfoSetter', evtNumList=[10], expList=[0])
15 
16 # Generate B0B0bar events
17 ge.add_evtgen_generator(
18  path=main,
19  finalstate='signal',
20  signaldecfile=b2.find_file('my_decay_file.dec')
21 )
22 
23 # Simulate the detector response
24 si.add_simulation(path=main)
25 
26 # Simulate the L1 trigger
27 l1.add_tsim(path=main)
28 
29 # Reconstruct the objects
30 re.add_reconstruction(path=main)
31 
32 # Create the mDST output file
33 mdst.add_mdst_output(path=main, filename='my_mdst_output.root')
34 
35 # Process the steering path
36 b2.process(path=main)
37 
38 # Finally, print out some statistics about the modules execution
39 print(b2.statistics)
mdst.add_mdst_output
def add_mdst_output(path, mc=True, filename='mdst.root', additionalBranches=[], dataDescription=None)
Definition: mdst.py:24