Belle II Software  light-2403-persian
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['USE_GRAND_REPROCESS_DATA'] = '1'
16 os.environ['PGUSER'] = 'g0db'
17 
18 main = basf2.create_path()
19 
20 # add all modules necessary to read and convert the mdst file
21 inputfile = basf2.find_file('b2bii_input_evtgen_exp_07_BptoD0pip-D0toKpipi0-0.mdst', 'examples', False)
22 convertBelleMdstToBelleIIMdst(inputfile, applySkim=True, path=main)
23 
24 # Store the converted Belle II dataobjects in ROOT
25 output = basf2.register_module('RootOutput')
26 output.param('outputFileName', 'B2BII_Convert_Example.mdst.root')
27 main.add_module(output)
28 
29 # progress
30 main.add_module('Progress')
31 
32 basf2.process(main)
33 
34 # Print call statistics
35 print(basf2.statistics)