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