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