Belle II Software development
AafhGeneration.py
1#!/usr/bin/env python3
2
3
10
11
17
18from basf2 import set_log_level, LogLevel, create_path, process, register_module
19
20# suppress messages and during processing:
21set_log_level(LogLevel.WARNING)
22
23main = create_path()
24
25# event info setter
26main.add_module("EventInfoSetter", expList=0, runList=1, evtNumList=100)
27
28# generator
29aafh = register_module('AafhInput')
30aafh.param({
31 # decay mode to generate.
32 # 1: e+e- -> mu+mu-L+L- where L is a user defined particle (default: tau)
33 # 2: e+e- -> mu+mu-mu+mu-
34 # 3: e+e- -> e+e-mu+mu-
35 # 4: e+e- -> e+e-L+L- where L is a user defined particle (default: tau)
36 # 5: e+e- -> e+e-e+e-
37 'mode': 3,
38 # to set the particle for modes 1 and 4 use set parameter "particle"
39 # rejection scheme to generate unweighted events
40 # 1: use rejection once for the final event weight
41 # 2: use rejection per sub generator and then for the final event
42 'rejection': 2,
43 # max subgenerator event weight, only used if rejection is set to 2
44 # (default). If this value is to low the generation will produce errors. If
45 # it is to high generation runs slower.
46 'maxSubgeneratorWeight': 1.0,
47 # max final event weight which is always used. If this value is to low the
48 # generation will produce errors. If it is to high generation runs slower.
49 # ==> should be around 2-4
50 'maxFinalWeight': 1.5,
51 # adjust subgenerator weights so that each sub generator has same
52 # probability to be called and the maximum weight is equal as well. These
53 # values are printed at the end of generation when output level is set to
54 # INFO. These weights strongly depend on the mode
55 'subgeneratorWeights': [1.000e+00, 2.216e+01, 3.301e+03, 6.606e+03, 1.000e+00, 1.675e+00, 5.948e+00, 6.513e+00],
56 # set to awfully precise
57 'suppressionLimits': [1e100] * 4,
58 # minimum invariant mass of the secondary pair
59 'minMass': 0.50,
60})
61aafh.logging.log_level = LogLevel.INFO
62
63# print generated particles
64mcparticleprinter = register_module('PrintMCParticles')
65mcparticleprinter.logging.log_level = LogLevel.INFO
66
67# creating the path for the processing
68main.add_module(aafh)
69main.add_module(mcparticleprinter)
70
71# process the events
72process(main)