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