Belle II Software  release-08-01-10
Convert.py
1 #!/usr/bin/env python3
2 
3 
10 
11 import os
12 import basf2
13 from b2biiConversion import convertBelleMdstToBelleIIMdst
14 
15 os.environ['PGUSER'] = 'g0db'
16 
17 main = basf2.create_path()
18 
19 # add all modules necessary to read and convert the mdst file
20 inputfile = basf2.find_file('b2bii_input_evtgen_exp_07_BptoD0pip-D0toKpipi0-0.mdst', 'examples', False)
21 convertBelleMdstToBelleIIMdst(inputfile, applySkim=True, path=main)
22 
23 # Store the converted Belle II dataobjects in ROOT
24 output = basf2.register_module('RootOutput')
25 output.param('outputFileName', 'B2BII_Convert_Example.mdst.root')
26 main.add_module(output)
27 
28 # progress
29 main.add_module('Progress')
30 
31 basf2.process(main)
32 
33 # Print call statistics
34 print(basf2.statistics)