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