Belle II Software development
PhokharaEvtgenGenerate.py
1#!/usr/bin/env python3
2
3"""
4<header>
5 <output>PhokharaEvtgenData.root</output>
6 <contact>Kirill Chilikin (K.A.Chilikin@inp.nsk.su)</contact>
7 <description>Generation of 25000 e+ e- -> J/psi eta_c events.</description>
8</header>
9"""
10
11import basf2
12import generators
13from ROOT import Belle2
14
15# Logging level.
16basf2.set_log_level(basf2.LogLevel.INFO)
17
18# Random seed.
19basf2.set_random_seed(12345)
20
21## \cond Doxygen_suppress
22
23# Create the main path.
24main = basf2.create_path()
25
26# Event information
27main.add_module("EventInfoSetter", expList=0, runList=1, evtNumList=25000)
28
29# Add combination of PHOKHARA and EvtGen.
30user_decay_file_name = 'generators/examples/PhokharaEvtgenDoubleCharmonium.dec'
31user_decay_file = Belle2.FileSystem.findFile(user_decay_file_name)
32generators.add_phokhara_evtgen_combination(
33 main, ['J/psi', 'eta_c'], user_decay_file, beam_energy_spread=False)
34
35# Output.
36output = basf2.register_module('RootOutput')
37output.param('outputFileName', 'PhokharaEvtgenData.root')
38main.add_module(output)
39
40
41
42# Progress.
43main.add_module('Progress')
44
45# Generate events.
46basf2.process(main)
47
48# Show call statistics.
49print(basf2.statistics)