~maddevelopers/mg5amcnlo/3.0.2

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
import logging.config
import logging
import pydoc
import os
import loop_me_comparator
import me_comparator
import unittest
import re


from madgraph import MG5DIR
from madgraph import MadGraph5Error
from madgraph.iolibs.files import cp

#Look for MG5/MG4 path
_mg5_path = os.sep.join(os.path.realpath(__file__).split(os.sep)[:-3])
_file_path = os.path.dirname(os.path.realpath(__file__))
_pickle_path = os.path.join(_file_path, 'input_files', 'ML_parallel_saved_runs')

# The processes below are treated all together because they are relatively quick

ML4_processes_short = [('u u~ > d d~',{'QCD':2,'QED':0},['QCD'],{'QCD':6,'QED':0}),
                       ('d g > d g',{'QCD':2,'QED':0},['QCD'],{'QCD':6,'QED':0}),
                       ('g g > d d~',{'QCD':2,'QED':0},['QCD'],{'QCD':6,'QED':0}),
                       ('e+ e- > d d~',{'QED':2,'QCD':0},['QCD'],{'QCD':2,'QED':4}),
                       ('g g > t t~',{'QCD':2,'QED':0},['QCD'],{'QCD':6,'QED':0}),
                       ('d~ d > g a',{'QED':1,'QCD':1},['QCD'],{'QCD':4,'QED':2}),
                       ('d~ d > g z',{'QED':1,'QCD':1},['QCD'],{'QCD':4,'QED':2})]

ML5_processes_short = [('u u~ > d d~',{'QCD':2,'QED':0},['QCD'],{'QCD':6,'QED':0}),
                       ('d g > d g',{'QCD':2,'QED':0},['QCD'],{'QCD':6,'QED':0}),
                       ('d~ u~ > d~ u~',{'QCD':2,'QED':0},['QCD'],{'QCD':6,'QED':0}), 
                       ('g u~ > g u~',{'QCD':2,'QED':0},['QCD'],{'QCD':6,'QED':0}),
                       ('g g > d d~',{'QCD':2,'QED':0},['QCD'],{'QCD':6,'QED':0}),
                       ('g g > t t~',{'QCD':2,'QED':0},['QCD'],{'QCD':6,'QED':0}),
                       ('g g > g g',{'QCD':2,'QED':0},['QCD'],{'QCD':6,'QED':0}),
                       ('d~ d > g a',{'QED':1,'QCD':1},['QCD'],{'QCD':4,'QED':2}),
                       ('u~ u > g z',{'QED':1,'QCD':1},['QCD'],{'QCD':4,'QED':2}),
                       ('e+ e- > d d~',{'QED':2,'QCD':0},['QCD'],{'QCD':2,'QED':4}),
                       ('d u~ > w- g',{'QED':1,'QCD':1},['QCD'],{'QCD':4,'QED':2})]

def procToFolderName(proc):
    """ Transform a string proc like 'u u~ > e+ e-' to a string for a folder name
    which would be uux_epem"""
    res=''.join(proc.split(' '))
    equiv_strings = [('+','p'),('-','m'),('~','x'),('>','_')]
    for eq in equiv_strings:
        res=res.replace(eq[0],eq[1])
    return res

# The longer processes below are treated one by one so that they can be better
# independently checked/updated (especially the corresponding reference pickle.)

ML4_processes_long =  [
                       # The process below is for testing the parallel tests only
                       ('e+ e- > d d~',{'QCD':0,'QED':2},['QCD'],{'QCD':2,'QED':4}),
                       # Below are the processes really tested
                       ('g g > h t t~',{'QCD':2,'QED':2},['QCD'],{'QCD':6,'QED':4}), 
                       ('d d~ > w+ w- g',{'QED':2,'QCD':1},['QCD'],{'QCD':4,'QED':4}),
                       ('d~ d > z z g',{'QED':2,'QCD':1},['QCD'],{'QCD':4,'QED':4}),
                       ('d~ d > z g g',{'QED':1,'QCD':2},['QCD'],{'QCD':6,'QED':2}),
                       ('d~ d > a g g',{'QED':1,'QCD':2},['QCD'],{'QCD':6,'QED':2}),
                       ('g g > z t t~',{'QED':1,'QCD':2},['QCD'],{'QCD':6,'QED':2}),
                       ('g g > a t t~',{'QED':1,'QCD':2},['QCD'],{'QCD':6,'QED':2})]

ML4_processes_long_dic = dict((procToFolderName(elem[0]),elem) for elem in \
                                                             ML4_processes_long)

ML5_processes_long =  [('g g > h t t~',{'QCD':2,'QED':1},['QCD'],{'QCD':6,'QED':2}), 
                       ('d d~ > w+ w- g',{'QED':2,'QCD':1},['QCD'],{'QCD':4,'QED':4}),
                       ('d~ d > z z g',{'QED':2,'QCD':1},['QCD'],{'QCD':4,'QED':4}),
                       ('s s~ > a z g',{'QED':2,'QCD':1},['QCD'],{'QCD':4,'QED':4}),                       
                       ('d~ d > z g g',{'QED':1,'QCD':2},['QCD'],{'QCD':6,'QED':2}),
                       ('d~ d > a g g',{'QED':1,'QCD':2},['QCD'],{'QCD':6,'QED':2}),
                       ('d~ u > w+ g g',{'QED':1,'QCD':2},['QCD'],{'QCD':6,'QED':2}),
                       ('g g > w- d~ u',{'QED':1,'QCD':2},['QCD'],{'QCD':6,'QED':2}),                       
                       ('g g > z t t~',{'QED':1,'QCD':2},['QCD'],{'QCD':6,'QED':2}),
                       ('g g > a t t~',{'QED':1,'QCD':2},['QCD'],{'QCD':6,'QED':2}),
                       ('g g > h h t t~',{'QCD':2,'QED':2},['QCD'],{'QCD':6,'QED':4}),
                       ('u u~ > w+ w- b b~',{'QCD':2,'QED':2},['QCD'],{'QCD':6,'QED':4}),                       
                       ('g g > g g g',{'QCD':3,'QED':0},['QCD'],{'QCD':8,'QED':0}),
                       ('u u~ > z z z',{'QED':3,'QCD':0},['QCD'],{'QCD':2,'QED':6}),
                       ('u d~ > h t b~',{'QED':3,'QCD':0},['QCD'],{'QCD':2,'QED':6}),
                       ('u u~ > w+ w- z',{'QED':3,'QCD':0},['QCD'],{'QCD':2,'QED':6}),
                       ('g g > g t t~',{'QED':0,'QCD':3},['QCD'],{'QCD':8,'QED':0}),
                       ('g s > e- ve~ c',{'QED':2,'QCD':1},['QCD'],{'QCD':4,'QED':4}),
                       ('g g > z c c~',{'QED':1,'QCD':2},['QCD'],{'QCD':6,'QED':2})]

ML5_processes_long_dic = dict((procToFolderName(elem[0]),elem) for elem in \
                                                             ML5_processes_long)

class ML5Test(unittest.TestCase):
    """ A class to test ML5 versus runs from older versions or ML4 """

    test_model_name = 'loop_sm-parallel_test'
    test_model_name_c_massive = 'loop_sm-parallel_test_c_massive'

    def setUp(self):
        """ Here we just copy the hidden restrict_card to a regular one.
        And we don't bother making it hidden again after the test."""
        cp(os.path.join(_mg5_path,'models','loop_sm','.restrict_parallel_test.dat'),
           os.path.join(_mg5_path,'models','loop_sm','restrict_parallel_test.dat'))
        cp(os.path.join(_mg5_path,'models','loop_sm',
                                       '.restrict_parallel_test_c_massive.dat'),
           os.path.join(_mg5_path,'models','loop_sm',
                                        'restrict_parallel_test_c_massive.dat'))

    @staticmethod
    def create_pickle(my_proc_list, pickle_file, runner, ref_runner=None,
                      model = 'loop_sm-parallel_test', energy = 2000):
        """ Create a pickle with name 'pickle_file' on the specified processes
        and also possibly using the PS points provided by the reference runner """
        
        my_comp = loop_me_comparator.LoopMEComparator()
        if not ref_runner is None:
            my_comp.set_me_runners(ref_runner,runner)
        else:
            my_comp.set_me_runners(runner)
        my_comp.run_comparison(my_proc_list,model=model,energy=energy)

        loop_me_comparator.LoopPickleRunner.store_comparison( 
            os.path.join(_pickle_path,pickle_file),
            [runner.proc_list,runner.res_list],
            runner.model,runner.name,energy=runner.energy)
        
    def compare_processes(self, my_proc_list = [], model = 'loop_sm-parallel_test',
            pickle_file = "", energy = 2000, tolerance = 3e-06, filename = "",
            chosen_runner = "ML5_opt"):
        """ A helper function to compare processes. 
        Note that the chosen_runner is what runner should to create the reference
        pickle if missing"""

        # Print out progress if it is a run for an individual process
        if len(my_proc_list)==1:
            print "\n== %s =="%my_proc_list[0][0]
        else:
            print "\n== %s =="%filename
        
        # Check if pickle exists, if not create it        
        if pickle_file!="" and not os.path.isfile(os.path.join(_pickle_path,pickle_file)):
            print " => Computing reference evaluation with %s"%chosen_runner
            self.create_loop_pickle(my_proc_list, model,
                                             pickle_file, energy, chosen_runner)
            print "\n => Done with %s evaluation"%chosen_runner
        # Load the stored runner
        if pickle_file != "":
            stored_runner = me_comparator.PickleRunner.find_comparisons(
                              os.path.join(_pickle_path,pickle_file))[0]

        # Create a MERunner object for MadLoop 5 optimized
        ML5_opt = loop_me_comparator.LoopMG5Runner()
        ML5_opt.setup(_mg5_path, optimized_output=True, temp_dir=filename)
        
        file = open(os.path.join(_mg5_path,'Template','loop_material','StandAlone',
                                 'Cards','MadLoopParams.dat'), 'r')

        MLParams = file.read()
        MLred = re.search(r'#MLReductionLib\n',MLParams)
        MLredstr=MLParams[MLred.end():MLred.end()+1]

        if MLredstr=="1":
            # Create a MERunner object for MadLoop 5 default
            ML5_default = loop_me_comparator.LoopMG5Runner()
            ML5_default.setup(_mg5_path, optimized_output=False, temp_dir=filename) 

        # Create and setup a comparator
        my_comp = loop_me_comparator.LoopMEComparator()
        
        # Always put the saved run first if you use it, so that the corresponding PS
        # points will be used.
        if MLredstr=="1":
            # CutTools
            if pickle_file != "":
                my_comp.set_me_runners(stored_runner,ML5_opt,ML5_default)
            else:
                my_comp.set_me_runners(ML5_opt,ML5_default)
        else:
            # TIR
            if pickle_file != "":
                my_comp.set_me_runners(stored_runner,ML5_opt)
            else:
                raise MadGraph5Error,"CANNOT find the stored result with TIR"
        
        # Run the actual comparison
        my_comp.run_comparison(my_proc_list,
                           model=model,
                           energy=energy)
        
        # Print the output
        my_comp.output_result(filename=os.path.join(_mg5_path,filename+'.log'))

        # Assert that all process comparisons passed the tolerance cut
        my_comp.assert_processes(self, tolerance)

        # Do some cleanup
        my_comp.cleanup()

    def create_loop_pickle(self, my_proc_list, model, pickle_file, energy, \
                                                                 chosen_runner):
        """ Create the pickle file for reference for the arguments here."""
#       print "Creating loop pickle for chosen_runner=",chosen_runner
        allowed_chosen_runners = ['ML4','ML5_opt','ML5_default'] 
        if chosen_runner not in allowed_chosen_runners:
            raise MadGraph5Error, 'The reference runner can only be in %s.'%\
                                                          allowed_chosen_runners
        
        runner = None
        if chosen_runner == 'ML5_opt':
            runner = loop_me_comparator.LoopMG5Runner()
            runner.setup(_mg5_path, optimized_output=True)
        if chosen_runner == 'ML5_default':
            runner = loop_me_comparator.LoopMG5Runner()
            runner.setup(_mg5_path, optimized_output=False)
        if chosen_runner == 'ML4':
            runner = loop_me_comparator.LoopMG4Runner()
            # Replace here the path of your ML4 installation
            runner.setup('/Users/valentin/Documents/Work/aMC@NLO_v4/ML4ParrallelTest/NLOComp')
        
        self.create_pickle(my_proc_list,pickle_file, runner, ref_runner=None, \
                                                      model=model,energy=energy)
        # Clean up the runner only if it is not ML4
        if chosen_runner != 'ML4':
            runner.cleanup()

    #===========================================================================
    # First tests consisting in a list of quick 2>2 processes to be run together
    #===========================================================================

    def test_short_ML5_sm_vs_stored_ML5(self):
        self.compare_processes(ML5_processes_short,model = self.test_model_name,
                                   pickle_file = 'ml5_short_parallel_tests.pkl',
                                        filename = 'ptest_short_ml5_vs_old_ml5',
                                                            chosen_runner='ML5')

    # In principle since previous version of ML5 has been validated against ML4, 
    # it is not necessary to test both against ML4 and the old ML5.
    def test_short_ML5_sm_vs_stored_ML4(self):
        self.compare_processes(ML4_processes_short,model = self.test_model_name,
                                    pickle_file = 'ml4_short_parallel_test.pkl',
                                            filename = 'ptest_short_ml5_vs_ml4',
                                                            chosen_runner='ML4')

    # The tests below probe one quite long process at a time individually, so
    # one can better manage them.
    
    #===========================================================================
    # First the long checks against results available in MadLoop4
    #===========================================================================

#   Use the quick process below for testing the parallel test
    def notest_long_sm_vs_stored_ML4_epem_ddx(self):
        proc = 'epem_ddx'
        self.compare_processes([ML4_processes_long_dic[proc]], 
               model = self.test_model_name, pickle_file = 'ml4_sm_%s.pkl'%proc,
               filename = 'ptest_long_sm_vs_ml4_%s'%proc, chosen_runner = 'ML4')

#   ('g g > h t t~',{'QCD':2,'QED':1},['QCD'],{'QCD':6,'QED':2})
    def test_long_sm_vs_stored_ML4_gg_httx(self):
        proc = 'gg_httx'
        self.compare_processes([ML4_processes_long_dic[proc]], 
               model = self.test_model_name, pickle_file = 'ml4_sm_%s.pkl'%proc,
               filename = 'ptest_long_sm_vs_ml4_%s'%proc, chosen_runner = 'ML4')

#   ('d d~ > w+ w- g',{'QED':2,'QCD':1},['QCD'],{'QCD':4,'QED':4})    
    def test_long_sm_vs_stored_ML4_ddx_wpwmg(self):
        proc = 'ddx_wpwmg'
        self.compare_processes([ML4_processes_long_dic[proc]], 
               model = self.test_model_name, pickle_file = 'ml4_sm_%s.pkl'%proc,
                                      filename = 'ptest_long_sm_vs_ml4_%s'%proc)

#   ('d~ d > z z g',{'QED':2,'QCD':1},['QCD'],{'QCD':4,'QED':4})
    def test_long_sm_vs_stored_ML4_dxd_zzg(self):
        proc = 'dxd_zzg'
        self.compare_processes([ML4_processes_long_dic[proc]], 
               model = self.test_model_name, pickle_file = 'ml4_sm_%s.pkl'%proc,
               filename = 'ptest_long_sm_vs_ml4_%s'%proc, chosen_runner = 'ML4')

#   ('d~ d > z g g',{'QED':1,'QCD':2},['QCD'],{'QCD':6,'QED':2})
    def test_long_sm_vs_stored_ML4_dxd_zgg(self):
        proc = 'dxd_zgg'
        self.compare_processes([ML4_processes_long_dic[proc]], 
               model = self.test_model_name, pickle_file = 'ml4_sm_%s.pkl'%proc,
               filename = 'ptest_long_sm_vs_ml4_%s'%proc, chosen_runner = 'ML4')

#   ('d~ d > a g g',{'QED':1,'QCD':2},['QCD'],{'QCD':6,'QED':2})
    def test_long_sm_vs_stored_ML4_dxd_agg(self):
        proc = 'dxd_agg'
        self.compare_processes([ML4_processes_long_dic[proc]], 
               model = self.test_model_name, pickle_file = 'ml4_sm_%s.pkl'%proc,
               filename = 'ptest_long_sm_vs_ml4_%s'%proc, chosen_runner = 'ML4')

#   ('g g > z t t~',{'QED':1,'QCD':2},['QCD'],{'QCD':6,'QED':2})
    def test_long_sm_vs_stored_ML4_gg_zttx(self):
        proc = 'gg_zttx'
        self.compare_processes([ML4_processes_long_dic[proc]], 
               model = self.test_model_name, pickle_file = 'ml4_sm_%s.pkl'%proc,
               filename = 'ptest_long_sm_vs_ml4_%s'%proc, chosen_runner = 'ML4')

#   ('g g > a t t~',{'QED':1,'QCD':2},['QCD'],{'QCD':6,'QED':2})
    def test_long_sm_vs_stored_ML4_gg_attx(self):
        proc = 'gg_zttx'
        self.compare_processes([ML4_processes_long_dic[proc]], 
               model = self.test_model_name, pickle_file = 'ml4_sm_%s.pkl'%proc,
               filename = 'ptest_long_sm_vs_ml4_%s'%proc, chosen_runner = 'ML4')

    #===========================================================================
    # Now the long checks against results previsouly generated in MadLoop 5.
    #===========================================================================

#   ('g g > g t t~ ',{'QED':0,'QCD':3},['QCD'],{'QCD':8,'QED':0})
    def test_long_sm_vs_stored_ML5_gg_gttx(self):
        proc = "gg_gttx"
        self.compare_processes([ML5_processes_long_dic[proc]],
               model = self.test_model_name, pickle_file = 'ml5_sm_%s.pkl'%proc,
                                  filename = 'ptest_long_sm_vs_old_ml5_%s'%proc,
                                                      chosen_runner = 'ML5_opt')

#   ('g g > h t t~',{'QCD':2,'QED':1},['QCD'],{'QCD':6,'QED':2})
    def test_long_sm_vs_stored_ML5_gg_httx(self):
        proc = "gg_httx"
        self.compare_processes([ML5_processes_long_dic[proc]],
               model = self.test_model_name, pickle_file = 'ml5_sm_%s.pkl'%proc,
                                  filename = 'ptest_long_sm_vs_old_ml5_%s'%proc,
                                                      chosen_runner = 'ML5_opt')

#   ('d d~ > w+ w- g',{'QED':2,'QCD':1},['QCD'],{'QCD':4,'QED':4})
    def test_long_sm_vs_stored_ML5_ddx_wpwmg(self):
        proc = "ddx_wpwmg"
        self.compare_processes([ML5_processes_long_dic[proc]],
               model = self.test_model_name, pickle_file = 'ml5_sm_%s.pkl'%proc,
                                  filename = 'ptest_long_sm_vs_old_ml5_%s'%proc,
                                                      chosen_runner = 'ML5_opt')

#   ('d~ d > z z g',{'QED':2,'QCD':1},['QCD'],{'QCD':4,'QED':4})
    def test_long_sm_vs_stored_ML5_dxd_zzg(self):
        proc = "dxd_zzg"
        self.compare_processes([ML5_processes_long_dic[proc]],
               model = self.test_model_name, pickle_file = 'ml5_sm_%s.pkl'%proc,
                                  filename = 'ptest_long_sm_vs_old_ml5_%s'%proc,
                                                      chosen_runner = 'ML5_opt')
    
#   ('s s~ > a z g',{'QED':2,'QCD':1},['QCD'],{'QCD':4,'QED':4})
    def test_long_sm_vs_stored_ML5_ssx_azg(self):
        proc = "ssx_azg"
        self.compare_processes([ML5_processes_long_dic[proc]],
               model = self.test_model_name, pickle_file = 'ml5_sm_%s.pkl'%proc,
                                  filename = 'ptest_long_sm_vs_old_ml5_%s'%proc,
                                                      chosen_runner = 'ML5_opt')
    
#   ('d~ d > z g g',{'QED':1,'QCD':2},['QCD'],{'QCD':6,'QED':2})
    def test_long_sm_vs_stored_ML5_dxd_zgg(self):
        proc = "dxd_zgg"
        self.compare_processes([ML5_processes_long_dic[proc]],
               model = self.test_model_name, pickle_file = 'ml5_sm_%s.pkl'%proc,
                                  filename = 'ptest_long_sm_vs_old_ml5_%s'%proc,
                                                      chosen_runner = 'ML5_opt')

#   ('d~ d > a g g',{'QED':1,'QCD':2},['QCD'],{'QCD':6,'QED':2})
    def test_long_sm_vs_stored_ML5_dxd_agg(self):
        proc = "dxd_agg"
        self.compare_processes([ML5_processes_long_dic[proc]],
               model = self.test_model_name, pickle_file = 'ml5_sm_%s.pkl'%proc,
                                  filename = 'ptest_long_sm_vs_old_ml5_%s'%proc,
                                                      chosen_runner = 'ML5_opt')

#   ('d~ u > w+ g g',{'QED':1,'QCD':2},['QCD'],{'QCD':6,'QED':2})
    def test_long_sm_vs_stored_ML5_dxu_wpgg(self):
        proc = "dxu_wpgg"
        self.compare_processes([ML5_processes_long_dic[proc]],
               model = self.test_model_name, pickle_file = 'ml5_sm_%s.pkl'%proc,
                                  filename = 'ptest_long_sm_vs_old_ml5_%s'%proc,
                                                      chosen_runner = 'ML5_opt')

#   ('g g > w- d~ u',{'QED':1,'QCD':2},['QCD'],{'QCD':6,'QED':2}) 
    def test_long_sm_vs_stored_ML5_gg_wmdxu(self):
        proc = "gg_wmdxu"
        self.compare_processes([ML5_processes_long_dic[proc]],
               model = self.test_model_name, pickle_file = 'ml5_sm_%s.pkl'%proc,
                                  filename = 'ptest_long_sm_vs_old_ml5_%s'%proc,
                                                      chosen_runner = 'ML5_opt')
                      
#   ('g g > z t t~',{'QED':1,'QCD':2},['QCD'],{'QCD':6,'QED':2})
    def test_long_sm_vs_stored_ML5_gg_zttx(self):
        proc = "gg_zttx"
        self.compare_processes([ML5_processes_long_dic[proc]],
               model = self.test_model_name, pickle_file = 'ml5_sm_%s.pkl'%proc,
                                  filename = 'ptest_long_sm_vs_old_ml5_%s'%proc,
                                                      chosen_runner = 'ML5_opt')

#   ('g g > a t t~',{'QED':1,'QCD':2},['QCD'],{'QCD':6,'QED':2})
    def test_long_sm_vs_stored_ML5_gg_attx(self):
        proc = "gg_attx"
        self.compare_processes([ML5_processes_long_dic[proc]],
               model = self.test_model_name, pickle_file = 'ml5_sm_%s.pkl'%proc,
                                  filename = 'ptest_long_sm_vs_old_ml5_%s'%proc,
                                                      chosen_runner = 'ML5_opt')

#   ('g g > h h t t~',{'QCD':2,'QED':2},['QCD'],{'QCD':6,'QED':4})
    def test_long_sm_vs_stored_ML5_gg_hhttx(self):
        proc = "gg_hhttx"
        self.compare_processes([ML5_processes_long_dic[proc]],
               model = self.test_model_name, pickle_file = 'ml5_sm_%s.pkl'%proc,
                                  filename = 'ptest_long_sm_vs_old_ml5_%s'%proc,
                                                      chosen_runner = 'ML5_opt')

#   ('u u~ > w+ w- b b~',{'QCD':2,'QED':2},['QCD'],{'QCD':6,'QED':4})
    def test_long_sm_vs_stored_ML5_uux_wpwmbbx(self):
        proc = "uux_wpwmbbx"
        self.compare_processes([ML5_processes_long_dic[proc]],
               model = self.test_model_name, pickle_file = 'ml5_sm_%s.pkl'%proc,
                                  filename = 'ptest_long_sm_vs_old_ml5_%s'%proc,
                                                      chosen_runner = 'ML5_opt')
             
#   ('g g > g g g',{'QCD':3,'QED':0},['QCD'],{'QCD':8,'QED':0})
#   The chosen PS point for this process turns out to be  unstable, so that 
#   MadLoop goes to quadruple precision. The agreement is then fine (10e-14!)
#   but it takes several hours for the non-optimized evaluation. So better skip
#   it unless you explicitly want to try out quad prec behaviors.
    def notest_long_sm_vs_stored_ML5_gg_ggg(self):
        proc = "gg_ggg"
        self.compare_processes([ML5_processes_long_dic[proc]],
               model = self.test_model_name, pickle_file = 'ml5_sm_%s.pkl'%proc,
                                  filename = 'ptest_long_sm_vs_old_ml5_%s'%proc,
                                                      chosen_runner = 'ML5_opt')

#   ('u u~ > z z z',{'QED':3,'QCD':0},['QCD'],{'QCD':2,'QED':6})
    def test_long_sm_vs_stored_ML5_uux_zzz(self):
        proc = "uux_zzz"
        self.compare_processes([ML5_processes_long_dic[proc]],
               model = self.test_model_name, pickle_file = 'ml5_sm_%s.pkl'%proc,
                                  filename = 'ptest_long_sm_vs_old_ml5_%s'%proc,
                                                      chosen_runner = 'ML5_opt')

#   ('u d~ > h t b~',{'QED':3,'QCD':0},['QCD'],{'QCD':2,'QED':6}),
    def test_long_sm_vs_stored_ML5_udx_htbx(self):
        proc = "udx_htbx"
        self.compare_processes([ML5_processes_long_dic[proc]],
               model = self.test_model_name, pickle_file = 'ml5_sm_%s.pkl'%proc,
                                  filename = 'ptest_long_sm_vs_old_ml5_%s'%proc,
                                                      chosen_runner = 'ML5_opt')

#   ('u u~ > w+ w- z',{'QED':3,'QCD':0},['QCD'],{'QCD':2,'QED':6})
    def test_long_sm_vs_stored_ML5_uux_wpwmz(self):
        proc = "uux_wpwmz"
        self.compare_processes([ML5_processes_long_dic[proc]],
               model = self.test_model_name, pickle_file = 'ml5_sm_%s.pkl'%proc,
                                  filename = 'ptest_long_sm_vs_old_ml5_%s'%proc,
                                                      chosen_runner = 'ML5_opt')
        
#    ('g s > e- ve~ c',{'QED':2,'QCD':1},['QCD'],{'QCD':3,'QED':2})
    def test_long_sm_vs_stored_ML5_gs_emvexc(self):
        proc = "gs_emvexc"
        self.compare_processes([ML5_processes_long_dic[proc]],
            model = self.test_model_name_c_massive, 
            pickle_file = 'ml5_sm_%s.pkl'%proc,
            filename = 'ptest_long_sm_vs_old_ml5_%s'%proc,
            chosen_runner = 'ML5_opt')
        
#   ('g g > z c c~',{'QED':1,'QCD':2},['QCD'],{'QCD':6,'QED':2})
    def test_long_sm_vs_stored_ML5_gg_zccx(self):
        proc = "gg_zccx"
        self.compare_processes([ML5_processes_long_dic[proc]],
               model = self.test_model_name_c_massive,
               pickle_file = 'ml5_sm_%s.pkl'%proc,
               filename = 'ptest_long_sm_vs_old_ml5_%s'%proc,
               chosen_runner = 'ML5_opt')