Belle II Software  release-08-01-10
RootToHepEvt.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 import basf2
13 
14 # Set the global log level
15 basf2.set_log_level(basf2.LogLevel.INFO)
16 
17 main = basf2.create_path()
18 
19 # Register the input module
20 myinput = basf2.register_module('RootInput')
21 myinput.param('inputFileName', './input.root')
22 
23 # Register the output module
24 myoutput = basf2.register_module('HepevtOutput')
25 myoutput.param('OutputFilename', './output.hepevt')
26 
27 # Register the Progress module and the Python histogram module
28 myprogress = basf2.register_module('Progress')
29 
30 main.add_module(myprogress)
31 main.add_module(myinput)
32 main.add_module(myoutput)
33 main.add_module("PrintMCParticles", logLevel=basf2.LogLevel.DEBUG, onlyPrimaries=False)
34 
35 # generate events
36 basf2.process(main)
37 
38 # show call statistics
39 print(basf2.statistics)