Merge lp:~maddevelopers/mg5amcnlo/fix_mirror_problem into lp:~madteam/mg5amcnlo/trunk

Proposed by Johan Alwall
Status: Merged
Merged at revision: 187
Proposed branch: lp:~maddevelopers/mg5amcnlo/fix_mirror_problem
Merge into: lp:~madteam/mg5amcnlo/trunk
Diff against target: 192 lines (+90/-10)
6 files modified
Template/Source/gen_ximprove.f (+10/-7)
Template/Source/run_config.inc (+1/-1)
UpdateNotes.txt (+8/-0)
madgraph/VERSION (+2/-2)
madgraph/core/diagram_generation.py (+4/-0)
tests/unit_tests/core/test_diagram_generation.py (+65/-0)
To merge this branch: bzr merge lp:~maddevelopers/mg5amcnlo/fix_mirror_problem
Reviewer Review Type Date Requested Status
Olivier Mattelaer Approve
Review via email: mp+81289@code.launchpad.net

Description of the change

- Fixed critical bug 886091
- Fixed remaining problem in gridpacks (in gen_ximprove.f after moving to luminocity), as well as long-standing bugs in gridpacks that we hadn't found before, and optimized the flag min_gevents_wu. Alexis is testing this now, but even if we don't hear back from him, I'd suggest to include this in this release.
- I'm still checking another problem that Alexis complains about (with cut_decays). If I indeed find a problem in this tomorrow I might add another fix in this release - for now let's assume that it's nothing.

To post a comment you must log in.
188. By Johan Alwall

Sorry I had left a debug printout

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

You said that Pierre reported the bug, but this is in fact Marco ;-)
Otherwise the modifications are fine, I'm running all the tests now to ensure that everything is fine, and in a couple of minuts, I'll approve this review

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

All tests passes. So it's fine.

review: Approve
189. By Johan Alwall

Whoops wrong acknowledgement in UpdateNotes

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Template/Source/gen_ximprove.f'
2--- Template/Source/gen_ximprove.f 2011-10-22 08:33:03 +0000
3+++ Template/Source/gen_ximprove.f 2011-11-05 00:51:24 +0000
4@@ -41,7 +41,7 @@
5 logical parallel, gen_events
6 character*20 param(maxpara),value(maxpara)
7 integer npara, nreq, ngran, nhel_refine
8- integer ij, kl, iseed
9+ integer ij, kl, iseed, ioffset
10 logical Gridpack,gridrun
11 logical split_channels
12 common /to_split/split_channels
13@@ -80,7 +80,7 @@
14 gen_events=.true.
15 split_channels=.false.
16 call get_integer(npara,param,value," gevents " ,nreq ,2000 )
17- err_goal = 1.2*nreq
18+ err_goal = 1.5*nreq ! extra factor to ensure works
19 call get_integer(npara,param,value," gseed " ,iseed ,4321 )
20 call get_integer(npara,param,value," ngran " ,ngran , -1)
21 if (ngran.eq.-1) ngran = int(sqrt(real(nreq)))
22@@ -91,9 +91,12 @@
23 c Modified to allow for more sequences
24 c iseed can be between 0 and 31328*30081
25 c before patern repeats
26+c JA 11/2/2011: Check for ioffset, as in ntuple (ranmar.f)
27 c
28+ call get_offset(ioffset)
29+ iseed = iseed * 31300
30 ij=1802 + mod(iseed,30081)
31- kl=9373 + (iseed/31328)
32+ kl=9373 + (iseed/31328) + ioffset
33 c write(*,'($a,i6,a3,i6)') 'Using random seed offsets',jconfig," : ",ioffset
34 c write(*,*) ' with seed', iseed
35 do while (ij .gt. 31328)
36@@ -799,8 +802,8 @@
37 np = 1
38 endif
39 ip = index(gn(i),'/')
40- write(*,*) 'Channel ',gn(i)(2:ip-1),
41- $ yerr, jpoints(i),npoints
42+ write(*,*) 'Channel ',gn(i)(2:ip-1), goal_lum * xsec(i) / xtot,
43+ $ npoints
44
45 ip = index(gn(i),'/')
46 write(26,'(2a)') 'j=',gn(i)(1:ip-1)
47@@ -830,7 +833,7 @@
48 c tjs 8/7/2007 Allow stop when have enough events
49 c
50 write(*,*) "Cross section",i,xsec(i),mfact(i)
51- write(26,'(9x,a,e13.5,a)') 'echo "',-goal_lum/xtot,
52+ write(26,'(9x,a,e13.5,a)') 'echo "',-npoints/xsec(i),
53 $ '" >> input_sg.txt' !Luminocity
54 write(26,'(9x,a)') 'echo "2" >> input_sg.txt' !Grid Adjustment
55 write(26,'(9x,a)') 'echo "1" >> input_sg.txt' !Suppression
56@@ -852,7 +855,7 @@
57 c
58 c tjs 8/7/2007 Change to request events not accuracy
59 c
60- write(26,'(9x,a,e13.5,a)') 'echo "',-goal_lum / xtot,
61+ write(26,'(9x,a,e13.5,a)') 'echo "',-npoints / xsec(i),
62 $ '" >> input_sg.txt' ! Luminocity
63 write(26,'(9x,a)') 'echo "0" >> input_sg.txt'
64 write(26,'(9x,a)') 'echo "1" >> input_sg.txt'
65
66=== modified file 'Template/Source/run_config.inc'
67--- Template/Source/run_config.inc 2011-08-19 00:06:00 +0000
68+++ Template/Source/run_config.inc 2011-11-05 00:51:24 +0000
69@@ -52,4 +52,4 @@
70 integer npoints_wu, itmax_wu !warmup # points/iterations
71 parameter (npoints_wu = 2000, itmax_wu = 8)
72 integer min_gevents_wu
73- parameter (min_gevents_wu=1000) !Minumum # unweighted events to generate from channel
74+ parameter (min_gevents_wu=200) !Minumum # unweighted events to generate from channel
75
76=== modified file 'UpdateNotes.txt'
77--- UpdateNotes.txt 2011-10-31 13:53:47 +0000
78+++ UpdateNotes.txt 2011-11-05 00:51:24 +0000
79@@ -1,5 +1,13 @@
80 Update notes for MadGraph 5 (in reverse time order)
81
82+1.3.27 (05/11/11) JA: Fix bug in mirrored amplitudes (sometimes
83+ amplitudes that should not be flagged as
84+ mirrored were flagged as mirrored). Thanks
85+ Marco Zaro for reporting this!
86+ JA: Fix another problem getting enough events in
87+ gridpack mode (it was not completely fixed in
88+ v. 1.3.24). Thanks Alexis!
89+
90 1.3.26 (31/10/11) JA: Fix color setting in MadEvent event file for
91 multiparticle vertices, which was not taken into
92 account in the upgrade in v. 1.3.18
93
94=== modified file 'madgraph/VERSION'
95--- madgraph/VERSION 2011-10-31 13:53:47 +0000
96+++ madgraph/VERSION 2011-11-05 00:51:24 +0000
97@@ -1,2 +1,2 @@
98-version = 1.3.26
99-date = 2011-10-31
100+version = 1.3.27
101+date = 2011-11-04
102
103=== modified file 'madgraph/core/diagram_generation.py'
104--- madgraph/core/diagram_generation.py 2011-10-10 11:50:58 +0000
105+++ madgraph/core/diagram_generation.py 2011-11-05 00:51:24 +0000
106@@ -1566,6 +1566,10 @@
107 d in new_amp.get('diagrams')])
108 new_amp.set('diagrams', diagrams)
109 new_amp.trim_diagrams()
110+
111+ # Make sure to reset mirror process
112+ new_amp.set('has_mirror_process', False)
113+
114 return new_amp
115
116 #===============================================================================
117
118=== modified file 'tests/unit_tests/core/test_diagram_generation.py'
119--- tests/unit_tests/core/test_diagram_generation.py 2011-10-04 04:15:47 +0000
120+++ tests/unit_tests/core/test_diagram_generation.py 2011-11-05 00:51:24 +0000
121@@ -3033,6 +3033,71 @@
122 # print amplitude.get('process').nice_string()
123 #print 'valid_procs = ',valid_procs
124
125+ def test_multiparticle_mirror_pp_3j(self):
126+ """Setting up and testing pp > 3j mirror process functionality
127+ """
128+
129+ max_fs = 3
130+
131+ p = [21, 1, 2, -1, -2]
132+
133+ my_multi_leg = base_objects.MultiLeg({'ids': p, 'state': True});
134+
135+ goal_number_processes = 29
136+
137+ goal_legs_mirror = [\
138+ ([21, 21, 21, 21, 21], False),
139+ ([21, 21, 21, 1, -1], False),
140+ ([21, 21, 21, 2, -2], False),
141+ ([21, 1, 21, 21, 1], True),
142+ ([21, 1, 1, 1, -1], True),
143+ ([21, 1, 1, 2, -2], True),
144+ ([21, 2, 21, 21, 2], True),
145+ ([21, 2, 1, 2, -1], True),
146+ ([21, 2, 2, 2, -2], True),
147+ ([21, -1, 21, 21, -1], True),
148+ ([21, -1, 1, -1, -1], True),
149+ ([21, -1, 2, -1, -2], True),
150+ ([21, -2, 21, 21, -2], True),
151+ ([21, -2, 1, -1, -2], True),
152+ ([21, -2, 2, -2, -2], True),
153+ ([1, 1, 21, 1, 1], False),
154+ ([1, 2, 21, 1, 2], True),
155+ ([1, -1, 21, 21, 21], True),
156+ ([1, -1, 21, 1, -1], True),
157+ ([1, -1, 21, 2, -2], True),
158+ ([1, -2, 21, 1, -2], True),
159+ ([2, 2, 21, 2, 2], False),
160+ ([2, -1, 21, 2, -1], True),
161+ ([2, -2, 21, 21, 21], True),
162+ ([2, -2, 21, 1, -1], True),
163+ ([2, -2, 21, 2, -2], True),
164+ ([-1, -1, 21, -1, -1], False),
165+ ([-1, -2, 21, -1, -2], True),
166+ ([-2, -2, 21, -2, -2], False)]
167+
168+ # Define the multiprocess
169+ my_multi_leglist = base_objects.MultiLegList([copy.copy(leg) for leg in [my_multi_leg] * 5])
170+
171+ my_multi_leglist[0].set('state', False)
172+ my_multi_leglist[1].set('state', False)
173+
174+ my_process_definition = base_objects.ProcessDefinition({\
175+ 'legs':my_multi_leglist,
176+ 'model':self.mymodel,
177+ 'orders': {'QED': 0}})
178+
179+ # Calculate diagrams for all processes
180+ myproc = diagram_generation.MultiProcess(my_process_definition,
181+ collect_mirror_procs = True)
182+
183+ amplitudes = myproc.get('amplitudes')
184+
185+ legs_mirror = [([l.get('id') for l in a.get('process').get('legs')],
186+ a.get('has_mirror_process')) for a in amplitudes]
187+
188+ self.assertEqual(legs_mirror, goal_legs_mirror)
189+
190 def test_find_maximal_non_qcd_order(self):
191 """Test find_maximal_non_qcd_order for different configurations
192 """

Subscribers

People subscribed via source and target branches