HNLs: generate_form_Factors.py

File generate_form_Factors.py, 26.7 KB (added by ManuelGonzalezLopez, 3 years ago)

Script to generate energy-dependent form factors.

Line 
1import os
2import sys
3
4path = sys.argv[1]
5
6# The directory Fortran is created
7
8os.mkdir(path + 'Fortran')
9
10# The files lorentz.py, vertices.py and parameters.py are renamed as *_old.py to keep the originals
11
12vertices = path + 'vertices.py'
13vertices_old = path + 'vertices_old.py'
14lorentz = path + 'lorentz.py'
15lorentz_old = path + 'lorentz_old.py'
16parameters = path + 'parameters.py'
17parameters_old = path + 'parameters_old.py'
18
19os.rename(vertices, vertices_old)
20os.rename(lorentz, lorentz_old)
21os.rename(parameters, parameters_old)
22
23###############################
24###############################
25###############################
26###############################
27
28# We modify the file vertices to include the functions FFSS1 to FFSS9
29
30with open(vertices_old) as f:
31 content = f.readlines()
32content = [x.strip() for x in content]
33
34# We asign the Lorentz functions FFSS1, FFSS2, and FFSS3 to the semileptonic D -> K lepton neutrino
35
36# We asign the Lorentz functions FFSS4, FFSS5, and FFSS6 to the semileptonic K -> Pi0 lepton neutrino
37
38# We asign the Lorentz functions FFSS7, FFSS8, and FFSS9 to the semileptonic K0 -> Pi lepton neutrino
39
40# We asign the Lorentz functions FFSS10, FFSS11, and FFSS12 to the semileptonic B -> Pi0 lepton neutrino
41
42# We asign the Lorentz functions FFSS13, FFSS14, and FFSS15 to the semileptonic B0-> Pi lepton neutrino
43
44# We asign the Lorentz functions FFSS16, FFSS17, and FFSS18 to the semileptonic B -> D0 lepton neutrino
45
46# We asign the Lorentz functions FFSS19, FFSS20, and FFSS21 to the semileptonic B0 -> D lepton neutrino
47
48# We asign the Lorentz functions FFSS22, FFSS23, and FFSS24 to the semileptonic Bs0 -> Ds lepton neutrino
49
50# We asign the Lorentz functions FFSS25, FFSS26, and FFSS27 to the semileptonic Bs0 -> K lepton neutrino
51
52subs1 = 'P.D__minus__, P.K0bar ]'
53subs2 = 'P.D__plus__, P.K0 ]'
54subs3 = 'P.D0bar, P.K__minus__ ]'
55subs4 = 'P.D0, P.K__plus__ ]'
56subs5 = 'P.K__minus__, P.Pi0 ]'
57subs6 = 'P.K__plus__, P.Pi0 ]'
58subs7 = 'P.K0bar, P.Pi__minus__ ]'
59subs8 = 'P.K0, P.Pi__plus__ ]'
60subs9 = 'P.B__plus__, P.Pi0 ]'
61subs10 = 'P.B__minus__, P.Pi0 ]'
62subs11 = 'P.B0bar, P.Pi__minus__ ]'
63subs12 = 'P.B0, P.Pi__plus__ ]'
64subs13 = 'P.B__plus__, P.D0 ]'
65subs14 = 'P.B__minus__, P.D0bar ]'
66subs15 = 'P.B0bar, P.D__minus__ ]'
67subs16 = 'P.B0, P.D__plus__ ]'
68subs17 = 'P.B0sbar, P.Ds__minus__ ]'
69subs18 = 'P.B0s, P.Ds__plus__ ]'
70subs19 = 'P.B0sbar, P.K__minus__ ]'
71subs20 = 'P.B0s, P.K__plus__ ]'
72
73for i in range(len(content)):
74 if subs1 in content[i] or subs2 in content[i] or subs3 in content[i] or subs4 in content[i]:
75 content[i+2]='lorentz = [ L.FFSS1, L.FFSS2, L.FFSS3 ],'
76 if subs5 in content[i] or subs6 in content[i]:
77 content[i+2]='lorentz = [ L.FFSS4, L.FFSS5, L.FFSS6 ],'
78 if subs7 in content[i] or subs8 in content[i]:
79 content[i+2]='lorentz = [ L.FFSS7, L.FFSS8, L.FFSS9 ],'
80 if subs9 in content[i] or subs10 in content[i]:
81 content[i+2]='lorentz = [ L.FFSS10, L.FFSS11, L.FFSS12 ], '
82 if subs11 in content[i] or subs12 in content[i]:
83 content[i+2]='lorentz = [ L.FFSS13, L.FFSS14, L.FFSS15 ],'
84 if subs13 in content[i] or subs14 in content[i]:
85 content[i+2]='lorentz = [ L.FFSS16, L.FFSS17, L.FFSS18 ],'
86 if subs15 in content[i] or subs16 in content[i]:
87 content[i+2]='lorentz = [ L.FFSS19, L.FFSS20, L.FFSS21 ],'
88 if subs17 in content[i] or subs18 in content[i]:
89 content[i+2]='lorentz = [ L.FFSS22, L.FFSS23, L.FFSS24 ],'
90 if subs19 in content[i] or subs20 in content[i]:
91 content[i+2]='lorentz = [ L.FFSS25, L.FFSS26, L.FFSS27 ],'
92
93#We export the new vertices.py
94
95with open(vertices, 'w') as f:
96 for item in content:
97 f.write("%s\n" % item)
98
99###############################
100###############################
101###############################
102###############################
103
104# We modify the lorentz file to include the functions FFSS1 to FFSS9 that will be used by the vertices file
105
106with open(lorentz_old) as f:
107 content = f.readlines()
108content = [x.strip() for x in content]
109
110content[9]=' import form_factors as ForFac'
111content[11]=' pass'
112
113subs1 = 'FFSS1 ='
114subs2 = 'FFSS2 ='
115subs3 = 'FFSS3 ='
116
117for i in range(len(content)):
118 if subs1 in content[i]:
119 content[i+2]="structure = 'func2((P(-2,3)+P(-2,4))*(P(-2,3)+P(-2,4)))*ProjM(2,1)')"
120 if subs2 in content[i]:
121 content[i+2]="structure = 'func1((P(-2,3)+P(-2,4))*(P(-2,3)+P(-2,4)))*P(-1,4)*Gamma(-1,2,-2)*ProjM(-2,1)')"
122 if subs3 in content[i]:
123 content[i+2]="structure = 'func2((P(-2,3)+P(-2,4))*(P(-2,3)+P(-2,4)))*ProjP(2,1)')\n\nFFSS4 = Lorentz(name = 'FFSS4',\nspins = [ 2, 2, 1, 1 ],\nstructure = 'func4((P(-2,3)+P(-2,4))*(P(-2,3)+P(-2,4)))*ProjM(2,1)')\n\nFFSS5 = Lorentz(name = 'FFSS5',\nspins = [ 2, 2, 1, 1 ],\nstructure = 'func3((P(-2,3)+P(-2,4))*(P(-2,3)+P(-2,4)))*P(-1,4)*Gamma(-1,2,-2)*ProjM(-2,1)')\n\nFFSS6 = Lorentz(name = 'FFSS6',\nspins = [ 2, 2, 1, 1 ],\nstructure = 'func4((P(-2,3)+P(-2,4))*(P(-2,3)+P(-2,4)))*ProjP(2,1)')\n\nFFSS7 = Lorentz(name = 'FFSS7',\nspins = [ 2, 2, 1, 1 ],\nstructure = 'func6((P(-2,3)+P(-2,4))*(P(-2,3)+P(-2,4)))*ProjM(2,1)')\n\nFFSS8 = Lorentz(name = 'FFSS8',\nspins = [ 2, 2, 1, 1 ],\nstructure = 'func5((P(-2,3)+P(-2,4))*(P(-2,3)+P(-2,4)))*P(-1,4)*Gamma(-1,2,-2)*ProjM(-2,1)')\n\nFFSS9 = Lorentz(name = 'FFSS9',\nspins = [ 2, 2, 1, 1 ],\nstructure = 'func6((P(-2,3)+P(-2,4))*(P(-2,3)+P(-2,4)))*ProjP(2,1)')\n\nFFSS10 = Lorentz(name = 'FFSS10',\nspins = [ 2, 2, 1, 1 ],\nstructure = 'func8((P(-2,3)+P(-2,4))*(P(-2,3)+P(-2,4)))*ProjM(2,1)')\n\nFFSS11 = Lorentz(name = 'FFSS11',\nspins = [ 2, 2, 1, 1 ],\nstructure = 'func7((P(-2,3)+P(-2,4))*(P(-2,3)+P(-2,4)))*P(-1,4)*Gamma(-1,2,-2)*ProjM(-2,1)')\n\nFFSS12 = Lorentz(name = 'FFSS12',\nspins = [ 2, 2, 1, 1 ],\nstructure = 'func8((P(-2,3)+P(-2,4))*(P(-2,3)+P(-2,4)))*ProjP(2,1)')\n\nFFSS13 = Lorentz(name = 'FFSS13',\nspins = [ 2, 2, 1, 1 ],\nstructure = 'func10((P(-2,3)+P(-2,4))*(P(-2,3)+P(-2,4)))*ProjM(2,1)')\n\nFFSS14 = Lorentz(name = 'FFSS14',\nspins = [ 2, 2, 1, 1 ],\nstructure = 'func9((P(-2,3)+P(-2,4))*(P(-2,3)+P(-2,4)))*P(-1,4)*Gamma(-1,2,-2)*ProjM(-2,1)')\n\nFFSS15 = Lorentz(name = 'FFSS15',\nspins = [ 2, 2, 1, 1 ],\nstructure = 'func10((P(-2,3)+P(-2,4))*(P(-2,3)+P(-2,4)))*ProjP(2,1)')\n\nFFSS16 = Lorentz(name = 'FFSS16',\nspins = [ 2, 2, 1, 1 ],\nstructure = 'func12((P(-2,3)+P(-2,4))*(P(-2,3)+P(-2,4)))*ProjM(2,1)')\n\nFFSS17 = Lorentz(name = 'FFSS17',\nspins = [ 2, 2, 1, 1 ],\nstructure = 'func11((P(-2,3)+P(-2,4))*(P(-2,3)+P(-2,4)))*P(-1,4)*Gamma(-1,2,-2)*ProjM(-2,1)')\n\nFFSS18 = Lorentz(name = 'FFSS18',\nspins = [ 2, 2, 1, 1 ],\nstructure = 'func12((P(-2,3)+P(-2,4))*(P(-2,3)+P(-2,4)))*ProjP(2,1)')\n\nFFSS19 = Lorentz(name = 'FFSS19',\nspins = [ 2, 2, 1, 1 ],\nstructure = 'func14((P(-2,3)+P(-2,4))*(P(-2,3)+P(-2,4)))*ProjM(2,1)')\n\nFFSS20 = Lorentz(name = 'FFSS20',\nspins = [ 2, 2, 1, 1 ],\nstructure = 'func13((P(-2,3)+P(-2,4))*(P(-2,3)+P(-2,4)))*P(-1,4)*Gamma(-1,2,-2)*ProjM(-2,1)')\n\nFFSS21 = Lorentz(name = 'FFSS21',\nspins = [ 2, 2, 1, 1 ],\nstructure = 'func14((P(-2,3)+P(-2,4))*(P(-2,3)+P(-2,4)))*ProjP(2,1)')\n\nFFSS22 = Lorentz(name = 'FFSS22',\nspins = [ 2, 2, 1, 1 ],\nstructure = 'func16((P(-2,3)+P(-2,4))*(P(-2,3)+P(-2,4)))*ProjM(2,1)')\n\nFFSS23 = Lorentz(name = 'FFSS23',\nspins = [ 2, 2, 1, 1 ],\nstructure = 'func15((P(-2,3)+P(-2,4))*(P(-2,3)+P(-2,4)))*P(-1,4)*Gamma(-1,2,-2)*ProjM(-2,1)')\n\nFFSS24 = Lorentz(name = 'FFSS24',\nspins = [ 2, 2, 1, 1 ],\nstructure = 'func16((P(-2,3)+P(-2,4))*(P(-2,3)+P(-2,4)))*ProjP(2,1)')\n\nFFSS25 = Lorentz(name = 'FFSS25',\nspins = [ 2, 2, 1, 1 ],\nstructure = 'func18((P(-2,3)+P(-2,4))*(P(-2,3)+P(-2,4)))*ProjM(2,1)')\n\nFFSS26 = Lorentz(name = 'FFSS26',\nspins = [ 2, 2, 1, 1 ],\nstructure = 'func17((P(-2,3)+P(-2,4))*(P(-2,3)+P(-2,4)))*P(-1,4)*Gamma(-1,2,-2)*ProjM(-2,1)')\n\nFFSS27 = Lorentz(name = 'FFSS27',\nspins = [ 2, 2, 1, 1 ],\nstructure = 'func18((P(-2,3)+P(-2,4))*(P(-2,3)+P(-2,4)))*ProjP(2,1)')"
124
125
126with open(lorentz, 'w') as f:
127 for item in content:
128 f.write("%s\n" % item)
129
130
131
132# We modify the parameters file to set the average form factors to 1.
133
134
135with open(parameters_old) as f:
136 content = f.readlines()
137content = [x.strip() for x in content]
138
139for j in range(1,7):
140 for k in range (1,4):
141 subs1 = 'fplusDK%sx%s = Parameter' % (j, k)
142 subs2 = 'fminusDK%sx%s = Parameter' % (j, k)
143 subs3 = 'fplusKPi0%sx%s = Parameter' % (j, k)
144 subs4 = 'fminusKPi0%sx%s = Parameter' % (j, k)
145 subs5 = 'fplusK0Pi%sx%s = Parameter' % (j, k)
146 subs6 = 'fminusK0Pi%sx%s = Parameter' % (j, k)
147 subs7 = 'fplusBPi0%sx%s = Parameter' % (j, k)
148 subs8 = 'fminusBPi0%sx%s = Parameter' % (j, k)
149 subs9 = 'fplusB0Pi%sx%s = Parameter' % (j, k)
150 subs10 = 'fminusB0Pi%sx%s = Parameter' % (j, k)
151 subs11 = 'fplusBD0%sx%s = Parameter' % (j, k)
152 subs12 = 'fminusBD0%sx%s = Parameter' % (j, k)
153 subs13 = 'fplusB0D%sx%s = Parameter' % (j, k)
154 subs14 = 'fminusB0D%sx%s = Parameter' % (j, k)
155 subs15 = 'fplusB0sDs%sx%s = Parameter' % (j, k)
156 subs16 = 'fminusB0sDs%sx%s = Parameter' % (j, k)
157 subs17 = 'fplusB0sK%sx%s = Parameter' % (j, k)
158 subs18 = 'fminusB0sK%sx%s = Parameter' % (j, k)
159
160 for i in range(len(content)):
161 if subs1 in content[i] or subs3 in content[i] or subs5 in content[i] or subs7 in content[i] or subs9 in content[i] or subs11 in content[i] or subs13 in content[i] or subs15 in content[i] or subs17 in content[i]:
162 content[i+3] = "value = '1',"
163 if subs2 in content[i] or subs4 in content[i] or subs6 in content[i] or subs8 in content[i] or subs10 in content[i] or subs12 in content[i] or subs14 in content[i] or subs16 in content[i] or subs18 in content[i]:
164 content[i+3] = "value = '0',"
165
166with open(parameters, 'w') as f:
167 for item in content:
168 f.write("%s\n" % item)
169
170###############################
171###############################
172###############################
173###############################
174
175# We create the file functions.f inside the Fortran folder
176
177functions = path + 'Fortran/' + 'functions.f'
178
179with open(functions, 'w') as f:
180 f.write(' double complex function tp(m1,m2)\n'
181 ' implicit none\n'
182 ' double complex m1,m2\n'
183 ' real*8 rm1,rm2\n'
184 ' rm1=real(m1)\n'
185 ' rm2=real(m2)\n'
186 ' tp=(rm1+rm2)**2\n'
187 ' return\n'
188 ' end\n'
189 '\n'
190 ' double complex function t0(m1,m2)\n'
191 ' implicit none\n'
192 ' double complex m1,m2\n'
193 ' real*8 rm1,rm2\n'
194 ' rm1=real(m1)\n'
195 ' rm2=real(m2)\n'
196 ' t0=(rm1+rm2)*(sqrt(rm1)-sqrt(rm2))**2\n'
197 ' return\n'
198 ' end\n'
199 '\n'
200 ' double complex function z(Q,m1,m2)\n'
201 ' implicit none\n'
202 ' double complex Q,m1,m2,tp,t0\n'
203 ' real*8 rQ,rm1,rm2,rtp,rt0\n'
204 ' rQ=real(Q)\n'
205 ' rm1=real(m1)\n'
206 ' rm2=real(m2)\n'
207 ' rtp=real(tp(m1,m2))\n'
208 ' rt0=real(t0(m1,m2))\n'
209 ' z=(sqrt(rtp-rQ)-sqrt(rtp-rt0))/(sqrt(rtp-rQ)+sqrt(rtp-rt0))\n'
210 ' return\n'
211 ' end\n'
212 '\n'
213 ' double complex function fpDK(Q)\n'
214 ' implicit none\n'
215 ' double complex Q,z\n'
216 ' real*8 f00DK, cpDK, MD, MK, rQ, rz,rz0,P\n'
217 ' f00DK=0.7647\n'
218 ' cpDK=-0.066\n'
219 ' MD=1.86958\n'
220 ' MK=0.493677\n'
221 ' P=0.224\n'
222 ' rq=real(Q)\n'
223 ' rz=real(z(Q,MD,MK))\n'
224 ' rz0=real(z(0,MD,MK))\n'
225 ' fpDK=(f00DK+cpDK*(rz-rz0)*(1+0.5*(rz+rz0)))/(1-P*rQ)\n'
226 ' return\n'
227 ' end\n'
228 '\n'
229 ' double complex function f0DK(Q)\n'
230 ' implicit none\n'
231 ' double complex Q,z\n'
232 ' real*8 f00DK, c0DK, MD, MK,rQ,rz,rz0\n'
233 ' MD=1.86958\n'
234 ' MK=0.493677\n'
235 ' f00DK=0.7647\n'
236 ' c0DK=-2.084\n'
237 ' rQ=real(Q)\n'
238 ' rz=real(z(Q,MD,MK))\n'
239 ' rz0=real(z(0,MD,MK))\n'
240 ' f0DK=f00DK+c0DK*(rz-rz0)*(1+0.5*(rz+rz0))\n'
241 ' return\n'
242 ' end\n'
243 '\n'
244 ' double complex function fmDK(Q)\n'
245 ' implicit none\n'
246 ' double complex Q,f0DK,fpDK\n'
247 ' real*8 MD, MK,rQ,rf0DK,rfpDK\n'
248 ' MD=1.86958\n'
249 ' MK=0.493677\n'
250 ' rQ=real(Q)\n'
251 ' rf0DK=real(f0DK(Q))\n'
252 ' rfpDK=real(fpDK(Q))\n'
253 ' fmDK=(MK**2-MD**2)/rQ*(rf0DK-rfpDK)\n'
254 ' return\n'
255 ' end\n'
256 '\n'
257 ' double complex function func1(S)\n'
258 ' implicit none\n'
259 ' double complex S,fpDK\n'
260 ' func1=real(fpDK(S))\n'
261 ' return\n'
262 ' end\n'
263 '\n'
264 ' double complex function func2(S)\n'
265 ' implicit none\n'
266 ' double complex S,fpDK,fmDK\n'
267 ' func2=real(fpDK(S))-real(fmDK(S))\n'
268 ' return\n'
269 ' end\n'
270 '\n'
271 ' double complex function fpKPi0(Q)\n'
272 ' implicit none\n'
273 ' double complex Q\n'
274 ' real*8 rQ,f00KPi,lplusKPi0,MP,MPplus\n'
275 ' f00KPi=0.9709\n'
276 ' lplusKPi0=0.0297\n'
277 ' MP=0.13498\n'
278 ' MPplus=0.13957\n'
279 ' rQ=real(Q)\n'
280 ' fpKPi0=f00KPi*(1+lplusKPi0*rQ/MPplus**2)\n'
281 ' return\n'
282 ' end\n'
283 '\n'
284 ' double complex function f0KPi0(Q)\n'
285 ' implicit none\n'
286 ' double complex Q\n'
287 ' real*8 rQ,f00KPi,l0KPi0,MP,MPplus\n'
288 ' f00KPi=0.9709\n'
289 ' l0KPi0=0.0195\n'
290 ' MP=0.13498\n'
291 ' MPplus=0.13957\n'
292 ' rQ=real(Q)\n'
293 ' f0KPi0=f00KPi*(1+l0KPi0*rQ/MPplus**2)\n'
294 ' return\n'
295 ' end\n'
296 '\n'
297 ' double complex function fmKPi0(Q)\n'
298 ' implicit none\n'
299 ' double complex Q,f0KPi0,fpKPi0\n'
300 ' real*8 MK,MP,rQ,rf0KPi0,rfpKPi0\n'
301 ' MP=0.13498\n'
302 ' MK=0.493677\n'
303 ' rQ=real(Q)\n'
304 ' rf0KPi0=real(f0KPi0(Q))\n'
305 ' rfpKPi0=real(fpKPi0(Q))\n'
306 ' fmKPi0=(MP**2-MK**2)/rQ*(rf0KPi0-rfpKPi0)\n'
307 ' return\n'
308 ' end\n'
309 '\n'
310 ' double complex function func3(S)\n'
311 ' implicit none\n'
312 ' double complex S,fpKPi0\n'
313 ' func3=real(fpKPi0(S))\n'
314 ' return\n'
315 ' end\n'
316 '\n'
317 ' double complex function func4(S)\n'
318 ' implicit none\n'
319 ' double complex S,fpKPi0,fmKPi0\n'
320 ' func4=real(fpKPi0(S))-real(fmKPi0(S))\n'
321 ' return\n'
322 ' end\n'
323 '\n'
324 ' double complex function fpK0Pi(Q)\n'
325 ' implicit none\n'
326 ' double complex Q\n'
327 ' real*8 rQ,f00KPi,lplusK0Pi,MP\n'
328 ' f00KPi=0.9709\n'
329 ' lplusK0Pi=0.0282\n'
330 ' MP=0.13957\n'
331 ' rQ=real(Q)\n'
332 ' fpK0Pi=f00KPi*(1+lplusK0Pi*rQ/MP**2)\n'
333 ' return\n'
334 ' end\n'
335 '\n'
336 ' double complex function f0K0Pi(Q)\n'
337 ' implicit none\n'
338 ' double complex Q\n'
339 ' real*8 rQ,f00KPi,l0K0Pi,MP\n'
340 ' f00KPi=0.9709\n'
341 ' l0K0Pi=0.0138\n'
342 ' MP=0.13957\n'
343 ' rQ=real(Q)\n'
344 ' f0K0Pi=f00KPi*(1+l0K0Pi*rQ/MP**2)\n'
345 ' return\n'
346 ' end\n'
347 '\n'
348 ' double complex function fmK0Pi(Q)\n'
349 ' implicit none\n'
350 ' double complex Q,f0K0Pi,fpK0Pi\n'
351 ' real*8 MK0,MP,rQ,rf0K0Pi,rfpK0Pi\n'
352 ' MP=0.13957\n'
353 ' MK0=0.497611\n'
354 ' rQ=real(Q)\n'
355 ' rf0K0Pi=real(f0K0Pi(Q))\n'
356 ' rfpK0Pi=real(fpK0Pi(Q))\n'
357 ' fmK0Pi=(MP**2-MK0**2)/rQ*(rf0K0Pi-rfpK0Pi)\n'
358 ' return\n'
359 ' end\n'
360 '\n'
361 ' double complex function func5(S)\n'
362 ' implicit none\n'
363 ' double complex S,fpK0Pi\n'
364 ' func5=real(fpK0Pi(S))\n'
365 ' return\n'
366 ' end\n'
367 '\n'
368 ' double complex function func6(S)\n'
369 ' implicit none\n'
370 ' double complex S,fpK0Pi,fmK0Pi\n'
371 ' func6=real(fpK0Pi(S))-real(fmK0Pi(S))\n'
372 ' return\n'
373 ' end\n'
374 '\n'
375 ' double complex function fpBPi0(Q)\n'
376 ' implicit none\n'
377 ' double complex Q,z\n'
378 ' real*8 rQ,rz,a0pBPi,a1pBPi,a2pBPi,MBstar,MB,MPi0\n'
379 ' a0pBPi=0.404\n'
380 ' a1pBPi=-0.68\n'
381 ' a2pBPi=-0.86\n'
382 ' MBstar=5.3247\n'
383 ' MB=5.279\n'
384 ' MPi0=0.13498\n'
385 ' rQ=real(Q)\n'
386 ' rz=real(z(Q,MB,MPi0))\n'
387 ' fpBPi0=1/(1-rQ/MBstar**2)*(a0pBPi+a1pBPi*rz+a2pBPi*rz**2+(2*a2pBPi-a1pBPi)*rz**3/3)\n'
388 ' return\n'
389 ' end\n'
390 '\n'
391 ' double complex function f0BPi0(Q)\n'
392 ' implicit none\n'
393 ' double complex Q,z\n'
394 ' real*8 rQ,rz,a00BPi,a10Bpi,a20BPi,MB,MPi0\n'
395 ' a00BPi=0.49\n'
396 ' a10BPi=-1.61\n'
397 ' a20BPi=1.2528\n'
398 ' MB=5.279\n'
399 ' MPi0=0.13498\n'
400 ' rQ=real(Q)\n'
401 ' rz=real(z(Q,MB,MPi0))\n'
402 ' f0BPi0=a00BPi+a10BPi*rz+a20BPi*rz**2\n'
403 ' return\n'
404 ' end\n'
405 '\n'
406 ' double complex function fmBPi0(Q)\n'
407 ' implicit none\n'
408 ' double complex Q,f0BPi0,fpBPi0\n'
409 ' real*8 MB,MPi0,rQ,rf0BPi0,rfpBPi0\n'
410 ' MPi0=0.13498\n'
411 ' MB=5.279\n'
412 ' rQ=real(Q)\n'
413 ' rf0BPi0=real(f0BPi0(Q))\n'
414 ' rfpBPi0=real(fpBPi0(Q))\n'
415 ' fmBPi0=(MPi0**2-MB**2)/rQ*(rf0BPi0-rfpBPi0)\n'
416 ' return\n'
417 ' end\n'
418 '\n'
419 ' double complex function func7(S)\n'
420 ' implicit none\n'
421 ' double complex S,fpBPi0\n'
422 ' func7=real(fpBPi0(S))\n'
423 ' return\n'
424 ' end\n'
425 '\n'
426 ' double complex function func8(S)\n'
427 ' implicit none\n'
428 ' double complex S,fpBPi0,fmBPi0\n'
429 ' func8=real(fpBPi0(S))-real(fmBPi0(S))\n'
430 ' return\n'
431 ' end\n'
432 '\n'
433 ' double complex function fpB0Pi(Q)\n'
434 ' implicit none\n'
435 ' double complex Q,z\n'
436 ' real*8 rQ,rz,a0pBPi,a1pBPi,a2pBPi,MBstar,MB0,MPi\n'
437 ' a0pBPi=0.404\n'
438 ' a1pBPi=-0.68\n'
439 ' a2pBPi=-0.86\n'
440 ' MBstar=5.3247\n'
441 ' MB0=5.28\n'
442 ' MPi=0.13957\n'
443 ' rQ=real(Q)\n'
444 ' rz=real(z(Q,MB0,MPi))\n'
445 ' fpB0Pi=1/(1-rQ/MBstar**2)*(a0pBPi+a1pBPi*rz+a2pBPi*rz**2+(2*a2pBPi-a1pBPi)*rz**3/3)\n'
446 ' return\n'
447 ' end\n'
448 '\n'
449 ' double complex function f0B0Pi(Q)\n'
450 ' implicit none\n'
451 ' double complex Q,z\n'
452 ' real*8 rQ,rz,a00BPi,a10Bpi,a20BPi,MB0,MPi\n'
453 ' a00BPi=0.49\n'
454 ' a10BPi=-1.61\n'
455 ' a20BPi=1.2528\n'
456 ' MB0=5.28\n'
457 ' MPi=0.13957\n'
458 ' rQ=real(Q)\n'
459 ' rz=real(z(Q,MB0,MPi))\n'
460 ' f0B0Pi=a00BPi+a10BPi*rz+a20BPi*rz**2\n'
461 ' return\n'
462 ' end\n'
463 '\n'
464 ' double complex function fmB0Pi(Q)\n'
465 ' implicit none\n'
466 ' double complex Q,f0B0Pi,fpB0Pi\n'
467 ' real*8 MB0,MPi,rQ,rf0B0Pi,rfpB0Pi\n'
468 ' MPi=0.13957\n'
469 ' MB0=5.28\n'
470 ' rQ=real(Q)\n'
471 ' rf0B0Pi=real(f0B0Pi(Q))\n'
472 ' rfpB0Pi=real(fpB0Pi(Q))\n'
473 ' fmB0Pi=(MPi**2-MB0**2)/rQ*(rf0B0Pi-rfpB0Pi)\n'
474 ' return\n'
475 ' end\n'
476 '\n'
477 ' double complex function func9(S)\n'
478 ' implicit none\n'
479 ' double complex S,fpB0Pi\n'
480 ' func9=real(fpB0Pi(S))\n'
481 ' return\n'
482 ' end\n'
483 '\n'
484 ' double complex function func10(S)\n'
485 ' implicit none\n'
486 ' double complex S,fpB0Pi,fmB0Pi\n'
487 ' func10=real(fpB0Pi(S))-real(fmB0Pi(S))\n'
488 ' return\n'
489 ' end\n'
490 '\n'
491 ' double complex function fpBD0(Q)\n'
492 ' implicit none\n'
493 ' double complex Q,z\n'
494 ' real*8 rQ,rz,a0pBD,a1pBD,a2pBD,MBstar,MB,MD0\n'
495 ' a0pBD=0.909\n'
496 ' a1pBD=-7.11\n'
497 ' a2pBD=66\n'
498 ' MBstar=5.3247\n'
499 ' MB=5.28\n'
500 ' MD0=1.865\n'
501 ' rQ=real(Q)\n'
502 ' rz=real(z(Q,MB,MD0))\n'
503 ' fpBD0=1/(1-rQ/MBstar**2)*(a0pBD+a1pBD*rz+a2pBD*rz**2+(2*a2pBD-a1pBD)*rz**3/3)\n'
504 ' return\n'
505 ' end\n'
506 '\n'
507 ' double complex function f0BD0(Q)\n'
508 ' implicit none\n'
509 ' double complex Q,z\n'
510 ' real*8 rQ,rz,a00BD,a10BD,a20BD,MB,MD0\n'
511 ' a00BD=0.794\n'
512 ' a10BD=-2.45\n'
513 ' a20BD=33.21\n'
514 ' MB=5.279\n'
515 ' MD0=1.865\n'
516 ' rQ=real(Q)\n'
517 ' rz=real(z(Q,MB,MD0))\n'
518 ' f0BD0=a00BD+a10BD*rz+a20BD*rz**2\n'
519 ' return\n'
520 ' end\n'
521 '\n'
522 ' double complex function fmBD0(Q)\n'
523 ' implicit none\n'
524 ' double complex Q,f0BD0,fpBD0\n'
525 ' real*8 MB,MD0,rQ,rf0BD0,rfpBD0\n'
526 ' MD0=1.865\n'
527 ' MB=5.279\n'
528 ' rQ=real(Q)\n'
529 ' rf0BD0=real(f0BD0(Q))\n'
530 ' rfpBD0=real(fpBD0(Q))\n'
531 ' fmBD0=(MD0**2-MB**2)/rQ*(rf0BD0-rfpBD0)\n'
532 ' return\n'
533 ' end\n'
534 '\n'
535 ' double complex function func11(S)\n'
536 ' implicit none\n'
537 ' double complex S,fpBD0\n'
538 ' func11=real(fpBD0(S))\n'
539 ' return\n'
540 ' end\n'
541 '\n'
542 ' double complex function func12(S)\n'
543 ' implicit none\n'
544 ' double complex S,fpBD0,fmBD0\n'
545 ' func12=real(fpBD0(S))-real(fmBD0(S))\n'
546 ' return\n'
547 ' end\n'
548 '\n'
549 ' double complex function fpB0D(Q)\n'
550 ' implicit none\n'
551 ' double complex Q,z\n'
552 ' real*8 rQ,rz,a0pBD,a1pBD,a2pBD,MBstar,MB0,MD\n'
553 ' a0pBD=0.909\n'
554 ' a1pBD=-7.11\n'
555 ' a2pBD=66\n'
556 ' MBstar=5.3247\n'
557 ' MB0=5.279\n'
558 ' MD=1.869\n'
559 ' rQ=real(Q)\n'
560 ' rz=real(z(Q,MB0,MD))\n'
561 ' fpB0D=1/(1-rQ/MBstar**2)*(a0pBD+a1pBD*rz+a2pBD*rz**2+(2*a2pBD-a1pBD)*rz**3/3)\n'
562 ' return\n'
563 ' end\n'
564 '\n'
565 ' double complex function f0B0D(Q)\n'
566 ' implicit none\n'
567 ' double complex Q,z\n'
568 ' real*8 rQ,rz,a00BD,a10BD,a20BD,MB0,MD\n'
569 ' a00BD=0.794\n'
570 ' a10BD=-2.45\n'
571 ' a20BD=33.21\n'
572 ' MB0=5.28\n'
573 ' MD=1.869\n'
574 ' rQ=real(Q)\n'
575 ' rz=real(z(Q,MB0,MD))\n'
576 ' f0B0D=a00BD+a10BD*rz+a20BD*rz**2\n'
577 ' return\n'
578 ' end\n'
579 '\n'
580 ' double complex function fmB0D(Q)\n'
581 ' implicit none\n'
582 ' double complex Q,f0B0D,fpB0D\n'
583 ' real*8 MB0,MD,rQ,rf0B0D,rfpB0D\n'
584 ' MD=1.869\n'
585 ' MB0=5.28\n'
586 ' rQ=real(Q)\n'
587 ' rf0B0D=real(f0B0D(Q))\n'
588 ' rfpB0D=real(fpB0D(Q))\n'
589 ' fmB0D=(MD**2-MB0**2)/rQ*(rf0B0D-rfpB0D)\n'
590 ' return\n'
591 ' end\n'
592 '\n'
593 ' double complex function func13(S)\n'
594 ' implicit none\n'
595 ' double complex S,fpB0D\n'
596 ' func13=real(fpB0D(S))\n'
597 ' return\n'
598 ' end\n'
599 '\n'
600 ' double complex function func14(S)\n'
601 ' implicit none\n'
602 ' double complex S,fpB0D,fmB0D\n'
603 ' func14=real(fpB0D(S))-real(fmB0D(S))\n'
604 ' return\n'
605 ' end\n'
606 '\n'
607 ' double complex function fpB0sDs(Q)\n'
608 ' implicit none\n'
609 ' double complex Q,z\n'
610 ' real*8 rQ,rz,a0pBD,a1pBD,a2pBD,MBstar,MB0s,MDs\n'
611 ' a0pBD=0.909\n'
612 ' a1pBD=-7.11\n'
613 ' a2pBD=66\n'
614 ' MBstar=5.3247\n'
615 ' MB0s=5.367\n'
616 ' MDs=1.9683\n'
617 ' rQ=real(Q)\n'
618 ' rz=real(z(Q,MB0s,MDs))\n'
619 ' fpB0sDs=1/(1-rQ/MBstar**2)*(a0pBD+a1pBD*rz+a2pBD*rz**2+(2*a2pBD-a1pBD)*rz**3/3)\n'
620 ' return\n'
621 ' end\n'
622 '\n'
623 ' double complex function f0B0sDs(Q)\n'
624 ' implicit none\n'
625 ' double complex Q,z\n'
626 ' real*8 rQ,rz,a00BD,a10BD,a20BD,MB0s,MDs\n'
627 ' a00BD=0.794\n'
628 ' a10BD=-2.45\n'
629 ' a20BD=39.2\n'
630 ' MB0s=5.367\n'
631 ' MDs=1.9683\n'
632 ' rQ=real(Q)\n'
633 ' rz=real(z(Q,MB0s,MDs))\n'
634 ' f0B0sDs=a00BD+a10BD*rz+a20BD*rz**2\n'
635 ' return\n'
636 ' end\n'
637 '\n'
638 ' double complex function fmB0sDs(Q)\n'
639 ' implicit none\n'
640 ' double complex Q,f0B0sDs,fpB0sDs\n'
641 ' real*8 MB0s,MDs,rQ,rf0B0sDs,rfpB0sDs\n'
642 ' MDs=1.9683\n'
643 ' MB0s=5.367\n'
644 ' rQ=real(Q)\n'
645 ' rf0B0sDs=real(f0B0sDs(Q))\n'
646 ' rfpB0sDs=real(fpB0sDs(Q))\n'
647 ' fmB0sDs=(MDs**2-MB0s**2)/rQ*(rf0B0sDs-rfpB0sDs)\n'
648 ' return\n'
649 ' end\n'
650 '\n'
651 ' double complex function func15(S)\n'
652 ' implicit none\n'
653 ' double complex S,fpB0sDs\n'
654 ' func15=real(fpB0sDs(S))\n'
655 ' return\n'
656 ' end\n'
657 '\n'
658 ' double complex function func16(S)\n'
659 ' implicit none\n'
660 ' double complex S,fpB0sDs,fmB0sDs\n'
661 ' func16=real(fpB0sDs(S))-real(fmB0sDs(S))\n'
662 ' return\n'
663 ' end\n'
664 '\n'
665 ' double complex function fpB0sK(Q)\n'
666 ' implicit none\n'
667 ' double complex Q,z\n'
668 ' real*8 rQ,rz,a0pBK,a1pBK,a2pBK,a3pBK,MBstar,MB0s,MK\n'
669 ' a0pBK=0.374\n'
670 ' a1pBK=-0.672\n'
671 ' a2pBK=0.07\n'
672 ' a3pBK=1.34\n'
673 ' MBstar=5.3247\n'
674 ' MB0s=5.367\n'
675 ' MK=0.493677\n'
676 ' rQ=real(Q)\n'
677 ' rz=real(z(Q,MB0s,MK))\n'
678 ' fpB0sK=1/(1-rQ/MBstar**2)*(a0pBK+a1pBK*rz+a2pBK*rz**2+a3pBK*rz**3+(a1pBK-2*a2pBK+3*a3pBK)/4*rz**4)\n'
679 ' return\n'
680 ' end\n'
681 '\n'
682 ' double complex function f0B0sK(Q)\n'
683 ' implicit none\n'
684 ' double complex Q,z\n'
685 ' real*8 rQ,rz,a00BK,a10BK,a20BK,a30BK,MB0s,MK\n'
686 ' a00BK=0.2203\n'
687 ' a10BK=0.089\n'
688 ' a20BK=0.24\n'
689 ' a30BK=14.02\n'
690 ' MB0s=5.367\n'
691 ' MK=0.493677\n'
692 ' rQ=real(Q)\n'
693 ' rz=real(z(Q,MB0s,MK))\n'
694 ' f0B0sK=a00BK+a10BK*rz+a20BK*rz**2+a30BK*rz**3\n'
695 ' return\n'
696 ' end\n'
697 '\n'
698 ' double complex function fmB0sK(Q)\n'
699 ' implicit none\n'
700 ' double complex Q,f0B0sK,fpB0sK\n'
701 ' real*8 MB0s,MK,rQ,rf0B0sK,rfpB0sK\n'
702 ' MK=0.493677\n'
703 ' MB0s=5.367\n'
704 ' rQ=real(Q)\n'
705 ' rf0B0sK=real(f0B0sK(Q))\n'
706 ' rfpB0sK=real(fpB0sK(Q))\n'
707 ' fmB0sK=(MK**2-MB0s**2)/rQ*(rf0B0sK-rfpB0sK)\n'
708 ' return\n'
709 ' end\n'
710 '\n'
711 ' double complex function func17(S)\n'
712 ' implicit none\n'
713 ' double complex S,fpB0sK\n'
714 ' func17=real(fpB0sK(S))\n'
715 ' return\n'
716 ' end\n'
717 '\n'
718 ' double complex function func18(S)\n'
719 ' implicit none\n'
720 ' double complex S,fpB0sK,fmB0sK\n'
721 ' func18=real(fpB0sK(S))-real(fmB0sK(S))\n'
722 ' return\n'
723 ' end')