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