Merge lp:~maddm/maddm/maddm_resonances into lp:maddm

Proposed by Olivier Mattelaer
Status: Merged
Merged at revision: 21
Proposed branch: lp:~maddm/maddm/maddm_resonances
Merge into: lp:maddm
Diff against target: 674 lines (+212/-55)
11 files modified
Templates/matrix_elements/makefile (+3/-2)
Templates/src/directional_detection.f (+1/-1)
Templates/src/init.f (+115/-7)
Templates/src/integrate.f (+25/-9)
Templates/src/interpolate.f (+5/-2)
Templates/src/makefile (+3/-2)
Templates/src/relic_canon.f (+8/-2)
Templates/src/tests.f (+5/-0)
maddm_interface.py (+7/-4)
maddm_run_interface.py (+31/-22)
python_templates/maddm.inc (+9/-4)
To merge this branch: bzr merge lp:~maddm/maddm/maddm_resonances
Reviewer Review Type Date Requested Status
Chiara Arina Pending
Review via email: mp+372250@code.launchpad.net

Commit message

fix a couple of issues including a compatibility issue with 2.6.6

To post a comment you must log in.
lp:~maddm/maddm/maddm_resonances updated
35. By olivier-mattelaer

fix an issue with compatibility with madgraph

Revision history for this message
Chiara Arina (carina) wrote :

Salut Olivier,

je ne sais pas si je dois faire quelque chose mais j’ai regarde le merging que tu proposes et c’est ok pour moi. Dit moi si je dois confirmer quelque part sur le site web..
Chiara

lp:~maddm/maddm/maddm_resonances updated
36. By olivier-mattelaer

revert chiara QED->QCD change but allow to test [noborn=QED] if no diagram are generated for [noborn=QCD]

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Templates/matrix_elements/makefile'
2--- Templates/matrix_elements/makefile 2016-05-14 13:38:36 +0000
3+++ Templates/matrix_elements/makefile 2019-09-05 08:03:10 +0000
4@@ -1,9 +1,10 @@
5-fort= gfortran
6+include ../Source/make_opts
7+fort= $(FC)
8
9 libname = matrix_elements
10 incdir = ../include
11
12-flags = -O -fno-align-commons -ffixed-line-length-132 -I$(incdir)
13+flags = $(FFLAGS) -I$(incdir)
14
15 objs = smatrix.o $(patsubst %.f,%.o,$(wildcard *.f))
16
17
18=== modified file 'Templates/src/directional_detection.f'
19--- Templates/src/directional_detection.f 2017-07-27 15:49:35 +0000
20+++ Templates/src/directional_detection.f 2019-09-05 08:03:10 +0000
21@@ -1831,7 +1831,7 @@
22 integer flag
23 double precision x, eff
24
25-
26+ efficiency = 0d0
27 if(flag .eq. 0) then
28 efficiency = 1.d0 ! for 100% detection efficiency
29
30
31=== modified file 'Templates/src/init.f'
32--- Templates/src/init.f 2017-01-23 13:00:58 +0000
33+++ Templates/src/init.f 2019-09-05 08:03:10 +0000
34@@ -107,9 +107,13 @@
35 c Y_eq = 45/(4*pi^4) g_i/g_*S x^2 K_2(x), with x=m_i/T
36 c K_2(x) is expanded for large values of x ( > 10)
37 if (mass.gt.5.d0*temp) then
38+ if (mass/temp.gt.706)then
39+ get_Y_eq = 0d0
40+ else
41 get_Y_eq = 45.d0/(4.d0*pi**4)*(dof/rel_dofs)*(mass/temp)**(1.5d0)
42 . * dsqrt(pi/2.d0)*dexp(-mass/temp) * (1.d0 + 15.d0/(8.d0*(mass/temp))
43 . + 105.d0/(128.d0*(mass/temp)**2) - 315.d0/(1024.d0*(mass/temp)**3))
44+ endif
45 else if (mass.gt.temp/5.d0) then
46 get_Y_eq = 45.d0/(4.d0*pi**4)*(dof/rel_dofs)*(mass/temp)**2
47 . * bessk(2,mass/temp)
48@@ -194,6 +198,11 @@
49 double precision Wij_hold, Wij_total, beta_step
50 logical flag1, flag2, flag3
51
52+ integer i, ii
53+ double precision next_beta(nres), tmp_beta
54+ integer res_step(nres)
55+ integer nres_points_local, max_width_factor
56+
57 c output to the screen to show progress
58 if (print_out) then
59 write(*,*) 'Calculating all the Wijs'
60@@ -202,9 +211,28 @@
61 flag3 = .true.
62 endif
63
64+ nres_points_local = 100
65+ max_width_factor = 6 ! this is e^N-1 times the width for the further point
66+
67+ do ii=1, nres
68+ res_step(ii) = - nres_points_local
69+ tmp_beta = -1d0
70+ if (beta_res(ii).lt.0d0) then
71+ res_step(ii) = nres_points_local +1
72+ cycle
73+ endif
74+ do while (tmp_beta.lt.0d0)
75+ tmp_beta = beta_res(ii) - beta_res_width(ii)*(DEXP(1d0*res_step(ii)*max_width_factor/nres_points_local)-1)
76+ res_step(ii) = res_step(ii) + 1
77+ enddo
78+c write(*,*) 'resonances',ii,beta_res(ii), beta_res_width(ii), res_step(ii)
79+ enddo
80+
81+
82 c setting up step sizes
83- beta_step = 0.01d0
84-
85+ beta_step = 1e-3
86+ beta_step_min = 1e-6
87+ beta_step_max = 1e-2
88 c starting the calculation of the Wij's
89 nWij = 1
90 betas(nWij) = 0.001d0
91@@ -213,11 +241,32 @@
92 c continue to do beta steps until we are near beta = 1
93 do while (betas(nWij).le.0.99d0-beta_step)
94 nWij = nWij+1
95- betas(nWij) = betas(nWij-1) + beta_step
96+ tmp_beta = betas(nWij-1) + beta_step
97+ do ii=1, nres
98+ if (res_step(ii).le.0)then
99+ next_beta(ii) = beta_res(ii) - beta_res_width(ii)*(DEXP(1d0*res_step(ii)*max_width_factor/nres_points_local)-1)
100+ elseif(res_step(ii).le.nres_points_local)then
101+ next_beta(ii) = beta_res(ii) + beta_res_width(ii)*(DEXP(1d0*res_step(ii)*max_width_factor/nres_points_local)-1)
102+ else
103+ next_beta(ii) = 1d0
104+ endif
105+ tmp_beta = min(tmp_beta, next_beta(ii),1d0)
106+ enddo
107+ betas(nWij) = tmp_beta
108 Wij_total = get_Wij_ann(betas(nWij))
109
110+
111 c if the new Wij is 100% larger than the previous Wij, then reduce the stepsize
112 if (((dabs(Wij_total-Wij_hold)/Wij_hold).gt.1.d0).and.(beta_step.gt.beta_step_min)) then
113+c write(*,*) 'reduce', betas(nWij), beta_step, ((dabs(Wij_total-Wij_hold)/Wij_hold)), Wij_total, Wij_hold
114+
115+ if (((dabs(Wij_total-Wij_hold)/Wij_hold).gt.2.d0))then
116+c write(*,*) 'rewind', betas(nWij-1)
117+ nWij = nWij-1
118+ beta_step = beta_step/2.d0
119+ cycle
120+ endif
121+
122 beta_step = beta_step/2.d0
123 if (beta_step .lt. beta_step_min) then
124 beta_step = beta_step_min
125@@ -226,12 +275,24 @@
126
127 c if the new Wij is within 10% of the previous Wij, then increase the stepsize
128 if (((dabs(Wij_total-Wij_hold)/Wij_hold).lt.0.1d0).and.(beta_step.lt.beta_step_max)) then
129- beta_step = beta_step*2.d0
130+ beta_step = beta_step*2d0
131 if (beta_step .gt. beta_step_max) then
132 beta_step = beta_step_max
133 endif
134+c write(*,*) 'increase', betas(nWij), beta_step
135 endif
136
137+ do ii=1, nres
138+ if (next_beta(ii).eq.tmp_beta) then
139+ res_step(ii) = res_step(ii)+1
140+ beta_step = max(beta_step,1e-3)
141+c if (beta_step.eq.1e-3) then
142+c write(*,*) 'reset'
143+c endif
144+ endif
145+ enddo
146+
147+
148 c Hold the Wij_value so that if the Wij integral is too small we have a stored value ot use
149 Wij_hold = Wij_total
150
151@@ -256,7 +317,7 @@
152 betas(nWij) = 0.999d0
153 Wij_total = get_Wij_ann(betas(nWij))
154
155- if (print_out) write(*,*) 'Done!'
156+ if (print_out) write(*,*) 'Done!', nWij
157 Wij_ann_calc = .true.
158
159 return
160@@ -284,7 +345,6 @@
161
162 c set beta_pass to pass beta to Wij_integrand
163 beta_pass = beta
164-
165 c loop over all the dm particles
166 do x1=1, ndmparticles
167 do x2=x1, ndmparticles
168@@ -311,6 +371,54 @@
169 return
170 end
171
172+c-------------------------------------------------------------------------c
173+ function get_Wij_ann_nogrid(beta)
174+c-------------------------------------------------------------------------c
175+c c
176+c Given the input velocity beta, this function integrates the matrix c
177+c elements generated by MadGraph over the solid angle for all c
178+c combinations of \chi_i, \chi_j to all final states. c
179+c c
180+c-------------------------------------------------------------------------c
181+ implicit none
182+ include 'maddm.inc'
183+
184+c input parameters
185+ double precision beta
186+ double precision Wij_ann_nogrid(maxdms,maxdms)
187+c external function used in this subroutine
188+ external Wij_ann_integrand
189+
190+c set beta_pass to pass beta to Wij_integrand
191+ beta_pass = beta
192+
193+ get_Wij_ann_nogrid = 0d0
194+c loop over all the dm particles
195+ do x1=1, ndmparticles
196+ do x2=x1, ndmparticles
197+ dmi = x1
198+ dmj = x2
199+
200+c integrate the 2 -> 2 process over x = (cos(theta)+1)/2.d0
201+ call romberg(Wij_ann_integrand, 0.d0, 1.d0, Wij_ann_nogrid(x1,x2), eps_wij, iter_wij)
202+
203+c the Wijs for (DMi, DMj) are the same for (DMj, DMi)
204+ if (x1.ne.x2) Wij_ann_nogrid(x2,x1) = Wij_ann_nogrid(x1,x2)
205+ enddo
206+ enddo
207+
208+c the return of this function will be the sum of all the Wij's
209+c so the next beta step can be determined
210+ get_Wij_ann = 0.d0
211+ do x1=1, ndmparticles
212+ do x2=x1, ndmparticles
213+ get_Wij_ann_nogrid = get_Wij_ann_nogrid + Wij_ann_nogrid(x1,x2)
214+ enddo
215+ enddo
216+
217+ return
218+ end
219+
220
221
222 c-------------------------------------------------------------------------c
223@@ -483,4 +591,4 @@
224 read(*,*)
225
226 return
227- end
228\ No newline at end of file
229+ end
230
231=== modified file 'Templates/src/integrate.f'
232--- Templates/src/integrate.f 2017-08-10 20:21:07 +0000
233+++ Templates/src/integrate.f 2019-09-05 08:03:10 +0000
234@@ -89,6 +89,8 @@
235 double precision left, right, whole, end_pt, start_pt, width
236
237 integer ii, jj, kk, grid_pos
238+ integer nres_points_local,max_width_factor
239+
240
241 c Set up the integration grid
242 c Initialize to 10*b, so that we can identify the relevant points
243@@ -97,7 +99,7 @@
244 grid=10.d0*b
245
246 c write(*,*) 'width: ', beta_res_width(1)
247-
248+ call find_resonances()
249 c Make sure that the array is large enough to store the grid
250 if (grid_npts.lt.ngrid_init) then
251 write(*,*) 'Error: grid array not large enough!'
252@@ -116,14 +118,18 @@
253 grid_pos = grid_pos+1
254 endif
255 enddo
256+
257+ nres_points_local = 20
258+ max_width_factor = 2 ! allow to go as far as e^N-1 times the width for the extra point
259
260 c then add more points around the resonance
261 do ii=1, nres
262 if (beta_res(ii).ge.a.and.beta_res(ii).lt.b.and.beta_res(ii).ge.0.d0) then
263- do jj=1, nres_points
264+ do jj=1, nres_points_local
265 c pts_to_add_adaptive = ceiling(real(pts_to_add_adaptive / 2))
266 c do kk = 1, pts_to_add_adaptive
267- additional_pt = beta_res(ii) + (exp(real(beta_res_width(ii))/10.d0*exp(real(jj)))-1.d0)
268+ additional_pt = beta_res(ii) + beta_res_width(ii)*(DEXP(1d0*jj**max_width_factor/nres_points_local)-1)
269+c additional_pt = beta_res(ii) + (exp(real(beta_res_width(ii))/10.d0*exp(real(jj)))-1.d0)
270 if (additional_pt.lt.b) then
271 grid(grid_pos) = additional_pt
272 grid_pos=grid_pos+1
273@@ -133,7 +139,7 @@
274 endif
275 endif
276
277- additional_pt = width - (exp(real(beta_res_width(ii))/10.d0*exp(real(jj)))-1.d0)
278+ additional_pt = beta_res(ii) - beta_res_width(ii)*(DEXP(1d0*jj**max_width_factor/nres_points_local)-1)
279 if (additional_pt.gt.a) then
280 grid(grid_pos) = additional_pt
281 grid_pos=grid_pos+1
282@@ -196,7 +202,7 @@
283 external func
284 integer gr_npts, ii
285 double precision grid_simp(gr_npts)
286-
287+ double precision tmp1, tmp2, tmp3
288 simpson = 0.d0
289 ii = 1
290
291@@ -215,8 +221,16 @@
292 c write(101,*) start_pt, func(start_pt)
293 c write(*,*) 'start, end', start_pt, end_pt
294 c write(*,*) 'func: ', func(0.d0), func(0.00001d0)
295- simpson = simpson+ (end_pt - start_pt)/6.d0*(func(start_pt) + 4.d0*func(0.5d0*
296+
297+ tmp1 = (func(start_pt) + 4.d0*func(0.5d0*
298 . (start_pt+end_pt)) + func(end_pt) )
299+ if (tmp1.lt.1e-20*simpson)then
300+ exit
301+ else if (tmp1.gt.1d-300) then
302+ simpson = simpson+ (end_pt - start_pt)/6.d0*tmp1
303+ else
304+ exit
305+ endif
306 c simpson = simpson+ (end_pt - start_pt)/8.d0*(max(0.d0, func(start_pt))
307 c . + 3.d0*max(0.d0,func(0.33d0*(2.d0*start_pt+end_pt)))
308 c . + 3.d0*max(0.d0,func(0.33d0*(start_pt+2.d0*end_pt))) + max(0.d0,func(end_pt)))
309@@ -471,8 +485,10 @@
310 endif
311 return
312 endif
313-c if(dabs(hnext) .lt. hmin) pause
314-c & 'stepsize smaller than minimum in odeint'
315+ if(dabs(hnext) .lt. hmin) then
316+ write(*,*) 'too small step'
317+ stop 1
318+ endif
319 h = hnext
320 enddo
321 c pause 'too many steps in odeint'
322@@ -682,7 +698,7 @@
323
324 c Set up for stratification
325 if (mds.ne.0) then
326- ng = (dble(ncall)/2.d0+0.25d0)**(1.d0/dble(ndim))
327+ ng = int((dble(ncall)/2.d0+0.25d0)**(1.d0/dble(ndim)))
328 mds = 1
329 if ((2*ng-ndmx).ge.0) then
330 mds = -1
331
332=== modified file 'Templates/src/interpolate.f'
333--- Templates/src/interpolate.f 2015-11-26 03:18:05 +0000
334+++ Templates/src/interpolate.f 2019-09-05 08:03:10 +0000
335@@ -21,6 +21,7 @@
336 c parameters used to find the index
337 integer index, lowindex, highindex, mid
338
339+ get_Wij_value = 0d0
340 c If the xvalue is outside the given array then set the index to the boundary
341 if (beta .lt. betas(1)) then
342 index = 1
343@@ -42,6 +43,8 @@
344
345 c interpolate the array with a line
346 if (group.eq.1) then
347+c write(*,*) 'bypass interpolation'
348+c get_Wij_value = get_Wij_ann_nogrid(beta)
349 get_Wij_value = (Wij_ann(i,j,index+1)-Wij_ann(i,j,index))/(betas(index+1)-betas(index))
350 . *(beta-betas(index))+Wij_ann(i,j,index)
351 else if (group.eq.2) then
352@@ -80,7 +83,7 @@
353
354 c parameters used to find the index
355 integer x_index, lowindex, highindex, mid
356-
357+ get_taacs_value = 0d0
358 c If the xvalue is outside the given array then set the index to the boundary
359 if (x .lt. x_taacs(1)) then
360 x_index = 1
361@@ -392,4 +395,4 @@
362 endif
363
364 return
365- end
366\ No newline at end of file
367+ end
368
369=== modified file 'Templates/src/makefile'
370--- Templates/src/makefile 2017-08-17 10:04:18 +0000
371+++ Templates/src/makefile 2019-09-05 08:03:10 +0000
372@@ -1,10 +1,11 @@
373+include ../Source/make_opts
374 prog = maddm
375-fort= gfortran
376+fort= $(FC)
377
378 libdir = ../lib/
379 incdir = ../include
380
381-flags = -O -fno-align-commons -ffixed-line-length-132 -L$(libdir) -I$(incdir) -fbounds-check
382+flags = $(FFLAGS) -L$(libdir) -I$(incdir)
383
384 libs = -lmatrix_elements -ldhelas -lmodel
385
386
387=== modified file 'Templates/src/relic_canon.f'
388--- Templates/src/relic_canon.f 2017-08-10 20:21:07 +0000
389+++ Templates/src/relic_canon.f 2019-09-05 08:03:10 +0000
390@@ -81,7 +81,7 @@
391 endif
392
393 x_1 = x_1 - dx_step
394- if (x_1.le.1d0) then
395+ if (x_1.le.1d0) then
396 write(*,*) 'Freezeout occurs too early! Relic density too big to comprehend. Seeting Omegah^2 = -1.0 \n'
397 relic_canon=-1.0
398 return
399@@ -255,10 +255,16 @@
400 enddo
401
402 c integrand for the thermally averaged annihilation cross section
403+ if (2.d0*x_pass*(1.d0-1.d0/(1.d0-beta**2)**(0.5d0)).lt.-695)then
404+ taacs_integrand_canon =mdm(1)**2*beta/(1.d0-beta**2)**2 * Wij_sum / (2.d0*T*K2_sum**2)
405+ . * 0d0
406+ . * (1.d0 + 3.d0*T/(8.d0*dsqrt(s)) - 15.d0*T**2/(128.d0*s) + 105.d0*T**3/(1024.d0*s**1.5d0))
407+ . / (1.d0 + 15.d0*T/(8.d0*mdm(1)) + 105.d0*T**2/(128.d0*mdm(1)**2) - 315.d0*T**3/(1024.d0*mdm(1)**3))**2
408+ else
409 taacs_integrand_canon = mdm(1)**2*beta/(1.d0-beta**2)**2 * Wij_sum / (2.d0*T*K2_sum**2)
410 . * dsqrt(2.d0/(pi*dsqrt(s)*T))*mdm(1)*dexp(2.d0*x_pass*(1.d0-1.d0/(1.d0-beta**2)**(0.5d0)))
411 . * (1.d0 + 3.d0*T/(8.d0*dsqrt(s)) - 15.d0*T**2/(128.d0*s) + 105.d0*T**3/(1024.d0*s**1.5d0))
412 . / (1.d0 + 15.d0*T/(8.d0*mdm(1)) + 105.d0*T**2/(128.d0*mdm(1)**2) - 315.d0*T**3/(1024.d0*mdm(1)**3))**2
413-
414+ endif
415 return
416 end
417
418=== modified file 'Templates/src/relic_density.f'
419Binary files Templates/src/relic_density.f 2016-11-04 11:35:41 +0000 and Templates/src/relic_density.f 2019-09-05 08:03:10 +0000 differ
420=== modified file 'Templates/src/tests.f'
421--- Templates/src/tests.f 2017-04-11 13:16:20 +0000
422+++ Templates/src/tests.f 2019-09-05 08:03:10 +0000
423@@ -637,6 +637,7 @@
424 write(*,*) 'Invalid value of p_or_E'
425 write(*,*) 'p_or_E = 1 for initial momentum'
426 write(*,*) 'p_or_E = 0 for initial energy'
427+ cross_check_process = 0d0
428 return
429 endif
430
431@@ -768,6 +769,10 @@
432 msq = smatrix_ann(p_ext,i_pass,j_pass,k_pass)
433 else if (group_pass.eq.2) then
434 msq = smatrix_dm2dm(p_ext,i_pass,j_pass,k_pass)
435+ else
436+ msq = 0d0
437+ write(*,*) 'undefined msq'
438+ stop 1
439 C else if (group_pass.eq.3) then
440 C msq = smatrix_scattering(p_ext,i_pass,j_pass,k_pass)
441 endif
442
443=== modified file 'maddm_interface.py'
444--- maddm_interface.py 2019-01-10 10:53:52 +0000
445+++ maddm_interface.py 2019-09-05 08:03:10 +0000
446@@ -139,8 +139,8 @@
447 super(MadDM_interface, self).preloop(*args, **opts)
448 self.prompt = 'MadDM>'
449
450- def change_principal_cmd(self, name):
451- out = super(MadDM_interface, self).change_principal_cmd(name)
452+ def change_principal_cmd(self, name, *args, **opts):
453+ out = super(MadDM_interface, self).change_principal_cmd(name,*args, **opts)
454 self.prompt = 'MadDM>'
455 return out
456
457@@ -1087,8 +1087,11 @@
458 except (self.InvalidCmd, diagram_generation.NoDiagramException), error:
459 if allow_loop_induce:
460 proc = '%s %s > %s %s [noborn=QCD] @ID ' % (name, antiname, ' '.join(argument), coupling)
461- self.do_add('process %s' % proc)
462-
463+ try:
464+ self.do_add('process %s' % proc)
465+ except (self.InvalidCmd, diagram_generation.NoDiagramException), error:
466+ proc = '%s %s > %s %s [noborn=QED] @ID ' % (name, antiname, ' '.join(argument), coupling)
467+ self.do_add('process %s' % proc)
468
469 def install_indirect(self):
470 """Code to install the reduction library if needed"""
471
472=== modified file 'maddm_run_interface.py'
473--- maddm_run_interface.py 2019-01-10 10:53:52 +0000
474+++ maddm_run_interface.py 2019-09-05 08:03:10 +0000
475@@ -74,7 +74,7 @@
476
477 def __init__(self):
478
479- self._allowed_final_states = ['qqx', 'ccx', 'gg', 'bbx', 'ttx', 'e+e-', 'mu+mu-', 'ta+ta-', 'w+w-', 'zz', 'hh',
480+ self._allowed_final_states = ['qqx', 'ccx', 'gg', 'bbx', 'ttx', 'emep', 'mummup', 'tamtap', 'wpwm', 'zz', 'hh',
481 'hess2013','hess2016', 'aaER16','aaIR90','aaNFWcR3','aaNFWR41']
482
483 self._oh2_planck = 0.1198
484@@ -88,10 +88,10 @@
485 'gg' :pjoin(MDMDIR, 'ExpData', 'MadDM_Fermi_Limit_gg.dat'),
486 'bbx' :pjoin(MDMDIR, 'ExpData', 'MadDM_Fermi_Limit_bb.dat'),
487 'ttx' :pjoin(MDMDIR, 'ExpData', 'MadDM_Fermi_Limit_tt.dat'),
488- 'e+e-' :pjoin(MDMDIR, 'ExpData', 'MadDM_Fermi_Limit_ee.dat'),
489- 'mu+mu-':pjoin(MDMDIR, 'ExpData', 'MadDM_Fermi_Limit_mumu.dat'),
490- 'ta+ta-':pjoin(MDMDIR, 'ExpData', 'MadDM_Fermi_Limit_tautau.dat'),
491- 'w+w-' :pjoin(MDMDIR, 'ExpData', 'MadDM_Fermi_Limit_WW.dat'),
492+ 'emep' :pjoin(MDMDIR, 'ExpData', 'MadDM_Fermi_Limit_ee.dat'),
493+ 'mummup':pjoin(MDMDIR, 'ExpData', 'MadDM_Fermi_Limit_mumu.dat'),
494+ 'tamtap':pjoin(MDMDIR, 'ExpData', 'MadDM_Fermi_Limit_tautau.dat'),
495+ 'wpwm' :pjoin(MDMDIR, 'ExpData', 'MadDM_Fermi_Limit_WW.dat'),
496 'zz' :pjoin(MDMDIR, 'ExpData', 'MadDM_Fermi_Limit_ZZ.dat'),
497 'hh' :pjoin(MDMDIR, 'ExpData', 'MadDM_Fermi_Limit_hh.dat'),
498
499@@ -103,8 +103,8 @@
500 'aaNFWcR3':pjoin(MDMDIR,'ExpData', 'Fermi_lines_2015_NFWcontracted_R3.dat'),
501 'aaNFWR41':pjoin(MDMDIR,'ExpData', 'Fermi_lines_2015_NFW_R41.dat')}
502
503- self._id_limit_vel = {'qqx':2.0E-5, 'ccx':2.0E-5, 'gg':2.0E-5, 'bbx':2.0E-5,'ttx':2.0E-5,'e+e-':2.0E-5,'mu+mu-':2.0E-5,'ta+ta-':2.0E-5,
504- 'w+w-':2.0E-5, 'zz':2.0E-5, 'hh':2.0E-5,
505+ self._id_limit_vel = {'qqx':2.0E-5, 'ccx':2.0E-5, 'gg':2.0E-5, 'bbx':2.0E-5,'ttx':2.0E-5,'emep':2.0E-5,'mummup':2.0E-5,'tamtap':2.0E-5,
506+ 'wpwm':2.0E-5, 'zz':2.0E-5, 'hh':2.0E-5,
507 'aaER16':1.0E-3,'aaIR90':1.0E-3,'aaNFWcR3':1.0E-3,'aaNFWR41':1.0E-3 ,
508 'hess2013': 1.0E-3 , 'hess2016': 1.0E-3 }
509
510@@ -243,7 +243,7 @@
511 self.channels = ['ee', 'mumu', 'tautau', 'qq', 'cc', 'bb', 'tt', 'ZZ', 'WW', 'hh', 'gammagamma', 'gg']
512
513 self.map_allowed_final_state_PPPC = {'qqx':'qq', 'ccx':'cc', 'gg':'gg', 'bbx':'bb', 'ttx':'tt',
514- 'e+e-':'ee', 'mu+mu-':'mumu', 'ta+ta-':'tautau', 'w+w-':'WW', 'zz':'ZZ', 'hh':'hh' }
515+ 'emep':'ee', 'mummup':'mumu', 'tamtap':'tautau', 'wpwm':'WW', 'zz':'ZZ', 'hh':'hh' }
516
517 def check_mass(self,mdm):
518 if (mdm < 5.0 or mdm > 100000):
519@@ -265,13 +265,13 @@
520 return
521
522 if not corr:
523- dic = np.load(PPPCDIR+'/PPPC_Tables_noEW.npy').item()
524+ dic = np.load(PPPCDIR+'/PPPC_Tables_noEW.npy', allow_pickle = True).item()
525 logger.info('PPPC4DMID Spectra at source loaded')
526 Spectra.PPPCdata = dic
527 Spectra.PPPC_type = ('source', corr)
528 return dic
529 elif corr == 'ew':
530- dic = np.load(PPPCDIR+'/PPPC_Tables_noEW.npy').item()
531+ dic = np.load(PPPCDIR+'/PPPC_Tables_noEW.npy', allow_pickle= True).item()
532 logger.info('PPPC4DMID Spectra at source (with EW corrections) loaded')
533 Spectra.PPPCdata = dic
534 Spectra.PPPC_type = ('source', corr)
535@@ -287,7 +287,7 @@
536 return
537
538 else:
539- dic = np.load(PPPCDIR+'/PPPC_Tables_epEarth_'+prof+'.npy').item()
540+ dic = np.load(PPPCDIR+'/PPPC_Tables_epEarth_'+prof+'.npy' , allow_pickle= True).item()
541 Spectra.PPPCdata = dic
542 Spectra.PPPC_type = ('earth', prof)
543
544@@ -934,10 +934,10 @@
545
546 # *** Indirect detection
547 if self.mode['indirect']:
548- halo_vel = self.maddm_card['vave_indirect']
549- if halo_vel > (3*10**(-6)) and halo_vel < ( 1.4*10**(-4) ): # cannot calculate Fermi limits
550+ halo_vel = self.maddm_card['vave_indirect']
551+ #if halo_vel > (3*10**(-6)) and halo_vel < ( 1.4*10**(-4) ): # cannot calculate Fermi limits
552
553- #if not self._two2twoLO:
554+ #if not self._two2twoLO:
555 detailled_keys = [k for k in self.last_results if k.startswith('taacsID#') ]
556 if len(detailled_keys)>1:
557 for key in detailled_keys:
558@@ -945,7 +945,8 @@
559 clean_key = clean_key_list[0]+"_"+clean_key_list[1]
560
561 order +=[clean_key]
562- order +=['lim_'+clean_key]
563+ if halo_vel > (3*10**(-6)) and halo_vel < ( 1.4*10**(-4) ):
564+ order +=['lim_'+clean_key]
565
566 order.append('taacsID')
567 order.append('tot_SM_xsec')
568@@ -1746,7 +1747,7 @@
569
570 detailled_keys = [k for k in self.last_results.keys() if k.startswith('taacsID#')]
571 logger.info('<sigma v> method: %s ' % self.maddm_card['sigmav_method'] )
572- logger.info('DM particle halo velocity: %s/c ' % halo_vel) # the velocity should be the same
573+ logger.info('DM particle halo velocity: %s/c ' % halo_vel) # the velocity should be the same
574
575 skip = []
576 if halo_vel > (3*10**(-6)) and halo_vel < ( 1.4*10**(-4) ): # range of validity of Fermi limits
577@@ -1770,7 +1771,7 @@
578 skip.append(f_original)
579 continue
580 if finalstate in self.limits._allowed_final_states :
581- s_ul = self.limits.ID_max(mdm, finalstate)
582+ s_ul = self.limits.ID_max(mdm, finalstate)
583 self.last_results['Fermi_lim_'+key] = self.limits.ID_max(mdm, finalstate)
584 else: s_ul = '-1'
585
586@@ -1910,7 +1911,7 @@
587 out_dir = dir_point # all the various output must be saved here == pjoin(events, run_name )
588
589 if 'off' in save_switch:
590- if 'inclusive' not in self.maddm_card['sigmav_method'] : # here, need to remove everyhting i.e. the whole run_xx folder
591+ if 'inclusive' not in self.maddm_card['sigmav_method'] : # here, need to remove everything i.e. the whole run_xx folder
592 shutil.rmtree(out_dir)
593
594 elif 'all' in save_switch :
595@@ -1921,7 +1922,7 @@
596 shutil.move(f_path , pjoin(self.dir_path , 'output', run_name, F) )
597
598
599- if 'inclusive' in self.maddm_card['sigmav_method']: # saving spectra onyl in inclusive mode since madevent/resh have their own pythia8 spectra
600+ if 'inclusive' in self.maddm_card['sigmav_method']: # saving spectra only in inclusive mode since madevent/resh have their own pythia8 spectra
601 self.save_spec_flux(out_dir = pjoin(self.dir_path , 'output', run_name), \
602 spec_source = spec_source, flux_source = flux_source, flux_earth = flux_earth)
603
604@@ -2540,9 +2541,17 @@
605 pythia8_card_path = pjoin(opts['mother_interface'].dir_path, 'Cards', 'pythia8_card.dat')
606
607 cards = [param_card_path, 'maddm', 'multinest', pythia8_card_path]
608+
609+ tmp_allow_arg = list(self.allow_arg)
610+ opts = dict(opts)
611+ opts['allow_arg'] = []
612+
613 common_run.AskforEditCard.__init__(self, question, cards,
614- *args, **opts)
615+ *args, **opts )
616+
617+ self.allow_arg += tmp_allow_arg
618 self.question = self.create_question()
619+
620
621 def write_switch(self, path=None):
622 """store value of the switch for the default at next run"""
623@@ -2822,7 +2831,7 @@
624
625 self.maddm.do_help(args[start])
626
627- ### CHECK if a help_xxx exist (only for those wihtout a do_xxx)
628+ ### CHECK if a help exist (only for those wihtout a do_xxx)
629 if len(args) == 1:
630 if not hasattr(self, 'do_%s' % args[0]) and hasattr(self, 'help_%s' % args[0]):
631 getattr(self, 'help_%s' %args[0])()
632@@ -3185,7 +3194,7 @@
633 self.add_param('dx_step', 1.0, hidden=True)
634
635 self.add_param('ngrid_init', 50, hidden=True, comment="Initial number of points in the grid to integrate over (of dm velocity)")
636- self.add_param('nres_points', 50, hidden=True, comment="Number of points to add for one width around each resonance peak. (the code will add points which exponentially increase in distance from the pole)")
637+ self.add_param('nres_points', 100, hidden=True, comment="Number of points to add for one width around each resonance peak. (the code will add points which exponentially increase in distance from the pole)")
638 self.add_param('eps_wij', 0.01, hidden=True, comment="precision of the romberg integration for Wij (irrelevant if simpson's rule used)")
639 self.add_param('iter_wij', 2, hidden=True, comment="minimum number of iterations in the romberg integration algorithm for both Wij (irrelevant if simpson's rule used)")
640
641
642=== modified file 'python_templates/maddm.inc'
643--- python_templates/maddm.inc 2017-08-10 20:21:07 +0000
644+++ python_templates/maddm.inc 2019-09-05 08:03:10 +0000
645@@ -3,6 +3,7 @@
646 double precision simpson, simpson_adaptive
647 c init.f
648 double precision get_Y_eq, get_gstar, get_Wij_ann, Wij_ann_integrand
649+ double precision get_Wij_ann_nogrid
650 c interpolate.f
651 integer getindex
652 double precision get_Wij_value, get_taacs_value, lineint, bessk, bessk1
653@@ -80,13 +81,17 @@
654 common/dmparms_logical/ solved_ODE, found_xf, dm_sm_scattering, print_out, dmsm_warning
655
656 c relic density integrals
657+ integer fitsize
658+ parameter (fitsize=2500)
659 integer nWij
660 common/num_Wijs/ nWij
661- double precision betas(1000), beta_step_min, beta_step_max
662+ double precision betas(fitsize), beta_step_min, beta_step_max
663 common/beta_steps/ betas, beta_step_min,beta_step_max
664- double precision Wij_ann(maxdms,maxdms,1000), Wij_dm2dm(maxdms,maxdms,max_dm2dm,1000)
665- double precision Wij_scattering(maxdms,maxdms,max_dm2dm,1000), x_taacs(1000), taacs_ann(maxdms,maxdms,1000)
666- double precision taacs_dm2dm(maxdms,maxdms,max_dm2dm,1000), taacs_scattering(maxdms,maxdms,max_dm2dm,1000)
667+ double precision Wij_ann(maxdms,maxdms,fitsize), Wij_dm2dm(maxdms,maxdms,max_dm2dm,fitsize)
668+ double precision Wij_scattering(maxdms,maxdms,max_dm2dm,fitsize), x_taacs(fitsize)
669+ double precision taacs_ann(maxdms,maxdms,fitsize)
670+ double precision taacs_dm2dm(maxdms,maxdms,max_dm2dm,fitsize)
671+ double precision taacs_scattering(maxdms,maxdms,max_dm2dm,fitsize)
672 common/dmintegrals/ Wij_ann, Wij_dm2dm, Wij_scattering, x_taacs, taacs_ann, taacs_dm2dm, taacs_scattering
673
674 c number of annihilation particles and associated diagrams

Subscribers

People subscribed via source and target branches

to all changes: