Belle II Software  release-08-01-10
PhokharaGenerationOnly.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 import basf2
13 
14 # Set the global log level
15 basf2.set_log_level(basf2.LogLevel.INFO)
16 
17 main = basf2.create_path()
18 
19 main.add_module("EventInfoSetter", expList=0, runList=1, evtNumList=100)
20 
21 # Register the PHOKHARA module
22 phokhara = basf2.register_module('PhokharaInput')
23 
24 # Set the logging level for the PHOKHARA module to INFO in order to see the cross sections etc.
25 phokhara.set_log_level(basf2.LogLevel.INFO)
26 
27 # Set the parameter file (EXPERTS ONLY!)
28 # phokhara.param('ParameterFile', 'test.dat')
29 
30 # Set the final state particles
31 # mu+mu-(0), pi+pi-(1), 2pi0pi+pi-(2), 2pi+2pi-(3), ppbar(4), nnbar(5), K+K-(6),
32 # K0K0bar(7), pi+pi-pi0(8), lamb(->pi-p)lambbar(->pi+pbar)(9), eta pi+ pi- (10)
33 phokhara.param('FinalState', 0)
34 
35 # soft photon cutoff, final result is indepedent of the cut off as long as its small (<1e-3)
36 # photon multiplicity (and exclusive cross sections depent on that parameter)
37 # EXPERTS ONLY
38 phokhara.param('Epsilon', 0.0001)
39 
40 # Events (weighted) to be used for maximum weight search before generation
41 phokhara.param('SearchMax', 5000)
42 
43 # Events (unweighted) before event loop is aborted
44 phokhara.param('nMaxTrials', 25000)
45 
46 # LO switch --> Born corresponds to 1 photon (0), Born corresponds to 0 photons (1), only Born: 0 photons (-1)
47 # original comment: ph0 Born: 1ph(0), Born: 0ph(1), only Born: 0ph(-1)
48 phokhara.param('LO', 0)
49 
50 # NLO switch --> only for LO=0: off(0), on(1)
51 # original comment: 1 photon : Born(0), NLO(1)
52 phokhara.param('NLO', 1)
53 
54 # QED corrections: ISR only(0), ISR+FSR(1), ISR+INT+FSR(2), if NLO=1 only 0 and 2 are possible
55 # original comment: ISR only(0), ISR+FSR(1), ISR+INT+FSR(2)
56 phokhara.param('QED', 0)
57 
58 # NLO options (only if NLO=1 and QED=2) - CODE RUNS VERY (!) SLOW
59 # original comment: IFSNLO: no(0), yes(1)
60 phokhara.param('IFSNLO', 0)
61 
62 # Vacuum polarization switch: off (0), on (1, [by Fred Jegerlehner, alphaQED/hadr5]), on (2,[by Thomas Teubner])
63 phokhara.param('Alpha', 0)
64 
65 # Pion FormFactor switch
66 # original comment: FF_pion: KS PionFormFactor(0),GS old (1),GS new (2)
67 phokhara.param('PionFF', 0)
68 
69 # Kaon FormFactor switch
70 # original comment: FF_kaon: KaonFormFactor constrained (0),KaonFormFactor unconstrained (1),KaonFormFactor old (2)
71 phokhara.param('KaonFF', 0)
72 
73 # Pion Structure
74 # original comment: for pi+pi- only: f0+f0(600): K+K- model(0), "no structure" model(1), no f0+f0(600)(2), f0 KLOE(3)
75 phokhara.param('PionStructure', 0)
76 
77 # Include narrow resonances (no Upsilon included yet!!!): no narrow resonances (0), j/psi (1) OR psi2s (2)
78 # original comment: narr_res: no narrow resonances (0), J/psi (1) and psi(2S) (2) only for pion = 0,1,6,7
79 phokhara.param('NarrowRes', 0)
80 
81 # Proton FormFactor switch
82 # original comment: FF_pp: ProtonFormFactor old(0), ProtonFormFactor new(1)
83 phokhara.param('ProtonFF', 1)
84 
85 # min/max angle of the photon
86 # original comment: minimal photon angle/missing momentum angle, maximal photon angle/missing momentum angle
87 phokhara.param('ScatteringAngleRangePhoton', [0., 180.])
88 
89 # min/max angle of the other final state particles
90 # original comment: minimal pions(muons,nucleons,kaons) angle, maximal pions(muons,nucleons,kaons) angle
91 phokhara.param('ScatteringAngleRangeFinalStates', [0., 180.])
92 
93 # Minimal hadrons/muons-gamma invariant mass squared [GeV^2]
94 # original comment: minimal hadrons(muons)-gamma-inv. mass squared
95 phokhara.param('MinInvMassHadronsGamma', 0.)
96 
97 # Minimal hadrons/muons invariant mass squared [GeV^2]
98 # original comment: minimal inv. mass squared of the hadrons(muons)
99 phokhara.param('MinInvMassHadrons', 0.5)
100 
101 # Maximal hadrons/muons invariant mass squared [GeV^2]
102 # original comment: maximal inv. mass squared of the hadrons(muons)
103 phokhara.param('MaxInvMassHadrons', 105.0)
104 
105 # Minimal photon energy/missing energy, must be larger than 0.01*(CMS energy) [GeV]
106 # original comment: minimal photon energy/missing energy
107 phokhara.param('MinEnergyGamma', 0.25)
108 
109 # output
110 output = basf2.register_module('RootOutput')
111 output.param('outputFileName', './phokhara_out.root')
112 
113 # Create the main path and add the modules
114 main.add_module("Progress")
115 main.add_module(phokhara)
116 main.add_module(output)
117 main.add_module("PrintMCParticles", logLevel=basf2.LogLevel.DEBUG, onlyPrimaries=False)
118 
119 # generate events
120 basf2.process(main)
121 
122 # show call statistics
123 print(basf2.statistics)