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