Merge lp:~maddevelopers/mg5amcnlo/heft_fix into lp:~maddevelopers/mg5amcnlo/combine_v0_6_0
- heft_fix
- Merge into combine_v0_6_0
Status: | Merged |
---|---|
Merged at revision: | 60 |
Proposed branch: | lp:~maddevelopers/mg5amcnlo/heft_fix |
Merge into: | lp:~maddevelopers/mg5amcnlo/combine_v0_6_0 |
Diff against target: |
216 lines (+101/-18) 4 files modified
madgraph/iolibs/helas_call_writers.py (+38/-7) madgraph/iolibs/import_v4.py (+4/-0) tests/acceptance_tests/test_cmd.py (+41/-0) tests/parallel_tests/sample_script.py (+18/-11) |
To merge this branch: | bzr merge lp:~maddevelopers/mg5amcnlo/heft_fix |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Olivier Mattelaer | Approve | ||
Review via email: mp+43019@code.launchpad.net |
Commit message
Description of the change
Included special calls for HEFT VVVS interaction in the FortranHelasCal
- 59. By Johan Alwall
-
Added acceptance test for v4 HEFT
Olivier Mattelaer (olivier-mattelaer) wrote : | # |
Johan Alwall (johan-alwall) wrote : | # |
I can't reproduce this. Did you run with the latest CVS version of
MG/ME (or, equivalently, by running bin/create_
> =======
> FAIL: test_v4_heft (tests.
> Test the import of models and the export of Helas Routine
> -------
> Traceback (most recent call last):
> File "/Users/
> 'check')))
> AssertionError: False is not True
Olivier Mattelaer (olivier-mattelaer) wrote : | # |
Sorry for that indeed, my cvs was not up-to-date for this.
Preview Diff
1 | === modified file 'madgraph/iolibs/helas_call_writers.py' | |||
2 | --- madgraph/iolibs/helas_call_writers.py 2010-10-28 00:17:50 +0000 | |||
3 | +++ madgraph/iolibs/helas_call_writers.py 2010-12-07 22:48:10 +0000 | |||
4 | @@ -211,7 +211,7 @@ | |||
5 | 211 | self_dict = {1: 'H', 2: 'F', -2: 'F', 3: 'J', 5: 'U'} | 211 | self_dict = {1: 'H', 2: 'F', -2: 'F', 3: 'J', 5: 'U'} |
6 | 212 | # Dictionaries used for sorting the letters in the Helas call | 212 | # Dictionaries used for sorting the letters in the Helas call |
7 | 213 | sort_wf = {'O': 0, 'I': 1, 'S': 2, 'T': 3, 'V': 4} | 213 | sort_wf = {'O': 0, 'I': 1, 'S': 2, 'T': 3, 'V': 4} |
9 | 214 | sort_amp = {'S': 1, 'V': 2, 'T': 0, 'O': 3, 'I': 4} | 214 | sort_amp = {'S': 0, 'V': 2, 'T': 1, 'O': 3, 'I': 4} |
10 | 215 | 215 | ||
11 | 216 | def default_setup(self): | 216 | def default_setup(self): |
12 | 217 | """Set up special Helas calls (wavefunctions and amplitudes) | 217 | """Set up special Helas calls (wavefunctions and amplitudes) |
13 | @@ -225,35 +225,29 @@ | |||
14 | 225 | # Gluon 4-vertex division tensor calls ggT for the FR sm and mssm | 225 | # Gluon 4-vertex division tensor calls ggT for the FR sm and mssm |
15 | 226 | 226 | ||
16 | 227 | key = ((3, 3, 5, 3), 'A') | 227 | key = ((3, 3, 5, 3), 'A') |
17 | 228 | |||
18 | 229 | call = lambda wf: \ | 228 | call = lambda wf: \ |
19 | 230 | "CALL UVVAXX(W(1,%d),W(1,%d),%s,zero,zero,zero,W(1,%d))" % \ | 229 | "CALL UVVAXX(W(1,%d),W(1,%d),%s,zero,zero,zero,W(1,%d))" % \ |
20 | 231 | (wf.get('mothers')[0].get('number'), | 230 | (wf.get('mothers')[0].get('number'), |
21 | 232 | wf.get('mothers')[1].get('number'), | 231 | wf.get('mothers')[1].get('number'), |
22 | 233 | |||
23 | 234 | wf.get('coupling'), | 232 | wf.get('coupling'), |
24 | 235 | wf.get('number')) | 233 | wf.get('number')) |
25 | 236 | self.add_wavefunction(key, call) | 234 | self.add_wavefunction(key, call) |
26 | 237 | 235 | ||
27 | 238 | key = ((3, 5, 3, 1), 'A') | 236 | key = ((3, 5, 3, 1), 'A') |
28 | 239 | |||
29 | 240 | call = lambda wf: \ | 237 | call = lambda wf: \ |
30 | 241 | "CALL JVTAXX(W(1,%d),W(1,%d),%s,zero,zero,W(1,%d))" % \ | 238 | "CALL JVTAXX(W(1,%d),W(1,%d),%s,zero,zero,W(1,%d))" % \ |
31 | 242 | (wf.get('mothers')[0].get('number'), | 239 | (wf.get('mothers')[0].get('number'), |
32 | 243 | wf.get('mothers')[1].get('number'), | 240 | wf.get('mothers')[1].get('number'), |
33 | 244 | |||
34 | 245 | wf.get('coupling'), | 241 | wf.get('coupling'), |
35 | 246 | wf.get('number')) | 242 | wf.get('number')) |
36 | 247 | self.add_wavefunction(key, call) | 243 | self.add_wavefunction(key, call) |
37 | 248 | 244 | ||
38 | 249 | key = ((3, 3, 5), 'A') | 245 | key = ((3, 3, 5), 'A') |
39 | 250 | |||
40 | 251 | call = lambda amp: \ | 246 | call = lambda amp: \ |
41 | 252 | "CALL VVTAXX(W(1,%d),W(1,%d),W(1,%d),%s,zero,AMP(%d))" % \ | 247 | "CALL VVTAXX(W(1,%d),W(1,%d),W(1,%d),%s,zero,AMP(%d))" % \ |
42 | 253 | (amp.get('mothers')[0].get('number'), | 248 | (amp.get('mothers')[0].get('number'), |
43 | 254 | amp.get('mothers')[1].get('number'), | 249 | amp.get('mothers')[1].get('number'), |
44 | 255 | amp.get('mothers')[2].get('number'), | 250 | amp.get('mothers')[2].get('number'), |
45 | 256 | |||
46 | 257 | amp.get('coupling'), | 251 | amp.get('coupling'), |
47 | 258 | amp.get('number')) | 252 | amp.get('number')) |
48 | 259 | self.add_amplitude(key, call) | 253 | self.add_amplitude(key, call) |
49 | @@ -318,6 +312,43 @@ | |||
50 | 318 | amp.get('number')) | 312 | amp.get('number')) |
51 | 319 | self.add_amplitude(key, call) | 313 | self.add_amplitude(key, call) |
52 | 320 | 314 | ||
53 | 315 | # HEFT VVVS calls | ||
54 | 316 | |||
55 | 317 | key = ((1, 3, 3, 3, 3), '') | ||
56 | 318 | call = lambda wf: \ | ||
57 | 319 | "CALL JVVSXX(W(1,%d),W(1,%d),W(1,%d),DUM1,%s,%s,%s,W(1,%d))" % \ | ||
58 | 320 | (wf.get('mothers')[0].get('number'), | ||
59 | 321 | wf.get('mothers')[1].get('number'), | ||
60 | 322 | wf.get('mothers')[2].get('number'), | ||
61 | 323 | wf.get('coupling'), | ||
62 | 324 | wf.get('mass'), | ||
63 | 325 | wf.get('width'), | ||
64 | 326 | wf.get('number')) | ||
65 | 327 | self.add_wavefunction(key, call) | ||
66 | 328 | |||
67 | 329 | key = ((3, 3, 3, 1, 4), '') | ||
68 | 330 | call = lambda wf: \ | ||
69 | 331 | "CALL HVVVXX(W(1,%d),W(1,%d),W(1,%d),DUM1,%s,%s,%s,W(1,%d))" % \ | ||
70 | 332 | (wf.get('mothers')[0].get('number'), | ||
71 | 333 | wf.get('mothers')[1].get('number'), | ||
72 | 334 | wf.get('mothers')[2].get('number'), | ||
73 | 335 | wf.get('coupling'), | ||
74 | 336 | wf.get('mass'), | ||
75 | 337 | wf.get('width'), | ||
76 | 338 | wf.get('number')) | ||
77 | 339 | self.add_wavefunction(key, call) | ||
78 | 340 | |||
79 | 341 | key = ((1, 3, 3, 3), '') | ||
80 | 342 | call = lambda amp: \ | ||
81 | 343 | "CALL VVVSXX(W(1,%d),W(1,%d),W(1,%d),W(1,%d),DUM1,%s,AMP(%d))" % \ | ||
82 | 344 | (amp.get('mothers')[0].get('number'), | ||
83 | 345 | amp.get('mothers')[1].get('number'), | ||
84 | 346 | amp.get('mothers')[2].get('number'), | ||
85 | 347 | amp.get('mothers')[3].get('number'), | ||
86 | 348 | amp.get('coupling'), | ||
87 | 349 | amp.get('number')) | ||
88 | 350 | self.add_amplitude(key, call) | ||
89 | 351 | |||
90 | 321 | def get_wavefunction_call(self, wavefunction): | 352 | def get_wavefunction_call(self, wavefunction): |
91 | 322 | """Return the function for writing the wavefunction | 353 | """Return the function for writing the wavefunction |
92 | 323 | corresponding to the key. If the function doesn't exist, | 354 | corresponding to the key. If the function doesn't exist, |
93 | 324 | 355 | ||
94 | === modified file 'madgraph/iolibs/import_v4.py' | |||
95 | --- madgraph/iolibs/import_v4.py 2010-12-07 00:44:02 +0000 | |||
96 | +++ madgraph/iolibs/import_v4.py 2010-12-07 22:48:10 +0000 | |||
97 | @@ -334,6 +334,10 @@ | |||
98 | 334 | # Should only use one Helas amplitude for electroweak | 334 | # Should only use one Helas amplitude for electroweak |
99 | 335 | # 4-vector vertices with FR. I choose W3W3NX. | 335 | # 4-vector vertices with FR. I choose W3W3NX. |
100 | 336 | myinter.set('lorentz', ['WWVVN']) | 336 | myinter.set('lorentz', ['WWVVN']) |
101 | 337 | elif values[len(part_list)] in ['DUM', 'DUM0', 'DUM1']: | ||
102 | 338 | # We can just use the second coupling, since the first | ||
103 | 339 | # is a dummy | ||
104 | 340 | myinter.set('couplings', {(0, 0):values[len(part_list)+1]}) | ||
105 | 337 | elif pdg_codes == [21, 21, 21, 21]: | 341 | elif pdg_codes == [21, 21, 21, 21]: |
106 | 338 | # gggg | 342 | # gggg |
107 | 339 | myinter.set('couplings', {(0, 0):values[len(part_list)], | 343 | myinter.set('couplings', {(0, 0):values[len(part_list)], |
108 | 340 | 344 | ||
109 | === modified file 'tests/acceptance_tests/test_cmd.py' | |||
110 | --- tests/acceptance_tests/test_cmd.py 2010-11-24 20:48:25 +0000 | |||
111 | +++ tests/acceptance_tests/test_cmd.py 2010-12-07 22:48:10 +0000 | |||
112 | @@ -338,6 +338,47 @@ | |||
113 | 338 | self.assertTrue(me_groups) | 338 | self.assertTrue(me_groups) |
114 | 339 | self.assertAlmostEqual(float(me_groups.group('value')), 1.953735e-2) | 339 | self.assertAlmostEqual(float(me_groups.group('value')), 1.953735e-2) |
115 | 340 | 340 | ||
116 | 341 | def test_v4_heft(self): | ||
117 | 342 | """Test the import of models and the export of Helas Routine """ | ||
118 | 343 | |||
119 | 344 | if os.path.isdir(self.out_dir): | ||
120 | 345 | shutil.rmdir(self.out_dir) | ||
121 | 346 | |||
122 | 347 | self.do('import model_v4 heft') | ||
123 | 348 | self.do('generate g g > h g g') | ||
124 | 349 | self.do('output standalone %s ' % self.out_dir) | ||
125 | 350 | |||
126 | 351 | devnull = open(os.devnull,'w') | ||
127 | 352 | # Check that the Model and Aloha output compile | ||
128 | 353 | subprocess.call(['make'], | ||
129 | 354 | stdout=devnull, stderr=devnull, | ||
130 | 355 | cwd=os.path.join(self.out_dir, 'Source')) | ||
131 | 356 | self.assertTrue(os.path.exists(os.path.join(self.out_dir, | ||
132 | 357 | 'lib', 'libdhelas3.a'))) | ||
133 | 358 | self.assertTrue(os.path.exists(os.path.join(self.out_dir, | ||
134 | 359 | 'lib', 'libmodel.a'))) | ||
135 | 360 | # Check that check_sa.f compiles | ||
136 | 361 | subprocess.call(['make', 'check'], | ||
137 | 362 | stdout=devnull, stderr=devnull, | ||
138 | 363 | cwd=os.path.join(self.out_dir, 'SubProcesses', | ||
139 | 364 | 'P0_gg_hgg')) | ||
140 | 365 | self.assertTrue(os.path.exists(os.path.join(self.out_dir, | ||
141 | 366 | 'SubProcesses', 'P0_gg_hgg', | ||
142 | 367 | 'check'))) | ||
143 | 368 | # Check that the output of check is correct | ||
144 | 369 | logfile = os.path.join(self.out_dir,'SubProcesses', 'P0_gg_hgg', | ||
145 | 370 | 'check.log') | ||
146 | 371 | subprocess.call('./check', | ||
147 | 372 | stdout=open(logfile, 'w'), stderr=devnull, | ||
148 | 373 | cwd=os.path.join(self.out_dir, 'SubProcesses', | ||
149 | 374 | 'P0_gg_hgg'), shell=True) | ||
150 | 375 | log_output = open(logfile, 'r').read() | ||
151 | 376 | me_re = re.compile('Matrix element\s*=\s*(?P<value>[\d\.eE\+-]+)\s*GeV', | ||
152 | 377 | re.IGNORECASE) | ||
153 | 378 | me_groups = me_re.search(log_output) | ||
154 | 379 | self.assertTrue(me_groups) | ||
155 | 380 | self.assertAlmostEqual(float(me_groups.group('value')), 1.10908942e-06) | ||
156 | 381 | |||
157 | 341 | def test_madevent_ufo_aloha(self): | 382 | def test_madevent_ufo_aloha(self): |
158 | 342 | """Test MadEvent output with UFO/ALOHA""" | 383 | """Test MadEvent output with UFO/ALOHA""" |
159 | 343 | 384 | ||
160 | 344 | 385 | ||
161 | === modified file 'tests/parallel_tests/sample_script.py' | |||
162 | --- tests/parallel_tests/sample_script.py 2010-12-05 05:38:08 +0000 | |||
163 | +++ tests/parallel_tests/sample_script.py 2010-12-07 22:48:10 +0000 | |||
164 | @@ -53,12 +53,19 @@ | |||
165 | 53 | 'e+ x1+ > e+ h1 x1+','e+ x1+ > e+ h2 x1+','e+ x1+ > e+ h3 x1+'] | 53 | 'e+ x1+ > e+ h1 x1+','e+ x1+ > e+ h2 x1+','e+ x1+ > e+ h3 x1+'] |
166 | 54 | my_proc_list += ['el+ h2 > el+ w+ w-'] | 54 | my_proc_list += ['el+ h2 > el+ w+ w-'] |
167 | 55 | 55 | ||
174 | 56 | my_proc_list += me_comparator.create_proc_list(['g', 'go'], initial=2, | 56 | #my_proc_list += me_comparator.create_proc_list(['g', 'go'], initial=2, |
175 | 57 | final=2) | 57 | # final=2) |
176 | 58 | 58 | #my_proc_list = me_comparator.create_proc_list(['g', 'h', 'h3'], initial=2, | |
177 | 59 | # Create a MERunner object for MG4 | 59 | # final=4) |
178 | 60 | #my_mg4 = me_comparator.MG4Runner() | 60 | |
179 | 61 | #my_mg4.setup(mg4_path) | 61 | my_proc_list = ['h > g g g g'] |
180 | 62 | # Create a MERunner object for MG4 | ||
181 | 63 | my_mg4 = me_comparator.MG4Runner() | ||
182 | 64 | my_mg4.setup(mg4_path) | ||
183 | 65 | |||
184 | 66 | # Create a MERunner object for MG4 | ||
185 | 67 | my_mg4_2 = me_comparator.MG4Runner() | ||
186 | 68 | my_mg4_2.setup(mg4_path) | ||
187 | 62 | 69 | ||
188 | 63 | # Create a MERunner object for MG5 | 70 | # Create a MERunner object for MG5 |
189 | 64 | my_mg5 = me_comparator.MG5Runner() | 71 | my_mg5 = me_comparator.MG5Runner() |
190 | @@ -69,21 +76,21 @@ | |||
191 | 69 | my_mg5_ufo.setup(mg5_path, mg4_path) | 76 | my_mg5_ufo.setup(mg5_path, mg4_path) |
192 | 70 | 77 | ||
193 | 71 | # Create a MERunner object for C++ | 78 | # Create a MERunner object for C++ |
196 | 72 | my_mg5_cpp = me_comparator.MG5_CPP_Runner() | 79 | #my_mg5_cpp = me_comparator.MG5_CPP_Runner() |
197 | 73 | my_mg5_cpp.setup(mg5_path, mg4_path) | 80 | #my_mg5_cpp.setup(mg5_path, mg4_path) |
198 | 74 | 81 | ||
199 | 75 | # Create and setup a comparator | 82 | # Create and setup a comparator |
200 | 76 | my_comp = me_comparator.MEComparator() | 83 | my_comp = me_comparator.MEComparator() |
202 | 77 | my_comp.set_me_runners(my_mg5_cpp, my_mg5_ufo, my_mg5) | 84 | my_comp.set_me_runners(my_mg5, my_mg5_ufo, my_mg4, my_mg4_2) |
203 | 78 | 85 | ||
204 | 79 | # Run the actual comparison | 86 | # Run the actual comparison |
205 | 80 | my_comp.run_comparison(my_proc_list, | 87 | my_comp.run_comparison(my_proc_list, |
207 | 81 | model='mssm', orders={'QED':4, 'QCD':4, 'HIG':1, 'HIW':1}, energy=2000) | 88 | model=['heft_fix', 'heft', 'heft', 'heft_fix'], orders={'QED':0, 'QCD':3, 'HIG':1, 'HIW':1}, energy=2000) |
208 | 82 | 89 | ||
209 | 83 | # Do some cleanup | 90 | # Do some cleanup |
210 | 84 | #my_comp.cleanup() | 91 | #my_comp.cleanup() |
211 | 85 | 92 | ||
213 | 86 | filename = "mssm_results.log" | 93 | filename = "heft_results.log" |
214 | 87 | 94 | ||
215 | 88 | # Print the output | 95 | # Print the output |
216 | 89 | my_comp.output_result(filename=filename) | 96 | my_comp.output_result(filename=filename) |
It's look perfect but:
======= ======= ======= ======= ======= ======= ======= ======= ======= ======= acceptance_ tests.test_ cmd.TestCmdShel l2) ------- ------- ------- ------- ------- ------- ------- ------- ------- omatt/Documents /Eclipse2/ heft/tests/ acceptance_ tests/test_ cmd.py" , line 367, in test_v4_heft
FAIL: test_v4_heft (tests.
Test the import of models and the export of Helas Routine
-------
Traceback (most recent call last):
File "/Users/
'check')))
AssertionError: False is not True