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