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