Belle II Software development
KKGenGenerationOnly_tauola_bbb.py
1#!/usr/bin/env python3
2
3
10
11import basf2 as b2
12from beamparameters import add_beamparameters
13
14b2.set_random_seed(12345)
15b2.set_log_level(b2.LogLevel.INFO)
16
17# main path
18main = b2.create_path()
19
20# event info setter
21main.add_module("EventInfoSetter", expList=0, runList=1, evtNumList=1000000)
22
23# beam parameters
24beamparameters = add_beamparameters(main, "Y4S")
25# beamparameters.param("generateCMS", True)
26# beamparameters.param("smearVertex", False)
27
28# to run the framework the used modules need to be registered
29kkgeninput = b2.register_module('KKGenInput')
30kkgeninput.param('tauinputFile', b2.find_file('data/generators/kkmc/tauola_bbb.input.dat'))
31kkgeninput.param('KKdefaultFile', b2.find_file('data/generators/kkmc/KK2f_defaults.dat'))
32# kkgeninput.param('taudecaytableFile', b2.find_file('data/generators/kkmc/tau_decaytable.dat'))
33# above line makes decay table to be read by Pythia; uncomment next line to make tau decay table to be read by Tauola
34kkgeninput.param('taudecaytableFile', '')
35kkgeninput.param('kkmcoutputfilename', 'kkmc_tautau_bbb.txt')
36
37# run
38main.add_module("Progress")
39main.add_module(kkgeninput)
40main.add_module("RootOutput", outputFileName="kkmc_tautau_bbb.root")
41main.add_module("HepMCOutput", OutputFilename='kkmc_tautau_bbb.hepmc', StoreVirtualParticles=True)
42# main.add_module("PrintTauTauMCParticles", logLevel=LogLevel.INFO, onlyPrimaries=False)
43# main.add_module("PrintMCParticles", logLevel=LogLevel.INFO, onlyPrimaries=False)
44
45# generate events
46b2.process(main)
47
48# show call statistics
49print(b2.statistics)