Belle II Software  release-05-01-25
test_dec_table.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 # Descriptor: script to test decay tables
4 
5 """
6 <header>
7  <output>../test.dst.root</output>
8  <contact>morda@pd.infn.it</contact>
9 </header>
10 """
11 
12 
13 from basf2 import *
14 from simulation import add_simulation
15 from reconstruction import add_reconstruction, add_mdst_output
16 from ROOT import Belle2
17 import glob
18 import sys
19 
20 
21 event_type = str(sys.argv[1])
22 set_random_seed(12345)
23 
24 # background (collision) files
25 bg = glob.glob('./BG/[A-Z]*.root')
26 
27 # create path
28 main = create_path()
29 
30 # specify number of events to be generated
31 eventinfosetter = register_module('EventInfoSetter')
32 eventinfosetter.param('evtNumList', [1000])
33 eventinfosetter.param('runList', [1])
34 eventinfosetter.param('expList', [1])
35 main.add_module(eventinfosetter)
36 
37 # generate BBbar events
38 evtgeninput = register_module('EvtGenInput')
39 evtgeninput.param('userDECFile', Belle2.FileSystem.findFile('/decfiles/dec/{0}.dec'.format(event_type)))
40 main.add_module(evtgeninput)
41 
42 # detector simulation
43 # add_simulation(main, bkgfiles=bg)
44 add_simulation(main)
45 
46 # reconstruction
47 add_reconstruction(main)
48 
49 # Finally add mdst output
50 output_filename = "test.dst.root"
51 add_mdst_output(main, filename=output_filename)
52 
53 # process events and print call statistics
54 process(main)
55 print(statistics)
CreateProdScripts.ColoredFormatter.format
def format(self, record)
Definition: CreateProdScripts.py:999
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