Belle II Software  release-05-01-25
test0_TauGeneric.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 # Descriptor: tau generic decays
4 
5 """
6 <header>
7  <output>../TauGeneric.dst.root, kkmc_tautau.txt</output>
8  <contact>kenji@hepl.phys.nagoya-u.ac.jp</contact>
9 </header>
10 """
11 
12 from beamparameters import add_beamparameters
13 import basf2 as b2
14 from simulation import add_simulation
15 from reconstruction import add_reconstruction, add_mdst_output
16 from ROOT import Belle2
17 
18 b2.set_random_seed(12345)
19 
20 # background (collision) files
21 # bg = glob.glob('./BG/[A-Z]*.root')
22 
23 # main path
24 main = b2.create_path()
25 
26 # specify number of events to be generated
27 eventinfosetter = b2.register_module('EventInfoSetter')
28 eventinfosetter.param('evtNumList', [5000])
29 eventinfosetter.param('runList', [1])
30 eventinfosetter.param('expList', [0])
31 main.add_module(eventinfosetter)
32 
33 # beam parameters
34 beamparameters = add_beamparameters(main, "Y4S")
35 
36 # generator
37 kkgeninput = b2.register_module('KKGenInput')
38 kkgeninput.param('tauinputFile', Belle2.FileSystem.findFile('data/generators/kkmc/tau.input.dat'))
39 kkgeninput.param('KKdefaultFile', Belle2.FileSystem.findFile('data/generators/kkmc/KK2f_defaults.dat'))
40 kkgeninput.param('taudecaytableFile', Belle2.FileSystem.findFile('data/generators/kkmc/tau_decaytable.dat'))
41 kkgeninput.param('kkmcoutputfilename', 'kkmc_tautau.txt')
42 main.add_module(kkgeninput)
43 
44 # detector simulation
45 # add_simulation(main, bkgfiles=bg)
46 add_simulation(main)
47 
48 # reconstruction
49 add_reconstruction(main)
50 
51 # Finally add mdst output
52 output_filename = "../TauGeneric.dst.root"
53 add_mdst_output(main, filename=output_filename)
54 
55 # process events and print call statistics
56 b2.process(main)
57 print(b2.statistics)
Belle2::FileSystem::findFile
static std::string findFile(const std::string &path, bool silent=false)
Search for given file or directory in local or central release directory, and return absolute path if...
Definition: FileSystem.cc:147