Belle II Software  release-08-01-10
KKGenGenerationMuMuOnly.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 import basf2
13 from beamparameters import add_beamparameters
14 
15 basf2.set_log_level(basf2.LogLevel.INFO)
16 
17 # main path
18 main = basf2.create_path()
19 
20 # event info setter
21 main.add_module("EventInfoSetter", expList=0, runList=1, evtNumList=100)
22 
23 # beam parameters
24 beamparameters = add_beamparameters(main, "Y4S")
25 
26 # to run the framework the used modules need to be registered
27 kkgeninput = basf2.register_module('KKGenInput')
28 kkgeninput.param('tauinputFile', basf2.find_file('data/generators/kkmc/mu.input.dat'))
29 kkgeninput.param('KKdefaultFile', basf2.find_file('data/generators/kkmc/KK2f_defaults.dat'))
30 kkgeninput.param('taudecaytableFile', '')
31 kkgeninput.param('kkmcoutputfilename', 'kkmc_mumu.txt')
32 
33 # run
34 main.add_module("Progress")
35 main.add_module(kkgeninput)
36 main.add_module("RootOutput", outputFileName="kkmc_mumu.root")
37 main.add_module("PrintMCParticles", logLevel=basf2.LogLevel.INFO, onlyPrimaries=False)
38 
39 # generate events
40 basf2.process(main)
41 
42 # show call statistics
43 print(basf2.statistics)