Merge lp:~maddevelopers/mg5amcnlo/2.5.2 into lp:mg5amcnlo/lts
- 2.5.2
- Merge into series2.0
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 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Rikkert Frederix | Needs Fixing | ||
Review via email: mp+312642@code.launchpad.net |
Commit message
Description of the change
mainly debugging 2.5.1
- 293. By Olivier Mattelaer
-
fix an IO test
- 294. By Olivier Mattelaer
-
version and update note
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 HEPToolsInstall
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:/
> Your team MadTeam is subscribed to branch lp:mg5amcnlo.
- 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
1 | === modified file 'MadSpin/decay.py' |
2 | --- MadSpin/decay.py 2016-08-26 13:55:42 +0000 |
3 | +++ MadSpin/decay.py 2016-12-10 02:02:40 +0000 |
4 | @@ -2707,16 +2707,20 @@ |
5 | commandline += "define pert_%s = %s;" % (order, ' '.join(map(str,pert)) ) |
6 | |
7 | # check if we have to increase by one the born order |
8 | - if '%s=' % order in process: |
9 | + if '%s=' % order in process or '%s<=' % order in process: |
10 | result=re.split(' ',process) |
11 | process='' |
12 | for r in result: |
13 | if '%s=' % order in r: |
14 | ior=re.split('=',r) |
15 | - r='QCD=%i' % (int(ior[1])+1) |
16 | + r='%s<=%i' % (order,int(ior[1])+1) |
17 | + elif '%s<=' % order in r: |
18 | + ior=re.split('=',r) |
19 | + r='%s<=%i' % (order,int(ior[1])+1) |
20 | + |
21 | process=process+r+' ' |
22 | #handle special tag $ | / @ |
23 | - result = re.split('([/$@]|\w+=\w+)', process, 1) |
24 | + result = re.split('([/$@]|\w+<?=\w+)', process, 1) |
25 | if len(result) ==3: |
26 | process, split, rest = result |
27 | commandline+="add process %s pert_%s %s%s %s --no_warning=duplicate;" % (process, order ,split, rest, proc_nb) |
28 | @@ -2809,16 +2813,20 @@ |
29 | commandline += "define pert_%s = %s;" % (order, ' '.join(map(str,pert)) ) |
30 | |
31 | # check if we have to increase by one the born order |
32 | - if '%s=' % order in process: |
33 | + if '%s=' % order in process or '%s<=' % order in process: |
34 | result=re.split(' ',process) |
35 | process='' |
36 | for r in result: |
37 | if '%s=' % order in r: |
38 | ior=re.split('=',r) |
39 | - r='QCD=%i' % (int(ior[1])+1) |
40 | + r='%s=%i' % (order,int(ior[1])+1) |
41 | + elif '%s<=' % order in r: |
42 | + ior=re.split('=',r) |
43 | + r='%s<=%i' % (order,int(ior[1])+1) |
44 | process=process+r+' ' |
45 | + |
46 | #handle special tag $ | / @ |
47 | - result = re.split('([/$@]|\w+=\w+)', process, 1) |
48 | + result = re.split('([/$@]|\w+<?=\w+)', process, 1) |
49 | if len(result) ==3: |
50 | process, split, rest = result |
51 | commandline+="add process %s pert_%s %s%s , %s %s --no_warning=duplicate;" % \ |
52 | |
53 | === modified file 'MadSpin/interface_madspin.py' |
54 | --- MadSpin/interface_madspin.py 2016-07-26 02:15:40 +0000 |
55 | +++ MadSpin/interface_madspin.py 2016-12-10 02:02:40 +0000 |
56 | @@ -248,7 +248,6 @@ |
57 | if '--bypass_check' in args: |
58 | args.remove('--bypass_check') |
59 | bypass_check = True |
60 | - |
61 | if len(args) == 1: |
62 | logger.warning("""No param_card defined for the new model. We will use the default one but this might completely wrong.""") |
63 | elif len(args) != 2: |
64 | @@ -709,8 +708,10 @@ |
65 | cumul allow to merge all the definition in one run (add process) |
66 | to generate events according to cross-section |
67 | """ |
68 | - |
69 | + |
70 | part = self.model.get_particle(pdg) |
71 | + if not part: |
72 | + return {}# this particle is not defined in the current model so ignore it |
73 | name = part.get_name() |
74 | out = {} |
75 | logger.info("generate %s decay event for particle %s" % (nb_event, name)) |
76 | @@ -739,6 +740,15 @@ |
77 | me5_cmd = madevent_interface.MadEventCmdShell(me_dir=os.path.realpath(\ |
78 | decay_dir), options=options) |
79 | me5_cmd.options["automatic_html_opening"] = False |
80 | + me5_cmd.options["madanalysis5_path"] = None |
81 | + me5_cmd.options["madanalysis_path"] = None |
82 | + try: |
83 | + os.remove(pjoin(decay_dir, 'Cards', 'madanalysis5_parton_card_default.dat')) |
84 | + os.remove(pjoin(decay_dir, 'Cards', 'madanalysis5_parton_card.dat')) |
85 | + except Exception,error: |
86 | + logger.debug(error) |
87 | + pass |
88 | + misc.sprint(os.listdir(pjoin(decay_dir,'Cards'))) |
89 | if self.options["run_card"]: |
90 | run_card = self.options["run_card"] |
91 | else: |
92 | @@ -746,6 +756,7 @@ |
93 | |
94 | run_card["iseed"] = self.seed |
95 | run_card['gridpack'] = True |
96 | + run_card['systematics_program'] = False |
97 | run_card.write(pjoin(decay_dir, "Cards", "run_card.dat")) |
98 | param_card = self.banner['slha'] |
99 | open(pjoin(decay_dir, "Cards", "param_card.dat"),"w").write(param_card) |
100 | @@ -763,12 +774,22 @@ |
101 | me5_cmd = madevent_interface.MadEventCmdShell(me_dir=os.path.realpath(\ |
102 | decay_dir), options=mg5.options) |
103 | me5_cmd.options["automatic_html_opening"] = False |
104 | + me5_cmd.options["madanalysis5_path"] = None |
105 | + me5_cmd.options["madanalysis_path"] = None |
106 | + try: |
107 | + os.remove(pjoin(decay_dir, 'Cards', 'madanalysis5_parton_card_default.dat')) |
108 | + os.remove(pjoin(decay_dir, 'Cards', 'madanalysis5_parton_card.dat')) |
109 | + except Exception,error: |
110 | + logger.debug(error) |
111 | + pass |
112 | + |
113 | if self.options["run_card"]: |
114 | run_card = self.options["run_card"] |
115 | else: |
116 | run_card = banner.RunCard(pjoin(decay_dir, "Cards", "run_card.dat")) |
117 | run_card["nevents"] = int(1.2*nb_event) |
118 | run_card["iseed"] = self.seed |
119 | + run_card["systematics_program"] = 'None' |
120 | run_card.write(pjoin(decay_dir, "Cards", "run_card.dat")) |
121 | param_card = self.banner['slha'] |
122 | open(pjoin(decay_dir, "Cards", "param_card.dat"),"w").write(param_card) |
123 | |
124 | === modified file 'MadSpin/src/driver.f' |
125 | --- MadSpin/src/driver.f 2016-04-06 18:45:52 +0000 |
126 | +++ MadSpin/src/driver.f 2016-12-10 02:02:40 +0000 |
127 | @@ -907,7 +907,11 @@ |
128 | if (index_p2.gt.0) then |
129 | m2_tchan(i)=m(index_p2) |
130 | else |
131 | - write(*,*) 'Warning: m_2^2 is negative in t-channel branching ',m2_tchan(i) |
132 | + if (m(index_p2).gt.5d-2)then |
133 | + m2_tchan(i) = 0d0 |
134 | + else |
135 | + write(*,*) 'Warning: m_2^2 is negative in t-channel branching ',m2_tchan(i) |
136 | + endif |
137 | endif |
138 | endif |
139 | ! extract phi |
140 | |
141 | === modified file 'Template/LO/Cards/run_card.dat' |
142 | --- Template/LO/Cards/run_card.dat 2016-11-03 21:20:15 +0000 |
143 | +++ Template/LO/Cards/run_card.dat 2016-12-10 02:02:40 +0000 |
144 | @@ -276,6 +276,6 @@ |
145 | %(sys_alpsfact)s = sys_alpsfact # \alpha_s emission scale factors |
146 | %(sys_matchscale)s = sys_matchscale # variation of merging scale |
147 | # PDF sets and number of members (0 or none for all members). |
148 | -%(sys_pdf)s = sys_pdf # separate by && if more than one set. |
149 | +%(sys_pdf)s = sys_pdf # list of pdf sets |
150 | # MSTW2008nlo68cl.LHgrid 1 = sys_pdf |
151 | # |
152 | |
153 | === added file 'Template/LO/Source/.make_opts' |
154 | --- Template/LO/Source/.make_opts 1970-01-01 00:00:00 +0000 |
155 | +++ Template/LO/Source/.make_opts 2016-12-10 02:02:40 +0000 |
156 | @@ -0,0 +1,103 @@ |
157 | +DEFAULT_F2PY_COMPILER=f2py |
158 | +DEFAULT_F_COMPILER=gfortran |
159 | +MACFLAG=-mmacosx-version-min=10.7 |
160 | +DEFAULT_CPP_COMPILER=clang |
161 | +MG5AMC_VERSION=SpecifiedByMG5aMCAtRunTime |
162 | +STDLIB=-lc++ |
163 | +PYTHIA8_PATH=NotInstalled |
164 | +STDLIB_FLAG=-stdlib=libc++ |
165 | +#end_of_make_opts_variables |
166 | + |
167 | +BIASLIBDIR=../../../lib/ |
168 | +BIASLIBRARY=libbias.$(libext) |
169 | + |
170 | +# Rest of the makefile |
171 | +ifeq ($(origin FFLAGS),undefined) |
172 | +FFLAGS= -O -w -fbounds-check -fPIC |
173 | +#FFLAGS+= -g -fbounds-check -ffpe-trap=invalid,zero,overflow,underflow,denormal -Wall |
174 | +endif |
175 | + |
176 | + |
177 | +# REMOVE MACFLAG IF NOT ON MAC OR FOR F2PY |
178 | +UNAME := $(shell uname -s) |
179 | +ifdef f2pymode |
180 | +MACFLAG= |
181 | +else |
182 | +ifneq ($(UNAME), Darwin) |
183 | +MACFLAG= |
184 | +endif |
185 | +endif |
186 | + |
187 | + |
188 | +ifeq ($(origin CXXFLAGS),undefined) |
189 | +CXXFLAGS= -O $(STDLIB_FLAG) $(MACFLAG) |
190 | +endif |
191 | + |
192 | +ifeq ($(origin CFLAGS),undefined) |
193 | +CFLAGS= -O $(STDLIB_FLAG) $(MACFLAG) |
194 | +endif |
195 | + |
196 | +# Increase the number of allowed charcters in a Fortran line |
197 | +FFLAGS+= -ffixed-line-length-132 |
198 | + |
199 | +# Set FC unless it's defined by an environment variable |
200 | +ifeq ($(origin FC),default) |
201 | +FC=$(DEFAULT_F_COMPILER) |
202 | +endif |
203 | +ifeq ($(origin F2PY), undefined) |
204 | +F2PY=$(DEFAULT_F2PY_COMPILER) |
205 | +endif |
206 | + |
207 | +UNAME := $(shell uname -s) |
208 | +ifeq ($(origin LDFLAGS), undefined) |
209 | +LDFLAGS=$(STDLIB) $(MACFLAG) |
210 | +endif |
211 | + |
212 | +# Options: dynamic, lhapdf |
213 | +# Option dynamic |
214 | + |
215 | +ifeq ($(UNAME), Darwin) |
216 | +dylibext=dylib |
217 | +else |
218 | +dylibext=so |
219 | +endif |
220 | + |
221 | +ifdef dynamic |
222 | +ifeq ($(UNAME), Darwin) |
223 | +libext=dylib |
224 | +FFLAGS+= -fno-common |
225 | +LDFLAGS += -bundle |
226 | +define CREATELIB |
227 | +$(FC) -dynamiclib -undefined dynamic_lookup -o $(1) $(2) |
228 | +endef |
229 | +else |
230 | +libext=so |
231 | +FFLAGS+= -fPIC |
232 | +LDFLAGS += -shared |
233 | +define CREATELIB |
234 | +$(FC) $(FFLAGS) $(LDFLAGS) -o $(1) $(2) |
235 | +endef |
236 | +endif |
237 | +else |
238 | +libext=a |
239 | +define CREATELIB |
240 | +$(AR) cru $(1) $(2) |
241 | +ranlib $(1) |
242 | +endef |
243 | +endif |
244 | + |
245 | +# Option lhapdf |
246 | + |
247 | +ifneq ($(lhapdf),) |
248 | +CXXFLAGS += $(shell $(lhapdf) --cppflags) |
249 | +alfas_functions=alfas_functions_lhapdf |
250 | +llhapdf+= -lLHAPDF |
251 | +else |
252 | +alfas_functions=alfas_functions |
253 | +llhapdf= |
254 | +endif |
255 | + |
256 | +# Helper function to check MG5 version |
257 | +define CHECK_MG5AMC_VERSION |
258 | +python -c 'import re; from distutils.version import StrictVersion; print StrictVersion("$(MG5AMC_VERSION)") >= StrictVersion("$(1)") if re.match("^[\d\.]+$$","$(MG5AMC_VERSION)") else True;' |
259 | +endef |
260 | \ No newline at end of file |
261 | |
262 | === removed file 'Template/LO/Source/make_opts' |
263 | --- Template/LO/Source/make_opts 2016-10-25 10:11:37 +0000 |
264 | +++ Template/LO/Source/make_opts 1970-01-01 00:00:00 +0000 |
265 | @@ -1,103 +0,0 @@ |
266 | -DEFAULT_F2PY_COMPILER=f2py |
267 | -DEFAULT_F_COMPILER=gfortran |
268 | -MACFLAG=-mmacosx-version-min=10.7 |
269 | -DEFAULT_CPP_COMPILER=clang |
270 | -MG5AMC_VERSION=SpecifiedByMG5aMCAtRunTime |
271 | -STDLIB=-lc++ |
272 | -PYTHIA8_PATH=NotInstalled |
273 | -STDLIB_FLAG=-stdlib=libc++ |
274 | -#end_of_make_opts_variables |
275 | - |
276 | -BIASLIBDIR=../../../lib/ |
277 | -BIASLIBRARY=libbias.$(libext) |
278 | - |
279 | -# Rest of the makefile |
280 | -ifeq ($(origin FFLAGS),undefined) |
281 | -FFLAGS= -O -w -fbounds-check -fPIC |
282 | -#FFLAGS+= -g -fbounds-check -ffpe-trap=invalid,zero,overflow,underflow,denormal -Wall |
283 | -endif |
284 | - |
285 | - |
286 | -# REMOVE MACFLAG IF NOT ON MAC OR FOR F2PY |
287 | -UNAME := $(shell uname -s) |
288 | -ifdef f2pymode |
289 | -MACFLAG= |
290 | -else |
291 | -ifneq ($(UNAME), Darwin) |
292 | -MACFLAG= |
293 | -endif |
294 | -endif |
295 | - |
296 | - |
297 | -ifeq ($(origin CXXFLAGS),undefined) |
298 | -CXXFLAGS= -O $(STDLIB_FLAG) $(MACFLAG) |
299 | -endif |
300 | - |
301 | -ifeq ($(origin CFLAGS),undefined) |
302 | -CFLAGS= -O $(STDLIB_FLAG) $(MACFLAG) |
303 | -endif |
304 | - |
305 | -# Increase the number of allowed charcters in a Fortran line |
306 | -FFLAGS+= -ffixed-line-length-132 |
307 | - |
308 | -# Set FC unless it's defined by an environment variable |
309 | -ifeq ($(origin FC),default) |
310 | -FC=$(DEFAULT_F_COMPILER) |
311 | -endif |
312 | -ifeq ($(origin F2PY), undefined) |
313 | -F2PY=$(DEFAULT_F2PY_COMPILER) |
314 | -endif |
315 | - |
316 | -UNAME := $(shell uname -s) |
317 | -ifeq ($(origin LDFLAGS), undefined) |
318 | -LDFLAGS=$(STDLIB) $(MACFLAG) |
319 | -endif |
320 | - |
321 | -# Options: dynamic, lhapdf |
322 | -# Option dynamic |
323 | - |
324 | -ifeq ($(UNAME), Darwin) |
325 | -dylibext=dylib |
326 | -else |
327 | -dylibext=so |
328 | -endif |
329 | - |
330 | -ifdef dynamic |
331 | -ifeq ($(UNAME), Darwin) |
332 | -libext=dylib |
333 | -FFLAGS+= -fno-common |
334 | -LDFLAGS += -bundle |
335 | -define CREATELIB |
336 | -$(FC) -dynamiclib -undefined dynamic_lookup -o $(1) $(2) |
337 | -endef |
338 | -else |
339 | -libext=so |
340 | -FFLAGS+= -fPIC |
341 | -LDFLAGS += -shared |
342 | -define CREATELIB |
343 | -$(FC) $(FFLAGS) $(LDFLAGS) -o $(1) $(2) |
344 | -endef |
345 | -endif |
346 | -else |
347 | -libext=a |
348 | -define CREATELIB |
349 | -$(AR) cru $(1) $(2) |
350 | -ranlib $(1) |
351 | -endef |
352 | -endif |
353 | - |
354 | -# Option lhapdf |
355 | - |
356 | -ifneq ($(lhapdf),) |
357 | -CXXFLAGS += $(shell $(lhapdf) --cppflags) |
358 | -alfas_functions=alfas_functions_lhapdf |
359 | -llhapdf+= -lLHAPDF |
360 | -else |
361 | -alfas_functions=alfas_functions |
362 | -llhapdf= |
363 | -endif |
364 | - |
365 | -# Helper function to check MG5 version |
366 | -define CHECK_MG5AMC_VERSION |
367 | -python -c 'import re; from distutils.version import StrictVersion; print StrictVersion("$(MG5AMC_VERSION)") >= StrictVersion("$(1)") if re.match("^[\d\.]+$$","$(MG5AMC_VERSION)") else True;' |
368 | -endef |
369 | \ No newline at end of file |
370 | |
371 | === modified file 'Template/LO/Source/rw_events.f' |
372 | --- Template/LO/Source/rw_events.f 2016-09-03 13:26:00 +0000 |
373 | +++ Template/LO/Source/rw_events.f 2016-12-10 02:02:40 +0000 |
374 | @@ -179,7 +179,7 @@ |
375 | c aqcd = g*g/4d0/pi |
376 | write(largeBuff,'(a)') '<event>' |
377 | evt_record=trim(evt_record)//trim(largeBuff) |
378 | - write(largeBuff,'(i2,i4,e16.7e3,3e15.7)') nexternal,ievent,wgt,scale, |
379 | + write(largeBuff,'(i2,i5,e16.7e3,3e15.7)') nexternal,ievent,wgt,scale, |
380 | $ aqed,aqcd |
381 | evt_record=trim(evt_record)//CHAR(13)//CHAR(10)//trim(largeBuff) |
382 | do i=1,nexternal |
383 | @@ -277,8 +277,7 @@ |
384 | c aqcd = g*g/4d0/pi |
385 | |
386 | write(lun,'(a)') '<event>' |
387 | - write(lun,'(i2,i4,e16.7e3,3e15.7)') nexternal,ievent,wgt,scale,aqed,aqcd |
388 | - write(*,'(i2,i4,e15.7e3,3e15.7)') nexternal,ievent,wgt,scale,aqed,aqcd |
389 | + write(lun,'(i2,i5,e16.7e3,3e15.7)') nexternal,ievent,wgt,scale,aqed,aqcd |
390 | do i=1,nexternal |
391 | write(lun,51) ic(1,i),ic(6,i),(ic(j,i),j=2,5), |
392 | $ (p(j,i),j=1,3),p(0,i),p(4,i),0.,real(ic(7,i)) |
393 | |
394 | === modified file 'Template/LO/SubProcesses/makefile' |
395 | --- Template/LO/SubProcesses/makefile 2016-08-11 00:19:31 +0000 |
396 | +++ Template/LO/SubProcesses/makefile 2016-12-10 02:02:40 +0000 |
397 | @@ -44,7 +44,7 @@ |
398 | $(FC) -o $(PROG) $(PROCESS) $(LINKLIBS) $(LDFLAGS) $(BIASDEPENDENCIES) |
399 | |
400 | gensym: $(SYMMETRY) configs.inc $(LIBDIR)libmodel.$(libext) $(LIBDIR)libgeneric.$(libext) |
401 | - $(FC) -o gensym $(SYMMETRY) -L../../lib/ -lmodel -lgeneric $(LDFLAGS) |
402 | + $(FC) -o gensym $(SYMMETRY) -L../../lib/ -lmodel -lgeneric -lpdf $(LDFLAGS) |
403 | |
404 | $(LIBDIR)libmodel.$(libext): ../../Cards/param_card.dat |
405 | cd ../../Source/MODEL; make |
406 | |
407 | === modified file 'Template/NLO/MCatNLO/PY8Analyzer/py8an_HwU_pp_lvl.f' |
408 | --- Template/NLO/MCatNLO/PY8Analyzer/py8an_HwU_pp_lvl.f 2016-02-23 10:48:46 +0000 |
409 | +++ Template/NLO/MCatNLO/PY8Analyzer/py8an_HwU_pp_lvl.f 2016-12-10 02:02:40 +0000 |
410 | @@ -61,6 +61,7 @@ |
411 | call set_error_estimation(0) |
412 | nwgt_analysis=nwgt |
413 | do i=1,1 |
414 | + l=0 |
415 | call HwU_book(l+1,'total rate '//HwUtype(i),2,-2.d0,2.d0) |
416 | call HwU_book(l+2,'lep rapidity '//HwUtype(i),40,-9d0,9d0) |
417 | call HwU_book(l+3,'lep pt '//HwUtype(i),100,0d0,200d0) |
418 | |
419 | === modified file 'Template/NLO/MCatNLO/srcHerwig/madfks_hwlhin.f' |
420 | --- Template/NLO/MCatNLO/srcHerwig/madfks_hwlhin.f 2016-04-04 09:56:54 +0000 |
421 | +++ Template/NLO/MCatNLO/srcHerwig/madfks_hwlhin.f 2016-12-10 02:02:40 +0000 |
422 | @@ -74,22 +74,27 @@ |
423 | # scale1_lhe,scale2_lhe, |
424 | # jwgtinfo,mexternal,iwgtnumpartn, |
425 | # wgtcentral,wgtmumin,wgtmumax,wgtpdfmin,wgtpdfmax |
426 | - if(jwgtinfo.eq.9)then |
427 | - if (nwgt.gt.1) then |
428 | + if(abs(jwgtinfo).eq.9.and.nwgt.gt.1)then |
429 | + do while(index(string,'</event>').eq.0.and. |
430 | + & index(string,'<rwgt>').eq.0) |
431 | read(iunit,'(a)')string ! <rwgt> |
432 | + enddo |
433 | + if(index(string,'</event>').eq.0)then |
434 | wgtref=XWGTUP/MQQ |
435 | do iww=2,nwgt ! start at 2, because 'central value' is not part of the extra weights |
436 | call read_rwgt_line_wgt(iunit,ww(iww)) |
437 | enddo |
438 | read(iunit,'(a)')string ! </rwgt> |
439 | + write(*,*) string |
440 | endif |
441 | + do while(index(string,'</event>').eq.0) |
442 | + read(iunit,'(a)')string ! <rwgt> |
443 | + enddo |
444 | else |
445 | do while(index(string,'</event>').eq.0) |
446 | read(iunit,'(a)')string |
447 | enddo |
448 | - backspace(iunit) |
449 | endif |
450 | - read(iunit,'(a)')string |
451 | else |
452 | string=buff(1:len_trim(buff)) |
453 | buff_tlh=' ' |
454 | |
455 | === modified file 'Template/NLO/SubProcesses/madfks_plot.f' |
456 | --- Template/NLO/SubProcesses/madfks_plot.f 2016-10-11 10:29:57 +0000 |
457 | +++ Template/NLO/SubProcesses/madfks_plot.f 2016-12-10 02:02:40 +0000 |
458 | @@ -265,7 +265,7 @@ |
459 | chybst=cosh(ybst_til_tolab) |
460 | shybst=sinh(ybst_til_tolab) |
461 | chybstmo=chybst-1.d0 |
462 | - do i=3,nexternal |
463 | + do i=nincoming+1,nexternal |
464 | call boostwdir2(chybst,shybst,chybstmo,xd,pp(0,i),pplab(0,i)) |
465 | enddo |
466 | c Fill the arrays (momenta, status and PDG): |
467 | |
468 | === modified file 'Template/NLO/SubProcesses/setcuts.f' |
469 | --- Template/NLO/SubProcesses/setcuts.f 2016-09-27 15:07:53 +0000 |
470 | +++ Template/NLO/SubProcesses/setcuts.f 2016-12-10 02:02:40 +0000 |
471 | @@ -156,7 +156,7 @@ |
472 | INTEGER NFKSPROCESS |
473 | COMMON/C_NFKSPROCESS/NFKSPROCESS |
474 | double precision taumin(fks_configs),taumin_s(fks_configs) |
475 | - & ,taumin_j(fks_configs),stot,xk(-nexternal:0) |
476 | + & ,taumin_j(fks_configs),stot,xk(nexternal) |
477 | save taumin,taumin_s,taumin_j,stot |
478 | integer i,j,k,d1,d2,iFKS,nt |
479 | double precision xm(-nexternal:nexternal),xm1,xm2,xmi |
480 | |
481 | === modified file 'Template/NLO/makefile' |
482 | --- Template/NLO/makefile 2013-11-15 12:29:09 +0000 |
483 | +++ Template/NLO/makefile 2016-12-10 02:02:40 +0000 |
484 | @@ -1,5 +1,5 @@ |
485 | -FILES = Cards HTML SubProcesses bin lib Source Events index.html README README.lhapdf \ |
486 | - TemplateVersion.txt MGMEVersion.txt |
487 | +FILES = Cards HTML SubProcesses bin lib Source Events FixedOrderAnalysis MCatNLO \ |
488 | + index.html README README.lhapdf TemplateVersion.txt MGMEVersion.txt |
489 | |
490 | amcatnlo.tar.gz: amcatnlo.tar |
491 | rm -f amcatnlo.tar.gz |
492 | |
493 | === modified file 'Template/loop_material/StandAlone/SubProcesses/MadLoopCommons.inc' |
494 | --- Template/loop_material/StandAlone/SubProcesses/MadLoopCommons.inc 2016-05-24 23:58:40 +0000 |
495 | +++ Template/loop_material/StandAlone/SubProcesses/MadLoopCommons.inc 2016-12-10 02:02:40 +0000 |
496 | @@ -104,6 +104,9 @@ |
497 | call SwitchOffCacheSystem_cll() |
498 | ENDIF |
499 | |
500 | +C Make sure no COLLIER error can interrupt the code |
501 | + call SwitchOffErrStop_cll() |
502 | + |
503 | C Specify below your other custom COLLIER parameter settings |
504 | C [user_specific_COLLIER_settings] |
505 | |
506 | |
507 | === modified file 'UpdateNotes.txt' |
508 | --- UpdateNotes.txt 2016-11-04 09:47:56 +0000 |
509 | +++ UpdateNotes.txt 2016-12-10 02:02:40 +0000 |
510 | @@ -1,5 +1,14 @@ |
511 | Update notes for MadGraph5_aMC@NLO (in reverse time order) |
512 | |
513 | +2.5.2(05/07/16) |
514 | + OM: improve systematics (thanks to Philipp Pigard) |
515 | + OM: new syntax to modify the run_card: set no_parton_cut |
516 | + This removes all the cut present in the card. |
517 | + OM: change the default configuration parameter cluster_local_path to None |
518 | + OM: change the syscalc syntax for the pdf to avoid using & since this is not xml compliant |
519 | + OM: avoid to bias module to include trivial weight in gridpack mode |
520 | + OM: Fix a bug making 2.5.1 not compatible with python2.6 |
521 | + OM: Improve "add missing" command if a full block is missing |
522 | |
523 | 2.5.1 (04/11/16) |
524 | PT+MZ: New interface for Herwig7. |
525 | |
526 | === modified file 'VERSION' |
527 | --- VERSION 2016-11-04 09:47:56 +0000 |
528 | +++ VERSION 2016-12-10 02:02:40 +0000 |
529 | @@ -1,5 +1,5 @@ |
530 | -version = 2.5.1 |
531 | -date = 2016-11-04 |
532 | +version = 2.5.2 |
533 | +date = 2016-05-07 |
534 | |
535 | |
536 | |
537 | |
538 | === modified file 'madgraph/__init__.py' |
539 | --- madgraph/__init__.py 2015-10-01 16:00:08 +0000 |
540 | +++ madgraph/__init__.py 2016-12-10 02:02:40 +0000 |
541 | @@ -37,3 +37,14 @@ |
542 | MG4DIR = MG5DIR |
543 | ReadWrite = os.access(MG5DIR, os.W_OK) # W_OK is for writing |
544 | |
545 | +if ReadWrite: |
546 | + # Temporary fix for problem with auto-update |
547 | + try: |
548 | + tmp_path = pjoin(MG5DIR, 'Template','LO','Source','make_opts') |
549 | + #1480375724 is 29/11/16 |
550 | + if os.path.exists(tmp_path) and os.path.getmtime(tmp_path) < 1480375724: |
551 | + os.remove(tmp_path) |
552 | + shutil.copy(pjoin(MG5DIR, 'Template','LO','Source','.make_opts'), |
553 | + pjoin(MG5DIR, 'Template','LO','Source','make_opts')) |
554 | + except Exception,error: |
555 | + pass |
556 | |
557 | === modified file 'madgraph/core/base_objects.py' |
558 | --- madgraph/core/base_objects.py 2016-10-31 19:32:57 +0000 |
559 | +++ madgraph/core/base_objects.py 2016-12-10 02:02:40 +0000 |
560 | @@ -237,7 +237,7 @@ |
561 | elif name == 'goldstone': |
562 | return self['type'] == 'goldstone' |
563 | elif name == 'propagating': |
564 | - return self['line'] is not None |
565 | + return self['line'] not in ['None',None] |
566 | else: |
567 | return super(Particle, self).get(name) |
568 | |
569 | @@ -348,7 +348,7 @@ |
570 | if not isinstance(value, str): |
571 | raise self.PhysicsObjectError, \ |
572 | "Line type %s is not a string" % repr(value) |
573 | - if value not in ['dashed', 'straight', 'wavy', 'curly', 'double','swavy','scurly','dotted']: |
574 | + if value not in ['None','dashed', 'straight', 'wavy', 'curly', 'double','swavy','scurly','dotted']: |
575 | raise self.PhysicsObjectError, \ |
576 | "Line type %s is unknown" % value |
577 | |
578 | |
579 | === modified file 'madgraph/interface/amcatnlo_run_interface.py' |
580 | --- madgraph/interface/amcatnlo_run_interface.py 2016-11-03 15:21:05 +0000 |
581 | +++ madgraph/interface/amcatnlo_run_interface.py 2016-12-10 02:02:40 +0000 |
582 | @@ -2943,8 +2943,8 @@ |
583 | 'hwpp_path'], |
584 | 'PYTHIA8': ['pythia8_path']} |
585 | |
586 | - if not all([self.options[ppath] for ppath in path_dict[shower]]): |
587 | - raise aMCatNLOError('Some paths are missing in the configuration file.\n' + \ |
588 | + if not all([self.options[ppath] and os.path.exists(self.options[ppath]) for ppath in path_dict[shower]]): |
589 | + raise aMCatNLOError('Some paths are missing or invalid in the configuration file.\n' + \ |
590 | ('Please make sure you have set these variables: %s' % ', '.join(path_dict[shower]))) |
591 | |
592 | if shower == 'HERWIGPP': |
593 | |
594 | === modified file 'madgraph/interface/common_run_interface.py' |
595 | --- madgraph/interface/common_run_interface.py 2016-11-03 21:20:15 +0000 |
596 | +++ madgraph/interface/common_run_interface.py 2016-12-10 02:02:40 +0000 |
597 | @@ -595,7 +595,7 @@ |
598 | 'cluster_type': 'condor', |
599 | 'cluster_status_update': (600, 30), |
600 | 'cluster_nb_retry':1, |
601 | - 'cluster_local_path': "/cvmfs/cp3.uclouvain.be/madgraph/", |
602 | + 'cluster_local_path': None, |
603 | 'cluster_retry_wait':300} |
604 | |
605 | options_madgraph= {'stdout_level':None} |
606 | @@ -1534,7 +1534,7 @@ |
607 | |
608 | # always pass to a path + get the event size |
609 | result_file= sys.stdout |
610 | - if not os.path.sep in args[0]: |
611 | + if not os.path.isfile(args[0]) and not os.path.sep in args[0]: |
612 | path = [pjoin(self.me_dir, 'Events', args[0], 'unweighted_events.lhe.gz'), |
613 | pjoin(self.me_dir, 'Events', args[0], 'unweighted_events.lhe'), |
614 | pjoin(self.me_dir, 'Events', args[0], 'events.lhe.gz'), |
615 | @@ -1554,7 +1554,7 @@ |
616 | else: |
617 | raise self.InvalidCmd, 'Invalid run name. Please retry' |
618 | elif self.options['nb_core'] != 1: |
619 | - lhe = lhe_parser.EventFile(args) |
620 | + lhe = lhe_parser.EventFile(args[0]) |
621 | nb_event = len(lhe) |
622 | lhe.close() |
623 | |
624 | @@ -1590,9 +1590,13 @@ |
625 | |
626 | # Check that all pdfset are correctly installed |
627 | if 'sys_pdf' in self.run_card: |
628 | - sys_pdf = self.run_card['sys_pdf'].split('&&') |
629 | - lhaid += [l.split()[0] for l in sys_pdf] |
630 | - |
631 | + if '&&' in self.run_card['sys_pdf']: |
632 | + line = ' '.join(self.run_card['sys_pdf']) |
633 | + sys_pdf = line.split('&&') |
634 | + lhaid += [l.split()[0] for l in sys_pdf] |
635 | + else: |
636 | + lhaid += [l for l in self.run_card['sys_pdf'].split() if not l.isdigit() or int(l) > 500] |
637 | + |
638 | else: |
639 | #check that all p |
640 | pdf = [a[6:] for a in opts if a.startswith('--pdf=')] |
641 | @@ -3921,7 +3925,8 @@ |
642 | 'pythia8_card PartonLevel:FSRinResonances False', |
643 | 'pythia8_card ProcessLevel:resonanceDecays False', |
644 | ]), |
645 | - 'mpi':([bool],['pythia8_card partonlevel:mpi %(0)s']) |
646 | + 'mpi':([bool],['pythia8_card partonlevel:mpi %(0)s']), |
647 | + 'no_parton_cut':([],['run_card nocut T']) |
648 | } |
649 | |
650 | special_shortcut_help = { |
651 | @@ -4576,7 +4581,6 @@ |
652 | #else: |
653 | # logger.warning("too many argument for this command") |
654 | # return |
655 | - |
656 | for arg in cmd: |
657 | try: |
658 | text = arg % values |
659 | @@ -4625,7 +4629,6 @@ |
660 | fsock.write(p_card) |
661 | return |
662 | |
663 | - |
664 | card = '' #store which card need to be modify (for name conflict) |
665 | if args[0] == 'madweight_card': |
666 | if not self.mw_card: |
667 | @@ -4666,7 +4669,6 @@ |
668 | pjoin(self.me_dir,'Cards', 'delphes_card.dat')) |
669 | return |
670 | |
671 | - |
672 | if args[0] in ['run_card', 'param_card', 'MadWeight_card', 'shower_card', |
673 | 'delphes_card','madanalysis5_hadron_card','madanalysis5_parton_card']: |
674 | if args[1] == 'default': |
675 | @@ -4751,7 +4753,11 @@ |
676 | val = args[start+1] |
677 | self.setR(args[start], val) |
678 | self.run_card.write(self.paths['run'], self.paths['run_default']) |
679 | - |
680 | + # special mode for set run_card nocut T (generated by set no_parton_cut |
681 | + elif card == 'run_card' and args[start] in ['nocut', 'no_cut']: |
682 | + logger.info("Going to remove all cuts from the run_card", '$MG:color:BLACK') |
683 | + self.run_card.remove_all_cut() |
684 | + self.run_card.write(self.paths['run'], self.paths['run_default']) |
685 | ### PARAM_CARD WITH BLOCK NAME ----------------------------------------- |
686 | elif (args[start] in self.param_card or args[start] == 'width') \ |
687 | and card in ['','param_card']: |
688 | @@ -5280,6 +5286,9 @@ |
689 | |
690 | def check_block(self, blockname): |
691 | add_entry = 0 |
692 | + if blockname.lower() not in self.param_card_default: |
693 | + logger.info('unknow block %s: block will be ignored', blockname) |
694 | + return add_entry |
695 | block = self.param_card_default[blockname] |
696 | for key in block.keys(): |
697 | if key not in input_in_block: |
698 | @@ -5291,6 +5300,8 @@ |
699 | add_entry += 1 |
700 | if add_entry: |
701 | text.append('\n') |
702 | + if add_entry: |
703 | + logger.info("Adding %s parameter(s) to block %s", add_entry, blockname) |
704 | return add_entry |
705 | |
706 | # Add to the current param_card all the missing input at default value |
707 | @@ -5344,7 +5355,9 @@ |
708 | continue |
709 | |
710 | if block not in defined_blocks: |
711 | - add_entry += len(self.param_card_default[block]) |
712 | + nb_entry = len(self.param_card_default[block]) |
713 | + logger.info("Block %s was missing. Adding the %s associated parameter(s)", block,nb_entry) |
714 | + add_entry += nb_entry |
715 | text.append(str(self.param_card_default[block])) |
716 | |
717 | # special check for the decay |
718 | |
719 | === modified file 'madgraph/interface/madevent_interface.py' |
720 | --- madgraph/interface/madevent_interface.py 2016-11-04 09:42:37 +0000 |
721 | +++ madgraph/interface/madevent_interface.py 2016-12-10 02:02:40 +0000 |
722 | @@ -3824,11 +3824,15 @@ |
723 | # Now setup the preamble to make sure that everything will use the locally |
724 | # installed tools (if present) even if the user did not add it to its |
725 | # environment variables. |
726 | - if MADEVENT: |
727 | + if 'heptools_install_dir' in self.options: |
728 | preamble = misc.get_HEPTools_location_setter( |
729 | - pjoin(self.options['mg5amc_py8_interface_path'],os.pardir),'lib') |
730 | + self.options['heptools_install_dir'],'lib') |
731 | else: |
732 | - preamble = misc.get_HEPTools_location_setter( |
733 | + if MADEVENT: |
734 | + preamble = misc.get_HEPTools_location_setter( |
735 | + pjoin(self.options['mg5amc_py8_interface_path'],os.pardir),'lib') |
736 | + else: |
737 | + preamble = misc.get_HEPTools_location_setter( |
738 | pjoin(MG5DIR,'HEPTools'),'lib') |
739 | |
740 | open(pythia_cmd_card,'w').write("""! |
741 | @@ -5485,8 +5489,12 @@ |
742 | |
743 | # Check that all pdfset are correctly installed |
744 | lhaid = [self.run_card.get_lhapdf_id()] |
745 | - sys_pdf = self.run_card['sys_pdf'].split('&&') |
746 | - lhaid += [l.split()[0] for l in sys_pdf] |
747 | + if '&&' in self.run_card['sys_pdf']: |
748 | + line = ' '.join(self.run_card['sys_pdf']) |
749 | + sys_pdf = line.split('&&') |
750 | + lhaid += [l.split()[0] for l in sys_pdf] |
751 | + else: |
752 | + lhaid += [l for l in self.run_card['sys_pdf'].split() if not l.isdigit() or int(l) > 500] |
753 | try: |
754 | pdfsets_dir = self.get_lhapdf_pdfsetsdir() |
755 | except Exception, error: |
756 | @@ -5497,17 +5505,34 @@ |
757 | # Copy all the relevant PDF sets |
758 | [self.copy_lhapdf_set([onelha], pdfsets_dir) for onelha in lhaid] |
759 | |
760 | - |
761 | + to_syscalc={'sys_scalefact': self.run_card['sys_scalefact'], |
762 | + 'sys_alpsfact': self.run_card['sys_alpsfact'], |
763 | + 'sys_matchscale': self.run_card['sys_matchscale'], |
764 | + 'sys_scalecorrelation': self.run_card['sys_scalecorrelation'], |
765 | + 'sys_pdf': self.run_card['sys_pdf']} |
766 | |
767 | tag = self.run_card['run_tag'] |
768 | card = pjoin(self.me_dir, 'bin','internal', 'syscalc_card.dat') |
769 | template = open(pjoin(self.me_dir, 'bin','internal', 'syscalc_template.dat')).read() |
770 | - self.run_card['sys_pdf'] = self.run_card['sys_pdf'].split('#',1)[0].replace('&&',' \n ') |
771 | - |
772 | - if self.run_card['sys_pdf'].lower() in ['', 'f', 'false', 'none', '.false.']: |
773 | - self.run_card['sys_pdf'] = '' |
774 | - if self.run_card['sys_alpsfact'].lower() in ['', 'f', 'false', 'none','.false.']: |
775 | - self.run_card['sys_alpsfact'] = '' |
776 | + |
777 | + if '&&' in to_syscalc['sys_pdf']: |
778 | + to_syscalc['sys_pdf'] = to_syscalc['sys_pdf'].split('#',1)[0].replace('&&',' \n ') |
779 | + else: |
780 | + data = to_syscalc['sys_pdf'].split() |
781 | + new = [] |
782 | + for d in data: |
783 | + if not d.isdigit(): |
784 | + new.append(d) |
785 | + elif int(d) > 500: |
786 | + new.append(d) |
787 | + else: |
788 | + new[-1] += ' %s' % d |
789 | + to_syscalc['sys_pdf'] = '\n'.join(new) |
790 | + |
791 | + if to_syscalc['sys_pdf'].lower() in ['', 'f', 'false', 'none', '.false.']: |
792 | + to_syscalc['sys_pdf'] = '' |
793 | + if to_syscalc['sys_alpsfact'].lower() in ['', 'f', 'false', 'none','.false.']: |
794 | + to_syscalc['sys_alpsfact'] = '' |
795 | |
796 | |
797 | |
798 | @@ -6477,7 +6502,7 @@ |
799 | interface.do_treatcards('all --no_MadLoopInit') |
800 | |
801 | # First make sure that IREGI and CUTTOOLS are compiled if needed |
802 | - if os.path.exists(pjoin(proc_dir,'Source','CUTTOOLS')): |
803 | + if os.path.exists(pjoin(proc_dir,'Source','CutTools')): |
804 | misc.compile(arg=['libcuttools'],cwd=pjoin(proc_dir,'Source')) |
805 | if os.path.exists(pjoin(proc_dir,'Source','IREGI')): |
806 | misc.compile(arg=['libiregi'],cwd=pjoin(proc_dir,'Source')) |
807 | |
808 | === modified file 'madgraph/interface/madgraph_interface.py' |
809 | --- madgraph/interface/madgraph_interface.py 2016-11-01 15:20:16 +0000 |
810 | +++ madgraph/interface/madgraph_interface.py 2016-12-10 02:02:40 +0000 |
811 | @@ -2449,6 +2449,7 @@ |
812 | |
813 | def complete_set(self, text, line, begidx, endidx): |
814 | "Complete the set command" |
815 | + misc.sprint([text,line,begidx, endidx]) |
816 | args = self.split_arg(line[0:begidx]) |
817 | |
818 | # Format |
819 | @@ -2864,6 +2865,14 @@ |
820 | mgme_dir) |
821 | self._mgme_dir = MG4DIR |
822 | |
823 | + # check that make_opts exists |
824 | + make_opts = pjoin(MG5DIR, 'Template','LO','Source','make_opts') |
825 | + make_opts_source = pjoin(MG5DIR, 'Template','LO','Source','.make_opts') |
826 | + if not os.path.exists(make_opts): |
827 | + shutil.copy(make_opts_source, make_opts) |
828 | + elif os.path.getmtime(make_opts) < os.path.getmtime(make_opts_source): |
829 | + shutil.copy(make_opts_source, make_opts) |
830 | + |
831 | # Variables to store state information |
832 | self._multiparticles = {} |
833 | self.options = {} |
834 | @@ -6409,6 +6418,12 @@ |
835 | subprocess.call([os.path.join('tests','test_manager.py')], |
836 | cwd=MG5DIR) |
837 | print 'new version installed, please relaunch mg5' |
838 | + try: |
839 | + os.remove(pjoin(MG5DIR, 'Template','LO','Source','make_opts')) |
840 | + shutil.copy(pjoin(MG5DIR, 'Template','LO','Source','.make_opts'), |
841 | + pjoin(MG5DIR, 'Template','LO','Source','make_opts')) |
842 | + except: |
843 | + pass |
844 | sys.exit(0) |
845 | elif answer == 'n': |
846 | # prevent for a future check |
847 | |
848 | === modified file 'madgraph/iolibs/export_v4.py' |
849 | --- madgraph/iolibs/export_v4.py 2016-10-24 12:21:59 +0000 |
850 | +++ madgraph/iolibs/export_v4.py 2016-12-10 02:02:40 +0000 |
851 | @@ -907,7 +907,7 @@ |
852 | return two value: |
853 | - True/False if the matrix_element was modified |
854 | - the new(or old) matrix element""" |
855 | - misc.sprint("DO not modify grouping") |
856 | + |
857 | return False, matrix_element |
858 | |
859 | #=========================================================================== |
860 | |
861 | === modified file 'madgraph/iolibs/template_files/madevent_makefile_source' |
862 | --- madgraph/iolibs/template_files/madevent_makefile_source 2016-09-01 09:14:58 +0000 |
863 | +++ madgraph/iolibs/template_files/madevent_makefile_source 2016-12-10 02:02:40 +0000 |
864 | @@ -54,8 +54,8 @@ |
865 | |
866 | $(BINDIR)gen_ximprove: gen_ximprove.o ranmar.o rw_routines.o open_file.o |
867 | $(FC) $(LDFLAGS) -o $@ $^ |
868 | -$(BINDIR)combine_events: $(COMBINE) $(LIBDIR)libmodel.$(libext) $(LIBDIR)libpdf.$(libext) run_card.inc |
869 | - $(FC) $(LDFLAGS) -o $@ $(COMBINE) -L$(LIBDIR) -lmodel -lpdf $(llhapdf) $(LDFLAGS) |
870 | +$(BINDIR)combine_events: $(COMBINE) $(LIBDIR)libmodel.$(libext) $(LIBDIR)libpdf.$(libext) run_card.inc $(LIBDIR)libbias.$(libext) |
871 | + $(FC) $(LDFLAGS) -o $@ $(COMBINE) -L$(LIBDIR) -lmodel -lpdf $(llhapdf) $(LDFLAGS) -lbias |
872 | $(BINDIR)gensudgrid: $(GENSUDGRID) $(LIBDIR)libpdf.$(libext) $(LIBDIR)libcernlib.$(libext) |
873 | $(FC) $(LDFLAGS) -o $@ $(GENSUDGRID) -L$(LIBDIR) -lmodel -lpdf -lcernlib $(llhapdf) $(LDFLAGS) |
874 | |
875 | |
876 | === modified file 'madgraph/iolibs/template_files/madevent_symmetry.f' |
877 | --- madgraph/iolibs/template_files/madevent_symmetry.f 2016-09-06 15:01:18 +0000 |
878 | +++ madgraph/iolibs/template_files/madevent_symmetry.f 2016-12-10 02:02:40 +0000 |
879 | @@ -13,6 +13,8 @@ |
880 | include 'run_config.inc' |
881 | include 'maxamps.inc' |
882 | include 'nexternal.inc' |
883 | + include 'cuts.inc' |
884 | + include '../../Source/run.inc' |
885 | |
886 | double precision ZERO |
887 | parameter (ZERO = 0d0) |
888 | @@ -32,16 +34,13 @@ |
889 | integer pow(-max_branch:-1,lmaxconfigs) |
890 | character*20 param(maxpara),value(maxpara) |
891 | double precision pmass(nexternal) !External particle mass |
892 | - double precision pi1(0:3),pi2(0:3),m1,m2,ebeam(2) |
893 | - integer lpp(2) |
894 | + double precision pi1(0:3),pi2(0:3),m1,m2 |
895 | c |
896 | c Global |
897 | c |
898 | include 'coupl.inc' |
899 | logical gridpack |
900 | common/to_gridpack/gridpack |
901 | - double precision bwcutoff |
902 | - common/to_bwcutoff/bwcutoff |
903 | double precision stot |
904 | common/to_stot/stot |
905 | c |
906 | @@ -53,6 +52,13 @@ |
907 | include 'configs.inc' |
908 | data use_config/0,lmaxconfigs*0/ |
909 | |
910 | +c |
911 | +c needed for the run_card handling |
912 | +c |
913 | + logical gridrun |
914 | + integer iseed,lhaid |
915 | + character*100 pdlabel |
916 | + double precision sf1,sf2,pb1,pb2,d |
917 | c----- |
918 | c Begin Code |
919 | c----- |
920 | @@ -74,13 +80,14 @@ |
921 | c stop |
922 | c endif |
923 | |
924 | - call load_para(npara,param,value) |
925 | - call get_logical(npara,param,value," gridpack ",gridpack,.false.) |
926 | - call get_real(npara,param,value," bwcutoff ",bwcutoff,5d0) |
927 | - call get_real(npara,param,value," ebeam1 ",ebeam(1),0d0) |
928 | - call get_real(npara,param,value," ebeam2 ",ebeam(2),0d0) |
929 | - call get_integer(npara,param,value," lpp1 ",lpp(1),0) |
930 | - call get_integer(npara,param,value," lpp2 ",lpp(2),0) |
931 | + include '../../Source/run_card.inc' |
932 | +c call load_para(npara,param,value) |
933 | +c call get_logical(npara,param,value," gridpack ",gridpack,.false.) |
934 | +c call get_real(npara,param,value," bwcutoff ",bwcutoff,5d0) |
935 | +c call get_real(npara,param,value," ebeam1 ",ebeam(1),0d0) |
936 | +c call get_real(npara,param,value," ebeam2 ",ebeam(2),0d0) |
937 | +c call get_integer(npara,param,value," lpp1 ",lpp(1),0) |
938 | +c call get_integer(npara,param,value," lpp2 ",lpp(2),0) |
939 | |
940 | call setpara('%(param_card_name)s' %(setparasecondarg)s) !Sets up couplings and masses |
941 | include 'pmass.inc' |
942 | |
943 | === modified file 'madgraph/iolibs/template_files/makefile_sa_f_sp' |
944 | --- madgraph/iolibs/template_files/makefile_sa_f_sp 2015-08-14 13:56:58 +0000 |
945 | +++ madgraph/iolibs/template_files/makefile_sa_f_sp 2016-12-10 02:02:40 +0000 |
946 | @@ -24,4 +24,4 @@ |
947 | |
948 | matrix$(MENUM)py.so: matrix.f makefile $(LIBS) |
949 | touch __init__.py |
950 | - $(F2PY) $(LINKLIBS) -c matrix.f -m matrix$(MENUM)py --fcompiler=$(FC) |
951 | \ No newline at end of file |
952 | + $(F2PY) $(LINKLIBS) -c matrix.f -m matrix$(MENUM)py |
953 | \ No newline at end of file |
954 | |
955 | === modified file 'madgraph/loop/loop_exporters.py' |
956 | --- madgraph/loop/loop_exporters.py 2016-09-08 23:15:34 +0000 |
957 | +++ madgraph/loop/loop_exporters.py 2016-12-10 02:02:40 +0000 |
958 | @@ -2445,7 +2445,7 @@ |
959 | '%(proc_prefix)sBornColorFlowCoefs.dat' |
960 | %matrix_element.rep_dict),'w') |
961 | self.write_color_flow_coefs_data_file(dat_writer, |
962 | - born_col_amps, matrix_element.get('loop_color_basis')) |
963 | + born_col_amps, matrix_element.get('born_color_basis')) |
964 | dat_writer.close() |
965 | |
966 | dat_writer = open(pjoin('..','MadLoop5_resources', |
967 | |
968 | === modified file 'madgraph/various/histograms.py' |
969 | --- madgraph/various/histograms.py 2016-10-03 09:30:33 +0000 |
970 | +++ madgraph/various/histograms.py 2016-12-10 02:02:40 +0000 |
971 | @@ -771,8 +771,13 @@ |
972 | elif selector == 'ALPSFACT': |
973 | selector = r'ALPSFACT' |
974 | elif selector == 'PDF': |
975 | - selector = r'MUF=1_MUR=1_PDF=(\d*)' |
976 | + selector = r'(?:MUF=1_MUR=1_PDF=|MU(?:F|R)="1.0" MU(?:R|F)="1.0" PDF=")(\d*)' |
977 | if not mode: |
978 | +# pdfs=[] |
979 | +## for n in self.bins[0].wgts: |
980 | +# misc.sprint( n) |
981 | +# if re.search(selector,n, re.IGNORECASE): |
982 | +# pdfs.append(int(re.findall(selector, n)[0])) |
983 | pdfs = [int(re.findall(selector, n)[0]) for n in self.bins[0].wgts if re.search(selector,n, re.IGNORECASE)] |
984 | min_pdf, max_pdf = min(pdfs), max(pdfs) |
985 | if max_pdf - min_pdf > 100: |
986 | @@ -816,9 +821,9 @@ |
987 | for i in xrange(len(values[0])): |
988 | pdf_stdev = 0.0 |
989 | data = [values[s][i] for s in xrange(len(values))] |
990 | - sdata = sum(data) |
991 | - sdata2 = sum(x**2 for x in data) |
992 | - pdf_stdev = math.sqrt(max(sdata2 -sdata**2/float(len(values)-2),0.0)) |
993 | + sdata = sum(data)/len(data) |
994 | + sdata2 = sum(x**2 for x in data)/len(data) |
995 | + pdf_stdev = math.sqrt(max(sdata2 -sdata**2,0.0)) |
996 | min_value.append(sdata - pdf_stdev) |
997 | max_value.append(sdata + pdf_stdev) |
998 | |
999 | @@ -3353,7 +3358,7 @@ |
1000 | h_min = [hwu_mult*b for b in h_min] |
1001 | h_max = [hwu_mult*b for b in h_max] |
1002 | fill_between_steps(bins, h_min, h_max, ax=ax, facecolor=H.get_color(), |
1003 | - alpha=0.5, edgecolor=H.get_color()) |
1004 | + alpha=0.5, edgecolor=H.get_color(),hatch='/') |
1005 | |
1006 | return hwu, H |
1007 | |
1008 | |
1009 | === modified file 'madgraph/various/lhe_parser.py' |
1010 | --- madgraph/various/lhe_parser.py 2016-11-04 08:50:51 +0000 |
1011 | +++ madgraph/various/lhe_parser.py 2016-12-10 02:02:40 +0000 |
1012 | @@ -772,14 +772,16 @@ |
1013 | grouped_error[group] = self.error[i]**2 |
1014 | else: |
1015 | ban = banner_mod.Banner(ff.banner) |
1016 | - for line in ban['init']: |
1017 | + for line in ban['init'].split('\n'): |
1018 | splitline = line.split() |
1019 | if len(splitline)==4: |
1020 | - cross, error, wgt, group = splitline |
1021 | - grouped_cross[int(group)] += cross |
1022 | - grouped_error[int(group)] += error**2 |
1023 | - |
1024 | - |
1025 | + cross, error, _, group = splitline |
1026 | + if int(group) in grouped_cross: |
1027 | + grouped_cross[group] += float(cross) |
1028 | + grouped_error[group] += float(error)**2 |
1029 | + else: |
1030 | + grouped_cross[group] = float(cross) |
1031 | + grouped_error[group] = float(error)**2 |
1032 | nb_group = len(grouped_cross) |
1033 | |
1034 | # compute the information for the first line |
1035 | @@ -818,7 +820,6 @@ |
1036 | init_information["cross_info"] = '\n'.join(init_information["cross_info"]) |
1037 | init_information['lha_stra'] = -1 * abs(lha_strategy) |
1038 | |
1039 | - |
1040 | template_init =\ |
1041 | """ %(idbmup1)i %(idbmup2)i %(ebmup1)e %(ebmup2)e %(pdfgup1)i %(pdfgup2)i %(pdfsup1)i %(pdfsup2)i %(lha_stra)i %(nprup)i |
1042 | %(cross_info)s |
1043 | |
1044 | === modified file 'madgraph/various/misc.py' |
1045 | --- madgraph/various/misc.py 2016-10-14 22:51:35 +0000 |
1046 | +++ madgraph/various/misc.py 2016-12-10 02:02:40 +0000 |
1047 | @@ -45,7 +45,6 @@ |
1048 | import madgraph.iolibs.files as files |
1049 | MADEVENT = False |
1050 | |
1051 | - |
1052 | |
1053 | logger = logging.getLogger('cmdprint.ext_program') |
1054 | logger_stderr = logging.getLogger('madevent.misc') |
1055 | @@ -991,15 +990,25 @@ |
1056 | """ |
1057 | |
1058 | def __init__(self, cls, attribute, value): |
1059 | - |
1060 | - self.old_value = getattr(cls, attribute) |
1061 | + |
1062 | self.cls = cls |
1063 | - self.attribute = attribute |
1064 | - setattr(self.cls, self.attribute, value) |
1065 | + self.attribute = attribute |
1066 | + if isinstance(attribute, list): |
1067 | + self.old_value = [] |
1068 | + for key, onevalue in zip(attribute, value): |
1069 | + self.old_value.append(getattr(cls, key)) |
1070 | + setattr(self.cls, key, onevalue) |
1071 | + else: |
1072 | + self.old_value = getattr(cls, attribute) |
1073 | + setattr(self.cls, self.attribute, value) |
1074 | |
1075 | def __exit__(self, ctype, value, traceback ): |
1076 | - |
1077 | - setattr(self.cls, self.attribute, self.old_value) |
1078 | + |
1079 | + if isinstance(self.attribute, list): |
1080 | + for key, old_value in zip(self.attribute, self.old_value): |
1081 | + setattr(self.cls, key, old_value) |
1082 | + else: |
1083 | + setattr(self.cls, self.attribute, self.old_value) |
1084 | |
1085 | def __enter__(self): |
1086 | return self.old_value |
1087 | @@ -1225,7 +1234,7 @@ |
1088 | is in the environment paths of the user. If not, it returns a preamble that |
1089 | sets it before calling the exectuable, for example: |
1090 | <preamble> ./my_exe |
1091 | - with <preamble> -> DYLD_LIBRARY_PATH='blabla;$DYLD_LIBRARY_PATH'""" |
1092 | + with <preamble> -> DYLD_LIBRARY_PATH=blabla:$DYLD_LIBRARY_PATH""" |
1093 | |
1094 | assert(type in ['bin','include','lib']) |
1095 | |
1096 | @@ -1236,7 +1245,7 @@ |
1097 | |
1098 | if target_env_var not in os.environ or \ |
1099 | target_path not in os.environ[target_env_var].split(os.pathsep): |
1100 | - return "%s='%s;$%s' "%(target_env_var,target_path,target_env_var) |
1101 | + return "%s=%s:$%s "%(target_env_var,target_path,target_env_var) |
1102 | else: |
1103 | return '' |
1104 | |
1105 | |
1106 | === modified file 'madgraph/various/systematics.py' |
1107 | --- madgraph/various/systematics.py 2016-11-03 15:21:05 +0000 |
1108 | +++ madgraph/various/systematics.py 2016-12-10 02:02:40 +0000 |
1109 | @@ -366,7 +366,15 @@ |
1110 | for lhapdfid,values in pdfs.items(): |
1111 | if lhapdfid == self.orig_pdf.lhapdfID: |
1112 | continue |
1113 | + if len(values) == 1 : |
1114 | + continue |
1115 | pdfset = self.pdfsets[lhapdfid] |
1116 | + |
1117 | + if pdfset.errorType == 'unknown' : |
1118 | + # Don't know how to determine uncertainty for 'unknown' errorType : |
1119 | + # File "lhapdf.pyx", line 329, in lhapdf.PDFSet.uncertainty (lhapdf.cpp:6621) |
1120 | + # RuntimeError: "ErrorType: unknown" not supported by LHAPDF::PDFSet::uncertainty. |
1121 | + continue |
1122 | pdferr = pdfset.uncertainty(values) |
1123 | 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])) |
1124 | |
1125 | @@ -402,6 +410,7 @@ |
1126 | |
1127 | text = '' |
1128 | |
1129 | + default = self.args[0] |
1130 | for arg in self.args[1:]: |
1131 | mur, muf, alps, dyn, pdf = arg[:5] |
1132 | if pdf == self.orig_pdf and alps ==1 and (mur!=1 or muf!=1 or dyn!=-1): |
1133 | @@ -409,7 +418,7 @@ |
1134 | text += "<weightgroup name=\"Central scale variation\" combine=\"envelope\">\n" |
1135 | in_scale=True |
1136 | elif in_scale: |
1137 | - if (pdf == self.orig_pdf and alps ==1): |
1138 | + if (pdf == self.orig_pdf and alps ==1) and arg != default: |
1139 | pass |
1140 | else: |
1141 | text += "</weightgroup> # scale\n" |
1142 | @@ -423,7 +432,12 @@ |
1143 | text += "</weightgroup> # ALPS\n" |
1144 | in_alps=False |
1145 | |
1146 | - if pdf != self.orig_pdf and mur == muf == 1 and dyn==-1 and alps ==1: |
1147 | + if mur == muf == 1 and dyn==-1 and alps ==1: |
1148 | + if pdf.lhapdfID < 0: |
1149 | + for central,sets in self.pdfsets.items(): |
1150 | + if pdf in sets.set(): |
1151 | + misc.sprint(central) |
1152 | + |
1153 | if pdf.lhapdfID in self.pdfsets: |
1154 | if in_pdf: |
1155 | text += "</weightgroup> # PDFSET -> PDFSET\n" |
1156 | @@ -432,7 +446,7 @@ |
1157 | text +="<weightgroup name=\"%s\" combine=\"%s\"> # %s: %s\n" %\ |
1158 | (pdfset.name, pdfset.errorType,pdfset.lhapdfID, descrip) |
1159 | in_pdf=pdf.lhapdfID |
1160 | - elif pdf.memberID == 1 and (pdf.lhapdfID - pdf.memberID) in self.pdfsets: |
1161 | + elif pdf.memberID == 0 and (pdf.lhapdfID - pdf.memberID) in self.pdfsets: |
1162 | if in_pdf: |
1163 | text += "</weightgroup> # PDFSET -> PDFSET\n" |
1164 | pdfset = self.pdfsets[pdf.lhapdfID - 1] |
1165 | @@ -441,6 +455,7 @@ |
1166 | (pdfset.name, pdfset.errorType,pdfset.lhapdfID, descrip) |
1167 | in_pdf=pdfset.lhapdfID |
1168 | elif in_pdf and pdf.lhapdfID - pdf.memberID != in_pdf: |
1169 | + misc.sprint(pdf.lhapdfID) |
1170 | text += "</weightgroup> # PDFSET -> PDF\n" |
1171 | in_pdf = False |
1172 | elif in_pdf: |
1173 | @@ -525,7 +540,14 @@ |
1174 | new_args[pos[name]] = value |
1175 | all_args.append(new_args) |
1176 | |
1177 | - self.args = [default]+ [arg for arg in all_args if arg!= default] |
1178 | + self.args = [default] + [arg for arg in all_args if arg!= default] |
1179 | + |
1180 | + # add the default before the pdf scan to have a full grouping |
1181 | + pdfplusone = [pdf for pdf in self.pdf if pdf.lhapdfID == self.orig_pdf.lhapdfID+1] |
1182 | + if pdfplusone: |
1183 | + pdfplusone = default[:-1] + [pdfplusone[0]] |
1184 | + index = self.args.index(pdfplusone) |
1185 | + self.args.insert(index, default) |
1186 | |
1187 | self.log( "#Will Compute %s weights per event." % (len(self.args)-1)) |
1188 | return |
1189 | @@ -594,14 +616,18 @@ |
1190 | mur = event.get_sqrts_scale(1.) |
1191 | muf1 = mur |
1192 | muf2 = mur |
1193 | - loinfo['pdf_q1'][-1] = mur |
1194 | - loinfo['pdf_q2'][-1] = mur |
1195 | + loinfo = dict(loinfo) |
1196 | + loinfo['pdf_q1'] = loinfo['pdf_q1'] [:-1] + [mur] |
1197 | + loinfo['pdf_q2'] = loinfo['pdf_q2'] [:-1] + [mur] |
1198 | |
1199 | |
1200 | |
1201 | # MUR part |
1202 | if self.b1 == 0 == self.b2: |
1203 | - wgt = self.alpsrunner(Dmur*mur)**loinfo['n_qcd'] |
1204 | + if loinfo['n_qcd'] != 0: |
1205 | + wgt = self.alpsrunner(Dmur*mur)**loinfo['n_qcd'] |
1206 | + else: |
1207 | + wgt = 1.0 |
1208 | else: |
1209 | wgt = pdf.alphasQ(Dmur*mur)**loinfo['n_qcd'] |
1210 | # MUF/PDF part |
1211 | @@ -685,7 +711,7 @@ |
1212 | wgt += tmp |
1213 | |
1214 | if __debug__ and dyn== -1 and Dmur==1 and Dmuf==1 and pdf==self.orig_pdf: |
1215 | - if not misc.equal(tmp, onewgt.ref_wgt, sig_fig=4): |
1216 | + if not misc.equal(tmp, onewgt.ref_wgt, sig_fig=2): |
1217 | misc.sprint(tmp, onewgt.ref_wgt, (tmp-onewgt.ref_wgt)/tmp) |
1218 | misc.sprint(onewgt) |
1219 | misc.sprint(cevent) |
1220 | @@ -756,7 +782,19 @@ |
1221 | else: |
1222 | opts['alps'] = [1.0] |
1223 | opts['together'] = [('mur','muf','alps','dyn')] |
1224 | - pdfs = card['sys_pdf'].split('&&') |
1225 | + if '&&' in card['sys_pdf']: |
1226 | + pdfs = card['sys_pdf'].split('&&') |
1227 | + else: |
1228 | + data = card['sys_pdf'].split() |
1229 | + pdfs = [] |
1230 | + for d in data: |
1231 | + if not d.isdigit(): |
1232 | + pdfs.append(d) |
1233 | + elif int(d) > 500: |
1234 | + pdfs.append(d) |
1235 | + else: |
1236 | + pdfs[-1] = '%s %s' % (pdfs[-1], d) |
1237 | + |
1238 | opts['dyn'] = [-1,1,2,3,4] |
1239 | opts['pdf'] = [] |
1240 | for pdf in pdfs: |
1241 | @@ -781,7 +819,21 @@ |
1242 | return obj |
1243 | |
1244 | if __name__ == "__main__": |
1245 | - call_systematics(sys.argv[1:]) |
1246 | + sys_args = sys.argv[1:] |
1247 | + for i, arg in enumerate(sys_args) : |
1248 | + if arg.startswith('--lhapdf_config=') : |
1249 | + lhapdf = misc.import_python_lhapdf(arg[len('--lhapdf_config='):]) |
1250 | + del sys_args[i] |
1251 | + break |
1252 | + |
1253 | + if 'lhapdf' not in globals(): |
1254 | + lhapdf = misc.import_python_lhapdf('lhapdf-config') |
1255 | + |
1256 | + if not lhapdf: |
1257 | + sys.exit('Can not run systematics since can not link python to lhapdf, specify --lhapdf-config=') |
1258 | + call_systematics(sys_args) |
1259 | + |
1260 | + |
1261 | |
1262 | |
1263 | |
1264 | |
1265 | === modified file 'models/check_param_card.py' |
1266 | --- models/check_param_card.py 2016-10-26 20:14:22 +0000 |
1267 | +++ models/check_param_card.py 2016-12-10 02:02:40 +0000 |
1268 | @@ -120,13 +120,13 @@ |
1269 | |
1270 | if format == 'float': |
1271 | if self.lhablock == 'decay' and not isinstance(self.value,basestring): |
1272 | - return 'DECAY %s %.{}e # %s'.format(precision) % (' '.join([str(d) for d in self.lhacode]), self.value, self.comment) |
1273 | + return 'DECAY %s %.{0}e # %s'.format(precision) % (' '.join([str(d) for d in self.lhacode]), self.value, self.comment) |
1274 | elif self.lhablock == 'decay': |
1275 | return 'DECAY %s Auto # %s' % (' '.join([str(d) for d in self.lhacode]), self.comment) |
1276 | elif self.lhablock and self.lhablock.startswith('qnumbers'): |
1277 | return ' %s %i # %s' % (' '.join([str(d) for d in self.lhacode]), int(self.value), self.comment) |
1278 | else: |
1279 | - return ' %s %.{}e # %s'.format(precision) % (' '.join([str(d) for d in self.lhacode]), self.value, self.comment) |
1280 | + return ' %s %.{0}e # %s'.format(precision) % (' '.join([str(d) for d in self.lhacode]), self.value, self.comment) |
1281 | elif format == 'int': |
1282 | return ' %s %i # %s' % (' '.join([str(d) for d in self.lhacode]), int(self.value), self.comment) |
1283 | elif format == 'str': |
1284 | @@ -435,7 +435,7 @@ |
1285 | |
1286 | # apply all the basic restriction rule |
1287 | if restrict_rule: |
1288 | - restrict_rule.check_param_card(self, modify=True, log=loglevel) |
1289 | + _, modify = restrict_rule.check_param_card(self, modify=True, log=loglevel) |
1290 | |
1291 | import models.model_reader as model_reader |
1292 | import madgraph.core.base_objects as base_objects |
1293 | @@ -449,7 +449,6 @@ |
1294 | for particle in model.get('particles'): |
1295 | if particle.get('goldstone') or particle.get('ghost'): |
1296 | continue |
1297 | - |
1298 | mass = model.get_parameter(particle.get('mass')) |
1299 | lhacode = abs(particle.get_pdg_code()) |
1300 | |
1301 | @@ -481,6 +480,7 @@ |
1302 | model_value = model_value.real |
1303 | if not misc.equal(model_value, param_value, 4): |
1304 | modify = True |
1305 | + misc.sprint(modify) |
1306 | if loglevel == 20: |
1307 | logger.info('For consistency, the width of particle %s (%s) is changed to %s.' % (lhacode, particle.get('name'), model_value), '$MG:color:BLACK') |
1308 | else: |
1309 | @@ -488,6 +488,7 @@ |
1310 | #logger.debug('was %s', param_value) |
1311 | if model_value != param_value: |
1312 | self.get('decay').get(abs(particle.get_pdg_code())).value = model_value |
1313 | + |
1314 | return modify |
1315 | |
1316 | |
1317 | @@ -1140,7 +1141,9 @@ |
1318 | |
1319 | def check_param_card(self, path, modify=False, write_missing=False, log=False): |
1320 | """Check that the restriction card are applied""" |
1321 | - |
1322 | + |
1323 | + is_modified = False |
1324 | + |
1325 | if isinstance(path,str): |
1326 | card = self.read_param_card(path) |
1327 | else: |
1328 | @@ -1169,6 +1172,7 @@ |
1329 | param = card[block].get(id) |
1330 | param.value = 0.0 |
1331 | param.comment += ' fixed by the model' |
1332 | + is_modified = True |
1333 | if log ==20: |
1334 | logger.log(log,'For model consistency, update %s with id %s to value %s', |
1335 | (block, id, 0.0), '$MG:color:BLACK') |
1336 | @@ -1199,6 +1203,7 @@ |
1337 | param = card[block].get(id) |
1338 | param.value = 1.0 |
1339 | param.comment += ' fixed by the model' |
1340 | + is_modified = True |
1341 | if log ==20: |
1342 | logger.log(log,'For model consistency, update %s with id %s to value %s', |
1343 | (block, id, 1.0), '$MG:color:BLACK') |
1344 | @@ -1210,6 +1215,7 @@ |
1345 | # check identical |
1346 | for block, id1, id2, comment in self.identical: |
1347 | if block not in card: |
1348 | + is_modified = True |
1349 | logger.warning('''Param card is not complete: Block %s is simply missing. |
1350 | We will use model default for all missing value! Please cross-check that |
1351 | this correspond to your expectation.''' % block) |
1352 | @@ -1234,6 +1240,7 @@ |
1353 | param = card[block].get(id1) |
1354 | param.value = value2 |
1355 | param.comment += ' must be identical to %s' % id2 |
1356 | + is_modified = True |
1357 | if log ==20: |
1358 | logger.log(log,'For model consistency, update %s with id %s to value %s since it should be equal to parameter with id %s', |
1359 | block, id1, value2, id2, '$MG:color:BLACK') |
1360 | @@ -1262,6 +1269,7 @@ |
1361 | param = card[block].get(id1) |
1362 | param.value = -value2 |
1363 | param.comment += ' must be opposite to %s' % id2 |
1364 | + is_modified = True |
1365 | if log ==20: |
1366 | 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', |
1367 | block, id1, -value2, id2, '$MG:color:BLACK') |
1368 | @@ -1269,7 +1277,7 @@ |
1369 | 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', |
1370 | block, id1, -value2, id2) |
1371 | |
1372 | - return card |
1373 | + return card, is_modified |
1374 | |
1375 | |
1376 | def convert_to_slha1(path, outputpath=None ): |
1377 | @@ -1651,8 +1659,9 @@ |
1378 | try : |
1379 | cardrule.check_param_card(path, modify=False) |
1380 | except InvalidParamCard: |
1381 | - new_data = cardrule.check_param_card(path, modify=True, write_missing=True) |
1382 | - cardrule.write_param_card(outputpath, new_data) |
1383 | + new_data, was_modified = cardrule.check_param_card(path, modify=True, write_missing=True) |
1384 | + if was_modified: |
1385 | + cardrule.write_param_card(outputpath, new_data) |
1386 | else: |
1387 | if path != outputpath: |
1388 | shutil.copy(path, outputpath) |
1389 | |
1390 | === modified file 'models/usermod.py' |
1391 | --- models/usermod.py 2016-06-20 10:43:25 +0000 |
1392 | +++ models/usermod.py 2016-12-10 02:02:40 +0000 |
1393 | @@ -30,6 +30,7 @@ |
1394 | import models as ufomodels |
1395 | import models.import_ufo as import_ufo |
1396 | import models.check_param_card as check_param_card |
1397 | +from madgraph import MG5DIR |
1398 | |
1399 | pjoin =os.path.join |
1400 | logger = logging.getLogger('madgraph.model') |
1401 | @@ -897,6 +898,16 @@ |
1402 | else: |
1403 | first =False |
1404 | old_part = p |
1405 | + if not old_part: |
1406 | + # last possibility is that the model do not follow MG5 convention |
1407 | + # but that "old" does |
1408 | + defaultname = base_objects.Model.load_default_name() # id->name |
1409 | + for pdg, value in defaultname.items(): |
1410 | + if value == old: |
1411 | + old_part = self.particle_dict[pdg] |
1412 | + identify_particles[new] = old_part.name |
1413 | + break |
1414 | + |
1415 | # end for the case security |
1416 | identify_pid[new_part.pdg_code] = old_part.pdg_code |
1417 | if new_part is None: |
1418 | |
1419 | === modified file 'tests/acceptance_tests/test_cmd_madevent.py' |
1420 | --- tests/acceptance_tests/test_cmd_madevent.py 2016-09-07 09:55:52 +0000 |
1421 | +++ tests/acceptance_tests/test_cmd_madevent.py 2016-12-10 02:02:40 +0000 |
1422 | @@ -570,12 +570,21 @@ |
1423 | |
1424 | def setUp(self): |
1425 | |
1426 | - self.path = tempfile.mkdtemp(prefix='acc_test_mg5') |
1427 | + self.debuging = False |
1428 | + if self.debuging: |
1429 | + self.path = pjoin(MG5DIR, 'ACC_TEST') |
1430 | + if os.path.exists(self.path): |
1431 | + shutil.rmtree(self.path) |
1432 | + os.mkdir(self.path) |
1433 | + else: |
1434 | + self.path = tempfile.mkdtemp(prefix='acc_test_mg5') |
1435 | self.run_dir = pjoin(self.path, 'MGPROC') |
1436 | + |
1437 | |
1438 | def tearDown(self): |
1439 | |
1440 | - shutil.rmtree(self.path) |
1441 | + if not self.debuging: |
1442 | + shutil.rmtree(self.path) |
1443 | |
1444 | def test_add_time_of_flight(self): |
1445 | """checking time of flight is working fine""" |
1446 | @@ -646,6 +655,7 @@ |
1447 | self.assertTrue(has_zero) |
1448 | self.assertTrue(has_non_zero) |
1449 | |
1450 | + self.assertFalse(self.debuging) |
1451 | |
1452 | |
1453 | def test_w_production_with_ms_decay(self): |
1454 | |
1455 | === modified file 'tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%MadLoopCommons.f' |
1456 | --- tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%MadLoopCommons.f 2016-09-07 13:39:06 +0000 |
1457 | +++ tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%MadLoopCommons.f 2016-12-10 02:02:40 +0000 |
1458 | @@ -103,6 +103,9 @@ |
1459 | CALL SWITCHOFFCACHESYSTEM_CLL() |
1460 | ENDIF |
1461 | |
1462 | +C Make sure no COLLIER error can interrupt the code |
1463 | + CALL SWITCHOFFERRSTOP_CLL() |
1464 | + |
1465 | C Specify below your other custom COLLIER parameter settings |
1466 | C [user_specific_COLLIER_settings] |
1467 |
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?