Belle II Software development
BBBremGenerationOnly.py
1#!/usr/bin/env python3
2
3
10
11
17
18import basf2
19
20# Set the global log level
21basf2.set_log_level(basf2.LogLevel.INFO)
22
23main = basf2.create_path()
24
25main.add_module("EventInfoSetter", expList=0, runList=1, evtNumList=10000)
26
27# Register the BBBremInput module
28bbbrem = basf2.register_module('BBBremInput')
29
30# Set the fraction of the minimum photon energy.
31# bbbrem.param('MinPhotonEnergyFraction', 0.000001)
32
33# Produce unweighted or weighted events.
34bbbrem.param('Unweighted', True)
35
36# Set the max weight (only for Unweighted=True).
37bbbrem.param('MaxWeight', 5.0e6)
38
39# Set the mode for bunch density correction (none=0, hard=1 (default), soft=2).
40bbbrem.param('DensityCorrectionMode', 1)
41
42# Set the Density correction parameter tc.
43bbbrem.param('DensityCorrectionParameter', 1.68e-17)
44
45# Set the logging level for the BBBREM module to INFO
46# bbbrem.set_log_level(LogLevel.INFO)
47
48# Register the Progress module and the Python histogram module
49progress = basf2.register_module('Progress')
50
51# output
52output = basf2.register_module('RootOutput')
53output.param('outputFileName', './bbbremgen.root')
54
55# Create the main path and add the modules
56
57main.add_module(progress)
58main.add_module(bbbrem)
59
60main.add_module("PrintMCParticles", logLevel=basf2.LogLevel.DEBUG, onlyPrimaries=False)
61
62main.add_module(output)
63
64# generate events
65basf2.process(main)
66
67# show call statistics
68print(basf2.statistics)