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