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