Merge lp:~maddevelopers/mg5amcnlo/2.5.2 into lp:mg5amcnlo/lts

Proposed by Olivier Mattelaer
Status: Merged
Merged at revision: 269
Proposed branch: lp:~maddevelopers/mg5amcnlo/2.5.2
Merge into: lp:mg5amcnlo/lts
Diff against target: 1466 lines (+434/-213)
35 files modified
MadSpin/decay.py (+14/-6)
MadSpin/interface_madspin.py (+23/-2)
MadSpin/src/driver.f (+5/-1)
Template/LO/Cards/run_card.dat (+1/-1)
Template/LO/Source/.make_opts (+103/-0)
Template/LO/Source/make_opts (+0/-103)
Template/LO/Source/rw_events.f (+2/-3)
Template/LO/SubProcesses/makefile (+1/-1)
Template/NLO/MCatNLO/PY8Analyzer/py8an_HwU_pp_lvl.f (+1/-0)
Template/NLO/MCatNLO/srcHerwig/madfks_hwlhin.f (+9/-4)
Template/NLO/SubProcesses/madfks_plot.f (+1/-1)
Template/NLO/SubProcesses/setcuts.f (+1/-1)
Template/NLO/makefile (+2/-2)
Template/loop_material/StandAlone/SubProcesses/MadLoopCommons.inc (+3/-0)
UpdateNotes.txt (+9/-0)
VERSION (+2/-2)
madgraph/__init__.py (+11/-0)
madgraph/core/base_objects.py (+2/-2)
madgraph/interface/amcatnlo_run_interface.py (+2/-2)
madgraph/interface/common_run_interface.py (+25/-12)
madgraph/interface/madevent_interface.py (+38/-13)
madgraph/interface/madgraph_interface.py (+15/-0)
madgraph/iolibs/export_v4.py (+1/-1)
madgraph/iolibs/template_files/madevent_makefile_source (+2/-2)
madgraph/iolibs/template_files/madevent_symmetry.f (+18/-11)
madgraph/iolibs/template_files/makefile_sa_f_sp (+1/-1)
madgraph/loop/loop_exporters.py (+1/-1)
madgraph/various/histograms.py (+10/-5)
madgraph/various/lhe_parser.py (+8/-7)
madgraph/various/misc.py (+18/-9)
madgraph/various/systematics.py (+62/-10)
models/check_param_card.py (+17/-8)
models/usermod.py (+11/-0)
tests/acceptance_tests/test_cmd_madevent.py (+12/-2)
tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%MadLoopCommons.f (+3/-0)
To merge this branch: bzr merge lp:~maddevelopers/mg5amcnlo/2.5.2
Reviewer Review Type Date Requested Status
Rikkert Frederix Needs Fixing
Review via email: mp+312642@code.launchpad.net

Description of the change

mainly debugging 2.5.1

To post a comment you must log in.
lp:~maddevelopers/mg5amcnlo/2.5.2 updated
293. By Olivier Mattelaer

fix an IO test

294. By Olivier Mattelaer

version and update note

Revision history for this message
Rikkert Frederix (frederix) wrote :

Automatic installation of COLLIER fails in this branch. It downloads version 1.1, but assume the code is 1.0. Seems like these versions are hard-coded in the HEPToolInstaller.py script, which is tricky to maintain. Is there a better way here?

review: Needs Fixing
Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

Hi,

The HEPToolInstaller.py is actually not part of the MG5 tarball.
The idea is to download that file when you do “install collier” (or many other code).
To be clear this file is updated EACH time you type install XXXXX (if XXXXX need the HEPToolsInstaller.py)

This allow to update the installation procedure independently of MG5aMC. Which offers us a very flexible way to
handle installation procedure.

Valentin is going to fix that collier support tonight.

Cheers,

Olivier

> On Dec 7, 2016, at 15:50, Rikkert Frederix <email address hidden> wrote:
>
> Review: Needs Fixing
>
> Automatic installation of COLLIER fails in this branch. It downloads version 1.1, but assume the code is 1.0. Seems like these versions are hard-coded in the HEPToolInstaller.py script, which is tricky to maintain. Is there a better way here?
> --
> https://code.launchpad.net/~maddevelopers/mg5amcnlo/2.5.2/+merge/312642
> Your team MadTeam is subscribed to branch lp:mg5amcnlo.

lp:~maddevelopers/mg5amcnlo/2.5.2 updated
295. By Rikkert Frederix

Fixed a small typo in one of the Pythia8 MC@NLO analyses.

296. By Valentin Hirschi

1. Fixed type in loop_exporter which has an effect that the BornColorFlow
   basis was not correctly labeled in the ML standalone output

297. By Olivier Mattelaer

fix a small MS bug

298. By Olivier Mattelaer

fixing a systematics bug for e+e- collision (with ckkw>0) and introduce 'set no_parton_cut' syntax

299. By Olivier Mattelaer

fix a bug in the <init> block reporting wrong cross-section in presence of many channel of integration

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'MadSpin/decay.py'
--- MadSpin/decay.py 2016-08-26 13:55:42 +0000
+++ MadSpin/decay.py 2016-12-10 02:02:40 +0000
@@ -2707,16 +2707,20 @@
2707 commandline += "define pert_%s = %s;" % (order, ' '.join(map(str,pert)) )2707 commandline += "define pert_%s = %s;" % (order, ' '.join(map(str,pert)) )
2708 2708
2709 # check if we have to increase by one the born order2709 # check if we have to increase by one the born order
2710 if '%s=' % order in process:2710 if '%s=' % order in process or '%s<=' % order in process:
2711 result=re.split(' ',process)2711 result=re.split(' ',process)
2712 process=''2712 process=''
2713 for r in result:2713 for r in result:
2714 if '%s=' % order in r:2714 if '%s=' % order in r:
2715 ior=re.split('=',r)2715 ior=re.split('=',r)
2716 r='QCD=%i' % (int(ior[1])+1)2716 r='%s<=%i' % (order,int(ior[1])+1)
2717 elif '%s<=' % order in r:
2718 ior=re.split('=',r)
2719 r='%s<=%i' % (order,int(ior[1])+1)
2720
2717 process=process+r+' '2721 process=process+r+' '
2718 #handle special tag $ | / @2722 #handle special tag $ | / @
2719 result = re.split('([/$@]|\w+=\w+)', process, 1) 2723 result = re.split('([/$@]|\w+<?=\w+)', process, 1)
2720 if len(result) ==3:2724 if len(result) ==3:
2721 process, split, rest = result2725 process, split, rest = result
2722 commandline+="add process %s pert_%s %s%s %s --no_warning=duplicate;" % (process, order ,split, rest, proc_nb)2726 commandline+="add process %s pert_%s %s%s %s --no_warning=duplicate;" % (process, order ,split, rest, proc_nb)
@@ -2809,16 +2813,20 @@
2809 commandline += "define pert_%s = %s;" % (order, ' '.join(map(str,pert)) )2813 commandline += "define pert_%s = %s;" % (order, ' '.join(map(str,pert)) )
2810 2814
2811 # check if we have to increase by one the born order2815 # check if we have to increase by one the born order
2812 if '%s=' % order in process:2816 if '%s=' % order in process or '%s<=' % order in process:
2813 result=re.split(' ',process)2817 result=re.split(' ',process)
2814 process=''2818 process=''
2815 for r in result:2819 for r in result:
2816 if '%s=' % order in r:2820 if '%s=' % order in r:
2817 ior=re.split('=',r)2821 ior=re.split('=',r)
2818 r='QCD=%i' % (int(ior[1])+1)2822 r='%s=%i' % (order,int(ior[1])+1)
2823 elif '%s<=' % order in r:
2824 ior=re.split('=',r)
2825 r='%s<=%i' % (order,int(ior[1])+1)
2819 process=process+r+' '2826 process=process+r+' '
2827
2820 #handle special tag $ | / @2828 #handle special tag $ | / @
2821 result = re.split('([/$@]|\w+=\w+)', process, 1) 2829 result = re.split('([/$@]|\w+<?=\w+)', process, 1)
2822 if len(result) ==3:2830 if len(result) ==3:
2823 process, split, rest = result2831 process, split, rest = result
2824 commandline+="add process %s pert_%s %s%s , %s %s --no_warning=duplicate;" % \2832 commandline+="add process %s pert_%s %s%s , %s %s --no_warning=duplicate;" % \
28252833
=== modified file 'MadSpin/interface_madspin.py'
--- MadSpin/interface_madspin.py 2016-07-26 02:15:40 +0000
+++ MadSpin/interface_madspin.py 2016-12-10 02:02:40 +0000
@@ -248,7 +248,6 @@
248 if '--bypass_check' in args:248 if '--bypass_check' in args:
249 args.remove('--bypass_check')249 args.remove('--bypass_check')
250 bypass_check = True250 bypass_check = True
251
252 if len(args) == 1: 251 if len(args) == 1:
253 logger.warning("""No param_card defined for the new model. We will use the default one but this might completely wrong.""")252 logger.warning("""No param_card defined for the new model. We will use the default one but this might completely wrong.""")
254 elif len(args) != 2:253 elif len(args) != 2:
@@ -709,8 +708,10 @@
709 cumul allow to merge all the definition in one run (add process)708 cumul allow to merge all the definition in one run (add process)
710 to generate events according to cross-section709 to generate events according to cross-section
711 """710 """
712 711
713 part = self.model.get_particle(pdg)712 part = self.model.get_particle(pdg)
713 if not part:
714 return {}# this particle is not defined in the current model so ignore it
714 name = part.get_name()715 name = part.get_name()
715 out = {}716 out = {}
716 logger.info("generate %s decay event for particle %s" % (nb_event, name))717 logger.info("generate %s decay event for particle %s" % (nb_event, name))
@@ -739,6 +740,15 @@
739 me5_cmd = madevent_interface.MadEventCmdShell(me_dir=os.path.realpath(\740 me5_cmd = madevent_interface.MadEventCmdShell(me_dir=os.path.realpath(\
740 decay_dir), options=options)741 decay_dir), options=options)
741 me5_cmd.options["automatic_html_opening"] = False742 me5_cmd.options["automatic_html_opening"] = False
743 me5_cmd.options["madanalysis5_path"] = None
744 me5_cmd.options["madanalysis_path"] = None
745 try:
746 os.remove(pjoin(decay_dir, 'Cards', 'madanalysis5_parton_card_default.dat'))
747 os.remove(pjoin(decay_dir, 'Cards', 'madanalysis5_parton_card.dat'))
748 except Exception,error:
749 logger.debug(error)
750 pass
751 misc.sprint(os.listdir(pjoin(decay_dir,'Cards')))
742 if self.options["run_card"]:752 if self.options["run_card"]:
743 run_card = self.options["run_card"]753 run_card = self.options["run_card"]
744 else:754 else:
@@ -746,6 +756,7 @@
746 756
747 run_card["iseed"] = self.seed757 run_card["iseed"] = self.seed
748 run_card['gridpack'] = True758 run_card['gridpack'] = True
759 run_card['systematics_program'] = False
749 run_card.write(pjoin(decay_dir, "Cards", "run_card.dat"))760 run_card.write(pjoin(decay_dir, "Cards", "run_card.dat"))
750 param_card = self.banner['slha']761 param_card = self.banner['slha']
751 open(pjoin(decay_dir, "Cards", "param_card.dat"),"w").write(param_card)762 open(pjoin(decay_dir, "Cards", "param_card.dat"),"w").write(param_card)
@@ -763,12 +774,22 @@
763 me5_cmd = madevent_interface.MadEventCmdShell(me_dir=os.path.realpath(\774 me5_cmd = madevent_interface.MadEventCmdShell(me_dir=os.path.realpath(\
764 decay_dir), options=mg5.options)775 decay_dir), options=mg5.options)
765 me5_cmd.options["automatic_html_opening"] = False776 me5_cmd.options["automatic_html_opening"] = False
777 me5_cmd.options["madanalysis5_path"] = None
778 me5_cmd.options["madanalysis_path"] = None
779 try:
780 os.remove(pjoin(decay_dir, 'Cards', 'madanalysis5_parton_card_default.dat'))
781 os.remove(pjoin(decay_dir, 'Cards', 'madanalysis5_parton_card.dat'))
782 except Exception,error:
783 logger.debug(error)
784 pass
785
766 if self.options["run_card"]:786 if self.options["run_card"]:
767 run_card = self.options["run_card"]787 run_card = self.options["run_card"]
768 else:788 else:
769 run_card = banner.RunCard(pjoin(decay_dir, "Cards", "run_card.dat"))789 run_card = banner.RunCard(pjoin(decay_dir, "Cards", "run_card.dat"))
770 run_card["nevents"] = int(1.2*nb_event)790 run_card["nevents"] = int(1.2*nb_event)
771 run_card["iseed"] = self.seed791 run_card["iseed"] = self.seed
792 run_card["systematics_program"] = 'None'
772 run_card.write(pjoin(decay_dir, "Cards", "run_card.dat"))793 run_card.write(pjoin(decay_dir, "Cards", "run_card.dat"))
773 param_card = self.banner['slha']794 param_card = self.banner['slha']
774 open(pjoin(decay_dir, "Cards", "param_card.dat"),"w").write(param_card)795 open(pjoin(decay_dir, "Cards", "param_card.dat"),"w").write(param_card)
775796
=== modified file 'MadSpin/src/driver.f'
--- MadSpin/src/driver.f 2016-04-06 18:45:52 +0000
+++ MadSpin/src/driver.f 2016-12-10 02:02:40 +0000
@@ -907,7 +907,11 @@
907 if (index_p2.gt.0) then907 if (index_p2.gt.0) then
908 m2_tchan(i)=m(index_p2)908 m2_tchan(i)=m(index_p2)
909 else909 else
910 write(*,*) 'Warning: m_2^2 is negative in t-channel branching ',m2_tchan(i) 910 if (m(index_p2).gt.5d-2)then
911 m2_tchan(i) = 0d0
912 else
913 write(*,*) 'Warning: m_2^2 is negative in t-channel branching ',m2_tchan(i)
914 endif
911 endif915 endif
912 endif916 endif
913 ! extract phi917 ! extract phi
914918
=== modified file 'Template/LO/Cards/run_card.dat'
--- Template/LO/Cards/run_card.dat 2016-11-03 21:20:15 +0000
+++ Template/LO/Cards/run_card.dat 2016-12-10 02:02:40 +0000
@@ -276,6 +276,6 @@
276%(sys_alpsfact)s = sys_alpsfact # \alpha_s emission scale factors276%(sys_alpsfact)s = sys_alpsfact # \alpha_s emission scale factors
277%(sys_matchscale)s = sys_matchscale # variation of merging scale277%(sys_matchscale)s = sys_matchscale # variation of merging scale
278# PDF sets and number of members (0 or none for all members).278# PDF sets and number of members (0 or none for all members).
279%(sys_pdf)s = sys_pdf # separate by && if more than one set.279%(sys_pdf)s = sys_pdf # list of pdf sets
280# MSTW2008nlo68cl.LHgrid 1 = sys_pdf280# MSTW2008nlo68cl.LHgrid 1 = sys_pdf
281#281#
282282
=== added file 'Template/LO/Source/.make_opts'
--- Template/LO/Source/.make_opts 1970-01-01 00:00:00 +0000
+++ Template/LO/Source/.make_opts 2016-12-10 02:02:40 +0000
@@ -0,0 +1,103 @@
1DEFAULT_F2PY_COMPILER=f2py
2DEFAULT_F_COMPILER=gfortran
3MACFLAG=-mmacosx-version-min=10.7
4DEFAULT_CPP_COMPILER=clang
5MG5AMC_VERSION=SpecifiedByMG5aMCAtRunTime
6STDLIB=-lc++
7PYTHIA8_PATH=NotInstalled
8STDLIB_FLAG=-stdlib=libc++
9#end_of_make_opts_variables
10
11BIASLIBDIR=../../../lib/
12BIASLIBRARY=libbias.$(libext)
13
14# Rest of the makefile
15ifeq ($(origin FFLAGS),undefined)
16FFLAGS= -O -w -fbounds-check -fPIC
17#FFLAGS+= -g -fbounds-check -ffpe-trap=invalid,zero,overflow,underflow,denormal -Wall
18endif
19
20
21# REMOVE MACFLAG IF NOT ON MAC OR FOR F2PY
22UNAME := $(shell uname -s)
23ifdef f2pymode
24MACFLAG=
25else
26ifneq ($(UNAME), Darwin)
27MACFLAG=
28endif
29endif
30
31
32ifeq ($(origin CXXFLAGS),undefined)
33CXXFLAGS= -O $(STDLIB_FLAG) $(MACFLAG)
34endif
35
36ifeq ($(origin CFLAGS),undefined)
37CFLAGS= -O $(STDLIB_FLAG) $(MACFLAG)
38endif
39
40# Increase the number of allowed charcters in a Fortran line
41FFLAGS+= -ffixed-line-length-132
42
43# Set FC unless it's defined by an environment variable
44ifeq ($(origin FC),default)
45FC=$(DEFAULT_F_COMPILER)
46endif
47ifeq ($(origin F2PY), undefined)
48F2PY=$(DEFAULT_F2PY_COMPILER)
49endif
50
51UNAME := $(shell uname -s)
52ifeq ($(origin LDFLAGS), undefined)
53LDFLAGS=$(STDLIB) $(MACFLAG)
54endif
55
56# Options: dynamic, lhapdf
57# Option dynamic
58
59ifeq ($(UNAME), Darwin)
60dylibext=dylib
61else
62dylibext=so
63endif
64
65ifdef dynamic
66ifeq ($(UNAME), Darwin)
67libext=dylib
68FFLAGS+= -fno-common
69LDFLAGS += -bundle
70define CREATELIB
71$(FC) -dynamiclib -undefined dynamic_lookup -o $(1) $(2)
72endef
73else
74libext=so
75FFLAGS+= -fPIC
76LDFLAGS += -shared
77define CREATELIB
78$(FC) $(FFLAGS) $(LDFLAGS) -o $(1) $(2)
79endef
80endif
81else
82libext=a
83define CREATELIB
84$(AR) cru $(1) $(2)
85ranlib $(1)
86endef
87endif
88
89# Option lhapdf
90
91ifneq ($(lhapdf),)
92CXXFLAGS += $(shell $(lhapdf) --cppflags)
93alfas_functions=alfas_functions_lhapdf
94llhapdf+= -lLHAPDF
95else
96alfas_functions=alfas_functions
97llhapdf=
98endif
99
100# Helper function to check MG5 version
101define CHECK_MG5AMC_VERSION
102python -c 'import re; from distutils.version import StrictVersion; print StrictVersion("$(MG5AMC_VERSION)") >= StrictVersion("$(1)") if re.match("^[\d\.]+$$","$(MG5AMC_VERSION)") else True;'
103endef
0\ No newline at end of file104\ No newline at end of file
1105
=== removed file 'Template/LO/Source/make_opts'
--- Template/LO/Source/make_opts 2016-10-25 10:11:37 +0000
+++ Template/LO/Source/make_opts 1970-01-01 00:00:00 +0000
@@ -1,103 +0,0 @@
1DEFAULT_F2PY_COMPILER=f2py
2DEFAULT_F_COMPILER=gfortran
3MACFLAG=-mmacosx-version-min=10.7
4DEFAULT_CPP_COMPILER=clang
5MG5AMC_VERSION=SpecifiedByMG5aMCAtRunTime
6STDLIB=-lc++
7PYTHIA8_PATH=NotInstalled
8STDLIB_FLAG=-stdlib=libc++
9#end_of_make_opts_variables
10
11BIASLIBDIR=../../../lib/
12BIASLIBRARY=libbias.$(libext)
13
14# Rest of the makefile
15ifeq ($(origin FFLAGS),undefined)
16FFLAGS= -O -w -fbounds-check -fPIC
17#FFLAGS+= -g -fbounds-check -ffpe-trap=invalid,zero,overflow,underflow,denormal -Wall
18endif
19
20
21# REMOVE MACFLAG IF NOT ON MAC OR FOR F2PY
22UNAME := $(shell uname -s)
23ifdef f2pymode
24MACFLAG=
25else
26ifneq ($(UNAME), Darwin)
27MACFLAG=
28endif
29endif
30
31
32ifeq ($(origin CXXFLAGS),undefined)
33CXXFLAGS= -O $(STDLIB_FLAG) $(MACFLAG)
34endif
35
36ifeq ($(origin CFLAGS),undefined)
37CFLAGS= -O $(STDLIB_FLAG) $(MACFLAG)
38endif
39
40# Increase the number of allowed charcters in a Fortran line
41FFLAGS+= -ffixed-line-length-132
42
43# Set FC unless it's defined by an environment variable
44ifeq ($(origin FC),default)
45FC=$(DEFAULT_F_COMPILER)
46endif
47ifeq ($(origin F2PY), undefined)
48F2PY=$(DEFAULT_F2PY_COMPILER)
49endif
50
51UNAME := $(shell uname -s)
52ifeq ($(origin LDFLAGS), undefined)
53LDFLAGS=$(STDLIB) $(MACFLAG)
54endif
55
56# Options: dynamic, lhapdf
57# Option dynamic
58
59ifeq ($(UNAME), Darwin)
60dylibext=dylib
61else
62dylibext=so
63endif
64
65ifdef dynamic
66ifeq ($(UNAME), Darwin)
67libext=dylib
68FFLAGS+= -fno-common
69LDFLAGS += -bundle
70define CREATELIB
71$(FC) -dynamiclib -undefined dynamic_lookup -o $(1) $(2)
72endef
73else
74libext=so
75FFLAGS+= -fPIC
76LDFLAGS += -shared
77define CREATELIB
78$(FC) $(FFLAGS) $(LDFLAGS) -o $(1) $(2)
79endef
80endif
81else
82libext=a
83define CREATELIB
84$(AR) cru $(1) $(2)
85ranlib $(1)
86endef
87endif
88
89# Option lhapdf
90
91ifneq ($(lhapdf),)
92CXXFLAGS += $(shell $(lhapdf) --cppflags)
93alfas_functions=alfas_functions_lhapdf
94llhapdf+= -lLHAPDF
95else
96alfas_functions=alfas_functions
97llhapdf=
98endif
99
100# Helper function to check MG5 version
101define CHECK_MG5AMC_VERSION
102python -c 'import re; from distutils.version import StrictVersion; print StrictVersion("$(MG5AMC_VERSION)") >= StrictVersion("$(1)") if re.match("^[\d\.]+$$","$(MG5AMC_VERSION)") else True;'
103endef
104\ No newline at end of file0\ No newline at end of file
1051
=== modified file 'Template/LO/Source/rw_events.f'
--- Template/LO/Source/rw_events.f 2016-09-03 13:26:00 +0000
+++ Template/LO/Source/rw_events.f 2016-12-10 02:02:40 +0000
@@ -179,7 +179,7 @@
179c aqcd = g*g/4d0/pi179c aqcd = g*g/4d0/pi
180 write(largeBuff,'(a)') '<event>'180 write(largeBuff,'(a)') '<event>'
181 evt_record=trim(evt_record)//trim(largeBuff)181 evt_record=trim(evt_record)//trim(largeBuff)
182 write(largeBuff,'(i2,i4,e16.7e3,3e15.7)') nexternal,ievent,wgt,scale,182 write(largeBuff,'(i2,i5,e16.7e3,3e15.7)') nexternal,ievent,wgt,scale,
183 $ aqed,aqcd183 $ aqed,aqcd
184 evt_record=trim(evt_record)//CHAR(13)//CHAR(10)//trim(largeBuff)184 evt_record=trim(evt_record)//CHAR(13)//CHAR(10)//trim(largeBuff)
185 do i=1,nexternal185 do i=1,nexternal
@@ -277,8 +277,7 @@
277c aqcd = g*g/4d0/pi277c aqcd = g*g/4d0/pi
278278
279 write(lun,'(a)') '<event>'279 write(lun,'(a)') '<event>'
280 write(lun,'(i2,i4,e16.7e3,3e15.7)') nexternal,ievent,wgt,scale,aqed,aqcd280 write(lun,'(i2,i5,e16.7e3,3e15.7)') nexternal,ievent,wgt,scale,aqed,aqcd
281 write(*,'(i2,i4,e15.7e3,3e15.7)') nexternal,ievent,wgt,scale,aqed,aqcd
282 do i=1,nexternal281 do i=1,nexternal
283 write(lun,51) ic(1,i),ic(6,i),(ic(j,i),j=2,5),282 write(lun,51) ic(1,i),ic(6,i),(ic(j,i),j=2,5),
284 $ (p(j,i),j=1,3),p(0,i),p(4,i),0.,real(ic(7,i))283 $ (p(j,i),j=1,3),p(0,i),p(4,i),0.,real(ic(7,i))
285284
=== modified file 'Template/LO/SubProcesses/makefile'
--- Template/LO/SubProcesses/makefile 2016-08-11 00:19:31 +0000
+++ Template/LO/SubProcesses/makefile 2016-12-10 02:02:40 +0000
@@ -44,7 +44,7 @@
44 $(FC) -o $(PROG) $(PROCESS) $(LINKLIBS) $(LDFLAGS) $(BIASDEPENDENCIES)44 $(FC) -o $(PROG) $(PROCESS) $(LINKLIBS) $(LDFLAGS) $(BIASDEPENDENCIES)
4545
46gensym: $(SYMMETRY) configs.inc $(LIBDIR)libmodel.$(libext) $(LIBDIR)libgeneric.$(libext)46gensym: $(SYMMETRY) configs.inc $(LIBDIR)libmodel.$(libext) $(LIBDIR)libgeneric.$(libext)
47 $(FC) -o gensym $(SYMMETRY) -L../../lib/ -lmodel -lgeneric $(LDFLAGS)47 $(FC) -o gensym $(SYMMETRY) -L../../lib/ -lmodel -lgeneric -lpdf $(LDFLAGS)
4848
49$(LIBDIR)libmodel.$(libext): ../../Cards/param_card.dat49$(LIBDIR)libmodel.$(libext): ../../Cards/param_card.dat
50 cd ../../Source/MODEL; make50 cd ../../Source/MODEL; make
5151
=== modified file 'Template/NLO/MCatNLO/PY8Analyzer/py8an_HwU_pp_lvl.f'
--- Template/NLO/MCatNLO/PY8Analyzer/py8an_HwU_pp_lvl.f 2016-02-23 10:48:46 +0000
+++ Template/NLO/MCatNLO/PY8Analyzer/py8an_HwU_pp_lvl.f 2016-12-10 02:02:40 +0000
@@ -61,6 +61,7 @@
61 call set_error_estimation(0)61 call set_error_estimation(0)
62 nwgt_analysis=nwgt62 nwgt_analysis=nwgt
63 do i=1,163 do i=1,1
64 l=0
64 call HwU_book(l+1,'total rate '//HwUtype(i),2,-2.d0,2.d0)65 call HwU_book(l+1,'total rate '//HwUtype(i),2,-2.d0,2.d0)
65 call HwU_book(l+2,'lep rapidity '//HwUtype(i),40,-9d0,9d0)66 call HwU_book(l+2,'lep rapidity '//HwUtype(i),40,-9d0,9d0)
66 call HwU_book(l+3,'lep pt '//HwUtype(i),100,0d0,200d0)67 call HwU_book(l+3,'lep pt '//HwUtype(i),100,0d0,200d0)
6768
=== modified file 'Template/NLO/MCatNLO/srcHerwig/madfks_hwlhin.f'
--- Template/NLO/MCatNLO/srcHerwig/madfks_hwlhin.f 2016-04-04 09:56:54 +0000
+++ Template/NLO/MCatNLO/srcHerwig/madfks_hwlhin.f 2016-12-10 02:02:40 +0000
@@ -74,22 +74,27 @@
74 # scale1_lhe,scale2_lhe,74 # scale1_lhe,scale2_lhe,
75 # jwgtinfo,mexternal,iwgtnumpartn,75 # jwgtinfo,mexternal,iwgtnumpartn,
76 # wgtcentral,wgtmumin,wgtmumax,wgtpdfmin,wgtpdfmax76 # wgtcentral,wgtmumin,wgtmumax,wgtpdfmin,wgtpdfmax
77 if(jwgtinfo.eq.9)then77 if(abs(jwgtinfo).eq.9.and.nwgt.gt.1)then
78 if (nwgt.gt.1) then78 do while(index(string,'</event>').eq.0.and.
79 & index(string,'<rwgt>').eq.0)
79 read(iunit,'(a)')string ! <rwgt>80 read(iunit,'(a)')string ! <rwgt>
81 enddo
82 if(index(string,'</event>').eq.0)then
80 wgtref=XWGTUP/MQQ83 wgtref=XWGTUP/MQQ
81 do iww=2,nwgt ! start at 2, because 'central value' is not part of the extra weights84 do iww=2,nwgt ! start at 2, because 'central value' is not part of the extra weights
82 call read_rwgt_line_wgt(iunit,ww(iww))85 call read_rwgt_line_wgt(iunit,ww(iww))
83 enddo86 enddo
84 read(iunit,'(a)')string ! </rwgt>87 read(iunit,'(a)')string ! </rwgt>
88 write(*,*) string
85 endif89 endif
90 do while(index(string,'</event>').eq.0)
91 read(iunit,'(a)')string ! <rwgt>
92 enddo
86 else93 else
87 do while(index(string,'</event>').eq.0)94 do while(index(string,'</event>').eq.0)
88 read(iunit,'(a)')string95 read(iunit,'(a)')string
89 enddo96 enddo
90 backspace(iunit)
91 endif97 endif
92 read(iunit,'(a)')string
93 else98 else
94 string=buff(1:len_trim(buff))99 string=buff(1:len_trim(buff))
95 buff_tlh=' '100 buff_tlh=' '
96101
=== modified file 'Template/NLO/SubProcesses/madfks_plot.f'
--- Template/NLO/SubProcesses/madfks_plot.f 2016-10-11 10:29:57 +0000
+++ Template/NLO/SubProcesses/madfks_plot.f 2016-12-10 02:02:40 +0000
@@ -265,7 +265,7 @@
265 chybst=cosh(ybst_til_tolab)265 chybst=cosh(ybst_til_tolab)
266 shybst=sinh(ybst_til_tolab)266 shybst=sinh(ybst_til_tolab)
267 chybstmo=chybst-1.d0267 chybstmo=chybst-1.d0
268 do i=3,nexternal268 do i=nincoming+1,nexternal
269 call boostwdir2(chybst,shybst,chybstmo,xd,pp(0,i),pplab(0,i))269 call boostwdir2(chybst,shybst,chybstmo,xd,pp(0,i),pplab(0,i))
270 enddo270 enddo
271c Fill the arrays (momenta, status and PDG):271c Fill the arrays (momenta, status and PDG):
272272
=== modified file 'Template/NLO/SubProcesses/setcuts.f'
--- Template/NLO/SubProcesses/setcuts.f 2016-09-27 15:07:53 +0000
+++ Template/NLO/SubProcesses/setcuts.f 2016-12-10 02:02:40 +0000
@@ -156,7 +156,7 @@
156 INTEGER NFKSPROCESS156 INTEGER NFKSPROCESS
157 COMMON/C_NFKSPROCESS/NFKSPROCESS157 COMMON/C_NFKSPROCESS/NFKSPROCESS
158 double precision taumin(fks_configs),taumin_s(fks_configs)158 double precision taumin(fks_configs),taumin_s(fks_configs)
159 & ,taumin_j(fks_configs),stot,xk(-nexternal:0)159 & ,taumin_j(fks_configs),stot,xk(nexternal)
160 save taumin,taumin_s,taumin_j,stot160 save taumin,taumin_s,taumin_j,stot
161 integer i,j,k,d1,d2,iFKS,nt161 integer i,j,k,d1,d2,iFKS,nt
162 double precision xm(-nexternal:nexternal),xm1,xm2,xmi162 double precision xm(-nexternal:nexternal),xm1,xm2,xmi
163163
=== modified file 'Template/NLO/makefile'
--- Template/NLO/makefile 2013-11-15 12:29:09 +0000
+++ Template/NLO/makefile 2016-12-10 02:02:40 +0000
@@ -1,5 +1,5 @@
1FILES = Cards HTML SubProcesses bin lib Source Events index.html README README.lhapdf \1FILES = Cards HTML SubProcesses bin lib Source Events FixedOrderAnalysis MCatNLO \
2 TemplateVersion.txt MGMEVersion.txt2 index.html README README.lhapdf TemplateVersion.txt MGMEVersion.txt
3 3
4amcatnlo.tar.gz: amcatnlo.tar4amcatnlo.tar.gz: amcatnlo.tar
5 rm -f amcatnlo.tar.gz5 rm -f amcatnlo.tar.gz
66
=== modified file 'Template/loop_material/StandAlone/SubProcesses/MadLoopCommons.inc'
--- Template/loop_material/StandAlone/SubProcesses/MadLoopCommons.inc 2016-05-24 23:58:40 +0000
+++ Template/loop_material/StandAlone/SubProcesses/MadLoopCommons.inc 2016-12-10 02:02:40 +0000
@@ -104,6 +104,9 @@
104 call SwitchOffCacheSystem_cll()104 call SwitchOffCacheSystem_cll()
105 ENDIF105 ENDIF
106106
107C Make sure no COLLIER error can interrupt the code
108 call SwitchOffErrStop_cll()
109
107C Specify below your other custom COLLIER parameter settings 110C Specify below your other custom COLLIER parameter settings
108C [user_specific_COLLIER_settings]111C [user_specific_COLLIER_settings]
109 112
110113
=== modified file 'UpdateNotes.txt'
--- UpdateNotes.txt 2016-11-04 09:47:56 +0000
+++ UpdateNotes.txt 2016-12-10 02:02:40 +0000
@@ -1,5 +1,14 @@
1Update notes for MadGraph5_aMC@NLO (in reverse time order)1Update notes for MadGraph5_aMC@NLO (in reverse time order)
22
32.5.2(05/07/16)
4 OM: improve systematics (thanks to Philipp Pigard)
5 OM: new syntax to modify the run_card: set no_parton_cut
6 This removes all the cut present in the card.
7 OM: change the default configuration parameter cluster_local_path to None
8 OM: change the syscalc syntax for the pdf to avoid using & since this is not xml compliant
9 OM: avoid to bias module to include trivial weight in gridpack mode
10 OM: Fix a bug making 2.5.1 not compatible with python2.6
11 OM: Improve "add missing" command if a full block is missing
312
42.5.1 (04/11/16)132.5.1 (04/11/16)
5 PT+MZ: New interface for Herwig7.14 PT+MZ: New interface for Herwig7.
615
=== modified file 'VERSION'
--- VERSION 2016-11-04 09:47:56 +0000
+++ VERSION 2016-12-10 02:02:40 +0000
@@ -1,5 +1,5 @@
1version = 2.5.11version = 2.5.2
2date = 2016-11-042date = 2016-05-07
33
44
55
66
=== modified file 'madgraph/__init__.py'
--- madgraph/__init__.py 2015-10-01 16:00:08 +0000
+++ madgraph/__init__.py 2016-12-10 02:02:40 +0000
@@ -37,3 +37,14 @@
37MG4DIR = MG5DIR37MG4DIR = MG5DIR
38ReadWrite = os.access(MG5DIR, os.W_OK) # W_OK is for writing38ReadWrite = os.access(MG5DIR, os.W_OK) # W_OK is for writing
3939
40if ReadWrite:
41 # Temporary fix for problem with auto-update
42 try:
43 tmp_path = pjoin(MG5DIR, 'Template','LO','Source','make_opts')
44 #1480375724 is 29/11/16
45 if os.path.exists(tmp_path) and os.path.getmtime(tmp_path) < 1480375724:
46 os.remove(tmp_path)
47 shutil.copy(pjoin(MG5DIR, 'Template','LO','Source','.make_opts'),
48 pjoin(MG5DIR, 'Template','LO','Source','make_opts'))
49 except Exception,error:
50 pass
4051
=== modified file 'madgraph/core/base_objects.py'
--- madgraph/core/base_objects.py 2016-10-31 19:32:57 +0000
+++ madgraph/core/base_objects.py 2016-12-10 02:02:40 +0000
@@ -237,7 +237,7 @@
237 elif name == 'goldstone':237 elif name == 'goldstone':
238 return self['type'] == 'goldstone'238 return self['type'] == 'goldstone'
239 elif name == 'propagating':239 elif name == 'propagating':
240 return self['line'] is not None240 return self['line'] not in ['None',None]
241 else:241 else:
242 return super(Particle, self).get(name)242 return super(Particle, self).get(name)
243243
@@ -348,7 +348,7 @@
348 if not isinstance(value, str):348 if not isinstance(value, str):
349 raise self.PhysicsObjectError, \349 raise self.PhysicsObjectError, \
350 "Line type %s is not a string" % repr(value)350 "Line type %s is not a string" % repr(value)
351 if value not in ['dashed', 'straight', 'wavy', 'curly', 'double','swavy','scurly','dotted']:351 if value not in ['None','dashed', 'straight', 'wavy', 'curly', 'double','swavy','scurly','dotted']:
352 raise self.PhysicsObjectError, \352 raise self.PhysicsObjectError, \
353 "Line type %s is unknown" % value353 "Line type %s is unknown" % value
354354
355355
=== modified file 'madgraph/interface/amcatnlo_run_interface.py'
--- madgraph/interface/amcatnlo_run_interface.py 2016-11-03 15:21:05 +0000
+++ madgraph/interface/amcatnlo_run_interface.py 2016-12-10 02:02:40 +0000
@@ -2943,8 +2943,8 @@
2943 'hwpp_path'],2943 'hwpp_path'],
2944 'PYTHIA8': ['pythia8_path']}2944 'PYTHIA8': ['pythia8_path']}
29452945
2946 if not all([self.options[ppath] for ppath in path_dict[shower]]):2946 if not all([self.options[ppath] and os.path.exists(self.options[ppath]) for ppath in path_dict[shower]]):
2947 raise aMCatNLOError('Some paths are missing in the configuration file.\n' + \2947 raise aMCatNLOError('Some paths are missing or invalid in the configuration file.\n' + \
2948 ('Please make sure you have set these variables: %s' % ', '.join(path_dict[shower])))2948 ('Please make sure you have set these variables: %s' % ', '.join(path_dict[shower])))
29492949
2950 if shower == 'HERWIGPP':2950 if shower == 'HERWIGPP':
29512951
=== modified file 'madgraph/interface/common_run_interface.py'
--- madgraph/interface/common_run_interface.py 2016-11-03 21:20:15 +0000
+++ madgraph/interface/common_run_interface.py 2016-12-10 02:02:40 +0000
@@ -595,7 +595,7 @@
595 'cluster_type': 'condor',595 'cluster_type': 'condor',
596 'cluster_status_update': (600, 30),596 'cluster_status_update': (600, 30),
597 'cluster_nb_retry':1,597 'cluster_nb_retry':1,
598 'cluster_local_path': "/cvmfs/cp3.uclouvain.be/madgraph/",598 'cluster_local_path': None,
599 'cluster_retry_wait':300}599 'cluster_retry_wait':300}
600600
601 options_madgraph= {'stdout_level':None}601 options_madgraph= {'stdout_level':None}
@@ -1534,7 +1534,7 @@
1534 1534
1535 # always pass to a path + get the event size1535 # always pass to a path + get the event size
1536 result_file= sys.stdout1536 result_file= sys.stdout
1537 if not os.path.sep in args[0]:1537 if not os.path.isfile(args[0]) and not os.path.sep in args[0]:
1538 path = [pjoin(self.me_dir, 'Events', args[0], 'unweighted_events.lhe.gz'),1538 path = [pjoin(self.me_dir, 'Events', args[0], 'unweighted_events.lhe.gz'),
1539 pjoin(self.me_dir, 'Events', args[0], 'unweighted_events.lhe'),1539 pjoin(self.me_dir, 'Events', args[0], 'unweighted_events.lhe'),
1540 pjoin(self.me_dir, 'Events', args[0], 'events.lhe.gz'),1540 pjoin(self.me_dir, 'Events', args[0], 'events.lhe.gz'),
@@ -1554,7 +1554,7 @@
1554 else:1554 else:
1555 raise self.InvalidCmd, 'Invalid run name. Please retry'1555 raise self.InvalidCmd, 'Invalid run name. Please retry'
1556 elif self.options['nb_core'] != 1:1556 elif self.options['nb_core'] != 1:
1557 lhe = lhe_parser.EventFile(args)1557 lhe = lhe_parser.EventFile(args[0])
1558 nb_event = len(lhe)1558 nb_event = len(lhe)
1559 lhe.close()1559 lhe.close()
15601560
@@ -1590,9 +1590,13 @@
1590 1590
1591 # Check that all pdfset are correctly installed1591 # Check that all pdfset are correctly installed
1592 if 'sys_pdf' in self.run_card:1592 if 'sys_pdf' in self.run_card:
1593 sys_pdf = self.run_card['sys_pdf'].split('&&')1593 if '&&' in self.run_card['sys_pdf']:
1594 lhaid += [l.split()[0] for l in sys_pdf]1594 line = ' '.join(self.run_card['sys_pdf'])
15951595 sys_pdf = line.split('&&')
1596 lhaid += [l.split()[0] for l in sys_pdf]
1597 else:
1598 lhaid += [l for l in self.run_card['sys_pdf'].split() if not l.isdigit() or int(l) > 500]
1599
1596 else:1600 else:
1597 #check that all p1601 #check that all p
1598 pdf = [a[6:] for a in opts if a.startswith('--pdf=')]1602 pdf = [a[6:] for a in opts if a.startswith('--pdf=')]
@@ -3921,7 +3925,8 @@
3921 'pythia8_card PartonLevel:FSRinResonances False',3925 'pythia8_card PartonLevel:FSRinResonances False',
3922 'pythia8_card ProcessLevel:resonanceDecays False',3926 'pythia8_card ProcessLevel:resonanceDecays False',
3923 ]),3927 ]),
3924 'mpi':([bool],['pythia8_card partonlevel:mpi %(0)s'])3928 'mpi':([bool],['pythia8_card partonlevel:mpi %(0)s']),
3929 'no_parton_cut':([],['run_card nocut T'])
3925 }3930 }
39263931
3927 special_shortcut_help = { 3932 special_shortcut_help = {
@@ -4576,7 +4581,6 @@
4576 #else:4581 #else:
4577 # logger.warning("too many argument for this command")4582 # logger.warning("too many argument for this command")
4578 # return4583 # return
4579
4580 for arg in cmd:4584 for arg in cmd:
4581 try:4585 try:
4582 text = arg % values4586 text = arg % values
@@ -4625,7 +4629,6 @@
4625 fsock.write(p_card)4629 fsock.write(p_card)
4626 return4630 return
4627 4631
4628
4629 card = '' #store which card need to be modify (for name conflict)4632 card = '' #store which card need to be modify (for name conflict)
4630 if args[0] == 'madweight_card':4633 if args[0] == 'madweight_card':
4631 if not self.mw_card:4634 if not self.mw_card:
@@ -4666,7 +4669,6 @@
4666 pjoin(self.me_dir,'Cards', 'delphes_card.dat'))4669 pjoin(self.me_dir,'Cards', 'delphes_card.dat'))
4667 return4670 return
4668 4671
4669
4670 if args[0] in ['run_card', 'param_card', 'MadWeight_card', 'shower_card',4672 if args[0] in ['run_card', 'param_card', 'MadWeight_card', 'shower_card',
4671 'delphes_card','madanalysis5_hadron_card','madanalysis5_parton_card']:4673 'delphes_card','madanalysis5_hadron_card','madanalysis5_parton_card']:
4672 if args[1] == 'default':4674 if args[1] == 'default':
@@ -4751,7 +4753,11 @@
4751 val = args[start+1]4753 val = args[start+1]
4752 self.setR(args[start], val)4754 self.setR(args[start], val)
4753 self.run_card.write(self.paths['run'], self.paths['run_default'])4755 self.run_card.write(self.paths['run'], self.paths['run_default'])
4754 4756 # special mode for set run_card nocut T (generated by set no_parton_cut
4757 elif card == 'run_card' and args[start] in ['nocut', 'no_cut']:
4758 logger.info("Going to remove all cuts from the run_card", '$MG:color:BLACK')
4759 self.run_card.remove_all_cut()
4760 self.run_card.write(self.paths['run'], self.paths['run_default'])
4755 ### PARAM_CARD WITH BLOCK NAME -----------------------------------------4761 ### PARAM_CARD WITH BLOCK NAME -----------------------------------------
4756 elif (args[start] in self.param_card or args[start] == 'width') \4762 elif (args[start] in self.param_card or args[start] == 'width') \
4757 and card in ['','param_card']:4763 and card in ['','param_card']:
@@ -5280,6 +5286,9 @@
5280 5286
5281 def check_block(self, blockname):5287 def check_block(self, blockname):
5282 add_entry = 05288 add_entry = 0
5289 if blockname.lower() not in self.param_card_default:
5290 logger.info('unknow block %s: block will be ignored', blockname)
5291 return add_entry
5283 block = self.param_card_default[blockname]5292 block = self.param_card_default[blockname]
5284 for key in block.keys():5293 for key in block.keys():
5285 if key not in input_in_block:5294 if key not in input_in_block:
@@ -5291,6 +5300,8 @@
5291 add_entry += 15300 add_entry += 1
5292 if add_entry:5301 if add_entry:
5293 text.append('\n')5302 text.append('\n')
5303 if add_entry:
5304 logger.info("Adding %s parameter(s) to block %s", add_entry, blockname)
5294 return add_entry5305 return add_entry
5295 5306
5296 # Add to the current param_card all the missing input at default value5307 # Add to the current param_card all the missing input at default value
@@ -5344,7 +5355,9 @@
5344 continue5355 continue
53455356
5346 if block not in defined_blocks:5357 if block not in defined_blocks:
5347 add_entry += len(self.param_card_default[block])5358 nb_entry = len(self.param_card_default[block])
5359 logger.info("Block %s was missing. Adding the %s associated parameter(s)", block,nb_entry)
5360 add_entry += nb_entry
5348 text.append(str(self.param_card_default[block])) 5361 text.append(str(self.param_card_default[block]))
5349 5362
5350 # special check for the decay5363 # special check for the decay
53515364
=== modified file 'madgraph/interface/madevent_interface.py'
--- madgraph/interface/madevent_interface.py 2016-11-04 09:42:37 +0000
+++ madgraph/interface/madevent_interface.py 2016-12-10 02:02:40 +0000
@@ -3824,11 +3824,15 @@
3824 # Now setup the preamble to make sure that everything will use the locally3824 # Now setup the preamble to make sure that everything will use the locally
3825 # installed tools (if present) even if the user did not add it to its3825 # installed tools (if present) even if the user did not add it to its
3826 # environment variables.3826 # environment variables.
3827 if MADEVENT:3827 if 'heptools_install_dir' in self.options:
3828 preamble = misc.get_HEPTools_location_setter(3828 preamble = misc.get_HEPTools_location_setter(
3829 pjoin(self.options['mg5amc_py8_interface_path'],os.pardir),'lib')3829 self.options['heptools_install_dir'],'lib')
3830 else:3830 else:
3831 preamble = misc.get_HEPTools_location_setter(3831 if MADEVENT:
3832 preamble = misc.get_HEPTools_location_setter(
3833 pjoin(self.options['mg5amc_py8_interface_path'],os.pardir),'lib')
3834 else:
3835 preamble = misc.get_HEPTools_location_setter(
3832 pjoin(MG5DIR,'HEPTools'),'lib')3836 pjoin(MG5DIR,'HEPTools'),'lib')
3833 3837
3834 open(pythia_cmd_card,'w').write("""!3838 open(pythia_cmd_card,'w').write("""!
@@ -5485,8 +5489,12 @@
5485 5489
5486 # Check that all pdfset are correctly installed5490 # Check that all pdfset are correctly installed
5487 lhaid = [self.run_card.get_lhapdf_id()]5491 lhaid = [self.run_card.get_lhapdf_id()]
5488 sys_pdf = self.run_card['sys_pdf'].split('&&')5492 if '&&' in self.run_card['sys_pdf']:
5489 lhaid += [l.split()[0] for l in sys_pdf]5493 line = ' '.join(self.run_card['sys_pdf'])
5494 sys_pdf = line.split('&&')
5495 lhaid += [l.split()[0] for l in sys_pdf]
5496 else:
5497 lhaid += [l for l in self.run_card['sys_pdf'].split() if not l.isdigit() or int(l) > 500]
5490 try:5498 try:
5491 pdfsets_dir = self.get_lhapdf_pdfsetsdir()5499 pdfsets_dir = self.get_lhapdf_pdfsetsdir()
5492 except Exception, error:5500 except Exception, error:
@@ -5497,17 +5505,34 @@
5497 # Copy all the relevant PDF sets5505 # Copy all the relevant PDF sets
5498 [self.copy_lhapdf_set([onelha], pdfsets_dir) for onelha in lhaid]5506 [self.copy_lhapdf_set([onelha], pdfsets_dir) for onelha in lhaid]
5499 5507
5500 5508 to_syscalc={'sys_scalefact': self.run_card['sys_scalefact'],
5509 'sys_alpsfact': self.run_card['sys_alpsfact'],
5510 'sys_matchscale': self.run_card['sys_matchscale'],
5511 'sys_scalecorrelation': self.run_card['sys_scalecorrelation'],
5512 'sys_pdf': self.run_card['sys_pdf']}
5501 5513
5502 tag = self.run_card['run_tag'] 5514 tag = self.run_card['run_tag']
5503 card = pjoin(self.me_dir, 'bin','internal', 'syscalc_card.dat')5515 card = pjoin(self.me_dir, 'bin','internal', 'syscalc_card.dat')
5504 template = open(pjoin(self.me_dir, 'bin','internal', 'syscalc_template.dat')).read()5516 template = open(pjoin(self.me_dir, 'bin','internal', 'syscalc_template.dat')).read()
5505 self.run_card['sys_pdf'] = self.run_card['sys_pdf'].split('#',1)[0].replace('&&',' \n ')5517
5506 5518 if '&&' in to_syscalc['sys_pdf']:
5507 if self.run_card['sys_pdf'].lower() in ['', 'f', 'false', 'none', '.false.']:5519 to_syscalc['sys_pdf'] = to_syscalc['sys_pdf'].split('#',1)[0].replace('&&',' \n ')
5508 self.run_card['sys_pdf'] = ''5520 else:
5509 if self.run_card['sys_alpsfact'].lower() in ['', 'f', 'false', 'none','.false.']:5521 data = to_syscalc['sys_pdf'].split()
5510 self.run_card['sys_alpsfact'] = ''5522 new = []
5523 for d in data:
5524 if not d.isdigit():
5525 new.append(d)
5526 elif int(d) > 500:
5527 new.append(d)
5528 else:
5529 new[-1] += ' %s' % d
5530 to_syscalc['sys_pdf'] = '\n'.join(new)
5531
5532 if to_syscalc['sys_pdf'].lower() in ['', 'f', 'false', 'none', '.false.']:
5533 to_syscalc['sys_pdf'] = ''
5534 if to_syscalc['sys_alpsfact'].lower() in ['', 'f', 'false', 'none','.false.']:
5535 to_syscalc['sys_alpsfact'] = ''
55115536
55125537
55135538
@@ -6477,7 +6502,7 @@
6477 interface.do_treatcards('all --no_MadLoopInit')6502 interface.do_treatcards('all --no_MadLoopInit')
6478 6503
6479 # First make sure that IREGI and CUTTOOLS are compiled if needed6504 # First make sure that IREGI and CUTTOOLS are compiled if needed
6480 if os.path.exists(pjoin(proc_dir,'Source','CUTTOOLS')):6505 if os.path.exists(pjoin(proc_dir,'Source','CutTools')):
6481 misc.compile(arg=['libcuttools'],cwd=pjoin(proc_dir,'Source'))6506 misc.compile(arg=['libcuttools'],cwd=pjoin(proc_dir,'Source'))
6482 if os.path.exists(pjoin(proc_dir,'Source','IREGI')):6507 if os.path.exists(pjoin(proc_dir,'Source','IREGI')):
6483 misc.compile(arg=['libiregi'],cwd=pjoin(proc_dir,'Source'))6508 misc.compile(arg=['libiregi'],cwd=pjoin(proc_dir,'Source'))
64846509
=== modified file 'madgraph/interface/madgraph_interface.py'
--- madgraph/interface/madgraph_interface.py 2016-11-01 15:20:16 +0000
+++ madgraph/interface/madgraph_interface.py 2016-12-10 02:02:40 +0000
@@ -2449,6 +2449,7 @@
24492449
2450 def complete_set(self, text, line, begidx, endidx):2450 def complete_set(self, text, line, begidx, endidx):
2451 "Complete the set command"2451 "Complete the set command"
2452 misc.sprint([text,line,begidx, endidx])
2452 args = self.split_arg(line[0:begidx])2453 args = self.split_arg(line[0:begidx])
24532454
2454 # Format2455 # Format
@@ -2864,6 +2865,14 @@
2864 mgme_dir)2865 mgme_dir)
2865 self._mgme_dir = MG4DIR2866 self._mgme_dir = MG4DIR
28662867
2868 # check that make_opts exists
2869 make_opts = pjoin(MG5DIR, 'Template','LO','Source','make_opts')
2870 make_opts_source = pjoin(MG5DIR, 'Template','LO','Source','.make_opts')
2871 if not os.path.exists(make_opts):
2872 shutil.copy(make_opts_source, make_opts)
2873 elif os.path.getmtime(make_opts) < os.path.getmtime(make_opts_source):
2874 shutil.copy(make_opts_source, make_opts)
2875
2867 # Variables to store state information2876 # Variables to store state information
2868 self._multiparticles = {}2877 self._multiparticles = {}
2869 self.options = {}2878 self.options = {}
@@ -6409,6 +6418,12 @@
6409 subprocess.call([os.path.join('tests','test_manager.py')],6418 subprocess.call([os.path.join('tests','test_manager.py')],
6410 cwd=MG5DIR) 6419 cwd=MG5DIR)
6411 print 'new version installed, please relaunch mg5'6420 print 'new version installed, please relaunch mg5'
6421 try:
6422 os.remove(pjoin(MG5DIR, 'Template','LO','Source','make_opts'))
6423 shutil.copy(pjoin(MG5DIR, 'Template','LO','Source','.make_opts'),
6424 pjoin(MG5DIR, 'Template','LO','Source','make_opts'))
6425 except:
6426 pass
6412 sys.exit(0)6427 sys.exit(0)
6413 elif answer == 'n':6428 elif answer == 'n':
6414 # prevent for a future check6429 # prevent for a future check
64156430
=== modified file 'madgraph/iolibs/export_v4.py'
--- madgraph/iolibs/export_v4.py 2016-10-24 12:21:59 +0000
+++ madgraph/iolibs/export_v4.py 2016-12-10 02:02:40 +0000
@@ -907,7 +907,7 @@
907 return two value:907 return two value:
908 - True/False if the matrix_element was modified908 - True/False if the matrix_element was modified
909 - the new(or old) matrix element"""909 - the new(or old) matrix element"""
910 misc.sprint("DO not modify grouping") 910
911 return False, matrix_element911 return False, matrix_element
912 912
913 #===========================================================================913 #===========================================================================
914914
=== modified file 'madgraph/iolibs/template_files/madevent_makefile_source'
--- madgraph/iolibs/template_files/madevent_makefile_source 2016-09-01 09:14:58 +0000
+++ madgraph/iolibs/template_files/madevent_makefile_source 2016-12-10 02:02:40 +0000
@@ -54,8 +54,8 @@
5454
55$(BINDIR)gen_ximprove: gen_ximprove.o ranmar.o rw_routines.o open_file.o 55$(BINDIR)gen_ximprove: gen_ximprove.o ranmar.o rw_routines.o open_file.o
56 $(FC) $(LDFLAGS) -o $@ $^56 $(FC) $(LDFLAGS) -o $@ $^
57$(BINDIR)combine_events: $(COMBINE) $(LIBDIR)libmodel.$(libext) $(LIBDIR)libpdf.$(libext) run_card.inc57$(BINDIR)combine_events: $(COMBINE) $(LIBDIR)libmodel.$(libext) $(LIBDIR)libpdf.$(libext) run_card.inc $(LIBDIR)libbias.$(libext)
58 $(FC) $(LDFLAGS) -o $@ $(COMBINE) -L$(LIBDIR) -lmodel -lpdf $(llhapdf) $(LDFLAGS)58 $(FC) $(LDFLAGS) -o $@ $(COMBINE) -L$(LIBDIR) -lmodel -lpdf $(llhapdf) $(LDFLAGS) -lbias
59$(BINDIR)gensudgrid: $(GENSUDGRID) $(LIBDIR)libpdf.$(libext) $(LIBDIR)libcernlib.$(libext)59$(BINDIR)gensudgrid: $(GENSUDGRID) $(LIBDIR)libpdf.$(libext) $(LIBDIR)libcernlib.$(libext)
60 $(FC) $(LDFLAGS) -o $@ $(GENSUDGRID) -L$(LIBDIR) -lmodel -lpdf -lcernlib $(llhapdf) $(LDFLAGS)60 $(FC) $(LDFLAGS) -o $@ $(GENSUDGRID) -L$(LIBDIR) -lmodel -lpdf -lcernlib $(llhapdf) $(LDFLAGS)
6161
6262
=== modified file 'madgraph/iolibs/template_files/madevent_symmetry.f'
--- madgraph/iolibs/template_files/madevent_symmetry.f 2016-09-06 15:01:18 +0000
+++ madgraph/iolibs/template_files/madevent_symmetry.f 2016-12-10 02:02:40 +0000
@@ -13,6 +13,8 @@
13 include 'run_config.inc'13 include 'run_config.inc'
14 include 'maxamps.inc'14 include 'maxamps.inc'
15 include 'nexternal.inc'15 include 'nexternal.inc'
16 include 'cuts.inc'
17 include '../../Source/run.inc'
16 18
17 double precision ZERO19 double precision ZERO
18 parameter (ZERO = 0d0)20 parameter (ZERO = 0d0)
@@ -32,16 +34,13 @@
32 integer pow(-max_branch:-1,lmaxconfigs)34 integer pow(-max_branch:-1,lmaxconfigs)
33 character*20 param(maxpara),value(maxpara)35 character*20 param(maxpara),value(maxpara)
34 double precision pmass(nexternal) !External particle mass36 double precision pmass(nexternal) !External particle mass
35 double precision pi1(0:3),pi2(0:3),m1,m2,ebeam(2)37 double precision pi1(0:3),pi2(0:3),m1,m2
36 integer lpp(2)
37c38c
38c Global39c Global
39c40c
40 include 'coupl.inc'41 include 'coupl.inc'
41 logical gridpack42 logical gridpack
42 common/to_gridpack/gridpack43 common/to_gridpack/gridpack
43 double precision bwcutoff
44 common/to_bwcutoff/bwcutoff
45 double precision stot44 double precision stot
46 common/to_stot/stot45 common/to_stot/stot
47c46c
@@ -53,6 +52,13 @@
53 include 'configs.inc'52 include 'configs.inc'
54 data use_config/0,lmaxconfigs*0/53 data use_config/0,lmaxconfigs*0/
5554
55c
56c needed for the run_card handling
57c
58 logical gridrun
59 integer iseed,lhaid
60 character*100 pdlabel
61 double precision sf1,sf2,pb1,pb2,d
56c-----62c-----
57c Begin Code63c Begin Code
58c-----64c-----
@@ -74,13 +80,14 @@
74c stop80c stop
75c endif81c endif
7682
77 call load_para(npara,param,value)83 include '../../Source/run_card.inc'
78 call get_logical(npara,param,value," gridpack ",gridpack,.false.)84c call load_para(npara,param,value)
79 call get_real(npara,param,value," bwcutoff ",bwcutoff,5d0)85c call get_logical(npara,param,value," gridpack ",gridpack,.false.)
80 call get_real(npara,param,value," ebeam1 ",ebeam(1),0d0)86c call get_real(npara,param,value," bwcutoff ",bwcutoff,5d0)
81 call get_real(npara,param,value," ebeam2 ",ebeam(2),0d0)87c call get_real(npara,param,value," ebeam1 ",ebeam(1),0d0)
82 call get_integer(npara,param,value," lpp1 ",lpp(1),0)88c call get_real(npara,param,value," ebeam2 ",ebeam(2),0d0)
83 call get_integer(npara,param,value," lpp2 ",lpp(2),0)89c call get_integer(npara,param,value," lpp1 ",lpp(1),0)
90c call get_integer(npara,param,value," lpp2 ",lpp(2),0)
8491
85 call setpara('%(param_card_name)s' %(setparasecondarg)s) !Sets up couplings and masses92 call setpara('%(param_card_name)s' %(setparasecondarg)s) !Sets up couplings and masses
86 include 'pmass.inc'93 include 'pmass.inc'
8794
=== modified file 'madgraph/iolibs/template_files/makefile_sa_f_sp'
--- madgraph/iolibs/template_files/makefile_sa_f_sp 2015-08-14 13:56:58 +0000
+++ madgraph/iolibs/template_files/makefile_sa_f_sp 2016-12-10 02:02:40 +0000
@@ -24,4 +24,4 @@
2424
25matrix$(MENUM)py.so: matrix.f makefile $(LIBS)25matrix$(MENUM)py.so: matrix.f makefile $(LIBS)
26 touch __init__.py26 touch __init__.py
27 $(F2PY) $(LINKLIBS) -c matrix.f -m matrix$(MENUM)py --fcompiler=$(FC)
28\ No newline at end of file27\ No newline at end of file
28 $(F2PY) $(LINKLIBS) -c matrix.f -m matrix$(MENUM)py
29\ No newline at end of file29\ No newline at end of file
3030
=== modified file 'madgraph/loop/loop_exporters.py'
--- madgraph/loop/loop_exporters.py 2016-09-08 23:15:34 +0000
+++ madgraph/loop/loop_exporters.py 2016-12-10 02:02:40 +0000
@@ -2445,7 +2445,7 @@
2445 '%(proc_prefix)sBornColorFlowCoefs.dat'2445 '%(proc_prefix)sBornColorFlowCoefs.dat'
2446 %matrix_element.rep_dict),'w')2446 %matrix_element.rep_dict),'w')
2447 self.write_color_flow_coefs_data_file(dat_writer,2447 self.write_color_flow_coefs_data_file(dat_writer,
2448 born_col_amps, matrix_element.get('loop_color_basis'))2448 born_col_amps, matrix_element.get('born_color_basis'))
2449 dat_writer.close()2449 dat_writer.close()
2450 2450
2451 dat_writer = open(pjoin('..','MadLoop5_resources',2451 dat_writer = open(pjoin('..','MadLoop5_resources',
24522452
=== modified file 'madgraph/various/histograms.py'
--- madgraph/various/histograms.py 2016-10-03 09:30:33 +0000
+++ madgraph/various/histograms.py 2016-12-10 02:02:40 +0000
@@ -771,8 +771,13 @@
771 elif selector == 'ALPSFACT':771 elif selector == 'ALPSFACT':
772 selector = r'ALPSFACT'772 selector = r'ALPSFACT'
773 elif selector == 'PDF':773 elif selector == 'PDF':
774 selector = r'MUF=1_MUR=1_PDF=(\d*)'774 selector = r'(?:MUF=1_MUR=1_PDF=|MU(?:F|R)="1.0" MU(?:R|F)="1.0" PDF=")(\d*)'
775 if not mode:775 if not mode:
776# pdfs=[]
777## for n in self.bins[0].wgts:
778# misc.sprint( n)
779# if re.search(selector,n, re.IGNORECASE):
780# pdfs.append(int(re.findall(selector, n)[0]))
776 pdfs = [int(re.findall(selector, n)[0]) for n in self.bins[0].wgts if re.search(selector,n, re.IGNORECASE)]781 pdfs = [int(re.findall(selector, n)[0]) for n in self.bins[0].wgts if re.search(selector,n, re.IGNORECASE)]
777 min_pdf, max_pdf = min(pdfs), max(pdfs) 782 min_pdf, max_pdf = min(pdfs), max(pdfs)
778 if max_pdf - min_pdf > 100:783 if max_pdf - min_pdf > 100:
@@ -816,9 +821,9 @@
816 for i in xrange(len(values[0])):821 for i in xrange(len(values[0])):
817 pdf_stdev = 0.0822 pdf_stdev = 0.0
818 data = [values[s][i] for s in xrange(len(values))]823 data = [values[s][i] for s in xrange(len(values))]
819 sdata = sum(data)824 sdata = sum(data)/len(data)
820 sdata2 = sum(x**2 for x in data)825 sdata2 = sum(x**2 for x in data)/len(data)
821 pdf_stdev = math.sqrt(max(sdata2 -sdata**2/float(len(values)-2),0.0))826 pdf_stdev = math.sqrt(max(sdata2 -sdata**2,0.0))
822 min_value.append(sdata - pdf_stdev)827 min_value.append(sdata - pdf_stdev)
823 max_value.append(sdata + pdf_stdev) 828 max_value.append(sdata + pdf_stdev)
824829
@@ -3353,7 +3358,7 @@
3353 h_min = [hwu_mult*b for b in h_min] 3358 h_min = [hwu_mult*b for b in h_min]
3354 h_max = [hwu_mult*b for b in h_max] 3359 h_max = [hwu_mult*b for b in h_max]
3355 fill_between_steps(bins, h_min, h_max, ax=ax, facecolor=H.get_color(),3360 fill_between_steps(bins, h_min, h_max, ax=ax, facecolor=H.get_color(),
3356 alpha=0.5, edgecolor=H.get_color())3361 alpha=0.5, edgecolor=H.get_color(),hatch='/')
33573362
3358 return hwu, H3363 return hwu, H
33593364
33603365
=== modified file 'madgraph/various/lhe_parser.py'
--- madgraph/various/lhe_parser.py 2016-11-04 08:50:51 +0000
+++ madgraph/various/lhe_parser.py 2016-12-10 02:02:40 +0000
@@ -772,14 +772,16 @@
772 grouped_error[group] = self.error[i]**2772 grouped_error[group] = self.error[i]**2
773 else:773 else:
774 ban = banner_mod.Banner(ff.banner)774 ban = banner_mod.Banner(ff.banner)
775 for line in ban['init']:775 for line in ban['init'].split('\n'):
776 splitline = line.split()776 splitline = line.split()
777 if len(splitline)==4:777 if len(splitline)==4:
778 cross, error, wgt, group = splitline778 cross, error, _, group = splitline
779 grouped_cross[int(group)] += cross779 if int(group) in grouped_cross:
780 grouped_error[int(group)] += error**2 780 grouped_cross[group] += float(cross)
781 781 grouped_error[group] += float(error)**2
782 782 else:
783 grouped_cross[group] = float(cross)
784 grouped_error[group] = float(error)**2
783 nb_group = len(grouped_cross)785 nb_group = len(grouped_cross)
784 786
785 # compute the information for the first line 787 # compute the information for the first line
@@ -818,7 +820,6 @@
818 init_information["cross_info"] = '\n'.join(init_information["cross_info"])820 init_information["cross_info"] = '\n'.join(init_information["cross_info"])
819 init_information['lha_stra'] = -1 * abs(lha_strategy)821 init_information['lha_stra'] = -1 * abs(lha_strategy)
820 822
821
822 template_init =\823 template_init =\
823 """ %(idbmup1)i %(idbmup2)i %(ebmup1)e %(ebmup2)e %(pdfgup1)i %(pdfgup2)i %(pdfsup1)i %(pdfsup2)i %(lha_stra)i %(nprup)i824 """ %(idbmup1)i %(idbmup2)i %(ebmup1)e %(ebmup2)e %(pdfgup1)i %(pdfgup2)i %(pdfsup1)i %(pdfsup2)i %(lha_stra)i %(nprup)i
824%(cross_info)s825%(cross_info)s
825826
=== modified file 'madgraph/various/misc.py'
--- madgraph/various/misc.py 2016-10-14 22:51:35 +0000
+++ madgraph/various/misc.py 2016-12-10 02:02:40 +0000
@@ -45,7 +45,6 @@
45 import madgraph.iolibs.files as files45 import madgraph.iolibs.files as files
46 MADEVENT = False46 MADEVENT = False
4747
48
49 48
50logger = logging.getLogger('cmdprint.ext_program')49logger = logging.getLogger('cmdprint.ext_program')
51logger_stderr = logging.getLogger('madevent.misc')50logger_stderr = logging.getLogger('madevent.misc')
@@ -991,15 +990,25 @@
991 """990 """
992991
993 def __init__(self, cls, attribute, value):992 def __init__(self, cls, attribute, value):
994 993
995 self.old_value = getattr(cls, attribute)
996 self.cls = cls994 self.cls = cls
997 self.attribute = attribute995 self.attribute = attribute
998 setattr(self.cls, self.attribute, value)996 if isinstance(attribute, list):
997 self.old_value = []
998 for key, onevalue in zip(attribute, value):
999 self.old_value.append(getattr(cls, key))
1000 setattr(self.cls, key, onevalue)
1001 else:
1002 self.old_value = getattr(cls, attribute)
1003 setattr(self.cls, self.attribute, value)
999 1004
1000 def __exit__(self, ctype, value, traceback ):1005 def __exit__(self, ctype, value, traceback ):
10011006
1002 setattr(self.cls, self.attribute, self.old_value)1007 if isinstance(self.attribute, list):
1008 for key, old_value in zip(self.attribute, self.old_value):
1009 setattr(self.cls, key, old_value)
1010 else:
1011 setattr(self.cls, self.attribute, self.old_value)
1003 1012
1004 def __enter__(self):1013 def __enter__(self):
1005 return self.old_value 1014 return self.old_value
@@ -1225,7 +1234,7 @@
1225 is in the environment paths of the user. If not, it returns a preamble that1234 is in the environment paths of the user. If not, it returns a preamble that
1226 sets it before calling the exectuable, for example:1235 sets it before calling the exectuable, for example:
1227 <preamble> ./my_exe1236 <preamble> ./my_exe
1228 with <preamble> -> DYLD_LIBRARY_PATH='blabla;$DYLD_LIBRARY_PATH'"""1237 with <preamble> -> DYLD_LIBRARY_PATH=blabla:$DYLD_LIBRARY_PATH"""
1229 1238
1230 assert(type in ['bin','include','lib'])1239 assert(type in ['bin','include','lib'])
1231 1240
@@ -1236,7 +1245,7 @@
1236 1245
1237 if target_env_var not in os.environ or \1246 if target_env_var not in os.environ or \
1238 target_path not in os.environ[target_env_var].split(os.pathsep):1247 target_path not in os.environ[target_env_var].split(os.pathsep):
1239 return "%s='%s;$%s' "%(target_env_var,target_path,target_env_var)1248 return "%s=%s:$%s "%(target_env_var,target_path,target_env_var)
1240 else:1249 else:
1241 return ''1250 return ''
12421251
12431252
=== modified file 'madgraph/various/systematics.py'
--- madgraph/various/systematics.py 2016-11-03 15:21:05 +0000
+++ madgraph/various/systematics.py 2016-12-10 02:02:40 +0000
@@ -366,7 +366,15 @@
366 for lhapdfid,values in pdfs.items():366 for lhapdfid,values in pdfs.items():
367 if lhapdfid == self.orig_pdf.lhapdfID:367 if lhapdfid == self.orig_pdf.lhapdfID:
368 continue368 continue
369 if len(values) == 1 :
370 continue
369 pdfset = self.pdfsets[lhapdfid]371 pdfset = self.pdfsets[lhapdfid]
372
373 if pdfset.errorType == 'unknown' :
374 # Don't know how to determine uncertainty for 'unknown' errorType :
375 # File "lhapdf.pyx", line 329, in lhapdf.PDFSet.uncertainty (lhapdf.cpp:6621)
376 # RuntimeError: "ErrorType: unknown" not supported by LHAPDF::PDFSet::uncertainty.
377 continue
370 pdferr = pdfset.uncertainty(values)378 pdferr = pdfset.uncertainty(values)
371 resume.write( '#PDF %s: %g +%2.3g%% -%2.3g%%\n' % (pdfset.name, pdferr.central,pdferr.errplus*100/all_cross[0], pdferr.errminus*100/all_cross[0]))379 resume.write( '#PDF %s: %g +%2.3g%% -%2.3g%%\n' % (pdfset.name, pdferr.central,pdferr.errplus*100/all_cross[0], pdferr.errminus*100/all_cross[0]))
372380
@@ -402,6 +410,7 @@
402 410
403 text = ''411 text = ''
404 412
413 default = self.args[0]
405 for arg in self.args[1:]:414 for arg in self.args[1:]:
406 mur, muf, alps, dyn, pdf = arg[:5]415 mur, muf, alps, dyn, pdf = arg[:5]
407 if pdf == self.orig_pdf and alps ==1 and (mur!=1 or muf!=1 or dyn!=-1):416 if pdf == self.orig_pdf and alps ==1 and (mur!=1 or muf!=1 or dyn!=-1):
@@ -409,7 +418,7 @@
409 text += "<weightgroup name=\"Central scale variation\" combine=\"envelope\">\n"418 text += "<weightgroup name=\"Central scale variation\" combine=\"envelope\">\n"
410 in_scale=True419 in_scale=True
411 elif in_scale:420 elif in_scale:
412 if (pdf == self.orig_pdf and alps ==1):421 if (pdf == self.orig_pdf and alps ==1) and arg != default:
413 pass422 pass
414 else:423 else:
415 text += "</weightgroup> # scale\n"424 text += "</weightgroup> # scale\n"
@@ -423,7 +432,12 @@
423 text += "</weightgroup> # ALPS\n"432 text += "</weightgroup> # ALPS\n"
424 in_alps=False433 in_alps=False
425 434
426 if pdf != self.orig_pdf and mur == muf == 1 and dyn==-1 and alps ==1:435 if mur == muf == 1 and dyn==-1 and alps ==1:
436 if pdf.lhapdfID < 0:
437 for central,sets in self.pdfsets.items():
438 if pdf in sets.set():
439 misc.sprint(central)
440
427 if pdf.lhapdfID in self.pdfsets:441 if pdf.lhapdfID in self.pdfsets:
428 if in_pdf:442 if in_pdf:
429 text += "</weightgroup> # PDFSET -> PDFSET\n"443 text += "</weightgroup> # PDFSET -> PDFSET\n"
@@ -432,7 +446,7 @@
432 text +="<weightgroup name=\"%s\" combine=\"%s\"> # %s: %s\n" %\446 text +="<weightgroup name=\"%s\" combine=\"%s\"> # %s: %s\n" %\
433 (pdfset.name, pdfset.errorType,pdfset.lhapdfID, descrip)447 (pdfset.name, pdfset.errorType,pdfset.lhapdfID, descrip)
434 in_pdf=pdf.lhapdfID 448 in_pdf=pdf.lhapdfID
435 elif pdf.memberID == 1 and (pdf.lhapdfID - pdf.memberID) in self.pdfsets:449 elif pdf.memberID == 0 and (pdf.lhapdfID - pdf.memberID) in self.pdfsets:
436 if in_pdf:450 if in_pdf:
437 text += "</weightgroup> # PDFSET -> PDFSET\n"451 text += "</weightgroup> # PDFSET -> PDFSET\n"
438 pdfset = self.pdfsets[pdf.lhapdfID - 1]452 pdfset = self.pdfsets[pdf.lhapdfID - 1]
@@ -441,6 +455,7 @@
441 (pdfset.name, pdfset.errorType,pdfset.lhapdfID, descrip)455 (pdfset.name, pdfset.errorType,pdfset.lhapdfID, descrip)
442 in_pdf=pdfset.lhapdfID 456 in_pdf=pdfset.lhapdfID
443 elif in_pdf and pdf.lhapdfID - pdf.memberID != in_pdf:457 elif in_pdf and pdf.lhapdfID - pdf.memberID != in_pdf:
458 misc.sprint(pdf.lhapdfID)
444 text += "</weightgroup> # PDFSET -> PDF\n"459 text += "</weightgroup> # PDFSET -> PDF\n"
445 in_pdf = False 460 in_pdf = False
446 elif in_pdf:461 elif in_pdf:
@@ -525,7 +540,14 @@
525 new_args[pos[name]] = value540 new_args[pos[name]] = value
526 all_args.append(new_args)541 all_args.append(new_args)
527 542
528 self.args = [default]+ [arg for arg in all_args if arg!= default]543 self.args = [default] + [arg for arg in all_args if arg!= default]
544
545 # add the default before the pdf scan to have a full grouping
546 pdfplusone = [pdf for pdf in self.pdf if pdf.lhapdfID == self.orig_pdf.lhapdfID+1]
547 if pdfplusone:
548 pdfplusone = default[:-1] + [pdfplusone[0]]
549 index = self.args.index(pdfplusone)
550 self.args.insert(index, default)
529551
530 self.log( "#Will Compute %s weights per event." % (len(self.args)-1))552 self.log( "#Will Compute %s weights per event." % (len(self.args)-1))
531 return553 return
@@ -594,14 +616,18 @@
594 mur = event.get_sqrts_scale(1.)616 mur = event.get_sqrts_scale(1.)
595 muf1 = mur617 muf1 = mur
596 muf2 = mur618 muf2 = mur
597 loinfo['pdf_q1'][-1] = mur619 loinfo = dict(loinfo)
598 loinfo['pdf_q2'][-1] = mur620 loinfo['pdf_q1'] = loinfo['pdf_q1'] [:-1] + [mur]
621 loinfo['pdf_q2'] = loinfo['pdf_q2'] [:-1] + [mur]
599 622
600 623
601 624
602 # MUR part625 # MUR part
603 if self.b1 == 0 == self.b2:626 if self.b1 == 0 == self.b2:
604 wgt = self.alpsrunner(Dmur*mur)**loinfo['n_qcd']627 if loinfo['n_qcd'] != 0:
628 wgt = self.alpsrunner(Dmur*mur)**loinfo['n_qcd']
629 else:
630 wgt = 1.0
605 else:631 else:
606 wgt = pdf.alphasQ(Dmur*mur)**loinfo['n_qcd']632 wgt = pdf.alphasQ(Dmur*mur)**loinfo['n_qcd']
607 # MUF/PDF part633 # MUF/PDF part
@@ -685,7 +711,7 @@
685 wgt += tmp711 wgt += tmp
686 712
687 if __debug__ and dyn== -1 and Dmur==1 and Dmuf==1 and pdf==self.orig_pdf:713 if __debug__ and dyn== -1 and Dmur==1 and Dmuf==1 and pdf==self.orig_pdf:
688 if not misc.equal(tmp, onewgt.ref_wgt, sig_fig=4):714 if not misc.equal(tmp, onewgt.ref_wgt, sig_fig=2):
689 misc.sprint(tmp, onewgt.ref_wgt, (tmp-onewgt.ref_wgt)/tmp)715 misc.sprint(tmp, onewgt.ref_wgt, (tmp-onewgt.ref_wgt)/tmp)
690 misc.sprint(onewgt)716 misc.sprint(onewgt)
691 misc.sprint(cevent)717 misc.sprint(cevent)
@@ -756,7 +782,19 @@
756 else:782 else:
757 opts['alps'] = [1.0]783 opts['alps'] = [1.0]
758 opts['together'] = [('mur','muf','alps','dyn')]784 opts['together'] = [('mur','muf','alps','dyn')]
759 pdfs = card['sys_pdf'].split('&&')785 if '&&' in card['sys_pdf']:
786 pdfs = card['sys_pdf'].split('&&')
787 else:
788 data = card['sys_pdf'].split()
789 pdfs = []
790 for d in data:
791 if not d.isdigit():
792 pdfs.append(d)
793 elif int(d) > 500:
794 pdfs.append(d)
795 else:
796 pdfs[-1] = '%s %s' % (pdfs[-1], d)
797
760 opts['dyn'] = [-1,1,2,3,4]798 opts['dyn'] = [-1,1,2,3,4]
761 opts['pdf'] = []799 opts['pdf'] = []
762 for pdf in pdfs:800 for pdf in pdfs:
@@ -781,7 +819,21 @@
781 return obj819 return obj
782820
783if __name__ == "__main__":821if __name__ == "__main__":
784 call_systematics(sys.argv[1:])822 sys_args = sys.argv[1:]
823 for i, arg in enumerate(sys_args) :
824 if arg.startswith('--lhapdf_config=') :
825 lhapdf = misc.import_python_lhapdf(arg[len('--lhapdf_config='):])
826 del sys_args[i]
827 break
828
829 if 'lhapdf' not in globals():
830 lhapdf = misc.import_python_lhapdf('lhapdf-config')
831
832 if not lhapdf:
833 sys.exit('Can not run systematics since can not link python to lhapdf, specify --lhapdf-config=')
834 call_systematics(sys_args)
835
836
785 837
786 838
787 839
788840
=== modified file 'models/check_param_card.py'
--- models/check_param_card.py 2016-10-26 20:14:22 +0000
+++ models/check_param_card.py 2016-12-10 02:02:40 +0000
@@ -120,13 +120,13 @@
120 120
121 if format == 'float':121 if format == 'float':
122 if self.lhablock == 'decay' and not isinstance(self.value,basestring):122 if self.lhablock == 'decay' and not isinstance(self.value,basestring):
123 return 'DECAY %s %.{}e # %s'.format(precision) % (' '.join([str(d) for d in self.lhacode]), self.value, self.comment)123 return 'DECAY %s %.{0}e # %s'.format(precision) % (' '.join([str(d) for d in self.lhacode]), self.value, self.comment)
124 elif self.lhablock == 'decay':124 elif self.lhablock == 'decay':
125 return 'DECAY %s Auto # %s' % (' '.join([str(d) for d in self.lhacode]), self.comment)125 return 'DECAY %s Auto # %s' % (' '.join([str(d) for d in self.lhacode]), self.comment)
126 elif self.lhablock and self.lhablock.startswith('qnumbers'):126 elif self.lhablock and self.lhablock.startswith('qnumbers'):
127 return ' %s %i # %s' % (' '.join([str(d) for d in self.lhacode]), int(self.value), self.comment)127 return ' %s %i # %s' % (' '.join([str(d) for d in self.lhacode]), int(self.value), self.comment)
128 else:128 else:
129 return ' %s %.{}e # %s'.format(precision) % (' '.join([str(d) for d in self.lhacode]), self.value, self.comment)129 return ' %s %.{0}e # %s'.format(precision) % (' '.join([str(d) for d in self.lhacode]), self.value, self.comment)
130 elif format == 'int':130 elif format == 'int':
131 return ' %s %i # %s' % (' '.join([str(d) for d in self.lhacode]), int(self.value), self.comment)131 return ' %s %i # %s' % (' '.join([str(d) for d in self.lhacode]), int(self.value), self.comment)
132 elif format == 'str':132 elif format == 'str':
@@ -435,7 +435,7 @@
435 435
436 # apply all the basic restriction rule436 # apply all the basic restriction rule
437 if restrict_rule:437 if restrict_rule:
438 restrict_rule.check_param_card(self, modify=True, log=loglevel)438 _, modify = restrict_rule.check_param_card(self, modify=True, log=loglevel)
439 439
440 import models.model_reader as model_reader440 import models.model_reader as model_reader
441 import madgraph.core.base_objects as base_objects441 import madgraph.core.base_objects as base_objects
@@ -449,7 +449,6 @@
449 for particle in model.get('particles'):449 for particle in model.get('particles'):
450 if particle.get('goldstone') or particle.get('ghost'):450 if particle.get('goldstone') or particle.get('ghost'):
451 continue451 continue
452
453 mass = model.get_parameter(particle.get('mass'))452 mass = model.get_parameter(particle.get('mass'))
454 lhacode = abs(particle.get_pdg_code())453 lhacode = abs(particle.get_pdg_code())
455454
@@ -481,6 +480,7 @@
481 model_value = model_value.real480 model_value = model_value.real
482 if not misc.equal(model_value, param_value, 4):481 if not misc.equal(model_value, param_value, 4):
483 modify = True482 modify = True
483 misc.sprint(modify)
484 if loglevel == 20:484 if loglevel == 20:
485 logger.info('For consistency, the width of particle %s (%s) is changed to %s.' % (lhacode, particle.get('name'), model_value), '$MG:color:BLACK')485 logger.info('For consistency, the width of particle %s (%s) is changed to %s.' % (lhacode, particle.get('name'), model_value), '$MG:color:BLACK')
486 else:486 else:
@@ -488,6 +488,7 @@
488 #logger.debug('was %s', param_value)488 #logger.debug('was %s', param_value)
489 if model_value != param_value: 489 if model_value != param_value:
490 self.get('decay').get(abs(particle.get_pdg_code())).value = model_value490 self.get('decay').get(abs(particle.get_pdg_code())).value = model_value
491
491 return modify492 return modify
492493
493494
@@ -1140,7 +1141,9 @@
1140 1141
1141 def check_param_card(self, path, modify=False, write_missing=False, log=False):1142 def check_param_card(self, path, modify=False, write_missing=False, log=False):
1142 """Check that the restriction card are applied"""1143 """Check that the restriction card are applied"""
1143 1144
1145 is_modified = False
1146
1144 if isinstance(path,str): 1147 if isinstance(path,str):
1145 card = self.read_param_card(path)1148 card = self.read_param_card(path)
1146 else:1149 else:
@@ -1169,6 +1172,7 @@
1169 param = card[block].get(id) 1172 param = card[block].get(id)
1170 param.value = 0.01173 param.value = 0.0
1171 param.comment += ' fixed by the model'1174 param.comment += ' fixed by the model'
1175 is_modified = True
1172 if log ==20:1176 if log ==20:
1173 logger.log(log,'For model consistency, update %s with id %s to value %s',1177 logger.log(log,'For model consistency, update %s with id %s to value %s',
1174 (block, id, 0.0), '$MG:color:BLACK') 1178 (block, id, 0.0), '$MG:color:BLACK')
@@ -1199,6 +1203,7 @@
1199 param = card[block].get(id) 1203 param = card[block].get(id)
1200 param.value = 1.01204 param.value = 1.0
1201 param.comment += ' fixed by the model'1205 param.comment += ' fixed by the model'
1206 is_modified = True
1202 if log ==20:1207 if log ==20:
1203 logger.log(log,'For model consistency, update %s with id %s to value %s',1208 logger.log(log,'For model consistency, update %s with id %s to value %s',
1204 (block, id, 1.0), '$MG:color:BLACK') 1209 (block, id, 1.0), '$MG:color:BLACK')
@@ -1210,6 +1215,7 @@
1210 # check identical1215 # check identical
1211 for block, id1, id2, comment in self.identical:1216 for block, id1, id2, comment in self.identical:
1212 if block not in card:1217 if block not in card:
1218 is_modified = True
1213 logger.warning('''Param card is not complete: Block %s is simply missing.1219 logger.warning('''Param card is not complete: Block %s is simply missing.
1214 We will use model default for all missing value! Please cross-check that1220 We will use model default for all missing value! Please cross-check that
1215 this correspond to your expectation.''' % block)1221 this correspond to your expectation.''' % block)
@@ -1234,6 +1240,7 @@
1234 param = card[block].get(id1) 1240 param = card[block].get(id1)
1235 param.value = value21241 param.value = value2
1236 param.comment += ' must be identical to %s' % id21242 param.comment += ' must be identical to %s' % id2
1243 is_modified = True
1237 if log ==20:1244 if log ==20:
1238 logger.log(log,'For model consistency, update %s with id %s to value %s since it should be equal to parameter with id %s',1245 logger.log(log,'For model consistency, update %s with id %s to value %s since it should be equal to parameter with id %s',
1239 block, id1, value2, id2, '$MG:color:BLACK')1246 block, id1, value2, id2, '$MG:color:BLACK')
@@ -1262,6 +1269,7 @@
1262 param = card[block].get(id1) 1269 param = card[block].get(id1)
1263 param.value = -value21270 param.value = -value2
1264 param.comment += ' must be opposite to %s' % id21271 param.comment += ' must be opposite to %s' % id2
1272 is_modified = True
1265 if log ==20:1273 if log ==20:
1266 logger.log(log,'For model consistency, update %s with id %s to value %s since it should be equal to the opposite of the parameter with id %s',1274 logger.log(log,'For model consistency, update %s with id %s to value %s since it should be equal to the opposite of the parameter with id %s',
1267 block, id1, -value2, id2, '$MG:color:BLACK')1275 block, id1, -value2, id2, '$MG:color:BLACK')
@@ -1269,7 +1277,7 @@
1269 logger.log(log,'For model consistency, update %s with id %s to value %s since it should be equal to the opposite of the parameter with id %s',1277 logger.log(log,'For model consistency, update %s with id %s to value %s since it should be equal to the opposite of the parameter with id %s',
1270 block, id1, -value2, id2)1278 block, id1, -value2, id2)
12711279
1272 return card1280 return card, is_modified
1273 1281
12741282
1275def convert_to_slha1(path, outputpath=None ):1283def convert_to_slha1(path, outputpath=None ):
@@ -1651,8 +1659,9 @@
1651 try :1659 try :
1652 cardrule.check_param_card(path, modify=False)1660 cardrule.check_param_card(path, modify=False)
1653 except InvalidParamCard:1661 except InvalidParamCard:
1654 new_data = cardrule.check_param_card(path, modify=True, write_missing=True)1662 new_data, was_modified = cardrule.check_param_card(path, modify=True, write_missing=True)
1655 cardrule.write_param_card(outputpath, new_data)1663 if was_modified:
1664 cardrule.write_param_card(outputpath, new_data)
1656 else:1665 else:
1657 if path != outputpath:1666 if path != outputpath:
1658 shutil.copy(path, outputpath)1667 shutil.copy(path, outputpath)
16591668
=== modified file 'models/usermod.py'
--- models/usermod.py 2016-06-20 10:43:25 +0000
+++ models/usermod.py 2016-12-10 02:02:40 +0000
@@ -30,6 +30,7 @@
30import models as ufomodels30import models as ufomodels
31import models.import_ufo as import_ufo31import models.import_ufo as import_ufo
32import models.check_param_card as check_param_card32import models.check_param_card as check_param_card
33from madgraph import MG5DIR
3334
34pjoin =os.path.join35pjoin =os.path.join
35logger = logging.getLogger('madgraph.model')36logger = logging.getLogger('madgraph.model')
@@ -897,6 +898,16 @@
897 else:898 else:
898 first =False899 first =False
899 old_part = p900 old_part = p
901 if not old_part:
902 # last possibility is that the model do not follow MG5 convention
903 # but that "old" does
904 defaultname = base_objects.Model.load_default_name() # id->name
905 for pdg, value in defaultname.items():
906 if value == old:
907 old_part = self.particle_dict[pdg]
908 identify_particles[new] = old_part.name
909 break
910
900 # end for the case security911 # end for the case security
901 identify_pid[new_part.pdg_code] = old_part.pdg_code 912 identify_pid[new_part.pdg_code] = old_part.pdg_code
902 if new_part is None:913 if new_part is None:
903914
=== modified file 'tests/acceptance_tests/test_cmd_madevent.py'
--- tests/acceptance_tests/test_cmd_madevent.py 2016-09-07 09:55:52 +0000
+++ tests/acceptance_tests/test_cmd_madevent.py 2016-12-10 02:02:40 +0000
@@ -570,12 +570,21 @@
570570
571 def setUp(self):571 def setUp(self):
572 572
573 self.path = tempfile.mkdtemp(prefix='acc_test_mg5')573 self.debuging = False
574 if self.debuging:
575 self.path = pjoin(MG5DIR, 'ACC_TEST')
576 if os.path.exists(self.path):
577 shutil.rmtree(self.path)
578 os.mkdir(self.path)
579 else:
580 self.path = tempfile.mkdtemp(prefix='acc_test_mg5')
574 self.run_dir = pjoin(self.path, 'MGPROC') 581 self.run_dir = pjoin(self.path, 'MGPROC')
582
575 583
576 def tearDown(self):584 def tearDown(self):
577585
578 shutil.rmtree(self.path)586 if not self.debuging:
587 shutil.rmtree(self.path)
579588
580 def test_add_time_of_flight(self):589 def test_add_time_of_flight(self):
581 """checking time of flight is working fine"""590 """checking time of flight is working fine"""
@@ -646,6 +655,7 @@
646 self.assertTrue(has_zero)655 self.assertTrue(has_zero)
647 self.assertTrue(has_non_zero)656 self.assertTrue(has_non_zero)
648 657
658 self.assertFalse(self.debuging)
649 659
650660
651 def test_w_production_with_ms_decay(self):661 def test_w_production_with_ms_decay(self):
652662
=== modified file 'tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%MadLoopCommons.f'
--- tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%MadLoopCommons.f 2016-09-07 13:39:06 +0000
+++ tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%MadLoopCommons.f 2016-12-10 02:02:40 +0000
@@ -103,6 +103,9 @@
103 CALL SWITCHOFFCACHESYSTEM_CLL()103 CALL SWITCHOFFCACHESYSTEM_CLL()
104 ENDIF104 ENDIF
105105
106C Make sure no COLLIER error can interrupt the code
107 CALL SWITCHOFFERRSTOP_CLL()
108
106C Specify below your other custom COLLIER parameter settings 109C Specify below your other custom COLLIER parameter settings
107C [user_specific_COLLIER_settings]110C [user_specific_COLLIER_settings]
108111

Subscribers

People subscribed via source and target branches

to all changes: