Belle II Software development
KLMK0LGenerate.py
1#!/usr/bin/env python3
2
3
10
11"""
12<header>
13 <output>KLMK0LOutput.root</output>
14 <contact>Leo Piilonen (piilonen@vt.edu)</contact>
15 <description>Generation of 2000 B -> J/psi K_L0 events for KLM validation.</description>
16</header>
17"""
18
19import basf2
20from simulation import add_simulation
21from reconstruction import add_reconstruction
22
23basf2.set_log_level(basf2.LogLevel.WARNING)
24
25# Fixed random seed
26basf2.set_random_seed(123456)
27
28# Create main path
29main = basf2.create_path()
30
31# Event data
32eventinfosetter = basf2.register_module('EventInfoSetter')
33eventinfosetter.param('evtNumList', [2000])
34
35# Evtgen and beam parameters.
36evtgen = basf2.register_module('EvtGenInput')
37evtgen.param('userDECFile', basf2.find_file('klm/validation/btojpsikl0.dec'))
38
39# Add progress bars
40progress = basf2.register_module('Progress')
41progressBar = basf2.register_module('ProgressBar')
42
43# Output
44output = basf2.register_module('RootOutput')
45output.param('outputFileName', '../KLMK0LOutput.root')
46
47# Add modules to main path
48main.add_module(eventinfosetter)
49main.add_module(evtgen)
50
51add_simulation(path=main)
52add_reconstruction(path=main)
53
54main.add_module(progress)
55main.add_module(progressBar)
56
57main.add_module(output)
58
59# Process the path
60basf2.process(main)