Merge lp:~mg5core2/mg5amcnlo/2.6.3 into lp:mg5amcnlo/lts

Proposed by Olivier Mattelaer
Status: Merged
Merged at revision: 278
Proposed branch: lp:~mg5core2/mg5amcnlo/2.6.3
Merge into: lp:mg5amcnlo/lts
Diff against target: 15327 lines (+10841/-748)
107 files modified
MadSpin/interface_madspin.py (+280/-139)
MadSpin/madspin (+19/-21)
Template/LO/Cards/run_card.dat (+1/-1)
Template/LO/SubProcesses/genps.f (+5/-6)
Template/LO/SubProcesses/reweight.f (+82/-4)
Template/NLO/SubProcesses/montecarlocounter.f (+65/-37)
UpdateNotes.txt (+28/-0)
VERSION (+2/-2)
aloha/aloha_writers.py (+21/-6)
aloha/create_aloha.py (+3/-4)
madgraph/interface/amcatnlo_interface.py (+2/-2)
madgraph/interface/amcatnlo_run_interface.py (+2/-2)
madgraph/interface/common_run_interface.py (+35/-12)
madgraph/interface/extended_cmd.py (+13/-5)
madgraph/interface/madevent_interface.py (+16/-3)
madgraph/interface/madgraph_interface.py (+32/-9)
madgraph/interface/reweight_interface.py (+2/-0)
madgraph/iolibs/export_v4.py (+138/-6)
madgraph/iolibs/file_writers.py (+3/-3)
madgraph/iolibs/files.py (+3/-0)
madgraph/iolibs/template_files/matrix_standalone_splitOrders_v4.inc (+2/-2)
madgraph/iolibs/template_files/matrix_standalone_v4.inc (+1/-1)
madgraph/iolibs/ufo_expression_parsers.py (+237/-6)
madgraph/loop/loop_exporters.py (+15/-1)
madgraph/loop/loop_helas_objects.py (+3/-3)
madgraph/madevent/gen_crossxhtml.py (+18/-2)
madgraph/madevent/sum_html.py (+6/-0)
madgraph/various/banner.py (+34/-12)
madgraph/various/hepmc_parser.py (+342/-0)
madgraph/various/lhe_parser.py (+54/-7)
madgraph/various/misc.py (+4/-3)
mg5decay/decay_objects.py (+1/-1)
models/import_ufo.py (+315/-32)
models/write_param_card.py (+2/-2)
tests/acceptance_tests/test_cmd_amcatnlo.py (+12/-5)
tests/acceptance_tests/test_cmd_madevent.py (+28/-1)
tests/acceptance_tests/test_cmd_reweight.py (+2/-2)
tests/acceptance_tests/test_madspin.py (+114/-0)
tests/acceptance_tests/test_madweight.py (+4/-4)
tests/acceptance_tests/test_model_equivalence.py (+5/-2)
tests/input_files/DM_pion/CT_couplings.py (+1731/-0)
tests/input_files/DM_pion/CT_vertices.py (+1291/-0)
tests/input_files/DM_pion/__init__.py (+48/-0)
tests/input_files/DM_pion/coupling_orders.py (+25/-0)
tests/input_files/DM_pion/couplings.py (+563/-0)
tests/input_files/DM_pion/decays.py (+113/-0)
tests/input_files/DM_pion/function_library.py (+71/-0)
tests/input_files/DM_pion/lorentz.py (+182/-0)
tests/input_files/DM_pion/object_library.py (+377/-0)
tests/input_files/DM_pion/param_pion.dat (+183/-0)
tests/input_files/DM_pion/parameters.py (+858/-0)
tests/input_files/DM_pion/particles.py (+489/-0)
tests/input_files/DM_pion/propagators.py (+35/-0)
tests/input_files/DM_pion/py.py (+67/-0)
tests/input_files/DM_pion/vertices.py (+1007/-0)
tests/input_files/DM_pion/write_param_card.py (+207/-0)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%born_matrix.f (+2/-2)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%born_matrix.f (+2/-2)
tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_standalone/matrix.f (+1/-1)
tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QCDsq_eq_4.f (+10/-9)
tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QCDsq_gt_0_QEDAmpAndQEDsq_gt_2.f (+8/-7)
tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QCDsq_gt_4.f (+5/-5)
tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QEDsq_le_4.f (+13/-10)
tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_WGTsq_le_10_QEDAmpAndQEDsq_gt_2.f (+8/-7)
tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_default.f (+10/-9)
tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDpert_default.f (+5/-5)
tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%P0_gg_ttx%born_matrix.f (+2/-2)
tests/input_files/IOTestsComparison/SquaredOrder_IOTest/sqso_uux_uuxuuxx/matrix_NoSQSO.f (+1/-1)
tests/input_files/IOTestsComparison/SquaredOrder_IOTest/sqso_uux_uuxuuxx/matrix_QCDsq_le_6.f (+2/-2)
tests/input_files/IOTestsComparison/SquaredOrder_IOTest/sqso_uux_uuxuuxx/matrix_ampOrderQED2_eq_2_WGTsq_le_14_QCDsq_gt_4.f (+2/-2)
tests/input_files/IOTestsComparison/TestCmdMatchBox/MatchBoxOutput/%TEST%SubProcesses%P0_wpwm_wpwm%matrix.f (+8/-8)
tests/input_files/IOTestsComparison/long_ML_SMQCD_default/dux_mumvmxg/%..%..%Source%MODEL%model_functions.f (+114/-0)
tests/input_files/IOTestsComparison/long_ML_SMQCD_default/dux_mumvmxg/%..%..%Source%MODEL%model_functions.inc (+4/-0)
tests/input_files/IOTestsComparison/long_ML_SMQCD_default/dux_mumvmxg/born_matrix.f (+1/-1)
tests/input_files/IOTestsComparison/long_ML_SMQCD_default/gg_wmtbx/%..%..%Source%MODEL%model_functions.f (+114/-0)
tests/input_files/IOTestsComparison/long_ML_SMQCD_default/gg_wmtbx/%..%..%Source%MODEL%model_functions.inc (+4/-0)
tests/input_files/IOTestsComparison/long_ML_SMQCD_default/gg_wmtbx/born_matrix.f (+1/-1)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/dux_mumvmxg/%..%..%Source%MODEL%model_functions.f (+114/-0)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/dux_mumvmxg/%..%..%Source%MODEL%model_functions.inc (+4/-0)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/dux_mumvmxg/born_matrix.f (+1/-1)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/gg_wmtbx/%..%..%Source%MODEL%model_functions.f (+114/-0)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/gg_wmtbx/%..%..%Source%MODEL%model_functions.inc (+4/-0)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/gg_wmtbx/born_matrix.f (+1/-1)
tests/input_files/IOTestsComparison/short_ML_SMQCD_LoopInduced/gg_hh/%..%..%Source%MODEL%model_functions.f (+114/-0)
tests/input_files/IOTestsComparison/short_ML_SMQCD_LoopInduced/gg_hh/%..%..%Source%MODEL%model_functions.inc (+4/-0)
tests/input_files/IOTestsComparison/short_ML_SMQCD_default/ddx_ttx/born_matrix.f (+1/-1)
tests/input_files/IOTestsComparison/short_ML_SMQCD_default/gg_ttx/%..%..%Source%MODEL%model_functions.f (+114/-0)
tests/input_files/IOTestsComparison/short_ML_SMQCD_default/gg_ttx/%..%..%Source%MODEL%model_functions.inc (+4/-0)
tests/input_files/IOTestsComparison/short_ML_SMQCD_default/gg_ttx/born_matrix.f (+1/-1)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/ddx_ttx/born_matrix.f (+1/-1)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/gg_ttx/%..%..%Source%MODEL%model_functions.f (+114/-0)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/gg_ttx/%..%..%Source%MODEL%model_functions.inc (+4/-0)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/gg_ttx/born_matrix.f (+1/-1)
tests/parallel_tests/me_comparator.py (+1/-3)
tests/parallel_tests/test_ML5.py (+1/-1)
tests/parallel_tests/test_ML5MSSMQCD.py (+1/-1)
tests/parallel_tests/test_aloha.py (+168/-2)
tests/parallel_tests/test_cmd_amcatnlo.py (+1/-1)
tests/time_db (+260/-259)
tests/unit_tests/iolibs/test_export_v4.py (+1/-1)
tests/unit_tests/iolibs/test_helas_call_writers.py (+30/-30)
tests/unit_tests/iolibs/test_link_to_ufo.py (+7/-2)
tests/unit_tests/iolibs/test_ufo_parsers.py (+53/-3)
tests/unit_tests/various/test_banner.py (+19/-0)
tests/unit_tests/various/test_decay.py (+2/-2)
tests/unit_tests/various/test_import_ufo.py (+138/-8)
tests/unit_tests/various/test_misc.py (+48/-7)
To merge this branch: bzr merge lp:~mg5core2/mg5amcnlo/2.6.3
Reviewer Review Type Date Requested Status
MadTeam Pending
Review via email: mp+347781@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Rikkert Frederix (frederix) wrote :

Hi Olivier,

Should we also release 3.0.1 together with this?

Cheers,
Rik

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

Hi,

I do not know what is the status of 3.0.1 (in term of merging with 2.6.3, test, ...)
I'm kind of disconnected of 3.0.1.
I'm obviously fine to release 3.0.1

Cheers,

Olivier

> On 12 Jun 2018, at 11:13, Rikkert Frederix <email address hidden> wrote:
>
> Hi Olivier,
>
> Should we also release 3.0.1 together with this?
>
> Cheers,
> Rik
>
> --
> https://code.launchpad.net/~mg5core2/mg5amcnlo/2.6.3/+merge/347781
> Your team mg5core2 is subscribed to branch lp:~mg5core2/mg5amcnlo/2.6.3.

lp:~mg5core2/mg5amcnlo/2.6.3 updated
314. By olivier-mattelaer

improvment in the model to optimise the creation of aloha routine

315. By olivier-mattelaer

fixing IOTest linked to HuaSheng change

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

Hi,

I have freezed this branch.

Concerning 3.0.1, I have started the merge of 2.6.3 within 3.0.1 but this was a tricky one
(I need some input from Paolo) and would need some additional test for the loop_qcd_qed model.
since even the tests were in conflicts...
So this will require at least a week before we can release 3.0.1

Olivier

Revision history for this message
marco zaro (marco-zaro) wrote :

H olivier,
If you want I can also have a look at the merge
What are the problematic files?
Cheers,
Marco

On Wed, Jun 13, 2018, 17:44 Olivier Mattelaer <
<email address hidden>> wrote:

> Hi,
>
> I have freezed this branch.
>
> Concerning 3.0.1, I have started the merge of 2.6.3 within 3.0.1 but this
> was a tricky one
> (I need some input from Paolo) and would need some additional test for the
> loop_qcd_qed model.
> since even the tests were in conflicts...
> So this will require at least a week before we can release 3.0.1
>
> Olivier
>
>
> --
> https://code.launchpad.net/~mg5core2/mg5amcnlo/2.6.3/+merge/347781
> Your team MadTeam is requested to review the proposed merge of
> lp:~mg5core2/mg5amcnlo/2.6.3 into lp:mg5amcnlo.
>

lp:~mg5core2/mg5amcnlo/2.6.3 updated
316. By olivier-mattelaer

avoid two coupling with different coupling order to be merged when restricting model

317. By olivier-mattelaer

fix an issue with the latest change for loop_sm

318. By olivier-mattelaer

small fix for MA5@NLO

319. By olivier-mattelaer

change linked to the tests.

320. By olivier-mattelaer

avoid side effects on the test by modifying configuration file. + fix an issue with aloha model with restriction file

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'MadSpin/interface_madspin.py'
2--- MadSpin/interface_madspin.py 2018-03-11 12:10:19 +0000
3+++ MadSpin/interface_madspin.py 2018-06-15 08:18:50 +0000
4@@ -35,6 +35,7 @@
5 import madgraph.interface.madgraph_interface as mg_interface
6 import madgraph.interface.master_interface as master_interface
7 import madgraph.interface.madevent_interface as madevent_interface
8+import madgraph.interface.common_run_interface as common_run_interface
9 import madgraph.interface.reweight_interface as rwgt_interface
10 import madgraph.various.misc as misc
11 import madgraph.iolibs.files as files
12@@ -53,6 +54,68 @@
13 cmd_logger = logging.getLogger('cmdprint2') # -> print
14
15
16+class MadSpinOptions(banner.ConfigFile):
17+
18+ def default_setup(self):
19+
20+ self.add_param("max_weight", -1)
21+ self.add_param('curr_dir', os.path.realpath(os.getcwd()))
22+ self.add_param('Nevents_for_max_weigth', 0)
23+ self.add_param("max_weight_ps_point", 400)
24+ self.add_param('BW_cut', -1)
25+ self.add_param('nb_sigma', 0.)
26+ self.add_param('ms_dir', '')
27+ self.add_param('max_running_process', 100)
28+ self.add_param('onlyhelicity', False)
29+ self.add_param('spinmode', "madspin", allowed=['madspin','none','onshell'])
30+ self.add_param('use_old_dir', False, comment='should be use only for faster debugging')
31+ self.add_param('run_card', '' , comment='define cut for spinmode==none. Path to run_card to use')
32+ self.add_param('fixed_order', False, comment='to activate fixed order handling of counter-event')
33+ self.add_param('seed', 0, comment='control the seed of madspin')
34+ self.add_param('cross_section', {'__type__':0.}, comment="forcing normalization of cross-section after MS (for none/onshell)" )
35+ self.add_param('new_wgt', 'cross-section' ,allowed=['cross-section', 'BR'], comment="if not consistent number of particles, choose what to do for the weight. (BR: means local according to number of part, cross use the force cross-section")
36+ self.add_param('input_format', 'auto', allowed=['auto','lhe', 'hepmc', 'lhe_no_banner'])
37+
38+
39+ ############################################################################
40+ ## Special post-processing of the options ##
41+ ############################################################################
42+ def post_set_ms_dir(self, value, change_userdefine, raiseerror):
43+ """ special handling for set ms_dir """
44+
45+ self.__setitem__('curr_dir', value, change_userdefine=change_userdefine)
46+
47+ ############################################################################
48+ def post_set_seed(self, value, change_userdefine, raiseerror):
49+ """ special handling for set seed """
50+
51+ random.seed(value)
52+
53+ ############################################################################
54+ def post_set_run_card(self, value, change_userdefine, raiseerror):
55+ """ special handling for set run_card """
56+
57+ if value == 'default':
58+ self.run_card = None
59+ elif os.path.isfile(value):
60+ self.run_card = banner.RunCard(value)
61+
62+ args = value.split()
63+ if len(args) >2:
64+ if not self.options['run_card']:
65+ self.run_card = banner.RunCardLO()
66+ self.run_card.remove_all_cut()
67+ self.run_card[args[0]] = ' '.join(args[1:])
68+
69+
70+ ############################################################################
71+ def post_fixed_order(self, value, change_userdefine, raiseerror):
72+ """ special handling for set fixed_order """
73+
74+ if value:
75+ logger.warning('Fix order madspin fails to have the correct scale information. This can bias the results!')
76+ logger.warning('Not all functionalities of MadSpin handle this mode correctly (only onshell mode so far).')
77+
78
79 class MadSpinInterface(extended_cmd.Cmd):
80 """Basic interface for madspin"""
81@@ -77,22 +140,7 @@
82 self.mode = "madspin" # can be flat/bridge change the way the decay is done.
83 # note amc@nlo does not support bridge.
84
85- self.options = {'max_weight': -1,
86- 'curr_dir': os.path.realpath(os.getcwd()),
87- 'Nevents_for_max_weigth': 0,
88- 'max_weight_ps_point': 400,
89- 'BW_cut':-1,
90- 'nb_sigma':0,
91- 'ms_dir':None,
92- 'max_running_process':100,
93- 'onlyhelicity': False,
94- 'spinmode': "madspin",
95- 'use_old_dir': False, #should be use only for faster debugging
96- 'run_card': None, # define cut for spinmode==none.
97- 'fixed_order': False # to activate fixed order handling of counter-event
98- }
99-
100-
101+ self.options = MadSpinOptions()
102
103 self.events_file = None
104 self.decay_processes = {}
105@@ -107,7 +155,21 @@
106 logger.info("Extracting the banner ...")
107 self.do_import(event_path)
108
109-
110+
111+ def setup_for_pure_decay(self):
112+ """this is for spinmode=None -> simple decay
113+ We go here if they are no banner.
114+ -> this requires that a command import model appears in the card!
115+ """
116+
117+ logger.info("Setup the code for pure decay mode")
118+ self.proc_option = []
119+ self.final_state_full = ''
120+ self.final_state_compact = ''
121+ self.prod_branches = ''
122+ self.final_state = set()
123+
124+
125 def do_import(self, inputfile):
126 """import the event file"""
127
128@@ -126,6 +188,7 @@
129 if not os.path.exists(inputfile):
130 if inputfile.endswith('.gz'):
131 if not os.path.exists(inputfile[:-3]):
132+ misc.sprint(os.getcwd(), os.listdir('.'), inputfile, os.path.exists(inputfile), os.path.exists(inputfile[:-3]))
133 raise self.InvalidCmd('No such file or directory : %s' % inputfile)
134 else:
135 inputfile = inputfile[:-3]
136@@ -134,14 +197,21 @@
137 else:
138 raise self.InvalidCmd('No such file or directory : %s' % inputfile)
139
140+ self.inputfile = inputfile
141+ if self.options['spinmode'] == 'none' and \
142+ (self.options['input_format'] != 'lhe' or (self.options['input_format'] == 'auto' and '.lhe' in inputfile[:-5])):
143+ self.banner = banner.Banner()
144+ self.setup_for_pure_decay()
145+ return
146+
147 if inputfile.endswith('.gz'):
148 misc.gunzip(inputfile)
149 inputfile = inputfile[:-3]
150-
151 # Read the banner of the inputfile
152 self.events_file = open(os.path.realpath(inputfile))
153 self.banner = banner.Banner(self.events_file)
154
155+
156 # Check the validity of the banner:
157 if 'slha' not in self.banner:
158 self.events_file = None
159@@ -163,7 +233,6 @@
160 self.options['nb_sigma'] = N_sigma
161 if self.options['BW_cut'] == -1:
162 self.options['BW_cut'] = float(self.banner.get_detail('run_card', 'bwcutoff'))
163-
164 else:
165 if not self.options['Nevents_for_max_weigth']:
166 self.options['Nevents_for_max_weigth'] = 75
167@@ -273,7 +342,7 @@
168
169
170 #Check the param_card
171- if not bypass_check:
172+ if not (bypass_check or self.options['input_format'] in ['hepmc', 'lhe_no_banner']):
173 if not hasattr(self.banner, 'param_card'):
174 self.banner.charge_card('slha')
175 param_card = check_param_card.ParamCard(card)
176@@ -395,42 +464,10 @@
177
178 args = self.split_arg(line)
179 self.check_set(args)
180-
181- if args[0] not in ['ms_dir', 'run_card']:
182- args[1] = args[1].lower()
183-
184- if args[0] in ['max_weight', 'BW_effect','ms_dir', 'spinmode']:
185- self.options[args[0]] = args[1]
186- if args[0] == 'ms_dir':
187- self.options['curr_dir'] = self.options['ms_dir']
188- elif args[0] == 'seed':
189- random.seed(int(args[1]))
190- self.seed = int(args[1])
191- elif args[0] == 'BW_cut':
192- self.options[args[0]] = float(args[1])
193- elif args[0] in ['onlyhelicity', 'use_old_dir']:
194- self.options[args[0]] = banner.ConfigFile.format_variable(args[1], bool, args[0])
195- elif args[0] in ['run_card']:
196- if args[1] == 'default':
197- self.options['run_card'] = None
198- elif os.path.isfile(args[1]):
199- self.options['run_card'] = banner.RunCard(args[1])
200- elif len(args) >2:
201- if not self.options['run_card']:
202- self.options['run_card'] = banner.RunCardLO()
203- self.options['run_card'].remove_all_cut()
204- self.options['run_card'][args[1]] = args[2]
205- elif args[0] in 'fixed_order':
206- if args[1].lower() in ['t', 'true']:
207- self.options['fixed_order'] = True
208- logger.warning('Fix order madspin fails to have the correct scale information. This can bias the results!')
209- logger.warning('Not all functionality of MadSpin handle this mode correctly (only onshell mode so far).')
210- else:
211- self.options['fixed_order'] = False
212- logger.info('fixed_order options set to %s', self.options['fixed_order'])
213- else:
214- self.options[args[0]] = int(args[1])
215-
216+
217+ self.options[args[0]] = ' '.join(args[1:])
218+
219+
220 def complete_set(self, text, line, begidx, endidx):
221
222
223@@ -559,17 +596,17 @@
224
225 model_line = self.banner.get('proc_card', 'full_model_line')
226
227- if not self.seed:
228- self.seed = random.randint(0, int(30081*30081))
229- self.do_set('seed %s' % self.seed)
230- logger.info('Will use seed %s' % self.seed)
231- self.history.insert(0, 'set seed %s' % self.seed)
232+ if not self.options['seed']:
233+ self.options['seed'] = random.randint(0, int(30081*30081))
234+ #self.do_set('seed %s' % self.seed)
235+ logger.info('Will use seed %s' % self.options['seed'])
236+ self.history.insert(0, 'set seed %s' % self.options['seed'])
237
238- if self.seed > 30081*30081: # can't use too big random number
239- msg = 'Random seed too large ' + str(self.seed) + ' > 30081*30081'
240+ if self.options['seed'] > 30081*30081: # can't use too big random number
241+ msg = 'Random seed too large ' + str(self.options['seed']) + ' > 30081*30081'
242 raise Exception, msg
243
244- self.options['seed'] = self.seed
245+ #self.options['seed'] = self.seed
246 text = '%s\n' % '\n'.join([ line for line in self.history if line])
247 self.banner.add_text('madspin' , text)
248
249@@ -678,9 +715,9 @@
250
251 # NOW we have all the information available for RUNNING
252
253- if self.seed:
254+ if self.options['seed']:
255 #seed is specified need to use that one:
256- open(pjoin(self.options['ms_dir'],'seeds.dat'),'w').write('%s\n'%self.seed)
257+ open(pjoin(self.options['ms_dir'],'seeds.dat'),'w').write('%s\n'%self.options['seed'])
258 #remove all ranmar_state
259 for name in misc.glob(pjoin('*', 'SubProcesses','*','ranmar_state.dat'),
260 self.options['ms_dir']):
261@@ -741,30 +778,58 @@
262 for name in misc.glob("decay_*_*", self.path_me):
263 shutil.rmtree(name)
264
265- self.events_file.close()
266- orig_lhe = lhe_parser.EventFile(self.events_file.name)
267-
268+ if self.events_file:
269+ self.events_file.close()
270+ filename = self.events_file.name
271+ else:
272+ filename = self.inputfile
273+
274+ if self.options['input_format'] == 'auto':
275+ if '.lhe' in filename :
276+ self.options['input_format'] = 'lhe'
277+ elif '.hepmc' in filename:
278+ self.options['input_format'] = 'hepmc'
279+ else:
280+ raise Exception, "fail to recognized input format automatically"
281+
282+ if self.options['input_format'] in ['lhe', 'lhe_no_banner']:
283+ orig_lhe = lhe_parser.EventFile(filename)
284+ if self.options['input_format'] == 'lhe_no_banner':
285+ orig_lhe.allow_empty_event = True
286+
287+ elif self.options['input_format'] in ['hepmc']:
288+ import madgraph.various.hepmc_parser as hepmc_parser
289+ orig_lhe = hepmc_parser.HEPMC_EventFile(filename)
290+ logger.info("Parsing input event to know how many decay to generate. This can takes few minuts.")
291+ else:
292+ raise Exception
293+
294 to_decay = collections.defaultdict(int)
295 nb_event = 0
296+
297 for event in orig_lhe:
298 nb_event +=1
299 for particle in event:
300 if particle.status == 1 and particle.pdg in asked_to_decay:
301 # final state and tag as to decay
302 to_decay[particle.pdg] += 1
303+ if self.options['input_format'] == 'hepmc' and nb_event == 250:
304+ for key in to_decay:
305+ to_decay[key] *= 50.013 # to avoid accidental coincidence with nevents
306+ break
307
308 # Handle the banner of the output file
309- if not self.seed:
310- self.seed = random.randint(0, int(30081*30081))
311- self.do_set('seed %s' % self.seed)
312- logger.info('Will use seed %s' % self.seed)
313- self.history.insert(0, 'set seed %s' % self.seed)
314+ if not self.options['seed']:
315+ self.options['seed'] = random.randint(0, int(30081*30081))
316+ #self.do_set('seed %s' % self.seed)
317+ logger.info('Will use seed %s' % self.options['seed'])
318+ self.history.insert(0, 'set seed %s' % self.options['seed'])
319
320- if self.seed > 30081*30081: # can't use too big random number
321- msg = 'Random seed too large ' + str(self.seed) + ' > 30081*30081'
322+ if self.options['seed'] > 30081*30081: # can't use too big random number
323+ msg = 'Random seed too large ' + str(self.options['seed']) + ' > 30081*30081'
324 raise Exception, msg
325
326- self.options['seed'] = self.seed
327+ #self.options['seed'] = self.options['seed']
328
329 text = '%s\n' % '\n'.join([ line for line in self.history if line])
330 self.banner.add_text('madspin' , text)
331@@ -791,61 +856,104 @@
332 evt_decayfile[pdg] = self.generate_events(pdg, nb_event, mg5)
333 else:
334 evt_decayfile[pdg] = self.generate_events(pdg, nb_needed, mg5, cumul=True)
335+ elif self.options['cross_section']:
336+ #cross-section hard-coded -> allow
337+ part = self.model.get_particle(pdg)
338+ name = part.get_name()
339+
340+ if name not in self.list_branches:
341+ continue
342+ else:
343+ try:
344+ evt_decayfile[pdg] = self.generate_events(pdg, nb_needed, mg5, cumul=True)
345+ except common_run_interface.ZeroResult:
346+ logger.warning("Branching ratio is zero for this particle. Not decaying it")
347+ del to_decay[pdg]
348 else:
349 part = self.model.get_particle(pdg)
350 name = part.get_name()
351 if name not in self.list_branches or len(self.list_branches[name]) == 0:
352 continue
353- raise self.InvalidCmd("The bridge mode of MadSpin does not support event files where events do not *all* share the same set of final state particles to be decayed.")
354+ raise self.InvalidCmd("The bridge mode of MadSpin does not support event files where events do not *all* share the same set of final state particles to be decayed. One workaround is to force the final cross-section manually.")
355
356
357-
358-
359 # Compute the branching ratio.
360- br = 1
361- for (pdg, event_files) in evt_decayfile.items():
362- if not event_files:
363- continue
364- totwidth = float(self.banner.get('param', 'decay', abs(pdg)).value)
365- if to_decay[pdg] == nb_event:
366- # Exactly one particle of this type to decay by event
367- pwidth = sum([event_files[k].cross for k in event_files])
368- if pwidth > 1.01 * totwidth:
369- logger.critical("Branching ratio larger than one for %s " % pdg)
370- br *= pwidth / totwidth
371- elif to_decay[pdg] % nb_event == 0:
372- # More than one particle of this type to decay by event
373- # Need to check the number of event file to check if we have to
374- # make separate type of decay or not.
375- nb_mult = to_decay[pdg] // nb_event
376- if nb_mult == len(event_files):
377- for k in event_files:
378- pwidth = event_files[k].cross
379- if pwidth > 1.01 * totwidth:
380- logger.critical("Branching ratio larger than one for %s " % pdg)
381- br *= pwidth / totwidth
382- br *= math.factorial(nb_mult)
383- else:
384- pwidth = sum(event_files[k].cross for k in event_files)
385+ if not self.options['cross_section']:
386+ br = 1
387+ for (pdg, event_files) in evt_decayfile.items():
388+ if not event_files:
389+ continue
390+ totwidth = float(self.banner.get('param', 'decay', abs(pdg)).value)
391+ if to_decay[pdg] == nb_event:
392+ # Exactly one particle of this type to decay by event
393+ pwidth = sum([event_files[k].cross for k in event_files])
394 if pwidth > 1.01 * totwidth:
395 logger.critical("Branching ratio larger than one for %s " % pdg)
396- br *= (pwidth / totwidth)**nb_mult
397- else:
398- raise self.InvalidCmd("The bridge mode of MadSpin does not support event files where events do not *all* share the same set of final state particles to be decayed.")
399+ br *= pwidth / totwidth
400+ elif to_decay[pdg] % nb_event == 0:
401+ # More than one particle of this type to decay by event
402+ # Need to check the number of event file to check if we have to
403+ # make separate type of decay or not.
404+ nb_mult = to_decay[pdg] // nb_event
405+ if nb_mult == len(event_files):
406+ for k in event_files:
407+ pwidth = event_files[k].cross
408+ if pwidth > 1.01 * totwidth:
409+ logger.critical("Branching ratio larger than one for %s " % pdg)
410+ br *= pwidth / totwidth
411+ br *= math.factorial(nb_mult)
412+ else:
413+ pwidth = sum(event_files[k].cross for k in event_files)
414+ if pwidth > 1.01 * totwidth:
415+ logger.critical("Branching ratio larger than one for %s " % pdg)
416+ br *= (pwidth / totwidth)**nb_mult
417+ else:
418+ raise self.InvalidCmd("The bridge mode of MadSpin does not support event files where events do not *all* share the same set of final state particles to be decayed.")
419+ else:
420+ br = 1
421 self.branching_ratio = br
422 self.efficiency = 1
423- self.cross, self.error = self.banner.get_cross(witherror=True)
424+ try:
425+ self.cross, self.error = self.banner.get_cross(witherror=True)
426+ except:
427+ if self.options['input_format'] != 'lhe':
428+ self.cross, self.error = 0, 0
429 self.cross *= br
430 self.error *= br
431
432-
433 # modify the cross-section in the init block of the banner
434- self.banner.scale_init_cross(self.branching_ratio)
435-
436-
437+ if not self.options['cross_section']:
438+ self.banner.scale_init_cross(self.branching_ratio)
439+ else:
440+
441+ if self.options['input_format'] in ['lhe_no_banner','hepmc'] and 'init' not in self.banner:
442+ self.cross = sum(self.options['cross_section'].values())
443+ self.error = 0
444+ self.branching_ratio = 1
445+ else:
446+ self.banner.modify_init_cross(self.options['cross_section'])
447+ new_cross, new_error = self.banner.get_cross(witherror=True)
448+ self.branching_ratio = new_cross / self.cross
449+ self.cross = new_cross
450+ self.error = new_error
451+
452 # 3. Merge the various file together.
453- output_lhe = lhe_parser.EventFile(orig_lhe.name.replace('.lhe', '_decayed.lhe.gz'), 'w')
454- self.banner.write(output_lhe, close_tag=False)
455+ if self.options['input_format'] == 'hepmc':
456+ name = orig_lhe.name.replace('.hepmc', '_decayed.lhe')
457+ if not name.endswith('.gz'):
458+ name = '%s.gz' % name
459+
460+ output_lhe = lhe_parser.EventFile(name, 'w')
461+ else:
462+ name = orig_lhe.name.replace('.lhe', '_decayed.lhe')
463+ if not name.endswith('.gz'):
464+ name = '%s.gz' % name
465+ output_lhe = lhe_parser.EventFile(name, 'w')
466+ try:
467+ self.banner.write(output_lhe, close_tag=False)
468+ except Exception:
469+ if self.options['input_format'] == 'lhe':
470+ raise
471
472 # initialise object which store not use event due to wrong helicity
473 bufferedEvents_decay = {}
474@@ -856,8 +964,9 @@
475 start = time.time()
476 counter = 0
477 orig_lhe.seek(0)
478+
479 for event in orig_lhe:
480- if counter and counter % 1000 == 0 and float(str(counter)[1:]) ==0:
481+ if counter and counter % 100 == 0 and float(str(counter)[1:]) ==0:
482 print "decaying event number %s [%s s]" % (counter, time.time()-start)
483 counter +=1
484
485@@ -866,9 +975,13 @@
486 particles = [p for p in event if int(p.status) == 1.0]
487 random.shuffle(particles)
488 ids = [particle.pid for particle in particles]
489+ br = 1 #br for that particular events (for special/weighted case)
490+ hepmc_output = lhe_parser.Event() #for hepmc case: collect the decay particle
491 for i,particle in enumerate(particles):
492+ #misc.sprint(i, particle.pdg, particle.pid)
493+ #misc.sprint(self.final_state, evt_decayfile)
494 # check if we need to decay the particle
495- if particle.pdg not in self.final_state or particle.pdg not in evt_decayfile:
496+ if not (particle.pdg in self.final_state or particle.pdg in evt_decayfile):
497 continue # nothing to do for this particle
498 # check how the decay need to be done
499 nb_decay = len(evt_decayfile[particle.pdg])
500@@ -893,9 +1006,16 @@
501 decay_file_nb = j
502 else:
503 break
504-
505+
506+ if self.options['new_wgt'] == 'BR':
507+ tot_width = float(self.banner.get('param', 'decay', abs(pdg)).value)
508+ if tot_width:
509+ br = decay_file.cross / tot_width
510 # ok start the procedure
511- helicity = particle.helicity
512+ if hasattr(particle,'helicity'):
513+ helicity = particle.helicity
514+ else:
515+ helicity = 9
516 bufferedEvents = bufferedEvents_decay[particle.pdg][decay_file_nb]
517
518 # now that we have the file to read. find the associate event
519@@ -927,14 +1047,36 @@
520 # only add to the buffering if the buffer is not too large
521 bufferedEvents[helicity].append(decay)
522 # now that we have the event make the merge
523- particle.add_decay(decay)
524+ if self.options['input_format'] != 'hepmc':
525+ particle.add_decay(decay)
526+ else:
527+ if len(hepmc_output) == 0:
528+ hepmc_output.append(lhe_parser.Particle(event=hepmc_output))
529+ hepmc_output[0].color2 = 0
530+ decayed_particle = lhe_parser.Particle(particle, hepmc_output)
531+ hepmc_output.append(decayed_particle)
532+ decayed_particle.add_decay(decay)
533 # change the weight associate to the event
534- event.wgt *= self.branching_ratio
535- wgts = event.parse_reweight()
536- for key in wgts:
537- wgts[key] *= self.branching_ratio
538- # all particle have been decay if needed
539- output_lhe.write(str(event))
540+ if self.options['new_wgt'] == 'cross-section':
541+ event.wgt *= self.branching_ratio
542+ br = self.branching_ratio
543+ else:
544+ event.wgt *= br
545+
546+ if self.options['input_format'] != 'hepmc':
547+ wgts = event.parse_reweight()
548+ for key in wgts:
549+ wgts[key] *= br
550+ # all particle have been decay if needed
551+ output_lhe.write(str(event))
552+ else:
553+ hepmc_output.wgt = event.wgt
554+ hepmc_output.nexternal = len(hepmc_output) # the append does not update nexternal
555+ hepmc_output.assign_mother()
556+ output_lhe.write(str(hepmc_output))
557+ else:
558+ if counter==0:
559+ raise Exception
560 output_lhe.write('</LesHouchesEvents>\n')
561
562
563@@ -971,7 +1113,7 @@
564 cumul allow to merge all the definition in one run (add process)
565 to generate events according to cross-section
566 """
567-
568+ nb_event = int(nb_event) # in case of hepmc request the nb_event is not an integer
569 if cumul:
570 width = 0.
571 else:
572@@ -1016,18 +1158,18 @@
573 logger.debug(error)
574 pass
575 if self.options["run_card"]:
576- run_card = self.options["run_card"]
577+ run_card = self.run_card
578 else:
579 run_card = banner.RunCard(pjoin(decay_dir, "Cards", "run_card.dat"))
580
581- run_card["iseed"] = self.seed
582+ run_card["iseed"] = self.options['seed']
583 run_card['gridpack'] = True
584 run_card['systematics_program'] = 'False'
585 run_card['use_syst'] = False
586 run_card.write(pjoin(decay_dir, "Cards", "run_card.dat"))
587 param_card = self.banner['slha']
588 open(pjoin(decay_dir, "Cards", "param_card.dat"),"w").write(param_card)
589- self.seed += 1
590+ self.options['seed'] += 1
591 # actually creation
592 me5_cmd.exec_cmd("generate_events run_01 -f")
593 if output_width:
594@@ -1057,10 +1199,16 @@
595 logger.debug(error)
596 pass
597 if self.options["run_card"]:
598- run_card = self.options["run_card"]
599+ run_card = self.run_card
600 else:
601 run_card = banner.RunCard(pjoin(decay_dir, "Cards", "run_card.dat"))
602 run_card["nevents"] = int(1.2*nb_event)
603+ # Handle the banner of the output file
604+ if not self.seed:
605+ self.seed = random.randint(0, int(30081*30081))
606+ self.do_set('seed %s' % self.seed)
607+ logger.info('Will use seed %s' % self.seed)
608+ self.history.insert(0, 'set seed %s' % self.seed)
609 run_card["iseed"] = self.seed
610 run_card["systematics_program"] = 'None'
611 run_card.write(pjoin(decay_dir, "Cards", "run_card.dat"))
612@@ -1140,8 +1288,7 @@
613 if particle.status == 1 and particle.pdg in asked_to_decay:
614 # final state and tag as to decay
615 to_decay[particle.pdg] += 1
616- #misc.sprint(to_decay)
617- #misc.sprint("import the mode -> temporary with logging")
618+
619 with misc.MuteLogger(["madgraph", "madevent", "ALOHA", "cmdprint"], [50,50,50,50]):
620 mg5 = self.mg5cmd
621 if not self.model:
622@@ -1436,10 +1583,6 @@
623 full_event = lhe_parser.Event(str(production))
624 full_event = full_event.add_decays(decays)
625 full_me = self.calculate_matrix_element(full_event)
626- #misc.sprint(full_event)
627- #misc.sprint([p.pdg for p in production])
628- #misc.sprint([p.pdg for p in full_event])
629- #misc.sprint(full_me, production_me, decay_me)
630 return full_event, full_me/(production_me*decay_me)
631
632
633@@ -1457,7 +1600,6 @@
634 init = (-init[0],)
635 final = tuple(-i for i in final)
636 tag = (init, final)
637- misc.sprint([k for k in self.all_me.keys() if len(k[0])==1])
638 orig_order = self.all_me[tag]['order']
639
640 pdir = self.all_me[tag]['pdir']
641@@ -1520,7 +1662,6 @@
642
643 rwgt_interface.ReweightInterface.get_LO_definition_from_NLO()
644
645-
646
647
648 if __name__ == '__main__':
649
650=== modified file 'MadSpin/madspin'
651--- MadSpin/madspin 2013-11-12 23:52:05 +0000
652+++ MadSpin/madspin 2018-06-15 08:18:50 +0000
653@@ -49,6 +49,7 @@
654 if len(args) == 0:
655 args = ''
656
657+
658 import subprocess
659
660 # Check if optimize mode is (and should be) activated
661@@ -114,23 +115,6 @@
662 pass
663 import MadSpin.interface_madspin as interface
664
665-try:
666- cmd_line = interface.MadSpinInterface()
667- cmd_line.use_rawinput = True
668- cmd_line.cmdloop()
669-except:
670- pass
671-try:
672- cmd_line.exec_cmd('quit all', printcmd=False)
673- readline.set_history_length(100)
674- if not os.path.exists(os.path.join(os.environ['HOME'], '.mg5')):
675- os.mkdir(os.path.join(os.environ['HOME'], '.mg5'))
676- readline.write_history_file(history_file)
677-except Exception, error:
678- pass
679-
680-sys.exit(0)
681-
682 # Call the cmd interface main loop
683 try:
684 if options.file or args:
685@@ -143,12 +127,14 @@
686 cmd_line = interface.MasterCmdWeb()
687 cmd_line.debug_output = os.path.join(os.path.dirname(input_file),'generation.log')
688 cmd_line.use_rawinput = False
689- cmd_line.run_cmd('import ' + input_file)
690+ cmd_line.import_command_file(input_file)
691 cmd_line.run_cmd('quit')
692 else:
693+ print "using input+file", input_file
694 cmd_line = interface.MadSpinInterface()
695 cmd_line.use_rawinput = False
696- cmd_line.run_cmd('import ' + input_file)
697+ cmd_line.haspiping = False
698+ cmd_line.import_command_file(input_file)
699 cmd_line.run_cmd('quit')
700 else:
701 # Interactive mode
702@@ -160,8 +146,20 @@
703 cmd_line = interface.MasterCmdWeb()
704 cmd_line.cmdloop()
705 else:
706- cmd_line = interface.MasterCmd(mgme_dir = options.mgme_dir)
707- cmd_line.cmdloop()
708+ try:
709+ cmd_line = interface.MadSpinInterface()
710+ cmd_line.use_rawinput = True
711+ cmd_line.cmdloop()
712+ except:
713+ pass
714+ try:
715+ cmd_line.exec_cmd('quit all', printcmd=False)
716+ readline.set_history_length(100)
717+ if not os.path.exists(os.path.join(os.environ['HOME'], '.mg5')):
718+ os.mkdir(os.path.join(os.environ['HOME'], '.mg5'))
719+ readline.write_history_file(history_file)
720+ except Exception, error:
721+ pass
722 except KeyboardInterrupt:
723 print 'writting history and quit on KeyboardInterrupt'
724 pass
725
726=== modified file 'Template/LO/Cards/run_card.dat'
727--- Template/LO/Cards/run_card.dat 2018-04-25 21:20:23 +0000
728+++ Template/LO/Cards/run_card.dat 2018-06-15 08:18:50 +0000
729@@ -12,7 +12,7 @@
730 # mind the format: value = variable ! comment *
731 # *
732 # To display more options, you can type the command: *
733-* update full_run_card *
734+# update full_run_card *
735 #*********************************************************************
736 #
737 #*******************
738
739=== modified file 'Template/LO/SubProcesses/genps.f'
740--- Template/LO/SubProcesses/genps.f 2018-04-20 08:38:20 +0000
741+++ Template/LO/SubProcesses/genps.f 2018-06-15 08:18:50 +0000
742@@ -104,7 +104,7 @@
743 c
744 integer iconfig,mincfig,maxcfig,invar
745 double precision p1(0:3,nexternal+1)
746- double precision x(maxinvar)
747+ double precision x(*)
748 double precision wgt
749 c
750 c Local
751@@ -279,19 +279,18 @@
752 cm_rap=.5d0*dlog((p0+p3)/(p0-p3))
753 set_cm_rap=.true.
754 c Set shat
755- s(-nbranch) = m2**2+2*xbk(1)*ebeam(1) *
756- $ (ebeam(2)+sqrt(ebeam(2)**2-m2**2))
757+ s(-nbranch) = x(ndim)*stot
758 elseif (abs(lpp(2)) .ge. 1) then
759 call sample_get_x(sjac,x(ndim),ndim,mincfig,0d0,1d0)
760 xbk(2) = x(ndim)
761+
762 c Set CM rapidity for use in the rap() function
763 p0=ebeam(1)+xbk(2)*ebeam(2)
764 p3=sqrt(ebeam(1)**2-m1**2)-xbk(2)*ebeam(2)
765 cm_rap=.5d0*dlog((p0+p3)/(p0-p3))
766 set_cm_rap=.true.
767 c Set shat
768- s(-nbranch) = m1**2+2*(ebeam(1)+sqrt(ebeam(1)**2-m1**2))
769- $ * xbk(2)*ebeam(2)
770+ s(-nbranch) = x(ndim)*stot
771 else
772 c Set CM rapidity for use in the rap() function
773 p0=ebeam(1) + ebeam(2)
774@@ -663,7 +662,7 @@
775 c double precision spole(-max_branch:0),swidth(-max_branch:0)
776 double precision jac,pswgt
777 integer nbranch
778- double precision x(40) ! ja 3/2/11 21->40 after strange segfault
779+ double precision x(*) ! ja 3/2/11 21->40 after strange segfault
780 c
781 c Local
782 c
783
784=== modified file 'Template/LO/SubProcesses/reweight.f'
785--- Template/LO/SubProcesses/reweight.f 2018-03-11 12:29:51 +0000
786+++ Template/LO/SubProcesses/reweight.f 2018-06-15 08:18:50 +0000
787@@ -1,3 +1,20 @@
788+c for cross-checking change in this file.
789+c here is a minimal list of process that we have to
790+c test
791+c
792+c SM
793+c ----
794+c p p > t t~ (up to 2jet)
795+c p p > w+ (up to 3 jet)
796+c p p > z t t~ j j (no MLM needed)
797+c
798+c
799+c HEFT
800+c ----
801+c p p > h j b b~
802+c q q > a a g q q
803+c g g > h g q q
804+
805 double precision function gamma(q0)
806 c**************************************************
807 c calculates the branching probability
808@@ -522,7 +539,8 @@
809 common/to_stot/stot,m1,m2
810
811 C local variables
812- integer i, j, idi, idj, k
813+ integer i, j, idi, idj, k,m
814+ integer get_color
815 real*8 PI
816 parameter( PI = 3.14159265358979323846d0 )
817 integer iforest(2,-max_branch:-1,lmaxconfigs)
818@@ -545,6 +563,7 @@
819 logical chclusold,fail,increasecode
820 save chclusold
821 integer tmpindex
822+ integer pdgm, pdgid1, pdgid2
823
824 logical isqcd,isjet,isparton,cluster,isjetvx,is_octet
825 integer ifsno
826@@ -746,8 +765,17 @@
827 c The ishft gives the FS particle corresponding to imocl
828 if(.not.is_octet(ipdgcl(ishft(1,ipart(1,imocl(n))-1),igraphs(1),iproc)))then
829 ! split case for q a > q and for g > g h (with the gluon splitting into quark)
830- if (ipart(2,imocl(n)).eq.0) then ! q a > q case
831- iqjets(ipart(1,imocl(n)))=0
832+ ! also check for case of three scalar interaction (then do nothing)
833+ pdgm = ipdgcl(imocl(n),igraphs(1),iproc)
834+ pdgid1 = ipdgcl(idacl(n,1),igraphs(1),iproc)
835+ pdgid2 = ipdgcl(idacl(n,2),igraphs(1),iproc)
836+
837+ if (.not.isqcd(pdgm).and..not.isqcd(pdgid1).and..not.isqcd(pdgid2)) then
838+ ! this is to avoid to do weird stuff for w+ w- z (or h h h)
839+ ! this fix an issue for qq_zttxqq G1594.08
840+ continue
841+ elseif (ipart(2,imocl(n)).eq.0) then ! q a > q case
842+ iqjets(ipart(1,imocl(n)))=0
843 else ! octet. want to be sure that both are tagged as jet before removing one
844 ! this prevent that both are removed in case of g > g h , g > q1 q2, q1 > a q1.
845 ! at least one of the two should be kept as jet
846@@ -791,7 +819,57 @@
847 goodjet(imocl(n))=
848 $ (isjet(ipdgcl(imocl(n),igraphs(1),iproc)).and.
849 $ goodjet(idacl(n,1)).and.goodjet(idacl(n,2)))
850- endif
851+
852+c check case with g > g g
853+c where the hardest gluon is not goodjet but the other is.
854+c in that case change ipart(1,) of the mother gluon
855+c pure QCD jet
856+c need to take care of the following case:
857+c tttttttttt
858+c gggggggggggggggg
859+c ggggggggg tttttttttt
860+c gggggggg
861+c
862+c in that case the up gluon can be tag as the hardest one
863+c but this one is also lead to no QCD one.
864+c so in that case we have to change ipart(1) to the sofest gluon
865+ pdgm = ipdgcl(imocl(n),igraphs(1),iproc)
866+ pdgid1 = ipdgcl(idacl(n,1),igraphs(1),iproc)
867+ pdgid2 = ipdgcl(idacl(n,2),igraphs(1),iproc)
868+ if (is_octet(pdgm).and.is_octet(pdgid1).and.is_octet(pdgid2))then
869+c write(*,*) 'pure QCD vertex (2)'
870+c write(*,*) pdgm , '>', pdgid1,' ', pdgid2
871+c write(*,*) 'ipart', ipart(1,imocl(n)), ipart(2,imocl(n))
872+c write(*,*) 'id', imocl(n), idacl(n,1),idacl(n,2)
873+c write(*,*) 'ipart',ipart(1,imocl(n)),'/', ipart(2,imocl(n)), ipart(1,idacl(n,1)),'/', ipart(2,idacl(n,1)),
874+c $ ipart(1,idacl(n,2)),'/', ipart(2,idacl(n,2))
875+c write(*,*) 'googjet', goodjet(idacl(n,1)),goodjet(idacl(n,2))
876+ if (ipart(1,imocl(n)).eq.ipart(1, idacl(n,1))) then
877+ if (.not.goodjet(idacl(n,1)).and.goodjet(idacl(n,2))) then
878+c write(*,*) 'ggg with hard jet set a QED the second jet lead to', ipart(1,idacl(n,2)), ipart(2,idacl(n,2))
879+ do m =n_max_cl,n,-1
880+ if(ipart(1,m).eq.ipart(1,imocl(n)).and.ipart(2,m).eq.ipart(2,imocl(n)))then
881+ ipart(1,m) = ipart(1,idacl(n,2))
882+ ipart(2,m) = ipart(2,idacl(n,2))
883+ endif
884+ enddo
885+ endif
886+ else
887+ if (.not.goodjet(idacl(n,2)).and.goodjet(idacl(n,1))) then
888+c write(*,*) 'ggg with hard jet set a QED the second jet lead to', ipart(1,idacl(n,1)), ipart(2,idacl(n,1))
889+ do m =n_max_cl,n,-1
890+ if(ipart(1,m).eq.ipart(1,imocl(n)).and.ipart(2,m).eq.ipart(2,imocl(n)))then
891+ ipart(1,m) = ipart(1,idacl(n,1))
892+ ipart(2,m) = ipart(2,idacl(n,1))
893+ endif
894+ enddo
895+ endif
896+ endif
897+ endif
898+
899+
900+
901+ endif
902 enddo
903
904 if (btest(mlevel,4))then
905
906=== modified file 'Template/NLO/SubProcesses/montecarlocounter.f'
907--- Template/NLO/SubProcesses/montecarlocounter.f 2017-12-16 08:06:58 +0000
908+++ Template/NLO/SubProcesses/montecarlocounter.f 2018-06-15 08:18:50 +0000
909@@ -19,7 +19,7 @@
910 logical notagluon,found
911 common/cnotagluon/notagluon
912 integer nglu,nsngl
913- logical isspecial,isspecial0
914+ logical isspecial(max_bcol)
915 common/cisspecial/isspecial
916 logical spec_case
917 c
918@@ -68,9 +68,9 @@
919
920 fksfather=min(i_fks,j_fks)
921
922-c isspecial will be set equal to .true. only if the father is a gluon,
923-c and another gluon will be found which is connected to it by both
924-c colour and anticolour
925+c isspecial will be set equal to .true. colour flow by colour flow only
926+c if the father is a gluon, and another gluon will be found which is
927+c connected to it by both colour and anticolour
928 isspecial=.false.
929 c
930 c consider only leading colour flows
931@@ -89,7 +89,6 @@
932 do i=1,max_bcol
933 if(.not.is_leading_cflow(i))cycle
934 c Loop over Born-level colour flows
935- isspecial0=.false.
936 c nglu and nsngl are the number of gluons (except for the father) and of
937 c colour singlets in the Born process, according to the information
938 c stored in ICOLUP
939@@ -178,19 +177,18 @@
940 stop
941 endif
942 colorflow(k0,colorflow(k0,0))=i
943- isspecial0=.true.
944+ isspecial(i)=.true.
945 endif
946 endif
947 enddo
948 endif
949 enddo
950 if( ((nglu+nsngl).gt.(nexternal-2)) .or.
951- # (isspecial0.and.(nglu+nsngl).ne.(nexternal-2)) )then
952+ # (isspecial(i).and.(nglu+nsngl).ne.(nexternal-2)) )then
953 write(*,*)'Error #4 in set_matrices'
954- write(*,*)isspecial0,nglu,nsngl
955+ write(*,*)isspecial(i),nglu,nsngl
956 stop
957 endif
958- isspecial=isspecial.or.isspecial0
959 enddo
960 call check_mc_matrices
961 return
962@@ -213,7 +211,7 @@
963 common/cfksfather/fksfather
964 logical notagluon
965 common/cnotagluon/notagluon
966- logical isspecial
967+ logical isspecial(max_bcol)
968 common/cisspecial/isspecial
969 logical is_leading_cflow(max_bcol)
970 integer num_leading_cflows
971@@ -275,8 +273,8 @@
972 c
973 if( (notagluon.and.ntot.ne.num_leading_cflows) .or.
974 # ( (.not.notagluon).and.
975- # ( (.not.isspecial).and.ntot.ne.(2*num_leading_cflows) .or.
976- # (isspecial.and.ntot.ne.num_leading_cflows) ) ) )then
977+ # ( (.not.isspecial(1)).and.ntot.ne.(2*num_leading_cflows) .or.
978+ # (isspecial(1).and.ntot.ne.num_leading_cflows) ) ) )then
979 write(*,*)'Error #6 in check_mc_matrices',
980 # notagluon,ntot,num_leading_cflows,max_bcol
981 stop
982@@ -429,7 +427,7 @@
983
984 integer ipartners(0:nexternal-1),colorflow(nexternal-1,0:max_bcol)
985 common /MC_info/ ipartners,colorflow
986- logical isspecial
987+ logical isspecial(max_bcol)
988 common/cisspecial/isspecial
989
990 integer fksfather
991@@ -633,7 +631,6 @@
992 c go --> go g
993 if(ileg.le.2)then
994 N_p=2
995- if(isspecial)N_p=1
996 if(limit)then
997 xkern(1)=(g**2/N_p)*8*vca*(1-x*(1-x))**2/(s*x**2)
998 xkernazi(1)=-(g**2/N_p)*16*vca*(1-x)**2/(s*x**2)
999@@ -650,7 +647,6 @@
1000 c
1001 elseif(ileg.eq.3)then
1002 N_p=2
1003- if(isspecial)N_p=1
1004 if(non_limit)then
1005 xfact=(2-(1-x)*(1-(kn0/kn)*yj))/kn*knbar*(1-x)*(1-yj)
1006 prefact=2/(s*N_p)
1007@@ -661,7 +657,6 @@
1008 c
1009 elseif(ileg.eq.4)then
1010 N_p=2
1011- if(isspecial)N_p=1
1012 if(limit)then
1013 xkern(1)=(g**2/N_p)*( 8*vca*
1014 & (s**2*(1-(1-x)*x)-s*(1+x)*xm12+xm12**2)**2 )/
1015@@ -697,7 +692,6 @@
1016 c
1017 elseif(ileg.eq.4)then
1018 N_p=2
1019- if(isspecial)N_p=1
1020 if(limit)then
1021 xkern(1)=(g**2/N_p)*( 4*vtf*(1-x)*
1022 & (s**2*(1-2*(1-x)*x)-2*s*x*xm12+xm12**2) )/
1023@@ -730,7 +724,6 @@
1024 c a --> a q
1025 if(ileg.le.2)then
1026 N_p=2
1027- if(isspecial)N_p=1
1028 if(limit)then
1029 xkern(1)=(g**2/N_p)*4*vcf*(1-x)*((1-x)**2+1)/(s*x**2)
1030 xkern(2)=xkern(1)*(g_ew**2/g**2)*(qi2/vcf)
1031@@ -925,8 +918,10 @@
1032 xkernazi(i)=xkernazi(i)*gfactazi*gfactsf*wcc
1033 enddo
1034 do cflows=1,colorflow(npartner,0)
1035- born_red=born_red+bornbars(colorflow(npartner,cflows))
1036- born_red_tilde=born_red_tilde+bornbarstilde(colorflow(npartner,cflows))
1037+ N_p=1
1038+ if(isspecial(cflows))N_p=2d0
1039+ born_red=born_red+N_p*bornbars(colorflow(npartner,cflows))
1040+ born_red_tilde=born_red_tilde+N_p*bornbarstilde(colorflow(npartner,cflows))
1041 enddo
1042 c Change here, to include also xkern(2)!
1043 xmcxsec(npartner)=xkern(1)*born_red+xkernazi(1)*born_red_tilde
1044@@ -1207,26 +1202,58 @@
1045
1046
1047 function gfunction(w,alpha,beta,delta)
1048-c Gets smoothly to 0 as w goes to 1
1049+c Gets smoothly to 0 as w goes to 1.
1050+c Call with
1051+c alpha > 1, or alpha < 0; if alpha < 0, gfunction = 1;
1052+c 0 < |beta| <= 1;
1053+c 0 < delta <= 2.
1054 implicit none
1055+ double precision tiny
1056+ parameter (tiny=1.d-5)
1057 double precision gfunction,alpha,beta,delta,w,wmin,wg,tt,tmp
1058-
1059- if(beta.lt.0d0)then
1060- wmin=0d0
1061- else
1062- wmin=max(0d0,1d0-delta)
1063- endif
1064- wg=min(1d0-(1-wmin)*abs(beta),0.99d0)
1065- tt=(abs(w)-wg)/(1d0-wg)
1066- if(tt.gt.1d0)then
1067- write(*,*)'Fatal error in gfunction',tt
1068- stop
1069- endif
1070+ logical firsttime
1071+ save firsttime
1072+ data firsttime /.true./
1073+ double precision cutoff,cutoff2
1074+ parameter(cutoff=1d0)
1075+ parameter(cutoff2=0.99d0)
1076+c
1077+c set cutoff < 1 and cutoff2 = cutoff in the final version
1078+c
1079+ if(firsttime)then
1080+ firsttime=.false.
1081+ if(alpha.ge.0d0.and.alpha.lt.1d0)then
1082+ write(*,*)'Incorrect alpha in gfunction',alpha
1083+ stop
1084+ endif
1085+ if(abs(beta).gt.1d0)then
1086+ write(*,*)'Incorrect beta in gfunction',beta
1087+ stop
1088+ endif
1089+ if(delta.gt.2d0.or.delta.le.0d0)then
1090+ write(*,*)'Incorrect delta in gfunction',delta
1091+ stop
1092+ endif
1093+ endif
1094+c
1095 tmp=1d0
1096 if(alpha.gt.0d0)then
1097- if(tt.gt.0d0.and.abs(w).lt.0.99d0)
1098- & tmp=(1-tt)**(2*alpha)/(tt**(2*alpha)+(1-tt)**(2*alpha))
1099- if(abs(w).ge.0.99d0)tmp=0d0
1100+ if(beta.lt.0d0)then
1101+ wmin=0d0
1102+ else
1103+ wmin=max(0d0,1d0-delta)
1104+ endif
1105+ wg=min(1d0-(1-wmin)*abs(beta),cutoff-tiny)
1106+ if(abs(w).gt.wg.and.abs(w).lt.cutoff2)then
1107+ tt=(abs(w)-wg)/(cutoff-wg)
1108+ if(tt.gt.1d0)then
1109+ write(*,*)'Fatal error in gfunction',tt
1110+ stop
1111+ endif
1112+ tmp=(1-tt)**(2*alpha)/(tt**(2*alpha)+(1-tt)**(2*alpha))
1113+ elseif(abs(w).ge.cutoff2)then
1114+ tmp=0d0
1115+ endif
1116 endif
1117 gfunction=tmp
1118 return
1119@@ -2600,6 +2627,7 @@
1120 subroutine assign_ref_scale(p,xii,sh,ref_sc)
1121 implicit none
1122 include "nexternal.inc"
1123+ include "madfks_mcatnlo.inc"
1124 double precision p(0:3,nexternal-1),xii,sh,ref_sc
1125 integer i_scale,i
1126 parameter(i_scale=1)
1127@@ -2619,7 +2647,7 @@
1128 stop
1129 endif
1130 c Safety threshold for the reference scale
1131- ref_sc=max(ref_sc,30d0)
1132+ ref_sc=max(ref_sc,scaleMClow+scaleMCdelta)
1133
1134 return
1135 end
1136
1137=== modified file 'UpdateNotes.txt'
1138--- UpdateNotes.txt 2018-04-29 13:58:31 +0000
1139+++ UpdateNotes.txt 2018-06-15 08:18:50 +0000
1140@@ -1,5 +1,33 @@
1141 Update notes for MadGraph5_aMC@NLO (in reverse time order)
1142
1143+2.6.3 (13/06/18)
1144+ OM: When importing model, we now run one additional layer of optimisation:
1145+ - if a vertex as two identical coupling for the same color structure then the associated lorentz
1146+ structure are merged in a single one and the vertex is modified accordingly
1147+ OM: When restricting a model, we also run one additional layer of optimisation
1148+ - Opposite sign coupling are now identified and merged into a single one
1149+ - if a vertex as two identical coupling (up to the sign) for the same color structure
1150+ then the associated lorentz structure are merged in a single one and the
1151+ vertex is modified accordingly
1152+ VH+OM: changing the ALOHA naming scheme for combine routine when the function name starts to be too long.
1153+ OM: adding a hidden parameter to the run_card (python_seed) to allow to control the randon number
1154+ generated within python and be able to have full reproducibility of the events
1155+ OM: Fixing some issue with the default dynamical scale choice for
1156+ - non minimal QED sample
1157+ - heft model when multiple radiation coming from the higgs decay/scattering
1158+ This can also impact MLM since it use the same definition for the dynamical scale
1159+ OM: Fix some issue for DIS scattering where the shat was wrongly defined for low energy scattering.
1160+ Low energy scattering are not adviced since they break the factorization theorem.
1161+ In particular the z-boost of the events are quite ill defined in that scenario.
1162+ OM: changing the format of the param_card for NLO model to match expectation from the latest PY8
1163+ OM: Update of MadSpin to allow special input file for the case of spinmode=none.
1164+ With that very simple mode of decay, you can now decay hepmc file or wrongly formatted leshouches event
1165+ (in that mode we do not have spin correlation and width effect)
1166+ PT: in montecarlocounter.f: improved colour-flow treatment in the case gluons are twice colour-connected to each other
1167+ new gfunction(w) to get smoothly to 0 as w -> 1. (for NLO+PS run)
1168+ OM: Fix some issue for the new QED model (including one in the handling of complex mass scheme of such model)
1169+ OM: Fixing an issue of the param_card out of sync when running compute-widths
1170+ OM: Adding Qnumbers block for ghost (the latest version of py8 was crashing due to their absence)
1171
1172 2.6.2 (29/04/18)
1173
1174
1175=== modified file 'VERSION'
1176--- VERSION 2018-04-29 13:58:31 +0000
1177+++ VERSION 2018-06-15 08:18:50 +0000
1178@@ -1,5 +1,5 @@
1179-version = 2.6.2
1180-date = 2018-04-29
1181+version = 2.6.3
1182+date = 2018-06-13
1183
1184
1185
1186
1187=== modified file 'aloha/aloha_writers.py'
1188--- aloha/aloha_writers.py 2018-04-11 15:28:05 +0000
1189+++ aloha/aloha_writers.py 2018-06-15 08:18:50 +0000
1190@@ -1177,7 +1177,7 @@
1191
1192 def get_routine_name(name=None, outgoing=None, tag=None, abstract=None):
1193 """ build the name of the aloha function """
1194-
1195+
1196 assert (name and outgoing is not None) or abstract
1197
1198 if tag is None:
1199@@ -1205,6 +1205,14 @@
1200 def combine_name(name, other_names, outgoing, tag=None, unknown_propa=False):
1201 """ build the name for combined aloha function """
1202
1203+ def myHash(target_string):
1204+ if len(target_string)<50:
1205+ return target_string
1206+ if '%(propa)s' in target_string:
1207+ return 'ALOHA_'+(str(hash(target_string.lower()))).replace('-','m')+'%(propa)s'
1208+ else:
1209+ return 'ALOHA_'+(str(hash(target_string.lower()))).replace('-','m')
1210+
1211 if tag and any(t.startswith('P') for t in tag[:-1]):
1212 # propagator need to be the last entry for the tag
1213 for i,t in enumerate(tag):
1214@@ -1238,9 +1246,11 @@
1215 if unknown_propa and outgoing:
1216 routine += '%(propa)s'
1217 if outgoing is not None:
1218- return routine +'_%s' % outgoing
1219+ return myHash(routine)+'_%s' % outgoing
1220+# return routine +'_%s' % outgoing
1221 else:
1222- return routine
1223+ return myHash(routine)
1224+# return routine
1225
1226 if tag is not None:
1227 addon = ''.join(tag)
1228@@ -1257,10 +1267,15 @@
1229 if unknown_propa:
1230 addon += '%(propa)s'
1231
1232+# if outgoing is not None:
1233+# return '_'.join((name,) + tuple(other_names)) + addon + '_%s' % outgoing
1234+# else:
1235+# return '_'.join((name,) + tuple(other_names)) + addon
1236+
1237 if outgoing is not None:
1238- return '_'.join((name,) + tuple(other_names)) + addon + '_%s' % outgoing
1239+ return myHash('_'.join((name,) + tuple(other_names))) + addon + '_%s' % outgoing
1240 else:
1241- return '_'.join((name,) + tuple(other_names)) + addon
1242+ return myHash('_'.join((name,) + tuple(other_names))) + addon
1243
1244 class ALOHAWriterForCPP(WriteALOHA):
1245 """Routines for writing out helicity amplitudes as C++ .h and .cc files."""
1246@@ -1736,7 +1751,7 @@
1247 # added to another file
1248 self.mode = 'no_include'
1249
1250- #name = combine_name(self.name, lor_names, offshell, self.tag)
1251+
1252
1253 #h_text = self.write_combined_h(lor_names, offshell, **opt)
1254 cc_text, h_text = StringIO() , StringIO()
1255
1256=== modified file 'aloha/create_aloha.py'
1257--- aloha/create_aloha.py 2018-04-26 18:04:25 +0000
1258+++ aloha/create_aloha.py 2018-06-15 08:18:50 +0000
1259@@ -470,8 +470,8 @@
1260 propaR = deltaL('pr1',id) * deltaL('pr2', 'I2') * delta('pr2', spin_id) * delta('pr1', 'I3')
1261 #numerator += "*deltaL('pr_1',id) * deltaL('pr_2', 'I2') * delta('pr_1', spin_id) * delta('pr_2', 'I3')"
1262 elif spin == 5 :
1263- tag = {'1': _spin2_mult + id, '2': 2 * _spin2_mult + id,
1264- '51': 'I2', '52': 'I3', 'id':id}
1265+ tag = {'1': _spin2_mult + id, '2': 'I2',
1266+ '51': 2 * _spin2_mult + id, '52': 'I3', 'id':id}
1267
1268 numerator = self.mod_propagator_expression(tag, numerator)
1269 if denominator:
1270@@ -938,7 +938,7 @@
1271 if self.has_key((lorentzname, outgoing)):
1272 self[(lorentzname, outgoing)].add_combine(list_l_name[1:])
1273 else:
1274- lorentz = eval('self.model.lorentz.%s' % lorentzname)
1275+ lorentz = eval('self.model.lorentz.%s' % list_l_name[0])
1276 assert lorentz.structure == 'external'
1277 else:
1278 l_lorentz = []
1279@@ -1240,7 +1240,6 @@
1280
1281 # avoid to add tag in global
1282 old_tag = set(aloha_lib.KERNEL.use_tag)
1283- print 'create lib',tag
1284 name, i = tag
1285 if name == "Spin2Prop":
1286 lib[('Spin2Prop',i)] = create( Spin2Propagator(_spin2_mult + i, \
1287
1288=== modified file 'madgraph/interface/amcatnlo_interface.py'
1289--- madgraph/interface/amcatnlo_interface.py 2016-09-01 09:44:05 +0000
1290+++ madgraph/interface/amcatnlo_interface.py 2018-06-15 08:18:50 +0000
1291@@ -384,7 +384,7 @@
1292 else:
1293 for diag_type, get_amps in get_amps_dict.items():
1294 self._curr_amps = get_amps()
1295- self.draw(' '.join(args[1:]), type=diag_type)
1296+ self.draw(' '.join(args[1:]), Dtype=diag_type)
1297 # set _curr_amps back to empty
1298 self._curr_amps = diagram_generation.AmplitudeList()
1299
1300@@ -402,7 +402,7 @@
1301 text += '\n\nReal diagrams:'
1302 text += '\n'.join(amp.nice_string() for amp in get_amps_dict['real']())
1303 text += '\n\nLoop diagrams:\n'
1304- text += '\n'.join(amp.nice_string() for amp in get_amps_dict['virt']())
1305+ text += '\n'.join(amp.nice_string() for amp in get_amps_dict['loop']())
1306 pydoc.pager(text)
1307
1308 # set _curr_amps back to empty
1309
1310=== modified file 'madgraph/interface/amcatnlo_run_interface.py'
1311--- madgraph/interface/amcatnlo_run_interface.py 2018-03-22 14:00:54 +0000
1312+++ madgraph/interface/amcatnlo_run_interface.py 2018-06-15 08:18:50 +0000
1313@@ -2058,7 +2058,7 @@
1314 """-1 12 ! points, iterations
1315 %(accuracy)s ! desired fractional accuracy
1316 1 -0.1 ! alpha, beta for Gsoft
1317- 1 -0.1 ! alpha, beta for Gazi
1318+-1 -0.1 ! alpha, beta for Gazi
1319 1 ! Suppress amplitude (0 no, 1 yes)?
1320 1 ! Exact helicity sum (0 yes, n = number/event)?
1321 %(channel)s ! Enter Configuration Number:
1322@@ -5325,7 +5325,7 @@
1323 cards.append('madspin_card.dat')
1324 if switch['reweight'] != 'OFF':
1325 cards.append('reweight_card.dat')
1326- if switch['madanalysis'] == 'HADRON':
1327+ if switch['madanalysis'] in ['HADRON', 'ON']:
1328 cards.append('madanalysis5_hadron_card.dat')
1329 if 'aMC@' in mode:
1330 cards.append('shower_card.dat')
1331
1332=== modified file 'madgraph/interface/common_run_interface.py'
1333--- madgraph/interface/common_run_interface.py 2018-04-28 21:38:38 +0000
1334+++ madgraph/interface/common_run_interface.py 2018-06-15 08:18:50 +0000
1335@@ -3338,11 +3338,12 @@
1336 line = 'compute_widths %s --path=%s' % (line, path)
1337 cmd.exec_cmd(line, model=model)
1338 interface.child = None
1339-
1340-
1341-
1342-
1343- raise Exception, 'fail to find a way to handle Auto width'
1344+ del cmd
1345+ return
1346+
1347+
1348+
1349+ raise Exception, 'fail to find a way to handle Auto width'
1350
1351
1352 def store_scan_result(self):
1353@@ -3388,6 +3389,7 @@
1354 os.remove(pjoin(self.me_dir,'RunWeb'))
1355 except Exception:
1356 pass
1357+
1358 try:
1359 self.store_result()
1360 except Exception:
1361@@ -3686,6 +3688,7 @@
1362 self.results.add_detail('cross', madspin_cmd.cross)#cross * madspin_cmd.branching_ratio)
1363 self.results.add_detail('error', madspin_cmd.error+ cross * madspin_cmd.err_branching_ratio)
1364 self.results.add_detail('run_mode', current['run_mode'])
1365+ self.to_store.append("event")
1366
1367 self.run_name = new_run
1368 self.banner = madspin_cmd.banner
1369@@ -5739,8 +5742,12 @@
1370
1371 fail_due_to_format = 0 #parameter to avoid infinite loop
1372 def postcmd(self, stop, line):
1373- ending_question = cmd.OneLinePathCompletion.postcmd(self,stop,line)
1374
1375+ if line not in [None, '0', 'done', '']:
1376+ ending_question = cmd.OneLinePathCompletion.postcmd(self,stop,line)
1377+ else:
1378+ ending_question = True
1379+
1380 if ending_question:
1381 self.check_card_consistency()
1382 if self.param_consistency:
1383@@ -6140,6 +6147,12 @@
1384
1385 def do_compute_widths(self, line):
1386 signal.alarm(0) # avoid timer if any
1387+
1388+ # ensure that the card is in sync
1389+ if 'param' in self.modified_card:
1390+ self.write_card('param')
1391+ self.modified_card.discard('param')
1392+
1393 path = self.paths['param']
1394 pattern = re.compile(r'''decay\s+(\+?\-?\d+)\s+auto(@NLO|)''',re.I)
1395 text = open(path).read()
1396@@ -6257,7 +6270,7 @@
1397 logger.info("add in the pythia8_card the parameter \"%s\" with value \"%s\"" % (name, value), '$MG:BOLD')
1398 elif len(args) > 0:
1399 if args[0] in self.cards:
1400- card = args[0]
1401+ card = args[0]
1402 elif "%s.dat" % args[0] in self.cards:
1403 card = "%s.dat" % args[0]
1404 elif "%s_card.dat" % args[0] in self.cards:
1405@@ -6267,7 +6280,11 @@
1406 else:
1407 logger.error("unknow card %s. Please retry." % args[0])
1408 return
1409-
1410+ # ensure that the card is in sync
1411+ if card in self.modified_card:
1412+ self.write_card(card)
1413+ self.modified_card.discard(card)
1414+
1415 if card in self.paths:
1416 path = self.paths[card]
1417 elif os.path.exists(card):
1418@@ -6431,6 +6448,12 @@
1419 """Running ASperGe"""
1420 signal.alarm(0) # avoid timer if any
1421
1422+ # ensure that the card is in sync
1423+ if 'param' in self.modified_card:
1424+ self.write_card('param')
1425+ self.modified_card.discard('param')
1426+
1427+
1428 path = pjoin(self.me_dir,'bin','internal','ufomodel','ASperGE')
1429 if not os.path.exists(path):
1430 logger.error('ASperge has not been detected in the current model, therefore it will not be run.')
1431@@ -6541,8 +6564,8 @@
1432
1433 if answer in self.modified_card:
1434 self.write_card(answer)
1435- elif answer.replace('_card.dat','') in self.modified_card:
1436- self.write_card(answer.replace('_card.dat',''))
1437+ elif os.path.basename(answer.replace('_card.dat','')) in self.modified_card:
1438+ self.write_card(os.path.basename(answer.replace('_card.dat','')))
1439
1440 try:
1441 self.mother_interface.exec_cmd('open %s' % path)
1442@@ -6613,7 +6636,7 @@
1443 """ This is a decorator for customizing/using scan over the param_card (or technically other)
1444 This should be use like this:
1445
1446- @scanhandling(arguments)
1447+ @scanparamcardhandling(arguments)
1448 def run_launch(self, *args, **opts)
1449
1450 possible arguments are listed above and should be function who takes a single
1451@@ -6715,7 +6738,7 @@
1452 #param_card_iterator.write(card_path) #-> this is done by the with statement
1453 name = misc.get_scan_name(orig_name, next_name)
1454 path = result_path(obj) % name
1455- logger.info("write all cross-section results in %s" % path ,'$MG:BOLD')
1456+ logger.info("write scan results in %s" % path ,'$MG:BOLD')
1457 order = summaryorder(obj)()
1458 param_card_iterator.write_summary(path, order=order)
1459 return new_fct
1460
1461=== modified file 'madgraph/interface/extended_cmd.py'
1462--- madgraph/interface/extended_cmd.py 2018-03-23 16:46:49 +0000
1463+++ madgraph/interface/extended_cmd.py 2018-06-15 08:18:50 +0000
1464@@ -2350,6 +2350,8 @@
1465 color_for_XXXX(value) -> return the representation on the screen for value
1466 get_cardcmd_for_XXXX(value)> return the command to run to customize the cards to
1467 match the status
1468+ print_options_XXXX() -> return the text to disply below "other options"
1469+ default is other possible value (ordered correctly)
1470
1471 consistency_XX_YY(val_XX, val_YY)
1472 -> XX is the new key set by the user to a new value val_XX
1473@@ -2553,6 +2555,12 @@
1474 value = self.get_allowed(base)[cur+1]
1475 except IndexError:
1476 value = self.get_allowed(base)[0]
1477+ if value == "OFF" and cur == 0:
1478+ logger.warning("Invalid action: %s" % self.print_options(base))
1479+ elif cur == 0:
1480+ logger.warning("Can not change value for this parameter")
1481+
1482+
1483 elif line in ['', 'done', 'EOF', 'eof','0']:
1484 super(ControlSwitch, self).default(line)
1485 return self.answer
1486@@ -2823,10 +2831,10 @@
1487 else:
1488 return self.red % switch_value
1489
1490- def print_info(self,key):
1491+ def print_options(self,key, keep_default=False):
1492
1493- if hasattr(self, 'print_info_%s' % key):
1494- return getattr(self, 'print_info_%s' % key)
1495+ if hasattr(self, 'print_options_%s' % key) and not keep_default:
1496+ return getattr(self, 'print_options_%s' % key)()
1497
1498 #re-order the options in order to have those in cycling order
1499 try:
1500@@ -3087,7 +3095,7 @@
1501 to_display = self.switch[key]
1502 if len(to_display) > max_len_switch: max_len_switch=len(to_display)
1503
1504- info = self.print_info(key)
1505+ info = self.print_options(key)
1506 if len(info)> max_len_add_info: max_len_add_info = len(info)
1507
1508 if self.get_allowed(key):
1509@@ -3115,7 +3123,7 @@
1510 'descrip': descrip,
1511 'name': key,
1512 'switch': self.color_for_value(key,self.switch[key]),
1513- 'add_info': self.print_info(key),
1514+ 'add_info': self.print_options(key),
1515 'switch_nc': self.switch[key],
1516 'strike_switch': u'\u0336'.join(' %s ' %self.switch[key].upper()) + u'\u0336',
1517 }
1518
1519=== modified file 'madgraph/interface/madevent_interface.py'
1520--- madgraph/interface/madevent_interface.py 2018-04-26 14:24:04 +0000
1521+++ madgraph/interface/madevent_interface.py 2018-06-15 08:18:50 +0000
1522@@ -530,6 +530,8 @@
1523 if options['delphes_path']:
1524 if 'PY6' in self.available_module or 'PY8' in self.available_module:
1525 self.available_module.add('Delphes')
1526+ else:
1527+ logger.warning("Delphes program installed but no parton shower module detected.\n Please install pythia8")
1528 if not MADEVENT or ('mg5_path' in options and options['mg5_path']):
1529 self.available_module.add('MadSpin')
1530 if misc.has_f2py() or options['f2py_compiler']:
1531@@ -658,7 +660,7 @@
1532 self.switch['detector'] = 'Delphes'
1533 elif self.get_allowed_detector():
1534 self.switch['detector'] = 'OFF'
1535- else:
1536+ else:
1537 self.switch['detector'] = 'Not Avail.'
1538
1539 # old mode to activate pgs
1540@@ -850,7 +852,7 @@
1541 if 'reweight' not in self.available_module:
1542 self.allowed_reweight = []
1543 return
1544- self.allowed_reweight = ['ON', 'OFF']
1545+ self.allowed_reweight = ['OFF', 'ON']
1546
1547 # check for plugin mode
1548 plugin_path = self.mother_interface.plugin_path
1549@@ -5573,6 +5575,14 @@
1550 break
1551 else:
1552 self.random = random.randint(1, 30107)
1553+
1554+ #set random seed for python part of the code
1555+ if self.run_card['python_seed'] == -2: #-2 means same as run_card
1556+ import random
1557+ random.seed(self.random)
1558+ elif self.run_card['python_seed'] >= 0:
1559+ import random
1560+ random.seed(self.run_card['python_seed'])
1561
1562 if self.run_card['ickkw'] == 2:
1563 logger.info('Running with CKKW matching')
1564@@ -5812,7 +5822,10 @@
1565 if self.random > 30081*30081: # can't use too big random number
1566 raise MadGraph5Error,\
1567 'Random seed too large ' + str(self.random) + ' > 30081*30081'
1568-
1569+ if self.run_card['python_seed'] == -2:
1570+ import random
1571+ random.seed(self.random)
1572+
1573 ############################################################################
1574 def save_random(self):
1575 """save random number in appropirate file"""
1576
1577=== modified file 'madgraph/interface/madgraph_interface.py'
1578--- madgraph/interface/madgraph_interface.py 2018-04-29 12:51:30 +0000
1579+++ madgraph/interface/madgraph_interface.py 2018-06-15 08:18:50 +0000
1580@@ -2782,11 +2782,11 @@
1581 'gauge','lorentz', 'brs', 'cms']
1582 _import_formats = ['model_v4', 'model', 'proc_v4', 'command', 'banner']
1583 _install_opts = ['Delphes', 'MadAnalysis4', 'ExRootAnalysis',
1584- 'update', 'Golem95', 'PJFry', 'QCDLoop', 'maddm']
1585+ 'update', 'Golem95', 'PJFry', 'QCDLoop', 'maddm', 'maddump']
1586
1587 # The targets below are installed using the HEPToolsInstaller.py script
1588 _advanced_install_opts = ['pythia8','zlib','boost','lhapdf6','lhapdf5','collier',
1589- 'hepmc','mg5amc_py8_interface','ninja','oneloop','MadAnalysis5','MadAnalysis']
1590+ 'hepmc','mg5amc_py8_interface','ninja','oneloop','MadAnalysis5']
1591
1592 _install_opts.extend(_advanced_install_opts)
1593
1594@@ -5801,7 +5801,7 @@
1595 # Return true for successful installation
1596 return True
1597
1598- install_plugin = ['maddm']
1599+ install_plugin = ['maddm', 'maddump']
1600 install_ad = {'pythia-pgs':['arXiv:0603175'],
1601 'Delphes':['arXiv:1307.6346'],
1602 'Delphes2':['arXiv:0903.2225'],
1603@@ -5819,7 +5819,9 @@
1604 'MadAnalysis':['arXiv:1206.1599'],
1605 'collier':['arXiv:1604.06792'],
1606 'oneloop':['arXiv:1007.4716'],
1607- 'maddm':['arXiv:1505.04190']}
1608+ 'maddm':['arXiv:1505.04190'],
1609+ 'maddump':['arXiv:1806.xxxxx']}
1610+
1611 install_server = ['http://madgraph.phys.ucl.ac.be/package_info.dat',
1612 'http://madgraph.physics.illinois.edu/package_info.dat']
1613 install_name = {'td_mac': 'td', 'td_linux':'td', 'Delphes2':'Delphes',
1614@@ -5869,6 +5871,7 @@
1615 # logger.info('{:^80}'.format("-"*70), '$MG:BOLD')
1616 logger.info(" You are installing '%s', please cite ref(s): \033[92m%s\033[0m. " % (args[0], ', '.join(advertisements[args[0]])), '$MG:BOLD')
1617
1618+ source = None
1619 # Load file with path of the different program:
1620 import urllib
1621 if paths:
1622@@ -5916,15 +5919,16 @@
1623
1624 if args[0] == 'Delphes':
1625 args[0] = 'Delphes3'
1626- if args[0] == 'MadAnalysis4':
1627- args[0] = 'MadAnalysis'
1628+
1629
1630 try:
1631 name = self.install_name
1632 name = name[args[0]]
1633 except KeyError:
1634 name = args[0]
1635-
1636+ if args[0] == 'MadAnalysis4':
1637+ args[0] = 'MadAnalysis'
1638+
1639 if args[0] in self._advanced_install_opts:
1640 # Now launch the advanced installation of the tool args[0]
1641 # path['HEPToolsInstaller'] is the online adress where to downlaod
1642@@ -5962,6 +5966,23 @@
1643 except Exception:
1644 pass
1645
1646+ if args[0] not in path:
1647+ if not source:
1648+ if index ==1:
1649+ othersource = 'ucl'
1650+ else:
1651+ othersource = 'uiuc'
1652+ # try with the mirror
1653+ misc.sprint('try other mirror', othersource, ' '.join(args))
1654+ return self.do_install('%s --source=%s' % (' '.join(args), othersource),
1655+ paths, additional_options)
1656+ else:
1657+ if 'xxx' in advertisements[name][0]:
1658+ logger.warning("Program not yet released. Please try later")
1659+ else:
1660+ raise Exception, "Online server are corrupted. No tarball available for %s" % name
1661+ return
1662+
1663 # Load that path
1664 logger.info('Downloading %s' % path[args[0]])
1665 misc.wget(path[args[0]], '%s.tgz' % name, cwd=MG5DIR)
1666@@ -6127,7 +6148,7 @@
1667 ff.close()
1668 import stat
1669 os.chmod(pjoin(MG5DIR, 'bin', '%s.py' % name), stat.S_IRWXU)
1670- logger.info('To use this module, you need to quite MG5aMC and run the executable bin/%s.py' % name)
1671+ logger.info('To use this module, you need to quit MG5aMC and run the executable bin/%s.py' % name)
1672 status=0
1673
1674 elif logger.level <= logging.INFO:
1675@@ -6193,7 +6214,7 @@
1676 if sys.platform == "darwin":
1677 logger.info('Downloading TD for Mac')
1678 target = 'http://madgraph.phys.ucl.ac.be/Downloads/td_mac_intel.tar.gz'
1679- misc.wget(target, 'tg.tgz', cwd=pjoin(MG5DIR,'td'))
1680+ misc.wget(target, 'td.tgz', cwd=pjoin(MG5DIR,'td'))
1681 misc.call(['tar', '-xzpvf', 'td.tgz'],
1682 cwd=pjoin(MG5DIR,'td'))
1683 files.mv(MG5DIR + '/td/td_mac_intel',MG5DIR+'/td/td')
1684@@ -6235,6 +6256,8 @@
1685 files.cp(pjoin(card_dir,'delphes_card_ATLAS.tcl'),
1686 pjoin(MG5DIR,'Template', 'Common', 'Cards', 'delphes_card_ATLAS.dat'))
1687
1688+ if not self.options['pythia-pgs_path'] and not self.options['pythia8_path']:
1689+ logger.warning("We noticed that no parton-shower module are installed/linked. \n In order to use Delphes from MG5aMC please install/link pythia8.")
1690
1691 #reset the position of the executable
1692 options_name = {'Delphes': 'delphes_path',
1693
1694=== modified file 'madgraph/interface/reweight_interface.py'
1695--- madgraph/interface/reweight_interface.py 2018-04-20 08:32:29 +0000
1696+++ madgraph/interface/reweight_interface.py 2018-06-15 08:18:50 +0000
1697@@ -467,6 +467,8 @@
1698 if not self.has_standalone_dir:
1699 if self.rwgt_dir and os.path.exists(pjoin(self.rwgt_dir,'rw_me','rwgt.pkl')):
1700 self.load_from_pickle()
1701+ if opts['rwgt_name']:
1702+ self.options['rwgt_name'] = opts['rwgt_name']
1703 if not self.rwgt_dir:
1704 self.me_dir = self.rwgt_dir
1705 self.load_module() # load the fortran information from the f2py module
1706
1707=== modified file 'madgraph/iolibs/export_v4.py'
1708--- madgraph/iolibs/export_v4.py 2018-04-24 10:26:54 +0000
1709+++ madgraph/iolibs/export_v4.py 2018-06-15 08:18:50 +0000
1710@@ -1952,6 +1952,18 @@
1711 self.make_model_symbolic_link()
1712
1713 #===========================================================================
1714+ # write a procdef_mg5 (an equivalent of the MG4 proc_card.dat)
1715+ #===========================================================================
1716+ def write_procdef_mg5(self, file_pos, modelname, process_str):
1717+ """ write an equivalent of the MG4 proc_card in order that all the Madevent
1718+ Perl script of MadEvent4 are still working properly for pure MG5 run.
1719+ Not needed for StandAlone so just return
1720+ """
1721+
1722+ return
1723+
1724+
1725+ #===========================================================================
1726 # Make the Helas and Model directories for Standalone directory
1727 #===========================================================================
1728 def make(self):
1729@@ -5395,8 +5407,8 @@
1730 self.params_dep = [] # (name, expression, type)
1731 self.params_indep = [] # (name, expression, type)
1732 self.params_ext = [] # external parameter
1733- self.p_to_f = parsers.UFOExpressionParserFortran()
1734- self.mp_p_to_f = parsers.UFOExpressionParserMPFortran()
1735+ self.p_to_f = parsers.UFOExpressionParserFortran(self.model)
1736+ self.mp_p_to_f = parsers.UFOExpressionParserMPFortran(self.model)
1737
1738 def pass_parameter_to_case_insensitive(self):
1739 """modify the parameter if some of them are identical up to the case"""
1740@@ -6173,7 +6185,8 @@
1741 # already handle by default
1742 if fct.name not in ["complexconjugate", "re", "im", "sec",
1743 "csc", "asec", "acsc", "theta_function", "cond",
1744- "condif", "reglogp", "reglogm", "reglog", "recms", "arg", "cot"]:
1745+ "condif", "reglogp", "reglogm", "reglog", "recms", "arg", "cot",
1746+ "grreglog","regsqrt"]:
1747 additional_fct.append(fct.name)
1748
1749
1750@@ -6185,6 +6198,8 @@
1751 double complex reglogm
1752 double complex recms
1753 double complex arg
1754+ double complex grreglog
1755+ double complex regsqrt
1756 %s
1757 """ % "\n".join([" double complex %s" % i for i in additional_fct]))
1758
1759@@ -6197,6 +6212,8 @@
1760 %(complex_mp_format)s mp_reglogm
1761 %(complex_mp_format)s mp_recms
1762 %(complex_mp_format)s mp_arg
1763+ %(complex_mp_format)s mp_grreglog
1764+ %(complex_mp_format)s mp_regsqrt
1765 %(additional)s
1766 """ %\
1767 {"additional": "\n".join([" %s mp_%s" % (self.mp_complex_format, i) for i in additional_fct]),
1768@@ -6285,6 +6302,62 @@
1769 endif
1770 endif
1771 end
1772+
1773+ double complex function regsqrt(arg_in)
1774+ implicit none
1775+ double complex arg_in
1776+ double complex arg
1777+ arg=arg_in
1778+ if(dabs(dimag(arg)).eq.0.0d0)then
1779+ arg=dcmplx(dble(arg),0.0d0)
1780+ endif
1781+ if(dabs(dble(arg)).eq.0.0d0)then
1782+ arg=dcmplx(0.0d0,dimag(arg))
1783+ endif
1784+ regsqrt=sqrt(arg)
1785+ end
1786+
1787+ double complex function grreglog(logsw,expr1_in,expr2_in)
1788+ implicit none
1789+ double complex TWOPII
1790+ parameter (TWOPII=2.0d0*3.1415926535897932d0*(0.0d0,1.0d0))
1791+ double complex expr1_in,expr2_in
1792+ double complex expr1,expr2
1793+ double precision logsw
1794+ double precision imagexpr
1795+ logical firstsheet
1796+ expr1=expr1_in
1797+ expr2=expr2_in
1798+ if(dabs(dimag(expr1)).eq.0.0d0)then
1799+ expr1=dcmplx(dble(expr1),0.0d0)
1800+ endif
1801+ if(dabs(dble(expr1)).eq.0.0d0)then
1802+ expr1=dcmplx(0.0d0,dimag(expr1))
1803+ endif
1804+ if(dabs(dimag(expr2)).eq.0.0d0)then
1805+ expr2=dcmplx(dble(expr2),0.0d0)
1806+ endif
1807+ if(dabs(dble(expr2)).eq.0.0d0)then
1808+ expr2=dcmplx(0.0d0,dimag(expr2))
1809+ endif
1810+ if(expr1.eq.(0.0d0,0.0d0))then
1811+ grreglog=(0.0d0,0.0d0)
1812+ else
1813+ imagexpr=dimag(expr1)*dimag(expr2)
1814+ firstsheet=imagexpr.ge.0.0d0
1815+ firstsheet=firstsheet.or.dble(expr1).ge.0.0d0
1816+ firstsheet=firstsheet.or.dble(expr2).ge.0.0d0
1817+ if(firstsheet)then
1818+ grreglog=log(expr1)
1819+ else
1820+ if(dimag(expr1).gt.0.0d0)then
1821+ grreglog=log(expr1) - logsw*TWOPII
1822+ else
1823+ grreglog=log(expr1) + logsw*TWOPII
1824+ endif
1825+ endif
1826+ endif
1827+ end
1828
1829 double complex function arg(comnum)
1830 implicit none
1831@@ -6375,6 +6448,63 @@
1832 endif
1833 endif
1834 end
1835+
1836+ %(complex_mp_format)s function mp_regsqrt(arg_in)
1837+ implicit none
1838+ %(complex_mp_format)s arg_in
1839+ %(complex_mp_format)s arg
1840+ arg=arg_in
1841+ if(abs(imagpart(arg)).eq.0.0e0_16)then
1842+ arg=cmplx(real(arg,kind=16),0.0e0_16)
1843+ endif
1844+ if(abs(real(arg,kind=16)).eq.0.0e0_16)then
1845+ arg=cmplx(0.0e0_16,imagpart(arg))
1846+ endif
1847+ mp_regsqrt=sqrt(arg)
1848+ end
1849+
1850+
1851+ %(complex_mp_format)s function mp_grreglog(logsw,expr1_in,expr2_in)
1852+ implicit none
1853+ %(complex_mp_format)s TWOPII
1854+ parameter (TWOPII=2.0e0_16*3.14169258478796109557151794433593750e0_16*(0.0e0_16,1.0e0_16))
1855+ %(complex_mp_format)s expr1_in,expr2_in
1856+ %(complex_mp_format)s expr1,expr2
1857+ %(real_mp_format)s logsw
1858+ %(real_mp_format)s imagexpr
1859+ logical firstsheet
1860+ expr1=expr1_in
1861+ expr2=expr2_in
1862+ if(abs(imagpart(expr1)).eq.0.0e0_16)then
1863+ expr1=cmplx(real(expr1,kind=16),0.0e0_16)
1864+ endif
1865+ if(abs(real(expr1,kind=16)).eq.0.0e0_16)then
1866+ expr1=cmplx(0.0e0_16,imagpart(expr1))
1867+ endif
1868+ if(abs(imagpart(expr2)).eq.0.0e0_16)then
1869+ expr2=cmplx(real(expr2,kind=16),0.0e0_16)
1870+ endif
1871+ if(abs(real(expr2,kind=16)).eq.0.0e0_16)then
1872+ expr2=cmplx(0.0e0_16,imagpart(expr2))
1873+ endif
1874+ if(expr1.eq.(0.0e0_16,0.0e0_16))then
1875+ mp_grreglog=(0.0e0_16,0.0e0_16)
1876+ else
1877+ imagexpr=imagpart(expr1)*imagpart(expr2)
1878+ firstsheet=imagexpr.ge.0.0e0_16
1879+ firstsheet=firstsheet.or.real(expr1,kind=16).ge.0.0e0_16
1880+ firstsheet=firstsheet.or.real(expr2,kind=16).ge.0.0e0_16
1881+ if(firstsheet)then
1882+ mp_grreglog=log(expr1)
1883+ else
1884+ if(imagpart(expr1).gt.0.0e0_16)then
1885+ mp_grreglog=log(expr1) - logsw*TWOPII
1886+ else
1887+ mp_grreglog=log(expr1) + logsw*TWOPII
1888+ endif
1889+ endif
1890+ endif
1891+ end
1892
1893 %(complex_mp_format)s function mp_arg(comnum)
1894 implicit none
1895@@ -6386,7 +6516,7 @@
1896 else
1897 mp_arg=log(comnum/abs(comnum))/imm
1898 endif
1899- end"""%{'complex_mp_format':self.mp_complex_format})
1900+ end"""%{'complex_mp_format':self.mp_complex_format,'real_mp_format':self.mp_real_format})
1901
1902
1903 #check for the file functions.f
1904@@ -6404,7 +6534,8 @@
1905 for fct in ufo_fct:
1906 # already handle by default
1907 if fct.name not in ["complexconjugate", "re", "im", "sec", "csc", "asec", "acsc", "condif",
1908- "theta_function", "cond", "reglog", "reglogp", "reglogm", "recms","arg"]:
1909+ "theta_function", "cond", "reglog", "reglogp", "reglogm", "recms","arg",
1910+ "grreglog","regsqrt"]:
1911 ufo_fct_template = """
1912 double complex function %(name)s(%(args)s)
1913 implicit none
1914@@ -6440,7 +6571,8 @@
1915 for fct in ufo_fct:
1916 # already handle by default
1917 if fct.name not in ["complexconjugate", "re", "im", "sec", "csc", "asec", "acsc","condif",
1918- "theta_function", "cond", "reglog", "reglogp","reglogm", "recms","arg"]:
1919+ "theta_function", "cond", "reglog", "reglogp","reglogm", "recms","arg",
1920+ "grreglog","regsqrt"]:
1921 ufo_fct_template = """
1922 %(complex_mp_format)s function mp_%(name)s(mp__%(args)s)
1923 implicit none
1924
1925=== modified file 'madgraph/iolibs/file_writers.py'
1926--- madgraph/iolibs/file_writers.py 2018-01-18 15:06:40 +0000
1927+++ madgraph/iolibs/file_writers.py 2018-06-15 08:18:50 +0000
1928@@ -393,11 +393,11 @@
1929 splitline = line.split('\'')
1930 i = 0
1931 while i < len(splitline):
1932- if i % 2 == 1:
1933+ if i % 2 == 1:
1934 # This is a quote - check for escaped \'s
1935 while splitline[i] and splitline[i][-1] == '\\':
1936 splitline[i] = splitline[i] + '\'' + splitline.pop(i + 1)
1937- i = i + 1
1938+ i = i + 1
1939 return len(splitline)-1
1940
1941 #===============================================================================
1942@@ -411,7 +411,7 @@
1943 fct_names should be a list of functions to remove
1944 """
1945
1946- f77_type = ['real*8', 'integer', 'double precision']
1947+ f77_type = ['real*8', 'integer', 'double precision', 'logical']
1948 pattern = re.compile('^\s+(?:SUBROUTINE|(?:%(type)s)\s+function)\s+([a-zA-Z]\w*)' \
1949 % {'type':'|'.join(f77_type)}, re.I)
1950
1951
1952=== modified file 'madgraph/iolibs/files.py'
1953--- madgraph/iolibs/files.py 2018-03-17 00:04:34 +0000
1954+++ madgraph/iolibs/files.py 2018-06-15 08:18:50 +0000
1955@@ -137,6 +137,7 @@
1956 try:
1957 shutil.copy(path1, path2)
1958 except IOError, why:
1959+ import madgraph.various.misc as misc
1960 try:
1961 if os.path.exists(path2):
1962 path2 = os.path.join(path2, os.path.split(path1)[1])
1963@@ -146,6 +147,8 @@
1964 raise
1965 if log:
1966 logger.warning(why)
1967+ else:
1968+ misc.sprint("fail to cp", why)
1969 except shutil.Error:
1970 # idetical file
1971 pass
1972
1973=== modified file 'madgraph/iolibs/template_files/matrix_standalone_splitOrders_v4.inc'
1974--- madgraph/iolibs/template_files/matrix_standalone_splitOrders_v4.inc 2017-07-31 22:08:40 +0000
1975+++ madgraph/iolibs/template_files/matrix_standalone_splitOrders_v4.inc 2018-06-15 08:18:50 +0000
1976@@ -109,7 +109,7 @@
1977 C
1978 INTEGER NHEL(NEXTERNAL,NCOMB)
1979 %(helicity_lines)s
1980- COMMON/%(proc_prefix)sBORN_HEL_CONFIGS/NHEL
1981+ COMMON/%(proc_prefix)sPROCESS_NHEL/NHEL
1982
1983 INTEGER USERHEL
1984 DATA USERHEL/-1/
1985@@ -357,7 +357,7 @@
1986 C GLOBALS
1987 C
1988 INTEGER HELC(NEXTERNAL,NCOMB)
1989- COMMON/%(proc_prefix)sBORN_HEL_CONFIGS/HELC
1990+ COMMON/%(proc_prefix)sPROCESS_NHEL/HELC
1991
1992 INTEGER POLARIZATIONS(0:NEXTERNAL,0:5)
1993 COMMON/%(proc_prefix)sBORN_BEAM_POL/POLARIZATIONS
1994
1995=== modified file 'madgraph/iolibs/template_files/matrix_standalone_v4.inc'
1996--- madgraph/iolibs/template_files/matrix_standalone_v4.inc 2017-07-31 22:08:40 +0000
1997+++ madgraph/iolibs/template_files/matrix_standalone_v4.inc 2018-06-15 08:18:50 +0000
1998@@ -275,7 +275,7 @@
1999 C GLOBALS
2000 C
2001 INTEGER HELC(NEXTERNAL,NCOMB)
2002- COMMON/%(proc_prefix)sBORN_HEL_CONFIGS/HELC
2003+ COMMON/%(proc_prefix)sPROCESS_NHEL/HELC
2004
2005 INTEGER POLARIZATIONS(0:NEXTERNAL,0:5)
2006 COMMON/%(proc_prefix)sBORN_BEAM_POL/POLARIZATIONS
2007
2008=== modified file 'madgraph/iolibs/ufo_expression_parsers.py'
2009--- madgraph/iolibs/ufo_expression_parsers.py 2018-04-24 19:44:41 +0000
2010+++ madgraph/iolibs/ufo_expression_parsers.py 2018-06-15 08:18:50 +0000
2011@@ -65,7 +65,7 @@
2012 # List of tokens and literals
2013 tokens = (
2014 'LOGICAL','LOGICALCOMB','POWER', 'CSC', 'SEC', 'ACSC', 'ASEC', 'TAN', 'ATAN',
2015- 'SQRT', 'CONJ', 'RE', 'RE2', 'IM', 'PI', 'COMPLEX', 'FUNCTION', 'IF','ELSE',
2016+ 'SQRT', 'BUILTIN', 'CONJ', 'RE', 'RE2', 'IM', 'PI', 'COMPLEX', 'FUNCTION', 'IF','ELSE',
2017 'VARIABLE', 'NUMBER','COND','REGLOG', 'REGLOGP', 'REGLOGM','RECMS','ARG'
2018 )
2019 literals = "=+-*/(),"
2020@@ -129,6 +129,9 @@
2021 def t_CONJ(self, t):
2022 r'complexconjugate'
2023 return t
2024+ def t_BUILTIN(self, t):
2025+ r'(?<!\w)abs|bool|float|int|min|max(?=\()'
2026+ return t
2027 def t_IM(self, t):
2028 r'(?<!\w)im(?=\()'
2029 return t
2030@@ -200,6 +203,7 @@
2031 ('right','CONJ'),
2032 ('right','RE'),
2033 ('right','IM'),
2034+ ('right', 'BUILTIN'),
2035 ('right','FUNCTION'),
2036 ('right','COMPLEX'),
2037 ('right','COND'),
2038@@ -293,6 +297,14 @@
2039 Fortran-style code."""
2040
2041
2042+ builtin_equiv = {'abs': 'ABS',
2043+ 'bool': 'LOGICAL',
2044+ 'float': 'REAL',
2045+ #'complex': 'COMPLEX', handle separatly
2046+ 'int': 'INTEGER',
2047+ 'min': 'MIN',
2048+ 'max': 'MAX'
2049+ }
2050
2051 # The following parser expressions need to be defined for each
2052 # output language/framework
2053@@ -305,9 +317,15 @@
2054 '<':'.LT.',
2055 'or':'.OR.',
2056 'and':'.AND.'}
2057+
2058+ types_def = { bool: lambda v: v ,
2059+ int :lambda v: 'INT(%s)' % v ,
2060+ float: lambda v: 'DBLE(%s)' % v,
2061+ complex: lambda v: 'DCMPLX(%s)' % v }
2062
2063- def __init__(self, *args, **opts):
2064+ def __init__(self, model, *args, **opts):
2065 """ """
2066+ self.model = model
2067 out = super(UFOExpressionParserFortran,self).__init__(*args, **opts)
2068 self.to_define = set()
2069
2070@@ -321,6 +339,7 @@
2071
2072 def p_expression_number(self, p):
2073 "expression : NUMBER"
2074+
2075 if p[1].endswith('j'):
2076 p[0] = ('DCMPLX(0d0, %e)' % float(p[1][:-1])).replace('e', 'd')
2077 else:
2078@@ -382,7 +401,8 @@
2079 | REGLOGP group
2080 | REGLOGM group
2081 | TAN group
2082- | ATAN group'''
2083+ | ATAN group
2084+ | BUILTIN group'''
2085
2086 if p[1] == 'csc': p[0] = '1d0/sin' + p[2]
2087 elif p[1] == 'sec': p[0] = '1d0/cos' + p[2]
2088@@ -398,9 +418,96 @@
2089 elif p[1] == 'reglog': p[0] = 'reglog(DCMPLX' + p[2] +')'
2090 elif p[1] == 'reglogp': p[0] = 'reglogp(DCMPLX' + p[2] + ')'
2091 elif p[1] == 'reglogm': p[0] = 'reglogm(DCMPLX' + p[2] + ')'
2092+ elif p[1] in self.builtin_equiv: p[0] = self.builtin_equiv[p[1]] + p[2]
2093
2094 if p[1] in ['reglog', 'reglogp', 'reglogm']:
2095 self.to_define.add(p[1])
2096+
2097+ def create_modelfct(self):
2098+ self.modelfct = dict([(f.name,f) for f in self.model.get('functions')])
2099+
2100+ def p_expression_function1(self, p):
2101+ "expression : FUNCTION '(' expression ')'"
2102+ p1 = p[1]
2103+ re_groups = self.re_cmath_function.match(p1)
2104+ if re_groups:
2105+ p1 = re_groups.group("name")
2106+ p[0] = p1 + '(' + p[3] + ')'
2107+ else:
2108+ if not hasattr(self, 'modelfct'):
2109+ self.create_modelfct()
2110+ if p1 in self.modelfct:
2111+ if not hasattr(self.modelfct[p1], 'argstype') or not self.modelfct[p1].argstype:
2112+ types = [self.types_def[complex] for _ in self.modelfct[p1].arguments]
2113+ else:
2114+ types = [self.types_def[t] for t in self.modelfct[p1].argstype]
2115+
2116+ p[0] = p1 + '(' + types[0](p[3]) + ')'
2117+ else:
2118+ p[0] = p1 + '(' + p[3] + ')'
2119+
2120+
2121+ def p_expression_function2(self, p):
2122+ '''expression : FUNCTION '(' expression ',' expression ')'
2123+ | FUNCTION '(' boolexpression ',' expression ')' '''
2124+
2125+ p1 = p[1]
2126+ re_groups = self.re_cmath_function.match(p1)
2127+ if re_groups:
2128+ p1 = re_groups.group("name")
2129+ p[0] = p1 + '(' + p[3] + ',' + p[5] + ')'
2130+ else:
2131+ if not hasattr(self, 'modelfct'):
2132+ self.create_modelfct()
2133+ if p1 in self.modelfct:
2134+ if not hasattr(self.modelfct[p1], 'argstype') or not self.modelfct[p1].argstype:
2135+ p[0] = p1 + '(' + p[3] + ',' + p[5] + ')'
2136+ else:
2137+ types = [self.types_def[t] for t in self.modelfct[p1].argstype]
2138+
2139+ p[0] = p1 + '(' + types[0](p[3]) + ',' + types[1](p[5]) + ')'
2140+ else:
2141+ p[0] = p1 + '(' + p[3] + ',' + p[5] + ')'
2142+
2143+ def p_expression_function3(self, p):
2144+ "expression : FUNCTION '(' expression ',' expression ',' expression ')'"
2145+ p1 = p[1]
2146+ re_groups = self.re_cmath_function.match(p1)
2147+ if re_groups:
2148+ p1 = re_groups.group("name")
2149+ p[0] = p1 + '(' + p[3] + ',' + p[5] + ' , ' + p[7] + ')'
2150+ else:
2151+ if not hasattr(self, 'modelfct'):
2152+ self.create_modelfct()
2153+ if p1 in self.modelfct:
2154+ if not hasattr(self.modelfct[p1], 'argstype') or not self.modelfct[p1].argstype:
2155+ p[0] = p1 + '(' + p[3] + ',' + p[5] + ' , ' + p[7] + ')'
2156+ else:
2157+ types = [self.types_def[t] for t in self.modelfct[p1].argstype]
2158+
2159+ p[0] = p1 + '(' + types[0](p[3]) + ',' + types[1](p[5]) + ' , ' + types[2](p[7]) + ')'
2160+ else:
2161+ p[0] = p1 + '(' + p[3] + ',' + p[5] + ' , ' + p[7] + ')'
2162+
2163+ def p_expression_function4(self, p):
2164+ "expression : FUNCTION '(' expression ',' expression ',' expression ',' expression ')'"
2165+ p1 = p[1]
2166+ re_groups = self.re_cmath_function.match(p1)
2167+ if re_groups:
2168+ p1 = re_groups.group("name")
2169+ p[0] = p1 + '(' + p[3] + ',' + p[5] + ' , ' + p[7] + ' , ' + p[9] + ')'
2170+ else:
2171+ if not hasattr(self, 'modelfct'):
2172+ self.create_modelfct()
2173+ if p1 in self.modelfct:
2174+ if not hasattr(self.modelfct[p1], 'argstype') or not self.modelfct[p1].argstype:
2175+ p[0] = p1 + '(' + p[3] + ',' + p[5] + ' , ' + p[7] + ' , ' + p[9] + ')'
2176+ else:
2177+ types = [self.types_def[t] for t in self.modelfct[p1].argstype]
2178+ p[0] = p1 + '(' + types[0](p[3]) + ',' + types[1](p[5]) + ' , ' + types[2](p[7]) + ' , ' + types[3](p[9]) + ')'
2179+
2180+ else:
2181+ p[0] = p1 + '(' + p[3] + ',' + p[5] + ' , ' + p[7] + ' , ' + p[9] + ')'
2182
2183 def p_expression_real(self, p):
2184 ''' expression : expression RE2 '''
2185@@ -432,6 +539,19 @@
2186 Fortran-style code for quadruple precision computation."""
2187
2188 mp_prefix = check_param_card.ParamCard.mp_prefix
2189+ types_def = { bool: lambda v: v ,
2190+ int :lambda v: 'mp__%s' % v if not v.startswith(('(','mp__','1','2','3','4','5','6','7','8','9','0','-')) else v,
2191+ float: lambda v: 'mp__%s' % v if not v.startswith(('(','mp__','1','2','3','4','5','6','7','8','9','0','-')) else v,
2192+ complex: lambda v: 'CMPLX(mp__%s, KIND=16)' % v if not v.startswith(('(','mp__','1','2','3','4','5','6','7','8','9','0','-' )) else 'CMPLX(%s, KIND=16)' % v}
2193+
2194+ builtin_equiv = {'abs': lambda v: 'ABS' +v,
2195+ 'bool': lambda v: 'LOGICAL' +v ,
2196+ 'float': lambda v: 'REAL(' +v+", KIND=16)",
2197+ 'complex': lambda v: 'COMPLEX(' +v+", KIND=16)",
2198+ 'int': lambda v: 'INTEGER' +v ,
2199+ 'min': lambda v: 'MIN' +v ,
2200+ 'max': lambda v: 'MAX' +v
2201+ }
2202
2203 # The following parser expressions need to be defined for each
2204 # output language/framework
2205@@ -462,6 +582,92 @@
2206 except Exception:
2207 p[0] = p[1] + "**" + p[3]
2208
2209+ def p_expression_function1(self, p):
2210+ "expression : FUNCTION '(' expression ')'"
2211+ p1 = p[1]
2212+ re_groups = self.re_cmath_function.match(p1)
2213+ if re_groups:
2214+ p1 = re_groups.group("name")
2215+ p[0] = p1 + '(' + p[3] + ')'
2216+ else:
2217+ if not hasattr(self, 'modelfct'):
2218+ self.create_modelfct()
2219+ if p1 in self.modelfct:
2220+ if not hasattr(self.modelfct[p1], 'argstype') or not self.modelfct[p1].argstype:
2221+ types = [self.types_def[complex] for _ in self.modelfct[p1].arguments]
2222+ else:
2223+ types = [self.types_def[t] for t in self.modelfct[p1].argstype]
2224+
2225+ p[0] = 'MP_' + p1 + '(' + types[0](p[3]) + ')'
2226+ else:
2227+ p[0] = 'MP_' + p1 + '(' + p[3] + ')'
2228+
2229+
2230+ def p_expression_function2(self, p):
2231+ '''expression : FUNCTION '(' expression ',' expression ')'
2232+ | FUNCTION '(' boolexpression ',' expression ')' '''
2233+
2234+ p1 = p[1]
2235+ re_groups = self.re_cmath_function.match(p1)
2236+ if re_groups:
2237+ p1 = re_groups.group("name")
2238+ p[0] = p1 + '(' + p[3] + ',' + p[5] + ')'
2239+ else:
2240+ if not hasattr(self, 'modelfct'):
2241+ self.create_modelfct()
2242+ if p1 in self.modelfct:
2243+ if not hasattr(self.modelfct[p1], 'argstype') or not self.modelfct[p1].argstype:
2244+ p[0] = p1 + '(' + p[3] + ',' + p[5] + ')'
2245+ else:
2246+ types = [self.types_def[t] for t in self.modelfct[p1].argstype]
2247+
2248+ p[0] = 'MP_' + p1 + '(' + types[0](p[3]) + ',' + types[1](p[5]) + ')'
2249+ else:
2250+ p[0] = 'MP_' + p1 + '(' + p[3] + ',' + p[5] + ')'
2251+
2252+ def p_expression_function3(self, p):
2253+ "expression : FUNCTION '(' expression ',' expression ',' expression ')'"
2254+ p1 = p[1]
2255+ re_groups = self.re_cmath_function.match(p1)
2256+ if re_groups:
2257+ p1 = re_groups.group("name")
2258+ p[0] = p1 + '(' + p[3] + ',' + p[5] + ' , ' + p[7] + ')'
2259+ else:
2260+ if not hasattr(self, 'modelfct'):
2261+ self.create_modelfct()
2262+ if p1 in self.modelfct:
2263+ if not hasattr(self.modelfct[p1], 'argstype') or not self.modelfct[p1].argstype:
2264+ p[0] = 'MP_' + p1 + '(' + p[3] + ',' + p[5] + ' , ' + p[7] + ')'
2265+ else:
2266+ types = [self.types_def[t] for t in self.modelfct[p1].argstype]
2267+
2268+ p[0] = 'MP_' + p1 + '(' + types[0](p[3]) + ',' + types[1](p[5]) + ' , ' + types[2](p[7]) + ')'
2269+ else:
2270+ p[0] = 'MP_' + p1 + '(' + p[3] + ',' + p[5] + ' , ' + p[7] + ')'
2271+
2272+ def p_expression_function4(self, p):
2273+ "expression : FUNCTION '(' expression ',' expression ',' expression ',' expression ')'"
2274+ p1 = p[1]
2275+ re_groups = self.re_cmath_function.match(p1)
2276+ if re_groups:
2277+ p1 = re_groups.group("name")
2278+ p[0] = p1 + '(' + p[3] + ',' + p[5] + ' , ' + p[7] + ' , ' + p[9] + ')'
2279+ else:
2280+ if not hasattr(self, 'modelfct'):
2281+ self.create_modelfct()
2282+ if p1 in self.modelfct:
2283+ if not hasattr(self.modelfct[p1], 'argstype') or not self.modelfct[p1].argstype:
2284+ p[0] = 'MP_' + p1 + '(' + p[3] + ',' + p[5] + ' , ' + p[7] + ' , ' + p[9] + ')'
2285+ else:
2286+ types = [self.types_def[t] for t in self.modelfct[p1].argstype]
2287+ misc.sprint(types)
2288+ p[0] = 'MP_' + p1 + '(' + types[0](p[3]) + ',' + types[1](p[5]) + ' , ' + types[2](p[7]) + ' , ' + types[3](p[9]) + ')'
2289+
2290+ else:
2291+ p[0] = 'MP_' + p1 + '(' + p[3] + ',' + p[5] + ' , ' + p[7] + ' , ' + p[9] + ')'
2292+
2293+
2294+
2295 def p_expression_if(self,p):
2296 "expression : expression IF boolexpression ELSE expression "
2297 p[0] = 'MP_CONDIF(%s,CMPLX(%s,KIND=16),CMPLX(%s,KIND=16))' % (p[3], p[1], p[5])
2298@@ -502,7 +708,8 @@
2299 | REGLOGP group
2300 | REGLOGM group
2301 | TAN group
2302- | ATAN group'''
2303+ | ATAN group
2304+ | BUILTIN group'''
2305
2306 if p[1] == 'csc': p[0] = '1e0_16/cos' + p[2]
2307 elif p[1] == 'sec': p[0] = '1e0_16/sin' + p[2]
2308@@ -518,6 +725,7 @@
2309 elif p[1] == 'reglog': p[0] = 'mp_reglog(CMPLX(' + p[2] +',KIND=16))'
2310 elif p[1] == 'reglogp': p[0] = 'mp_reglogp(CMPLX(' + p[2] + ',KIND=16))'
2311 elif p[1] == 'reglogm': p[0] = 'mp_reglogm(CMPLX(' + p[2] + ',KIND=16))'
2312+ elif p[1] in self.builtin_equiv: p[0] = self.builtin_equiv[p[1]](p[2])
2313
2314 if p[1] in ['reglog', 'reglogp', 'reglogm']:
2315 self.to_define.add(p[1])
2316@@ -557,6 +765,15 @@
2317 '<':'<',
2318 'or':'||',
2319 'and':'&&'}
2320+
2321+ builtin_equiv = {'abs': 'ABS',
2322+ 'bool': 'bool',
2323+ 'float': 'float',
2324+ #'complex': 'COMPLEX', handle separatly
2325+ 'int': 'int',
2326+ 'min': 'min',
2327+ 'max': 'max'
2328+ }
2329
2330 # The following parser expressions need to be defined for each
2331 # output language/framework
2332@@ -634,7 +851,8 @@
2333 | CONJ group
2334 | REGLOG group
2335 | REGLOGP group
2336- | REGLOGM group'''
2337+ | REGLOGM group
2338+ | BUILTIN group '''
2339 if p[1] == 'csc': p[0] = '1./cos' + p[2]
2340 elif p[1] == 'sec': p[0] = '1./sin' + p[2]
2341 elif p[1] == 'acsc': p[0] = 'asin(1./' + p[2] + ')'
2342@@ -649,6 +867,8 @@
2343 elif p[1] == 'reglog': p[0] = 'reglog' + p[2]
2344 elif p[1] == 'reglogp': p[0] = 'reglogp' + p[2]
2345 elif p[1] == 'reglogm': p[0] = 'reglogm' + p[2]
2346+ elif p[1] in self.buitin_equiv: p[0] = self.builtin_equiv[p[1]] + p[2]
2347+
2348
2349 def p_expression_real(self, p):
2350 ''' expression : expression RE2 '''
2351@@ -682,6 +902,15 @@
2352 '<':'<',
2353 'or':' or ',
2354 'and':' and '}
2355+
2356+ builtin_equiv = {'abs': 'abs',
2357+ 'bool': 'bool',
2358+ 'float': 'float',
2359+ #'complex': 'COMPLEX', handle separatly
2360+ 'int': 'int',
2361+ 'min': 'min',
2362+ 'max': 'max'
2363+ }
2364
2365 def __init__(self, *args,**kw):
2366 """Initialize the lex and yacc"""
2367@@ -790,7 +1019,8 @@
2368 | CONJ group
2369 | REGLOG group
2370 | REGLOGP group
2371- | REGLOGM group'''
2372+ | REGLOGM group
2373+ | BUILTIN group'''
2374 if p[1] == 'csc': p[0] = 'csc' + p[2]
2375 elif p[1] == 'sec': p[0] = 'sec' + p[2]
2376 elif p[1] == 'acsc': p[0] = 'acsc' + p[2]
2377@@ -805,6 +1035,7 @@
2378 elif p[1] == 'reglog': p[0] = 'reglog' + p[2]
2379 elif p[1] == 'reglogp': p[0] = 'reglogp' + p[2]
2380 elif p[1] == 'reglogm': p[0] = 'reglogm' + p[2]
2381+ elif p[1] in self.builtin_equiv: p[0] = self.builtin_equiv[p[1]] + p[2]
2382
2383 def p_expression_real(self, p):
2384 ''' expression : expression RE2 '''
2385
2386=== modified file 'madgraph/loop/loop_exporters.py'
2387--- madgraph/loop/loop_exporters.py 2018-04-27 10:54:08 +0000
2388+++ madgraph/loop/loop_exporters.py 2018-06-15 08:18:50 +0000
2389@@ -411,6 +411,9 @@
2390 shutil.copy(os.path.join(self.loop_dir,'StandAlone/', file),
2391 os.path.join(self.dir_path, file))
2392
2393+ cp(pjoin(self.loop_dir,'StandAlone/Cards/MadLoopParams.dat'),
2394+ pjoin(self.dir_path, 'Cards/MadLoopParams_default.dat'))
2395+
2396 ln(pjoin(self.dir_path, 'Cards','MadLoopParams.dat'), pjoin(self.dir_path,'SubProcesses'))
2397
2398 # We might need to give a different name to the MadLoop makefile
2399@@ -3041,7 +3044,18 @@
2400 context['MadEventOutput'] = True
2401 return context
2402
2403-
2404+ #===========================================================================
2405+ # write a procdef_mg5 (an equivalent of the MG4 proc_card.dat)
2406+ #===========================================================================
2407+ def write_procdef_mg5(self, file_pos, modelname, process_str):
2408+ """ write an equivalent of the MG4 proc_card in order that all the Madevent
2409+ Perl script of MadEvent4 are still working properly for pure MG5 run.
2410+ Not needed for StandAlone so we need to call the correct one
2411+ """
2412+
2413+ return export_v4.ProcessExporterFortranMEGroup.write_procdef_mg5(
2414+ self, file_pos, modelname, process_str)
2415+
2416 def get_source_libraries_list(self):
2417 """ Returns the list of libraries to be compiling when compiling the
2418 SOURCE directory. It is different for loop_induced processes and
2419
2420=== modified file 'madgraph/loop/loop_helas_objects.py'
2421--- madgraph/loop/loop_helas_objects.py 2017-07-13 10:33:37 +0000
2422+++ madgraph/loop/loop_helas_objects.py 2018-06-15 08:18:50 +0000
2423@@ -22,6 +22,7 @@
2424 import logging
2425 import itertools
2426 import math
2427+import os
2428
2429 import aloha
2430 import aloha.create_aloha as create_aloha
2431@@ -2316,11 +2317,10 @@
2432 already created and can be specified here instead of being generated.
2433 This can make a difference for very complicated models."""
2434
2435-
2436- if alohaModel is None:
2437+ if not alohaModel:# is None:
2438 # Generate it here
2439 model = self.get('processes')[0].get('model')
2440- myAlohaModel = create_aloha.AbstractALOHAModel(model.get('name'))
2441+ myAlohaModel = create_aloha.AbstractALOHAModel(os.path.basename(model.get('modelpath')))
2442 myAlohaModel.add_Lorentz_object(model.get('lorentz'))
2443 else:
2444 # Use the one provided
2445
2446=== modified file 'madgraph/madevent/gen_crossxhtml.py'
2447--- madgraph/madevent/gen_crossxhtml.py 2018-04-26 14:24:04 +0000
2448+++ madgraph/madevent/gen_crossxhtml.py 2018-06-15 08:18:50 +0000
2449@@ -394,7 +394,7 @@
2450
2451 def output(self):
2452 """ write the output file """
2453-
2454+
2455 # 1) Create the text for the status directory
2456 if self.status and self.current:
2457 if isinstance(self.status, str):
2458@@ -1319,10 +1319,14 @@
2459 def get_nb_line(self):
2460
2461 nb_line = 0
2462+ self.nb_line = nb_line
2463 for key in ['parton', 'reweight', 'pythia', 'pythia8', 'pgs',
2464 'delphes', 'shower', 'madanalysis5_hadron']:
2465 if len(getattr(self, key)):
2466 nb_line += 1
2467+ if nb_line ==0 and not os.path.exists(pjoin(self.me_dir, "Events", self["run_name"], "%(run)s_%(tag)s_banner.txt)" % \
2468+ {"run":self["run_name"], 'tag': self["tag"]})):
2469+ return 0
2470 return max([nb_line,1])
2471
2472
2473@@ -1344,6 +1348,13 @@
2474 <td> %(links)s</td>
2475 <td> %(action)s</td>
2476 </tr>"""
2477+ sub_part_template_parton_no_results = """
2478+ <td rowspan=%(cross_span)s><center><a> %(cross).4g <font face=symbol>&#177;</font> %(err).2g %(bias)s</a> %(syst)s </center></td>
2479+ <td rowspan=%(cross_span)s><center> %(nb_event)s<center></td><td> %(type)s </td>
2480+ <td> %(links)s</td>
2481+ <td> %(action)s</td>
2482+ </tr>"""
2483+
2484
2485 sub_part_template_py8 = """
2486 <td rowspan=%(cross_span)s><center><a href="./Events/%(run)s/%(tag)s_merged_xsecs.txt"> merged xsection</a> %(syst)s </center></td>
2487@@ -1373,6 +1384,8 @@
2488
2489 # Compute the HTMl output for subpart
2490 nb_line = self.get_nb_line()
2491+ if nb_line == 0:
2492+ return ""
2493 # Check that cross/nb_event/error are define
2494 if self.pythia and not self['nb_event']:
2495 try:
2496@@ -1429,7 +1442,10 @@
2497 elif ttype=='pythia8' and self['cross_pythia'] == -1:
2498 template = sub_part_template_py8
2499 else:
2500- template = sub_part_template_parton
2501+ if os.path.exists(pjoin(self.me_dir,'HTML', self['run_name'],'results.html')):
2502+ template = sub_part_template_parton
2503+ else:
2504+ template = sub_part_template_parton_no_results
2505 first = ttype
2506 if ttype=='parton' and self['cross_pythia']:
2507 local_dico['cross_span'] = 1
2508
2509=== modified file 'madgraph/madevent/sum_html.py'
2510--- madgraph/madevent/sum_html.py 2018-04-26 14:41:07 +0000
2511+++ madgraph/madevent/sum_html.py 2018-06-15 08:18:50 +0000
2512@@ -575,6 +575,12 @@
2513 mod_link = '../../SubProcesses/%(P)s/%(G)s/log.txt' % \
2514 {'P': os.path.basename(self.name),
2515 'G': oneresult.name}
2516+ if not os.path.exists(link) and not os.path.exists(mod_link):
2517+ P = os.path.basename(self.name)
2518+ base = pjoin(me_dir, 'SubProcesses', P, os.path.dirname(link))
2519+ pos = [pjoin(base,c) for c in os.listdir(base) if c.endswith('.log')]
2520+ if len(pos) == 1:
2521+ link = pos[0]
2522 else:
2523 link = '#%s' % oneresult.name
2524 mod_link = link
2525
2526=== modified file 'madgraph/various/banner.py'
2527--- madgraph/various/banner.py 2018-04-26 09:15:05 +0000
2528+++ madgraph/various/banner.py 2018-06-15 08:18:50 +0000
2529@@ -188,7 +188,6 @@
2530 """return the cross-section of the file"""
2531
2532 if "init" not in self:
2533- misc.sprint(self.keys())
2534 raise Exception
2535
2536 text = self["init"].split('\n')
2537@@ -339,6 +338,12 @@
2538 # assert "all" in cross
2539 assert "init" in self
2540
2541+ cross = dict(cross)
2542+ for key in cross.keys():
2543+ if isinstance(key, str) and key.isdigit() and int(key) not in cross:
2544+ cross[int(key)] = cross[key]
2545+
2546+
2547 all_lines = self["init"].split('\n')
2548 new_data = []
2549 new_data.append(all_lines[0])
2550@@ -353,7 +358,10 @@
2551 if int(pid) not in cross:
2552 raise Exception
2553 pid = int(pid)
2554- ratio = cross[pid]/float(xsec)
2555+ if float(xsec):
2556+ ratio = cross[pid]/float(xsec)
2557+ else:
2558+ ratio = 0
2559 line = " %+13.7e %+13.7e %+13.7e %i" % \
2560 (float(cross[pid]), ratio* float(xerr), ratio*float(xmax), pid)
2561 new_data.append(line)
2562@@ -1003,17 +1011,23 @@
2563
2564 return log(text)
2565
2566+ def post_set(self, name, value, change_userdefine, raiseerror):
2567+
2568+ if value is None:
2569+ value = self[name]
2570+
2571+ if hasattr(self, 'post_set_%s' % name):
2572+ return getattr(self, 'post_set_%s' % name)(value, change_userdefine, raiseerror)
2573
2574 def __setitem__(self, name, value, change_userdefine=False,raiseerror=False):
2575 """set the attribute and set correctly the type if the value is a string.
2576 change_userdefine on True if we have to add the parameter in user_set
2577 """
2578-
2579+
2580 if not len(self):
2581 #Should never happen but when deepcopy/pickle
2582 self.__init__()
2583-
2584-
2585+
2586 name = name.strip()
2587 lower_name = name.lower()
2588
2589@@ -1031,13 +1045,17 @@
2590 if lower_name in self.user_set:
2591 self.user_set.remove(lower_name)
2592 #keep old value.
2593+ self.post_set(lower_name, 'auto', change_userdefine, raiseerror)
2594 return
2595 elif lower_name in self.auto_set:
2596 self.auto_set.remove(lower_name)
2597
2598 # 2. Find the type of the attribute that we want
2599 if lower_name in self.list_parameter:
2600- targettype = self.list_parameter[lower_name]
2601+ targettype = self.list_parameter[lower_name]
2602+
2603+
2604+
2605 if isinstance(value, str):
2606 # split for each comma/space
2607 value = value.strip()
2608@@ -1058,8 +1076,6 @@
2609 i+=2
2610 new_value += current
2611
2612-
2613-
2614 value = new_value
2615
2616 elif not hasattr(value, '__iter__'):
2617@@ -1111,7 +1127,8 @@
2618 dict.__setitem__(self, lower_name, values)
2619 if change_userdefine:
2620 self.user_set.add(lower_name)
2621- return
2622+ #check for specific action
2623+ return self.post_set(lower_name, None, change_userdefine, raiseerror)
2624 elif lower_name in self.dict_parameter:
2625 targettype = self.dict_parameter[lower_name]
2626 full_reset = True #check if we just update the current dict or not
2627@@ -1161,7 +1178,7 @@
2628 raise Exception, '%s should be of dict type'% lower_name
2629 if change_userdefine:
2630 self.user_set.add(lower_name)
2631- return
2632+ return self.post_set(lower_name, None, change_userdefine, raiseerror)
2633 elif name in self:
2634 targettype = type(self[name])
2635 else:
2636@@ -1175,7 +1192,7 @@
2637 self.lower_to_case[lower_name] = name
2638 if change_userdefine:
2639 self.user_set.add(lower_name)
2640- return
2641+ return self.post_set(lower_name, None, change_userdefine, raiseerror)
2642
2643 value = self.format_variable(value, targettype, name=name)
2644 #check that the value is allowed:
2645@@ -1206,6 +1223,7 @@
2646 dict.__setitem__(self, lower_name, value)
2647 if change_userdefine:
2648 self.user_set.add(lower_name)
2649+ self.post_set(lower_name, None, change_userdefine, raiseerror)
2650
2651
2652 def add_param(self, name, value, system=False, comment=False, typelist=None,
2653@@ -2368,7 +2386,10 @@
2654 name = nline[1].strip().lower()
2655 value = self[name]
2656 if name in self.list_parameter:
2657- value = ', '.join([str(v) for v in value])
2658+ if self.list_parameter[name] != str:
2659+ value = ', '.join([str(v) for v in value])
2660+ else:
2661+ value = "['%s']" % "', '".join(str(v) for v in value)
2662 if python_template:
2663 text += line % {nline[1].strip():value, name:value}
2664 written.add(name)
2665@@ -2732,6 +2753,7 @@
2666 self.add_param("time_of_flight", -1.0, include=False)
2667 self.add_param("nevents", 10000)
2668 self.add_param("iseed", 0)
2669+ self.add_param("python_seed", -1, include=False, hidden=True, comment="controlling python seed [handling in particular the final unweighting].\n -1 means use default from random module.\n -2 means set to same value as iseed")
2670 self.add_param("lpp1", 1, fortran_name="lpp(1)", allowed=[-1,1,0,2,3,9, -2,-3],
2671 comment='first beam energy distribution:\n 0: fixed energy\n 1: PDF from proton\n -1: PDF from anti-proton\n 2:photon from proton, 3:photon from electron, 9: PLUGIN MODE')
2672 self.add_param("lpp2", 1, fortran_name="lpp(2)", allowed=[-1,1,0,2,3,9],
2673
2674=== added file 'madgraph/various/hepmc_parser.py'
2675--- madgraph/various/hepmc_parser.py 1970-01-01 00:00:00 +0000
2676+++ madgraph/various/hepmc_parser.py 2018-06-15 08:18:50 +0000
2677@@ -0,0 +1,342 @@
2678+from __future__ import division
2679+
2680+import gzip
2681+
2682+if '__main__' == __name__:
2683+ import sys
2684+ sys.path.append('../../')
2685+import misc
2686+import os
2687+import logging
2688+
2689+class HEPMC_Particle(object):
2690+
2691+ def __init__(self, text=None, event=None):
2692+
2693+ self.barcode = 0
2694+ self.pdg = 0
2695+ self.px = 0
2696+ self.py = 0
2697+ self.pz = 0
2698+ self.E = 0
2699+ self.mass = 0
2700+ self.status = 0
2701+ self.polarization_theta = 0
2702+ self.polarization_phi = 0
2703+ self.vertex_barcode = 0 #vertex on which this particle is incoming
2704+ self.nb_flow_list = 0
2705+ self.flows = []
2706+
2707+ if text:
2708+ self.parse(text, event)
2709+
2710+ @property
2711+ def pdg_code(self):
2712+ return self.pdg
2713+
2714+ pid = pdg_code
2715+
2716+ @property
2717+ def helicity(self):
2718+ return 9
2719+
2720+ def parse(self,line=None, event=None):
2721+ """ P 3 -2 0 0 3.0332529367341937e+01 3.0332529367341937e+01 0 21 0 0 -3 1 2 501"""
2722+
2723+ data = line.split()
2724+
2725+ self.barcode = int(data[1]) # 3
2726+ self.pdg = int(data[2]) #-2
2727+ self.px = float(data[3]) #0
2728+ self.py = float(data[4]) #0
2729+ self.pz = float(data[5]) #30.3
2730+ self.E = float(data[6]) # 30.3
2731+ self.mass = float(data[7]) # 0
2732+ self.status = int(data[8]) # 21
2733+ self.polarization_theta = float(data[9]) #0
2734+ self.polarization_phi = float(data[10]) #0
2735+ self.vertex_barcode = float(data[11]) #-3 vertex on which this particle is incoming
2736+ self.nb_flow_list = int(data[12]) # 1
2737+ self.flows = [(int(data[13+2*i]),int(data[13+2*i+1]))
2738+ for i in range(self.nb_flow_list)] # 2 501
2739+
2740+ if event:
2741+ event.curr_vertex.add_outcoming(self)
2742+
2743+ def __str__(self):
2744+ """P 3 -2 0 0 3.0332529367341937e+01 3.0332529367341937e+01 0 21 0 0 -3 1 2 501"""
2745+
2746+ start = """P %i %i %17.16e %17.16e %17.16e %17.16e %17.16e %i %17.16e %17.16e %i %i %s\n""" %\
2747+ (self.barcode, self.pdg, self.px, self.py, self.pz, self.E, self.mass,
2748+ self.status, self.polarization_theta, self.polarization_phi,
2749+ self.vertex_barcode, self.nb_flow_list, ' '.join("%i %i" % f for f in self.flows))
2750+
2751+
2752+ return start.replace("%17.16e" % 0, '0')
2753+
2754+
2755+
2756+
2757+class HEPMC_Vertex(object):
2758+
2759+ def __init__(self, text=None, event=None):
2760+
2761+ self.barcode = 0
2762+ self.id = 0
2763+ self.x = 0
2764+ self.y = 0
2765+ self.z = 0
2766+ self.ctau = 0
2767+ self.nb_orphan = 0
2768+ self.nb_outgoing = 0
2769+ self.nb_weight = 0
2770+ self.weights = []
2771+ self.incoming = []
2772+ self.outcoming = []
2773+
2774+
2775+ if text:
2776+ self.parse(text,event)
2777+
2778+ def parse(self, line, event=None):
2779+ """V -8 0 0 0 0 0 0 2 0"""
2780+
2781+ data = line.split()
2782+ self.barcode = int(data[1])
2783+ self.id = float(data[2])
2784+ self.x = float(data[3])
2785+ self.y = float(data[4])
2786+ self.z = float(data[5])
2787+ self.ctau = float(data[6])
2788+ self.nb_orphan = int(data[7])
2789+ self.nb_outgoing = int(data[8])
2790+ self.nb_weight = int(data[9])
2791+ self.weights = [float(data[10+i]) for i in range(self.nb_weight)]
2792+ if event:
2793+ event.vertex[self.barcode] = self
2794+
2795+ def add_incoming(self, particle):
2796+ self.incoming.append(particle)
2797+
2798+ def add_outcoming(self, particle):
2799+ self.outcoming.append(particle)
2800+
2801+class HEPMC_Event(object):
2802+
2803+ def __init__(self, text=None):
2804+ """The initialization of an empty Event (or one associate to a text file)"""
2805+ #
2806+ self.particles = {} #barcode to object
2807+ self.vertex = {} #barcode to object
2808+
2809+ # First line information (E line)
2810+ self.event_id = 0
2811+ self.nb_interaction = 0
2812+ self.scale = 0.
2813+ self.alphas = 0.
2814+ self.alphaew = 0.
2815+ self.process_id = 0
2816+ self.barcode_vertex =0
2817+ self.nb_vertex = 0
2818+ self.barcode_beam1 = 0
2819+ self.barcode_beam2 = 0
2820+ self.nb_random_state = 0
2821+ self.randoms = []
2822+ self.nb_weight = 0
2823+ self.weights = []
2824+
2825+ # not parse container (so far)
2826+ self.N = ''
2827+ self.U = ''
2828+ self.C = ''
2829+ self.H = ''
2830+ self.F = ''
2831+
2832+ if text:
2833+ self.parse(text)
2834+
2835+ @property
2836+ def wgt(self):
2837+ if self.weights:
2838+ return self.weights[0]
2839+ else:
2840+ return 0.
2841+ @wgt.setter
2842+ def wgt(self, value):
2843+ self.nb_weight = 1
2844+ self.weights = [value]
2845+
2846+
2847+ def parse(self, text):
2848+
2849+ for line in text.split('\n'):
2850+ if not line:
2851+ continue
2852+ if line[0] == 'P':
2853+ P = HEPMC_Particle(line, self)
2854+ self.add_particle(P)
2855+ elif line[0] == 'V':
2856+ V = HEPMC_Vertex(line, self)
2857+ self.curr_vertex = V
2858+ self.add_vertex(V)
2859+ elif line[0] in ['E', 'N', 'U', 'H','F','C']:
2860+ getattr(self, 'parse_%s' % line[0])(line)
2861+ else:
2862+ self.comment = '%s%s\n' % (self.comment,line)
2863+
2864+ # add the information about incoming particle
2865+ for particle in self:
2866+ try:
2867+ self.vertex[particle.vertex_barcode].add_incoming(particle)
2868+ except KeyError:
2869+ if particle.vertex_barcode == 0:
2870+ continue
2871+ raise
2872+
2873+ def parse_E(self,line):
2874+ """E 249 -1 -1.0000000000000000e+00 -1.0000000000000000e+00 -1.0000000000000000e+00 0 0 462 1 2 0 1 8.2247251000000005e-22"""
2875+
2876+ data = line.split()
2877+ self.event_id = int(data[1])
2878+ self.nb_interaction = int(data[2])
2879+ self.scale = float(data[3])
2880+ self.alphas = float(data[4])
2881+ self.alphaew = float(data[5])
2882+ self.process_id = int(data[6])
2883+ self.barcode_vertex= int(data[7])
2884+ self.nb_vertex = int(data[8])
2885+ self.barcode_beam1 = int(data[9])
2886+ self.barcode_beam2 = int(data[10])
2887+ self.nb_random_state = int(data[11])
2888+ self.randoms = [float(data[12+i]) for i in range(self.nb_random_state)]
2889+ self.nb_weight = int(data[12+self.nb_random_state])
2890+ self.weights = [float(data[13+self.nb_random_state+i])
2891+ for i in range(self.nb_weight)]
2892+
2893+ def parse_N(self,line):
2894+ """just keep the information so far"""
2895+ self.N = '%s\n' % line
2896+ def parse_U(self,line):
2897+ self.U = '%s\n' % line
2898+ def parse_H(self,line):
2899+ self.H = '%s\n' % line
2900+ def parse_F(self,line):
2901+ self.F = '%s\n' % line
2902+ def parse_C(self,line):
2903+ self.C = '%s\n' % line
2904+
2905+ def __iter__(self):
2906+ return self.particles.values().__iter__()
2907+
2908+ #def __next__(self):
2909+ #
2910+ # self.particles.__next__()
2911+
2912+ def add_vertex(self, V):
2913+ self.vertex[V.barcode] = V
2914+
2915+ def add_particle(self, P):
2916+ self.particles[P.barcode] = P
2917+
2918+class HEPMC_EventFile(object):
2919+
2920+ def __new__(self, path, mode='r', *args, **opt):
2921+
2922+ if not path.endswith(".gz"):
2923+ return file.__new__(HEPMC_EventFileNoGzip, path, mode, *args, **opt)
2924+ elif mode == 'r' and not os.path.exists(path) and os.path.exists(path[:-3]):
2925+ return HEPMC_EventFile.__new__(HEPMC_EventFileNoGzip, path[:-3], mode, *args, **opt)
2926+ else:
2927+ try:
2928+ return gzip.GzipFile.__new__(HEPMC_EventFileGzip, path, mode, *args, **opt)
2929+ except IOError, error:
2930+ raise
2931+ except Exception, error:
2932+ if mode == 'r':
2933+ misc.gunzip(path)
2934+ return file.__new__(HEPMC_EventFileNoGzip, path[:-3], mode, *args, **opt)
2935+
2936+
2937+ def __init__(self, path, mode='r', *args, **opt):
2938+ """open file and read the banner [if in read mode]"""
2939+
2940+ self.to_zip = False
2941+ if path.endswith('.gz') and mode == 'w' and\
2942+ isinstance(self, HEPMC_EventFileNoGzip):
2943+ path = path[:-3]
2944+ self.to_zip = True # force to zip the file at close() with misc.gzip
2945+
2946+ self.parsing = True # check if/when we need to parse the event.
2947+ self.eventgroup = False
2948+ try:
2949+ super(HEPMC_EventFile, self).__init__(path, mode, *args, **opt)
2950+ except IOError:
2951+ if '.gz' in path and isinstance(self, HEPMC_EventFileNoGzip) and\
2952+ mode == 'r' and os.path.exists(path[:-3]):
2953+ super(HEPMC_EventFile, self).__init__(path[:-3], mode, *args, **opt)
2954+ else:
2955+ raise
2956+
2957+ self.header = ''
2958+ if mode == 'r':
2959+ line = ''
2960+ while 'HepMC::IO_GenEvent-START_EVENT_LISTING' not in line:
2961+
2962+ try:
2963+ line = super(HEPMC_EventFile, self).next()
2964+ except StopIteration:
2965+ self.seek(0)
2966+ self.header = ''
2967+ break
2968+ self.header += line
2969+ self.start_event = ''
2970+
2971+ def seek(self, value):
2972+ self.start_event = ""
2973+ super(HEPMC_EventFile, self).seek(value)
2974+
2975+ def next(self):
2976+ """get next event"""
2977+ text = self.start_event
2978+ line = ''
2979+ while 1:
2980+ line = super(HEPMC_EventFile, self).next()
2981+ if line.startswith('E'):
2982+ self.start_event = line
2983+ if text:
2984+ return HEPMC_Event(text)
2985+ else:
2986+ text += line
2987+
2988+ elif line.lstrip().startswith('HepMC::IO_GenEvent-END_EVENT_LISTING'):
2989+ if text:
2990+ return HEPMC_Event(text)
2991+ elif line.lstrip().startswith('HepMC::IO_GenEvent-START_EVENT_LISTING'):
2992+ text = ''
2993+ else:
2994+ text += line
2995+
2996+
2997+class HEPMC_EventFileGzip(HEPMC_EventFile, gzip.GzipFile):
2998+ """A way to read/write a gzipped lhef event"""
2999+
3000+class HEPMC_EventFileNoGzip(HEPMC_EventFile, file):
3001+ """A way to read a standard event file"""
3002+
3003+ def close(self,*args, **opts):
3004+
3005+ out = super(EventFileNoGzip, self).close(*args, **opts)
3006+ if self.to_zip:
3007+ misc.gzip(self.name)
3008+
3009+
3010+if "__main__" == __name__:
3011+ path = "/Users/omatt/Documents/eclipse/2.3.3_PY8_install_cmd/PROC_sm_24/Events/run_01/tag_1_pythia8_events.hepmc.gz"
3012+ evts = HEPMC_EventFile(path)
3013+ nb_event = 0
3014+ nb_p = 0
3015+ for event in evts:
3016+ nb_event +=1
3017+ for p in event:
3018+ nb_p+=1
3019+ print nb_event, nb_p
3020
3021=== modified file 'madgraph/various/lhe_parser.py'
3022--- madgraph/various/lhe_parser.py 2018-03-09 15:44:05 +0000
3023+++ madgraph/various/lhe_parser.py 2018-06-15 08:18:50 +0000
3024@@ -52,7 +52,28 @@
3025 if event:
3026 self.event = event
3027 return
3028-
3029+ else:
3030+ try:
3031+ import madgraph.various.hepmc_parser as hepmc_parser
3032+ except Exception:
3033+ pass
3034+ else:
3035+ if isinstance(line, hepmc_parser.HEPMC_Particle):
3036+ self.event = event
3037+ self.event_id = len(event) #not yet in the event
3038+ for key in ['pid', 'status', 'E','px','py','pz','mass']:
3039+ setattr(self, key, getattr(line, key))
3040+ self.mother1 = 1
3041+ self.mother2 = 1
3042+ self.color1 = 0
3043+ self.color2 = 0
3044+ self.vtim = 0
3045+ self.comment = ''
3046+ self.helicity = 9
3047+ self.rwgt = 0
3048+ return
3049+
3050+
3051 self.event = event
3052 self.event_id = len(event) #not yet in the event
3053 # LHE information
3054@@ -154,6 +175,7 @@
3055 class EventFile(object):
3056 """A class to allow to read both gzip and not gzip file"""
3057
3058+ allow_empty_event = False
3059
3060 def __new__(self, path, mode='r', *args, **opt):
3061
3062@@ -261,7 +283,7 @@
3063 text += line
3064 if self.parsing:
3065 out = Event(text)
3066- if len(out) == 0:
3067+ if len(out) == 0 and not self.allow_empty_event:
3068 raise Exception
3069 return out
3070 else:
3071@@ -1246,6 +1268,27 @@
3072 self.assign_mother()
3073
3074 def assign_mother(self):
3075+ """convert the number in actual particle"""
3076+ #Security if not incoming particle. Define a fake particle and set all particle as
3077+ # decaying from that fake particle
3078+ if all(p.status != -1 for p in self):
3079+ if self.warning_order:
3080+ Event.warning_order = False
3081+ logger.warning("Weird format for lhe format: no incoming particle... adding a fake one")
3082+
3083+ mother = Particle(event=self)
3084+ mother.status = -1
3085+ mother.pid = 0
3086+ self.insert(0,mother)
3087+ mother.color2 = 0
3088+ mother.event_id = 0
3089+ self.nexternal += 1
3090+ for p in self[1:]:
3091+ p.mother1 = 1
3092+ p.mother2 = 1
3093+ p.event_id += 1
3094+
3095+
3096 # assign the mother:
3097 for i,particle in enumerate(self):
3098 if i < particle.mother1 or i < particle.mother2:
3099@@ -2055,7 +2098,7 @@
3100
3101 def __str__(self, event_id=''):
3102 """return a correctly formatted LHE event"""
3103-
3104+
3105 out="""<event%(event_flag)s>
3106 %(scale)s
3107 %(particles)s
3108@@ -2072,11 +2115,9 @@
3109 else:
3110 event_flag = ''
3111
3112- if self.nexternal:
3113- scale_str = "%2d %6d %+13.7e %14.8e %14.8e %14.8e" % \
3114+ scale_str = "%2d %6d %+13.7e %14.8e %14.8e %14.8e" % \
3115 (self.nexternal,self.ievent,self.wgt,self.scale,self.aqed,self.aqcd)
3116- else:
3117- scale_str = ''
3118+
3119
3120 if self.reweight_data:
3121 # check that all key have an order if not add them at the end
3122@@ -2367,6 +2408,12 @@
3123 """ return |\vec p|^2 """
3124 return self.px**2 + self.py**2 + self.pz**2
3125
3126+ @property
3127+ def theta(self):
3128+ """return the mass square"""
3129+ import math
3130+ return math.atan(math.sqrt((self.px**2+self.py**2)/self.pz**2))
3131+
3132
3133 def __add__(self, obj):
3134
3135
3136=== modified file 'madgraph/various/misc.py'
3137--- madgraph/various/misc.py 2018-04-29 07:57:44 +0000
3138+++ madgraph/various/misc.py 2018-06-15 08:18:50 +0000
3139@@ -1082,7 +1082,8 @@
3140 return self.path
3141
3142 class TMP_variable(object):
3143- """create a temporary directory and ensure this one to be cleaned.
3144+ """replace an attribute of a class with another value for the time of the
3145+ context manager
3146 """
3147
3148 def __init__(self, cls, attribute, value):
3149@@ -1463,8 +1464,8 @@
3150 else:
3151 return a == b
3152 else:
3153- power = sig_fig - int(math.log10(abs(a))) + 1
3154-
3155+ power = sig_fig - int(math.log10(abs(a)))
3156+
3157 return ( a==b or abs(int(a*10**power) - int(b*10**power)) < 10)
3158 else:
3159 return abs(a-b) < sig_fig
3160
3161=== modified file 'mg5decay/decay_objects.py'
3162--- mg5decay/decay_objects.py 2017-07-04 09:24:42 +0000
3163+++ mg5decay/decay_objects.py 2018-06-15 08:18:50 +0000
3164@@ -4091,7 +4091,7 @@
3165 model.lorentz_dict = dict([(l.name, l) for l in model['lorentz']])
3166 self.init_regular_expression()
3167
3168- structure = model.lorentz_dict[vertex['lorentz'][key[1]]].structure
3169+ structure = model.lorentz_dict[vertex['lorentz'][key[1]]].structure
3170 new_structure = self.lor_pattern.sub(self.simplify_lorentz,
3171 structure)
3172 lor_value = eval(new_structure % q_dict_lor)
3173
3174=== modified file 'models/import_ufo.py'
3175--- models/import_ufo.py 2018-03-10 22:48:36 +0000
3176+++ models/import_ufo.py 2018-06-15 08:18:50 +0000
3177@@ -21,6 +21,7 @@
3178 import re
3179 import sys
3180 import time
3181+import collections
3182
3183
3184 from madgraph import MadGraph5Error, MG5DIR, ReadWrite
3185@@ -497,7 +498,7 @@
3186 color_info = self.find_color_anti_color_rep()
3187
3188 # load the lorentz structure.
3189- self.model.set('lorentz', self.ufomodel.all_lorentz)
3190+ self.model.set('lorentz', list(self.ufomodel.all_lorentz))
3191
3192 # Substitute the expression of CT couplings which include CTparameters
3193 # in their definition with the corresponding dictionaries, e.g.
3194@@ -529,6 +530,11 @@
3195 for interaction_info in self.ufomodel.all_CTvertices:
3196 self.add_CTinteraction(interaction_info, color_info)
3197
3198+
3199+ for interaction in self.interactions:
3200+ self.optimise_interaction(interaction)
3201+
3202+
3203 self.model.set('conserved_charge', self.conservecharge)
3204
3205 # If we deal with a Loop model here, the order hierarchy MUST be
3206@@ -576,7 +582,102 @@
3207 del self.checked_lor
3208
3209 return self.model
3210-
3211+
3212+ def optimise_interaction(self, interaction):
3213+
3214+ # we want to check if the same coupling is used for two lorentz strucutre
3215+ # for the same color structure.
3216+ to_lor = {}
3217+ for (color, lor), coup in interaction['couplings'].items():
3218+ key = (color, coup)
3219+ if key in to_lor:
3220+ to_lor[key].append(lor)
3221+ else:
3222+ to_lor[key] = [lor]
3223+
3224+ nb_reduce = []
3225+ optimize = False
3226+ for key in to_lor:
3227+ if len(to_lor[key]) >1:
3228+ nb_reduce.append(len(to_lor[key])-1)
3229+ optimize = True
3230+
3231+ if not optimize:
3232+ return
3233+
3234+ if not hasattr(self, 'defined_lorentz_expr'):
3235+ self.defined_lorentz_expr = {}
3236+ self.lorentz_info = {}
3237+ self.lorentz_combine = {}
3238+ for lor in self.model['lorentz']:
3239+ self.defined_lorentz_expr[lor.get('structure')] = lor.get('name')
3240+ self.lorentz_info[lor.get('name')] = lor #(lor.get('structure'), lor.get('spins'))
3241+
3242+ for key in to_lor:
3243+ if len(to_lor[key]) == 1:
3244+ continue
3245+ names = [interaction['lorentz'][i] for i in to_lor[key]]
3246+ names.sort()
3247+
3248+ # get name of the new lorentz
3249+ if tuple(names) in self.lorentz_combine:
3250+ # already created new loretnz
3251+ new_name = self.lorentz_combine[tuple(names)]
3252+ else:
3253+ new_name = self.add_merge_lorentz(names)
3254+
3255+ # remove the old couplings
3256+ color, coup = key
3257+ to_remove = [(color, lor) for lor in to_lor[key]]
3258+ for rm in to_remove:
3259+ del interaction['couplings'][rm]
3260+
3261+ #add the lorentz structure to the interaction
3262+ if new_name not in [l for l in interaction.get('lorentz')]:
3263+ interaction.get('lorentz').append(new_name)
3264+
3265+ #find the associate index
3266+ new_l = interaction.get('lorentz').index(new_name)
3267+ # adding the new combination (color,lor) associate to this sum of structure
3268+ interaction['couplings'][(color, new_l)] = coup
3269+
3270+
3271+ def add_merge_lorentz(self, names):
3272+ """add a lorentz structure which is the sume of the list given above"""
3273+
3274+
3275+ #create new_name
3276+ ii = len(names[0])
3277+ while ii>0:
3278+ if not all(n.startswith(names[0][:ii]) for n in names[1:]):
3279+ ii -=1
3280+ else:
3281+ base_name = names[0][:ii]
3282+ break
3283+ else:
3284+ base_name = 'LMER'
3285+
3286+ i = 1
3287+ while '%s%s' %(base_name, i) in self.lorentz_info:
3288+ i +=1
3289+ new_name = '%s%s' %(base_name, i)
3290+ self.lorentz_combine[tuple(names)] = new_name
3291+ assert new_name not in self.lorentz_info
3292+ assert new_name not in [l.name for l in self.model['lorentz']]
3293+
3294+ # load the associate lorentz expression
3295+ new_struct = ' + '.join([self.lorentz_info[n].get('structure') for n in names])
3296+ spins = self.lorentz_info[names[0]].get('spins')
3297+ new_lor = self.add_lorentz(new_name, spins, new_struct)
3298+ self.lorentz_info[new_name] = new_lor
3299+
3300+ return new_name
3301+
3302+ # We also have to create the new lorentz
3303+
3304+
3305+
3306+
3307
3308 def add_particle(self, particle_info):
3309 """ convert and add a particle in the particle list """
3310@@ -980,7 +1081,6 @@
3311 (intType if poleOrder==0 else (intType+str(poleOrder)+\
3312 'eps')),loop_particles)
3313
3314-
3315 def find_color_anti_color_rep(self, output=None):
3316 """find which color are in the 3/3bar states"""
3317 # method look at the 3 3bar 8 configuration.
3318@@ -1197,6 +1297,7 @@
3319 self.conservecharge.discard(charge)
3320
3321
3322+
3323 def get_sign_flow(self, flow, nb_fermion):
3324 """ensure that the flow of particles/lorentz are coherent with flow
3325 and return a correct version if needed"""
3326@@ -1241,14 +1342,18 @@
3327
3328 def add_lorentz(self, name, spins , expr):
3329 """ Add a Lorentz expression which is not present in the UFO """
3330-
3331- new = self.model['lorentz'][0].__class__(name = name,
3332- spins = spins,
3333- structure = expr)
3334-
3335- self.model['lorentz'].append(new)
3336+
3337+ assert name not in [l.name for l in self.model['lorentz']]
3338+ with misc.TMP_variable(self.ufomodel.object_library, 'all_lorentz',
3339+ self.model['lorentz']):
3340+ new = self.model['lorentz'][0].__class__(name = name,
3341+ spins = spins,
3342+ structure = expr)
3343+ assert name in [l.name for l in self.model['lorentz']]
3344+ assert name not in [l.name for l in self.ufomodel.all_lorentz]
3345+ #self.model['lorentz'].append(new) # already done by above command
3346 self.model.create_lorentz_dict()
3347- return name
3348+ return new
3349
3350 _pat_T = re.compile(r'T\((?P<first>\d*),(?P<second>\d*)\)')
3351 _pat_id = re.compile(r'Identity\((?P<first>\d*),(?P<second>\d*)\)')
3352@@ -1657,6 +1762,7 @@
3353 super(RestrictModel, self).default_setup()
3354 self.rule_card = check_param_card.ParamCardRule()
3355 self.restrict_card = None
3356+ self.coupling_order_dict ={}
3357
3358 def restrict_model(self, param_card, rm_parameter=True, keep_external=False,
3359 complex_mass_scheme=None):
3360@@ -1702,6 +1808,10 @@
3361 self.del_coup += zero_couplings
3362 self.remove_couplings(self.del_coup)
3363
3364+ # modify interaction to avoid to have identical coupling with different lorentz
3365+ for interaction in self.get('interactions'):
3366+ self.optimise_interaction(interaction)
3367+
3368 # deal with parameters
3369 parameters = self.detect_special_parameters()
3370 self.fix_parameter_values(*parameters, simplify=rm_parameter,
3371@@ -1772,17 +1882,58 @@
3372 return self.detect_identical_couplings(strict_zero=True)
3373
3374
3375- if value in dict_value_coupling:
3376- iden_key.add(value)
3377- dict_value_coupling[value].append(name)
3378+ if value in dict_value_coupling or -1*value in dict_value_coupling:
3379+ if value in dict_value_coupling:
3380+ iden_key.add(value)
3381+ dict_value_coupling[value].append((name,1))
3382+ else:
3383+ iden_key.add(-1*value)
3384+ dict_value_coupling[-1*value].append((name,-1))
3385 else:
3386- dict_value_coupling[value] = [name]
3387-
3388+ dict_value_coupling[value] = [(name,1)]
3389 for key in iden_key:
3390- iden_coupling.append(dict_value_coupling[key])
3391+ tmp = []
3392+ if key in dict_value_coupling:
3393+ tmp += dict_value_coupling[key]
3394+ elif -1*key in dict_value_coupling:
3395+ tmp += dict_value_coupling[-1*key]
3396+ assert tmp
3397+
3398+ #ensure that all coupling have the same coupling order.
3399+ ords = [self.get_coupling_order(k) for k,c in tmp]
3400+ coup_by_ord = collections.defaultdict(list)
3401+ for o,t in zip(ords, tmp):
3402+ coup_by_ord[str(o)].append(t)
3403+ # add the remaining identical
3404+ for tmp3 in coup_by_ord.values():
3405+ if len(tmp3) > 1:
3406+ if tmp3[0][1] == -1: #ensure that the first coupling has positif value
3407+ tmp3 = [(t0,-t1) for t0, t1 in tmp3]
3408+ iden_coupling.append(tmp3)
3409+
3410+
3411+
3412
3413 return zero_coupling, iden_coupling
3414
3415+ def get_coupling_order(self, cname):
3416+ """return the coupling order associated to a coupling """
3417+
3418+ if cname in self.coupling_order_dict:
3419+ return self.coupling_order_dict[cname]
3420+
3421+ for v in self['interactions']:
3422+ for c in v['couplings'].values():
3423+ self.coupling_order_dict[c] = v['orders']
3424+
3425+ if cname not in self.coupling_order_dict:
3426+ self.coupling_order_dict[cname] = None
3427+ #can happen when some vertex are discarded due to ghost/...
3428+
3429+
3430+ return self.coupling_order_dict[cname]
3431+
3432+
3433
3434 def detect_special_parameters(self):
3435 """ return the list of (name of) parameter which are zero """
3436@@ -1898,17 +2049,52 @@
3437 return output
3438
3439
3440+ @staticmethod
3441+ def get_new_coupling_name(main, coupling, value, coeff):
3442+ """ We have main == coeff * coupling
3443+ coeff is only +1 or -1
3444+ main can be either GC_X or -GC_X
3445+ coupling can be either GC_Y or -GC_Y
3446+ value is either GC_Y or -GC_Y
3447+ the return is either GC_X or -GC_X
3448+ such that we have value == OUTPUT
3449+ """
3450+ assert coeff in [-1,1]
3451+ assert value == coupling or value == '-%s' % coupling or coupling == '-%s' % value
3452+ assert isinstance(main, str)
3453+ assert isinstance(coupling, str)
3454+ assert isinstance(value, str)
3455+ if coeff ==1:
3456+ if value == coupling:
3457+ return main # 4/4
3458+ else:
3459+ if main.startswith('-'):
3460+ return main[1:] # 2/2
3461+ else:
3462+ return '-%s' % main # 2/2
3463+ else:
3464+ if value == coupling:
3465+ if main.startswith('-'):
3466+ return main[1:] # 2/2
3467+ else:
3468+ return '-%s' % main # 2/2
3469+ else:
3470+ return main # 4/4
3471+
3472+
3473 def merge_iden_couplings(self, couplings):
3474 """merge the identical couplings in the interactions and particle
3475 counterterms"""
3476
3477
3478 logger_mod.debug(' Fuse the Following coupling (they have the same value): %s '% \
3479- ', '.join([obj for obj in couplings]))
3480+ ', '.join([str(obj) for obj in couplings]))
3481+
3482+ main = couplings[0][0]
3483+ assert couplings[0][1] == 1
3484+ self.del_coup += [c[0] for c in couplings[1:]] # add the other coupl to the suppress list
3485
3486- main = couplings[0]
3487- self.del_coup += couplings[1:] # add the other coupl to the suppress list
3488- for coupling in couplings[1:]:
3489+ for coupling, coeff in couplings[1:]:
3490 # check if param is linked to an interaction
3491 if coupling not in self.coupling_pos:
3492 continue
3493@@ -1917,13 +2103,12 @@
3494 isinstance(vert, base_objects.Interaction)]
3495 for vertex in vertices:
3496 for key, value in vertex['couplings'].items():
3497- if value == coupling:
3498- vertex['couplings'][key] = main
3499- elif value == '-%s' % coupling:
3500- if main.startswith('-'):
3501- vertex['couplings'][key] = main[1:]
3502- else:
3503- vertex['couplings'][key] = '-%s' % main
3504+ if value == coupling or value == '-%s' % coupling or coupling == '-%s' % value:
3505+ vertex['couplings'][key] = self.get_new_coupling_name(\
3506+ main, coupling, value, coeff)
3507+
3508+
3509+
3510
3511 # replace the coupling appearing in the particle counterterm
3512 particles_ct = [ pct for pct in self.coupling_pos[coupling] if
3513@@ -2183,11 +2368,109 @@
3514 data = self['parameters'][param_info[param]['dep']]
3515 data.remove(param_info[param]['obj'])
3516
3517-
3518-
3519-
3520-
3521-
3522+ def optimise_interaction(self, interaction):
3523+
3524+ # we want to check if the same coupling (up to the sign) is used for two lorentz structure
3525+ # for the same color structure.
3526+ to_lor = {}
3527+ for (color, lor), coup in interaction['couplings'].items():
3528+ abscoup, coeff = (coup[1:],-1) if coup.startswith('-') else (coup, 1)
3529+ key = (color, abscoup)
3530+ if key in to_lor:
3531+ to_lor[key].append((lor,coeff))
3532+ else:
3533+ to_lor[key] = [(lor,coeff)]
3534+
3535+ nb_reduce = []
3536+ optimize = False
3537+ for key in to_lor:
3538+ if len(to_lor[key]) >1:
3539+ nb_reduce.append(len(to_lor[key])-1)
3540+ optimize = True
3541+
3542+ if not optimize:
3543+ return
3544+
3545+ if not hasattr(self, 'defined_lorentz_expr'):
3546+ self.defined_lorentz_expr = {}
3547+ self.lorentz_info = {}
3548+ self.lorentz_combine = {}
3549+ for lor in self.get('lorentz'):
3550+ self.defined_lorentz_expr[lor.get('structure')] = lor.get('name')
3551+ self.lorentz_info[lor.get('name')] = lor #(lor.get('structure'), lor.get('spins'))
3552+
3553+ for key in to_lor:
3554+ if len(to_lor[key]) == 1:
3555+ continue
3556+ names = ['u%s' % interaction['lorentz'][i[0]] if i[1] ==1 else \
3557+ 'd%s' % interaction['lorentz'][i[0]] for i in to_lor[key]]
3558+
3559+ names.sort()
3560+
3561+ # get name of the new lorentz
3562+ if tuple(names) in self.lorentz_combine:
3563+ # already created new loretnz
3564+ new_name = self.lorentz_combine[tuple(names)]
3565+ else:
3566+ new_name = self.add_merge_lorentz(names)
3567+
3568+ # remove the old couplings
3569+ color, coup = key
3570+ to_remove = [(color, lor[0]) for lor in to_lor[key]]
3571+ for rm in to_remove:
3572+ del interaction['couplings'][rm]
3573+
3574+ #add the lorentz structure to the interaction
3575+ if new_name not in [l for l in interaction.get('lorentz')]:
3576+ interaction.get('lorentz').append(new_name)
3577+
3578+ #find the associate index
3579+ new_l = interaction.get('lorentz').index(new_name)
3580+ # adding the new combination (color,lor) associate to this sum of structure
3581+ interaction['couplings'][(color, new_l)] = coup
3582+
3583+
3584+
3585+ def add_merge_lorentz(self, names):
3586+ """add a lorentz structure which is the sume of the list given above"""
3587+
3588+ #create new_name
3589+ ii = len(names[0])
3590+ while ii>1:
3591+ #do not count the initial "u/d letter whcih indicates the sign"
3592+ if not all(n[1:].startswith(names[0][1:ii]) for n in names[1:]):
3593+ ii -=1
3594+ else:
3595+ base_name = names[0][1:ii]
3596+ break
3597+ else:
3598+ base_name = 'LMER'
3599+ i = 1
3600+ while '%s%s' %(base_name, i) in self.lorentz_info:
3601+ i +=1
3602+ new_name = '%s%s' %(base_name, i)
3603+ self.lorentz_combine[tuple(names)] = new_name
3604+
3605+ # load the associate lorentz expression
3606+ new_struct = ' + '.join([self.lorentz_info[n[1:]].get('structure') for n in names if n.startswith('u')])
3607+ if any( n.startswith('d') for n in names ):
3608+ new_struct += '-' + ' - '.join(['1.*(%s)' %self.lorentz_info[n[1:]].get('structure') for n in names if n.startswith('d')])
3609+ spins = self.lorentz_info[names[0][1:]].get('spins')
3610+ new_lor = self.add_lorentz(new_name, spins, new_struct)
3611+ self.lorentz_info[new_name] = new_lor
3612+
3613+ return new_name
3614+
3615+ def add_lorentz(self, name, spin, struct):
3616+ """adding lorentz structure to the current model"""
3617+ new = self['lorentz'][0].__class__(name = name,
3618+ spins = spin,
3619+ structure = struct)
3620+ self['lorentz'].append(new)
3621+ self.create_lorentz_dict()
3622+
3623+ return None
3624+
3625
3626
3627
3628
3629=== modified file 'models/write_param_card.py'
3630--- models/write_param_card.py 2017-01-15 14:28:13 +0000
3631+++ models/write_param_card.py 2018-06-15 08:18:50 +0000
3632@@ -308,8 +308,8 @@
3633 if part["pdg_code"] in self.sm_pdg or part["pdg_code"] < 0:
3634 continue
3635 # don't write ghosts in the QNumbers block
3636- if part["type"] == 'ghost':
3637- continue
3638+ #if part["type"] == 'ghost':
3639+ # continue
3640 text += self.qnumber_str % {'pdg': part["pdg_code"],
3641 'name': part["name"],
3642 'charge': 3 * part["charge"],
3643
3644=== modified file 'tests/acceptance_tests/test_cmd_amcatnlo.py'
3645--- tests/acceptance_tests/test_cmd_amcatnlo.py 2018-04-29 05:41:18 +0000
3646+++ tests/acceptance_tests/test_cmd_amcatnlo.py 2018-06-15 08:18:50 +0000
3647@@ -44,6 +44,7 @@
3648 _pickle_path =os.path.join(_file_path, 'input_files')
3649
3650 from madgraph import MG4DIR, MG5DIR, MadGraph5Error, InvalidCmd
3651+from tests.acceptance_tests.test_cmd_madevent import check_html_page
3652
3653 pjoin = os.path.join
3654
3655@@ -190,7 +191,7 @@
3656 self.assertTrue( 'HERWIG6 = parton_shower' in card)
3657 card = card.replace('HERWIG6 = parton_shower', 'HERWIGPP = parton_shower')
3658 open('%s/Cards/run_card.dat' % self.path, 'w').write(card)
3659- self.cmd_line.exec_cmd('set cluster_temp_path /tmp/')
3660+ self.cmd_line.exec_cmd('set cluster_temp_path /tmp/ --no_save')
3661 self.do('generate_events -pf')
3662 # test the lhe event file exists
3663 self.assertTrue(os.path.exists('%s/Events/run_01/events.lhe.gz' % self.path))
3664@@ -215,7 +216,7 @@
3665 self.assertTrue( 'HERWIG6 = parton_shower' in card)
3666 card = card.replace('HERWIG6 = parton_shower', 'PYTHIA8 = parton_shower')
3667 open('%s/Cards/run_card.dat' % self.path, 'w').write(card)
3668- self.cmd_line.exec_cmd('set cluster_temp_path /tmp/')
3669+ self.cmd_line.exec_cmd('set cluster_temp_path /tmp/ --no_save')
3670 self.cmd_line.exec_cmd('set pythia8_path None')
3671 self.do('generate_events -pf')
3672 # test the lhe event file exists
3673@@ -242,7 +243,7 @@
3674 self.assertTrue( ' -1 = nevt_job' in card)
3675 card = card.replace(' -1 = nevt_job', '500 = nevt_job')
3676 open('%s/Cards/run_card.dat' % self.path, 'w').write(card)
3677- self.cmd_line.exec_cmd('set cluster_temp_path /tmp/ --no-save')
3678+ self.cmd_line.exec_cmd('set cluster_temp_path /tmp/ --no_save')
3679 self.do('generate_events -pf')
3680 # test the lhe event file exists
3681 self.assertTrue(os.path.exists('%s/Events/run_01/events.lhe.gz' % self.path))
3682@@ -258,7 +259,7 @@
3683
3684 nevents =20
3685 text = """
3686- set crash_on_error True
3687+ set crash_on_error True --no_save
3688 generate p p > t t~ [QCD]
3689 output %s
3690 launch
3691@@ -378,7 +379,7 @@
3692 def test_madspin_LOonly(self):
3693
3694 text = """
3695- set crash_on_error True
3696+ set crash_on_error True --no_save
3697 generate p p > w+ [LOonly]
3698 output %s
3699 launch
3700@@ -596,6 +597,9 @@
3701 self.assertTrue(os.path.exists('%s/Events/run_01/alllogs_0.html' % self.path))
3702 self.assertTrue(os.path.exists('%s/Events/run_01/alllogs_1.html' % self.path))
3703 self.assertTrue(os.path.exists('%s/Events/run_01/alllogs_2.html' % self.path))
3704+
3705+ check_html_page(self, pjoin(self.path, 'crossx.html'))
3706+ check_html_page(self, pjoin(self.path, 'HTML', 'run_01', 'results.html'))
3707
3708
3709 def test_calculate_xsect_nlo(self):
3710@@ -614,6 +618,9 @@
3711 self.assertTrue(os.path.exists('%s/Events/run_01/alllogs_0.html' % self.path))
3712 self.assertTrue(os.path.exists('%s/Events/run_01/alllogs_1.html' % self.path))
3713
3714+ check_html_page(self, pjoin(self.path, 'crossx.html'))
3715+ check_html_page(self, pjoin(self.path, 'HTML', 'run_01', 'results.html'))
3716+
3717
3718 def test_calculate_xsect_lo(self):
3719 """test the param_card created is correct"""
3720
3721=== modified file 'tests/acceptance_tests/test_cmd_madevent.py'
3722--- tests/acceptance_tests/test_cmd_madevent.py 2018-04-26 14:24:04 +0000
3723+++ tests/acceptance_tests/test_cmd_madevent.py 2018-06-15 08:18:50 +0000
3724@@ -47,6 +47,22 @@
3725
3726 pjoin = os.path.join
3727
3728+def check_html_page(cls, link):
3729+ """return True if all link in the html page are existing on disk.
3730+ otherwise raise an assertion error"""
3731+
3732+ text=open(link).read()
3733+ pattern = re.compile(r'href=[\"\']?(.*?)?[\"\'\s\#]', re.DOTALL)
3734+
3735+ cwd = os.path.dirname(link)
3736+ with misc.chdir(cwd):
3737+ for path in pattern.findall(text):
3738+ if not path:
3739+ continue # means is just a linke starting with #
3740+ cls.assertTrue(os.path.exists(path), '%s/%s' %(cwd,path))
3741+ return True
3742+
3743+
3744 #===============================================================================
3745 # TestCmd
3746 #===============================================================================
3747@@ -588,6 +604,12 @@
3748 text = fsock.read()
3749 self.assertTrue(text.count('dynamical scheme') >= 3)
3750
3751+ # check that the html link makes sense
3752+ #check_html_page(self, pjoin(self.run_dir, 'crossx.html'))
3753+
3754+
3755+
3756+
3757
3758 def check_pythia_output(self, run_name='run_01', syst=False):
3759 """ """
3760@@ -825,6 +847,7 @@
3761 stdout=stdout,stderr=stdout)
3762
3763 self.check_parton_output(cross=4.541638, error=0.035)
3764+
3765 self.check_parton_output('run_02', cross=4.41887317, error=0.035)
3766 self.check_pythia_output()
3767 self.assertEqual(cwd, os.getcwd())
3768@@ -878,7 +901,11 @@
3769 'cross is %s and not %s. NB_SIGMA %s' % (float(data[0]['cross']), cross, float(data[0]['cross'])/new_error)
3770 )
3771 self.assertTrue(float(data[0]['error']) < 3 * error)
3772-
3773+
3774+ check_html_page(self, pjoin(self.run_dir, 'crossx.html'))
3775+ if 'decayed' not in run_name:
3776+ check_html_page(self, pjoin(self.run_dir,'HTML', run_name, 'results.html'))
3777+
3778 def check_pythia_output(self, run_name='run_01'):
3779 """ """
3780 # check that the number of event is fine:
3781
3782=== modified file 'tests/acceptance_tests/test_cmd_reweight.py'
3783--- tests/acceptance_tests/test_cmd_reweight.py 2018-04-24 21:57:16 +0000
3784+++ tests/acceptance_tests/test_cmd_reweight.py 2018-06-15 08:18:50 +0000
3785@@ -292,8 +292,8 @@
3786 rwgt_data = event.parse_reweight()
3787 #solutions.append(rwgt_data['MYNLO_tree'])
3788 if i < len(solutions):
3789- self.assertTrue(misc.equal(rwgt_data['MYNLO_tree'], solutions[i]))
3790- self.assertTrue(misc.equal(rwgt_data['MYNLO_tree'], event2.wgt))
3791+ self.assertTrue(misc.equal(rwgt_data['MYNLO_tree'], solutions[i],3), '(event %s) %s != %s ' % (i, rwgt_data['MYNLO_tree'], solutions[i]))
3792+ self.assertTrue(misc.equal(rwgt_data['MYNLO_tree'], event2.wgt, 3), '(event %s) %s != %s ' % (i, rwgt_data['MYNLO_tree'], event2.wgt))
3793 #misc.sprint(solutions)
3794
3795 def test_scan_reweighting(self):
3796
3797=== added file 'tests/acceptance_tests/test_madspin.py'
3798--- tests/acceptance_tests/test_madspin.py 1970-01-01 00:00:00 +0000
3799+++ tests/acceptance_tests/test_madspin.py 2018-06-15 08:18:50 +0000
3800@@ -0,0 +1,114 @@
3801+from __future__ import division
3802+import subprocess
3803+import unittest
3804+import os
3805+import re
3806+import shutil
3807+import sys
3808+import logging
3809+import time
3810+import tempfile
3811+import math
3812+
3813+logger = logging.getLogger('test_cmd')
3814+
3815+import tests.unit_tests.iolibs.test_file_writers as test_file_writers
3816+
3817+import madgraph.interface.master_interface as MGCmd
3818+import madgraph.interface.madevent_interface as MECmd
3819+import madgraph.interface.launch_ext_program as launch_ext
3820+import madgraph.iolibs.files as files
3821+
3822+import madgraph.various.misc as misc
3823+import madgraph.various.lhe_parser as lhe_parser
3824+import madgraph.various.banner as banner_mod
3825+import madgraph.various.lhe_parser as lhe_parser
3826+import madgraph.various.banner as banner
3827+
3828+_file_path = os.path.split(os.path.dirname(os.path.realpath(__file__)))[0]
3829+_pickle_path =os.path.join(_file_path, 'input_files')
3830+
3831+from madgraph import MG4DIR, MG5DIR, MadGraph5Error, InvalidCmd
3832+
3833+pjoin = os.path.join
3834+
3835+#===============================================================================
3836+# TestCmd
3837+#===============================================================================
3838+class TestMadSpin(unittest.TestCase):
3839+ """test that we can launch everything from a single file"""
3840+
3841+ def setUp(self):
3842+
3843+ self.debuging = False
3844+ if self.debuging:
3845+ self.path = pjoin(MG5DIR, 'MS_TEST')
3846+ if os.path.exists(self.path):
3847+ shutil.rmtree(self.path)
3848+ os.mkdir(self.path)
3849+ else:
3850+ self.path = tempfile.mkdtemp(prefix='ms_test_mg5')
3851+ self.run_dir = pjoin(self.path, 'MGPROC')
3852+
3853+
3854+ def tearDown(self):
3855+
3856+ if not self.debuging:
3857+ shutil.rmtree(self.path)
3858+ self.assertFalse(self.debuging)
3859+
3860+
3861+ def test_hepmc_decay(self):
3862+ """ """
3863+
3864+ cwd = os.getcwd()
3865+
3866+ files.cp(pjoin(MG5DIR, 'tests', 'input_files', 'test.hepmc.gz'), self.path)
3867+
3868+
3869+ fsock = open(pjoin(self.path, 'test_hepmc'),'w')
3870+ text = """
3871+ set spinmode none
3872+ set cross_section {0:1.0}
3873+ set new_wgt BR
3874+ set input_format hepmc
3875+ import ./test.hepmc.gz
3876+ import model %s/tests/input_files/DM_pion %s/tests/input_files/DM_pion/param_pion.dat
3877+ decay k0 > xr xr a
3878+ launch
3879+ """ % (MG5DIR, MG5DIR)
3880+
3881+ fsock.write(text)
3882+ fsock.close()
3883+
3884+ import subprocess
3885+ if logging.getLogger('madgraph').level <= 20:
3886+ stdout=None
3887+ stderr=None
3888+ else:
3889+ devnull =open(os.devnull,'w')
3890+ stdout=devnull
3891+ stderr=devnull
3892+
3893+ subprocess.call([pjoin(MG5DIR, 'MadSpin', 'madspin'),
3894+ pjoin(self.path, 'test_hepmc')],
3895+ cwd=pjoin(self.path),
3896+ stdout=stdout,stderr=stdout)
3897+ self.assertTrue(os.path.exists(pjoin(self.path, 'test_decayed.lhe.gz')))
3898+ lhe = lhe_parser.EventFile(pjoin(self.path, 'test_decayed.lhe.gz'))
3899+ self.assertEqual(10, len(lhe))
3900+
3901+ nb_dec = 0
3902+ nb_photon = 0
3903+ for event in lhe:
3904+ self.assertEqual(event.nexternal, len(event))
3905+ for particle in event:
3906+ if particle.pdg == 130:
3907+ self.assertEqual(particle.status,2)
3908+ nb_dec +=1
3909+ if particle.pdg ==22:
3910+ nb_photon += 1
3911+
3912+ self.assertEqual(nb_dec, 116)
3913+ self.assertEqual(nb_photon, 116)
3914+
3915\ No newline at end of file
3916
3917=== modified file 'tests/acceptance_tests/test_madweight.py'
3918--- tests/acceptance_tests/test_madweight.py 2015-10-24 19:53:10 +0000
3919+++ tests/acceptance_tests/test_madweight.py 2018-06-15 08:18:50 +0000
3920@@ -152,8 +152,8 @@
3921 except Exception, error:
3922 pass
3923
3924- cmd = """set automatic_html_opening False --no-save
3925- set cluster_temp_path /tmp --no-save
3926+ cmd = """set automatic_html_opening False --no_save
3927+ set cluster_temp_path /tmp --no_save
3928 generate p p > w+, w+ > e+ ve
3929 output madweight TEST_MW_W_prod -f
3930 launch
3931@@ -215,8 +215,8 @@
3932 except Exception, error:
3933 pass
3934
3935- cmd = """set automatic_html_opening False --no-save
3936- set cluster_temp_path /tmp --no-save
3937+ cmd = """set automatic_html_opening False --no_save
3938+ set cluster_temp_path /tmp --no_save
3939 generate p p > w+ j j, w+ > e+ ve
3940 output madweight TEST_MW_W2J_prod
3941 launch
3942
3943=== modified file 'tests/acceptance_tests/test_model_equivalence.py'
3944--- tests/acceptance_tests/test_model_equivalence.py 2016-09-06 15:01:18 +0000
3945+++ tests/acceptance_tests/test_model_equivalence.py 2018-06-15 08:18:50 +0000
3946@@ -347,6 +347,7 @@
3947 solutions = {'ymtau ': [1.7769999504089355], 'I4x33 ': [0.024123685681481218, 0.0], 'MTA ': [1.7769999504089355], 'GC_81 ': [0.0, 67.544], 'GC_5 ': [0.0, 0.094836], 'MZ ': [91.18800354003906], 'GC_27 ': [0.94484, 0.0], 'I1x33 ': [0.024123685681481218, 0.0], 'I3x33 ': [0.9448443987662922, 0.0], 'GC_95 ': [0.66811, 0.0], 'GC_60 ': [-0.37035, 0.0], 'ee__exp__2 ': [0.09483552005165403], 'aEWM1 ': [132.5070037841797], 'ytau ': [0.01020661671581679], 'GC_69 ': [-0.0, -190.38], 'GC_35 ': [-0.0, -0.42671], 'cw__exp__2 ': [0.7777535472599892], 'Gf ': [1.16639e-05], 'GC_59 ': [0.0, 0.08231], 'GC_21 ': [-0.94484, -0.0], 'ee ': [0.307953762847045], 'WZ ': [2.441404104232788], 'sw2 ': [0.22224645274001076], 'WT ': [1.5083359479904175], 'GC_80 ': [-0.0, -33.772], 'GC_57 ': [-0.0, -0.35482], 'sqrt__sw2 ': [0.4714302204356555], 'GC_67 ': [13.239, 0.0], 'GC_76 ': [-29.784, 0.0], 'GC_36 ': [0.0, 0.33188], 'GC_68 ': [-0.0, -63.46], 'GC_56 ': [0.10058, 0.0], 'sw__exp__2 ': [0.22224645274001076], 'GC_3 ': [-0.0, -0.30795], 'GC_54 ': [-0.10058, 0.0], 'WW ': [2.047600030899048], 'GC_70 ': [-26.266, 0.0], 'GC_66 ': [-13.239, 0.0], 'GC_38 ': [-0.0, -0.32662], 'GC_83 ': [-0.0, -0.017058], 'GC_77 ': [-16.545, 0.0], 'gw ': [0.653232969584471], 'MH ': [125.0], 'ymb ': [4.199999809265137], 'complexi ': [0.0, 1.0], 'GC_37 ': [-0.32662, 0.0], 'conjg__CKM1x1 ': [1.0], 'GC_2 ': [0.0, 0.2053], 'GC_51 ': [0.0, 0.28804], 'GC_71 ': [-0.0, -26.266], 'GC_39 ': [0.0, 0.32662], 'GC_82 ': [-0.017058, 0.0], 'GC_55 ': [-0.0, -0.10058], 'GC_78 ': [16.545, 0.0], 'GC_98 ': [-0.0072172, 0.0], 'GC_30 ': [-0.024124, -0.0], 'GC_15 ': [0.024124, 0.0], 'cw ': [0.881903366168873], 'yt ': [0.9448443987662922], 'sqrt__aEW ': [0.08687215260631942], 'vev ': [246.2184581018163], 'GC_79 ': [29.784, 0.0], 'GC_72 ': [0.0, 52.532], 'GC_1 ': [-0.0, -0.10265], 'conjg__CKM3x3 ': [1.0], 'GC_52 ': [-0.0, -0.57609], 'GC_100 ': [0.0, 0.46191], 'GC_65 ': [0.0, 0.27432], 'GC_12 ': [0.0, 1.4828], 'I2x33 ': [0.9448443987662922, 0.0], 'GC_94 ': [-0.0, -0.66811], 'sqrt__aS ': [0.3435112817874484], 'GC_31 ': [-0.0, -0.25774], 'aS ': [0.11800000071525575], 'MW__exp__2 ': [6467.21673128622], 'MZ__exp__4 ': [69143415.65084904], 'yb ': [0.024123685681481218], 'GC_99 ': [-0.0, -0.0072172], 'WH ': [0.006382339168339968], 'GC_96 ': [-0.010207, 0.0], 'MH__exp__2 ': [15625.0], 'GC_63 ': [0.0, 0.12671], 'GC_53 ': [0.0, 0.57609], 'GC_73 ': [26.266, 0.0], 'GC_64 ': [0.0, 0.084653], 'sw ': [0.4714302204356555], 'GC_9 ': [0.053768, 0.0], 'GC_32 ': [-0.0, -0.51548], 'muH ': [88.38834764831844], 'GC_7 ': [-0.053768, 0.0], 'aEW ': [0.0075467708984556505], 'vev__exp__2 ': [60623.52911003587], 'MZ__exp__2 ': [8315.251989618177], 'GC_97 ': [0.010207, 0.0], 'GC_62 ': [0.0, 0.37035], 'GC_74 ': [-24.765, 0.0], 'g1 ': [0.34919218438279087], 'GC_10 ': [-1.2177, 0.0], 'GC_8 ': [0.0, 0.053768], 'CKM3x3 ': [1.0], 'MW ': [80.41900727617956], 'MT ': [172.0], 'GC_33 ': [-0.0, -0.77321], 'GC_6 ': [0.0, 0.18967], 'GC_4 ': [0.0, 0.30795], 'MB ': [4.699999809265137], 'GC_61 ': [0.0, -0.20573], 'ymt ': [164.5], 'GC_75 ': [24.765, 0.0], 'G__exp__2 ': [1.4828317414825511], 'lam ': [0.1288691060169027], 'GC_50 ': [-0.0, -0.28804], 'GC_34 ': [0.0, 0.21336], 'GC_11 ': [0.0, 1.2177], 'sqrt__2 ': [1.4142135623730951], 'GC_58 ': [-0.0, -0.027437]}
3948 #solutions = {'GC_5 ': [0.0, 0.094836], 'mdl_MW ': [80.41900727617956], 'mdl_yb ': [0.024123685681481218], 'mdl_sw__exp__2 ': [0.22224645274001076], 'mdl_conjg__CKM3x3 ': [1.0], 'GC_56 ': [0.10058, 0.0], 'mdl_MH ': [125.0], 'GC_95 ': [0.66811, 0.0], 'mdl_I4x33 ': [0.024123685681481218, 0.0], 'mdl_complexi ': [0.0, 1.0], 'aEWM1 ': [132.5070037841797], 'GC_69 ': [-0.0, -190.38], 'GC_35 ': [-0.0, -0.42671], 'mdl_Gf ': [1.16639e-05], 'mdl_gw ': [0.653232969584471], 'mdl_conjg__CKM1x1 ': [1.0], 'mdl_sqrt__aEW ': [0.08687215260631942], 'GC_59 ': [0.0, 0.08231], 'GC_21 ': [-0.94484, -0.0], 'GC_4 ': [0.0, 0.30795], 'mdl_cw ': [0.881903366168873], 'GC_80 ': [-0.0, -33.772], 'GC_64 ': [0.0, 0.084653], 'GC_57 ': [-0.0, -0.35482], 'GC_76 ': [-29.784, 0.0], 'GC_67 ': [13.239, 0.0], 'mdl_vev__exp__2 ': [60623.52911003587], 'mdl_I3x33 ': [0.9448443987662922, 0.0], 'GC_36 ': [0.0, 0.33188], 'mdl_I1x33 ': [0.024123685681481218, 0.0], 'GC_81 ': [0.0, 67.544], 'mdl_sw2 ': [0.22224645274001076], 'GC_68 ': [-0.0, -63.46], 'mdl_ytau ': [0.01020661671581679], 'GC_100 ': [0.0, 0.46191], 'GC_3 ': [-0.0, -0.30795], 'GC_54 ': [-0.10058, 0.0], 'GC_70 ': [-26.266, 0.0], 'GC_66 ': [-13.239, 0.0], 'GC_38 ': [-0.0, -0.32662], 'GC_83 ': [-0.0, -0.017058], 'GC_77 ': [-16.545, 0.0], 'GC_27 ': [0.94484, 0.0], 'GC_10 ': [-1.2177, 0.0], 'GC_37 ': [-0.32662, 0.0], 'GC_60 ': [-0.37035, 0.0], 'GC_2 ': [0.0, 0.2053], 'mdl_muH ': [88.38834764831844], 'mdl_MT ': [172.0], 'mdl_WH ': [0.006382339168339968], 'GC_51 ': [0.0, 0.28804], 'GC_71 ': [-0.0, -26.266], 'GC_39 ': [0.0, 0.32662], 'GC_82 ': [-0.017058, 0.0], 'mdl_sw ': [0.4714302204356555], 'GC_55 ': [-0.0, -0.10058], 'GC_61 ': [0.0, -0.20573], 'mdl_cw__exp__2 ': [0.7777535472599892], 'mdl_ymt ': [164.5], 'GC_78 ': [16.545, 0.0], 'mdl_CKM3x3 ': [1.0], 'GC_30 ': [-0.024124, -0.0], 'GC_15 ': [0.024124, 0.0], 'mdl_aEW ': [0.0075467708984556505], 'mdl_sqrt__sw2 ': [0.4714302204356555], 'mdl_I2x33 ': [0.9448443987662922, 0.0], 'GC_72 ': [0.0, 52.532], 'GC_1 ': [-0.0, -0.10265], 'GC_52 ': [-0.0, -0.57609], 'GC_65 ': [0.0, 0.27432], 'GC_12 ': [0.0, 1.4828], 'mdl_ymb ': [4.199999809265137], 'mdl_ee ': [0.307953762847045], 'GC_79 ': [29.784, 0.0], 'mdl_sqrt__2 ': [1.4142135623730951], 'GC_31 ': [-0.0, -0.25774], 'aS ': [0.11800000071525575], 'GC_99 ': [-0.0, -0.0072172], 'mdl_vev ': [246.2184581018163], 'GC_96 ': [-0.010207, 0.0], 'GC_63 ': [0.0, 0.12671], 'GC_53 ': [0.0, 0.57609], 'GC_73 ': [26.266, 0.0], 'mdl_MZ__exp__2 ': [8315.251989618177], 'mdl_WZ ': [2.441404104232788], 'GC_9 ': [0.053768, 0.0], 'mdl_g1 ': [0.34919218438279087], 'GC_32 ': [-0.0, -0.51548], 'mdl_G ': [1.2177157884673053], 'mdl_WT ': [1.5083359479904175], 'GC_7 ': [-0.053768, 0.0], 'mdl_G__exp__2 ': [1.4828317414825511], 'GC_97 ': [0.010207, 0.0], 'GC_62 ': [0.0, 0.37035], 'GC_74 ': [-24.765, 0.0], 'mdl_MZ ': [91.18800354003906], 'mdl_MZ__exp__4 ': [69143415.65084904], 'GC_8 ': [0.0, 0.053768], 'mdl_yt ': [0.9448443987662922], 'GC_98 ': [-0.0072172, 0.0], 'mdl_ee__exp__2 ': [0.09483552005165403], 'mdl_MB ': [4.699999809265137], 'GC_33 ': [-0.0, -0.77321], 'mdl_ymtau ': [1.7769999504089355], 'mdl_WW ': [2.047600030899048], 'GC_6 ': [0.0, 0.18967], 'mdl_MTA ': [1.7769999504089355], 'GC_75 ': [24.765, 0.0], 'GC_94 ': [-0.0, -0.66811], 'mdl_MW__exp__2 ': [6467.21673128622], 'mdl_MH__exp__2 ': [15625.0], 'GC_50 ': [-0.0, -0.28804], 'GC_34 ': [0.0, 0.21336], 'GC_11 ': [0.0, 1.2177], 'mdl_sqrt__aS ': [0.3435112817874484], 'GC_58 ': [-0.0, -0.027437], 'mdl_lam ': [0.1288691060169027]}
3949 nb_value = 0
3950+ checked_solutions = solutions.keys()
3951 for line in testprog.stdout:
3952 self.assertTrue('Warning' not in line)
3953 if '=' not in line:
3954@@ -356,6 +357,7 @@
3955 if variable.startswith('mdl_'):
3956 variable = variable[4:]
3957
3958+ checked_solutions.remove(variable)
3959 if ',' in line:
3960 value = eval(split[1])
3961 else:
3962@@ -375,8 +377,9 @@
3963 # solutions[variable] = [singlevalue]
3964 # else:
3965 # solutions[variable].append(singlevalue)
3966-
3967- self.assertEqual(nb_value, 116)
3968+ self.assertEqual(nb_value, 116 - len(checked_solutions))
3969+ self.assertEqual(set(checked_solutions), set(['GC_%s ' % i for i in [27,67,54,38,78,15,79,96,73,9,74,4,50]]))
3970+
3971
3972
3973
3974
3975=== added directory 'tests/input_files/DM_pion'
3976=== added file 'tests/input_files/DM_pion/CT_couplings.py'
3977--- tests/input_files/DM_pion/CT_couplings.py 1970-01-01 00:00:00 +0000
3978+++ tests/input_files/DM_pion/CT_couplings.py 2018-06-15 08:18:50 +0000
3979@@ -0,0 +1,1731 @@
3980+# This file was automatically created by FeynRules 2.3.2
3981+# Mathematica version: 9.0 for Linux x86 (64-bit) (November 20, 2012)
3982+# Date: Thu 11 Jun 2015 17:39:54
3983+
3984+
3985+from object_library import all_couplings, Coupling
3986+
3987+from function_library import complexconjugate, re, im, csc, sec, acsc, asec, cot
3988+
3989+
3990+
3991+R2GC_138_1 = Coupling(name = 'R2GC_138_1',
3992+ value = '-(complex(0,1)*G**2)/(16.*cmath.pi**2)',
3993+ order = {'QCD':2})
3994+
3995+R2GC_139_2 = Coupling(name = 'R2GC_139_2',
3996+ value = '(complex(0,1)*G**2)/(48.*cmath.pi**2)',
3997+ order = {'QCD':2})
3998+
3999+R2GC_140_3 = Coupling(name = 'R2GC_140_3',
4000+ value = '(ee**2*complex(0,1)*G**2)/(216.*cmath.pi**2)',
4001+ order = {'QCD':2,'QED':2})
4002+
4003+R2GC_140_4 = Coupling(name = 'R2GC_140_4',
4004+ value = '(ee**2*complex(0,1)*G**2)/(54.*cmath.pi**2)',
4005+ order = {'QCD':2,'QED':2})
4006+
4007+R2GC_141_5 = Coupling(name = 'R2GC_141_5',
4008+ value = '-(ee*complex(0,1)*G**3)/(144.*cmath.pi**2)',
4009+ order = {'QCD':3,'QED':1})
4010+
4011+R2GC_141_6 = Coupling(name = 'R2GC_141_6',
4012+ value = '(ee*complex(0,1)*G**3)/(72.*cmath.pi**2)',
4013+ order = {'QCD':3,'QED':1})
4014+
4015+R2GC_142_7 = Coupling(name = 'R2GC_142_7',
4016+ value = '(complex(0,1)*G**3*gAd33)/(16.*cmath.pi**2)',
4017+ order = {'DMV':1,'QCD':3})
4018+
4019+R2GC_142_8 = Coupling(name = 'R2GC_142_8',
4020+ value = '(complex(0,1)*G**3*gAu22)/(16.*cmath.pi**2)',
4021+ order = {'DMV':1,'QCD':3})
4022+
4023+R2GC_142_9 = Coupling(name = 'R2GC_142_9',
4024+ value = '(complex(0,1)*G**3*gAd11)/(16.*cmath.pi**2)',
4025+ order = {'DMV':1,'QCD':3})
4026+
4027+R2GC_142_10 = Coupling(name = 'R2GC_142_10',
4028+ value = '(complex(0,1)*G**3*gAd22)/(16.*cmath.pi**2)',
4029+ order = {'DMV':1,'QCD':3})
4030+
4031+R2GC_142_11 = Coupling(name = 'R2GC_142_11',
4032+ value = '(complex(0,1)*G**3*gAu33)/(16.*cmath.pi**2)',
4033+ order = {'DMV':1,'QCD':3})
4034+
4035+R2GC_142_12 = Coupling(name = 'R2GC_142_12',
4036+ value = '(complex(0,1)*G**3*gAu11)/(16.*cmath.pi**2)',
4037+ order = {'DMV':1,'QCD':3})
4038+
4039+R2GC_143_13 = Coupling(name = 'R2GC_143_13',
4040+ value = '-(ee*complex(0,1)*G**2*gVd33)/(72.*cmath.pi**2)',
4041+ order = {'DMV':1,'QCD':2,'QED':1})
4042+
4043+R2GC_143_14 = Coupling(name = 'R2GC_143_14',
4044+ value = '(ee*complex(0,1)*G**2*gVu22)/(36.*cmath.pi**2)',
4045+ order = {'DMV':1,'QCD':2,'QED':1})
4046+
4047+R2GC_143_15 = Coupling(name = 'R2GC_143_15',
4048+ value = '-(ee*complex(0,1)*G**2*gVd11)/(72.*cmath.pi**2)',
4049+ order = {'DMV':1,'QCD':2,'QED':1})
4050+
4051+R2GC_143_16 = Coupling(name = 'R2GC_143_16',
4052+ value = '-(ee*complex(0,1)*G**2*gVd22)/(72.*cmath.pi**2)',
4053+ order = {'DMV':1,'QCD':2,'QED':1})
4054+
4055+R2GC_143_17 = Coupling(name = 'R2GC_143_17',
4056+ value = '(ee*complex(0,1)*G**2*gVu33)/(36.*cmath.pi**2)',
4057+ order = {'DMV':1,'QCD':2,'QED':1})
4058+
4059+R2GC_143_18 = Coupling(name = 'R2GC_143_18',
4060+ value = '(ee*complex(0,1)*G**2*gVu11)/(36.*cmath.pi**2)',
4061+ order = {'DMV':1,'QCD':2,'QED':1})
4062+
4063+R2GC_144_19 = Coupling(name = 'R2GC_144_19',
4064+ value = '(complex(0,1)*G**3*gVd33)/(48.*cmath.pi**2)',
4065+ order = {'DMV':1,'QCD':3})
4066+
4067+R2GC_144_20 = Coupling(name = 'R2GC_144_20',
4068+ value = '(complex(0,1)*G**3*gVu22)/(48.*cmath.pi**2)',
4069+ order = {'DMV':1,'QCD':3})
4070+
4071+R2GC_144_21 = Coupling(name = 'R2GC_144_21',
4072+ value = '(complex(0,1)*G**3*gVd11)/(48.*cmath.pi**2)',
4073+ order = {'DMV':1,'QCD':3})
4074+
4075+R2GC_144_22 = Coupling(name = 'R2GC_144_22',
4076+ value = '(complex(0,1)*G**3*gVd22)/(48.*cmath.pi**2)',
4077+ order = {'DMV':1,'QCD':3})
4078+
4079+R2GC_144_23 = Coupling(name = 'R2GC_144_23',
4080+ value = '(complex(0,1)*G**3*gVu33)/(48.*cmath.pi**2)',
4081+ order = {'DMV':1,'QCD':3})
4082+
4083+R2GC_144_24 = Coupling(name = 'R2GC_144_24',
4084+ value = '(complex(0,1)*G**3*gVu11)/(48.*cmath.pi**2)',
4085+ order = {'DMV':1,'QCD':3})
4086+
4087+R2GC_145_25 = Coupling(name = 'R2GC_145_25',
4088+ value = '(complex(0,1)*G**2*gAd33**2)/(24.*cmath.pi**2) + (complex(0,1)*G**2*gVd33**2)/(24.*cmath.pi**2)',
4089+ order = {'DMV':2,'QCD':2})
4090+
4091+R2GC_145_26 = Coupling(name = 'R2GC_145_26',
4092+ value = '(complex(0,1)*G**2*gAu22**2)/(24.*cmath.pi**2) + (complex(0,1)*G**2*gVu22**2)/(24.*cmath.pi**2)',
4093+ order = {'DMV':2,'QCD':2})
4094+
4095+R2GC_145_27 = Coupling(name = 'R2GC_145_27',
4096+ value = '(complex(0,1)*G**2*gAd11**2)/(24.*cmath.pi**2) + (complex(0,1)*G**2*gVd11**2)/(24.*cmath.pi**2)',
4097+ order = {'DMV':2,'QCD':2})
4098+
4099+R2GC_145_28 = Coupling(name = 'R2GC_145_28',
4100+ value = '(complex(0,1)*G**2*gAd22**2)/(24.*cmath.pi**2) + (complex(0,1)*G**2*gVd22**2)/(24.*cmath.pi**2)',
4101+ order = {'DMV':2,'QCD':2})
4102+
4103+R2GC_145_29 = Coupling(name = 'R2GC_145_29',
4104+ value = '(complex(0,1)*G**2*gAu33**2)/(24.*cmath.pi**2) + (complex(0,1)*G**2*gVu33**2)/(24.*cmath.pi**2)',
4105+ order = {'DMV':2,'QCD':2})
4106+
4107+R2GC_145_30 = Coupling(name = 'R2GC_145_30',
4108+ value = '(complex(0,1)*G**2*gAu11**2)/(24.*cmath.pi**2) + (complex(0,1)*G**2*gVu11**2)/(24.*cmath.pi**2)',
4109+ order = {'DMV':2,'QCD':2})
4110+
4111+R2GC_146_31 = Coupling(name = 'R2GC_146_31',
4112+ value = '-(complex(0,1)*G**2*MB**2)/(8.*cmath.pi**2)',
4113+ order = {'QCD':2})
4114+
4115+R2GC_146_32 = Coupling(name = 'R2GC_146_32',
4116+ value = '-(complex(0,1)*G**2*MC**2)/(8.*cmath.pi**2)',
4117+ order = {'QCD':2})
4118+
4119+R2GC_146_33 = Coupling(name = 'R2GC_146_33',
4120+ value = '-(complex(0,1)*G**2*MD**2)/(8.*cmath.pi**2)',
4121+ order = {'QCD':2})
4122+
4123+R2GC_146_34 = Coupling(name = 'R2GC_146_34',
4124+ value = '-(complex(0,1)*G**2*MS**2)/(8.*cmath.pi**2)',
4125+ order = {'QCD':2})
4126+
4127+R2GC_146_35 = Coupling(name = 'R2GC_146_35',
4128+ value = '-(complex(0,1)*G**2*MT**2)/(8.*cmath.pi**2)',
4129+ order = {'QCD':2})
4130+
4131+R2GC_146_36 = Coupling(name = 'R2GC_146_36',
4132+ value = '-(complex(0,1)*G**2*MU**2)/(8.*cmath.pi**2)',
4133+ order = {'QCD':2})
4134+
4135+R2GC_147_37 = Coupling(name = 'R2GC_147_37',
4136+ value = '(cw*ee**2*complex(0,1)*G**2)/(288.*cmath.pi**2*sw) - (ee**2*complex(0,1)*G**2*sw)/(864.*cw*cmath.pi**2)',
4137+ order = {'QCD':2,'QED':2})
4138+
4139+R2GC_147_38 = Coupling(name = 'R2GC_147_38',
4140+ value = '(cw*ee**2*complex(0,1)*G**2)/(144.*cmath.pi**2*sw) - (5*ee**2*complex(0,1)*G**2*sw)/(432.*cw*cmath.pi**2)',
4141+ order = {'QCD':2,'QED':2})
4142+
4143+R2GC_148_39 = Coupling(name = 'R2GC_148_39',
4144+ value = '-(cw*ee*complex(0,1)*G**3)/(192.*cmath.pi**2*sw) + (ee*complex(0,1)*G**3*sw)/(576.*cw*cmath.pi**2)',
4145+ order = {'QCD':3,'QED':1})
4146+
4147+R2GC_148_40 = Coupling(name = 'R2GC_148_40',
4148+ value = '(cw*ee*complex(0,1)*G**3)/(192.*cmath.pi**2*sw) - (5*ee*complex(0,1)*G**3*sw)/(576.*cw*cmath.pi**2)',
4149+ order = {'QCD':3,'QED':1})
4150+
4151+R2GC_149_41 = Coupling(name = 'R2GC_149_41',
4152+ value = '(-3*cw*ee*complex(0,1)*G**3)/(64.*cmath.pi**2*sw) - (3*ee*complex(0,1)*G**3*sw)/(64.*cw*cmath.pi**2)',
4153+ order = {'QCD':3,'QED':1})
4154+
4155+R2GC_149_42 = Coupling(name = 'R2GC_149_42',
4156+ value = '(3*cw*ee*complex(0,1)*G**3)/(64.*cmath.pi**2*sw) + (3*ee*complex(0,1)*G**3*sw)/(64.*cw*cmath.pi**2)',
4157+ order = {'QCD':3,'QED':1})
4158+
4159+R2GC_150_43 = Coupling(name = 'R2GC_150_43',
4160+ value = '(cw*ee*complex(0,1)*G**2*gAd33)/(96.*cmath.pi**2*sw) - (cw*ee*complex(0,1)*G**2*gVd33)/(96.*cmath.pi**2*sw) + (ee*complex(0,1)*G**2*gAd33*sw)/(96.*cw*cmath.pi**2) + (ee*complex(0,1)*G**2*gVd33*sw)/(288.*cw*cmath.pi**2)',
4161+ order = {'DMV':1,'QCD':2,'QED':1})
4162+
4163+R2GC_150_44 = Coupling(name = 'R2GC_150_44',
4164+ value = '-(cw*ee*complex(0,1)*G**2*gAu22)/(96.*cmath.pi**2*sw) + (cw*ee*complex(0,1)*G**2*gVu22)/(96.*cmath.pi**2*sw) - (ee*complex(0,1)*G**2*gAu22*sw)/(96.*cw*cmath.pi**2) - (5*ee*complex(0,1)*G**2*gVu22*sw)/(288.*cw*cmath.pi**2)',
4165+ order = {'DMV':1,'QCD':2,'QED':1})
4166+
4167+R2GC_150_45 = Coupling(name = 'R2GC_150_45',
4168+ value = '(cw*ee*complex(0,1)*G**2*gAd11)/(96.*cmath.pi**2*sw) - (cw*ee*complex(0,1)*G**2*gVd11)/(96.*cmath.pi**2*sw) + (ee*complex(0,1)*G**2*gAd11*sw)/(96.*cw*cmath.pi**2) + (ee*complex(0,1)*G**2*gVd11*sw)/(288.*cw*cmath.pi**2)',
4169+ order = {'DMV':1,'QCD':2,'QED':1})
4170+
4171+R2GC_150_46 = Coupling(name = 'R2GC_150_46',
4172+ value = '(cw*ee*complex(0,1)*G**2*gAd22)/(96.*cmath.pi**2*sw) - (cw*ee*complex(0,1)*G**2*gVd22)/(96.*cmath.pi**2*sw) + (ee*complex(0,1)*G**2*gAd22*sw)/(96.*cw*cmath.pi**2) + (ee*complex(0,1)*G**2*gVd22*sw)/(288.*cw*cmath.pi**2)',
4173+ order = {'DMV':1,'QCD':2,'QED':1})
4174+
4175+R2GC_150_47 = Coupling(name = 'R2GC_150_47',
4176+ value = '-(cw*ee*complex(0,1)*G**2*gAu33)/(96.*cmath.pi**2*sw) + (cw*ee*complex(0,1)*G**2*gVu33)/(96.*cmath.pi**2*sw) - (ee*complex(0,1)*G**2*gAu33*sw)/(96.*cw*cmath.pi**2) - (5*ee*complex(0,1)*G**2*gVu33*sw)/(288.*cw*cmath.pi**2)',
4177+ order = {'DMV':1,'QCD':2,'QED':1})
4178+
4179+R2GC_150_48 = Coupling(name = 'R2GC_150_48',
4180+ value = '-(cw*ee*complex(0,1)*G**2*gAu11)/(96.*cmath.pi**2*sw) + (cw*ee*complex(0,1)*G**2*gVu11)/(96.*cmath.pi**2*sw) - (ee*complex(0,1)*G**2*gAu11*sw)/(96.*cw*cmath.pi**2) - (5*ee*complex(0,1)*G**2*gVu11*sw)/(288.*cw*cmath.pi**2)',
4181+ order = {'DMV':1,'QCD':2,'QED':1})
4182+
4183+R2GC_151_49 = Coupling(name = 'R2GC_151_49',
4184+ value = '(ee**2*complex(0,1)*G**2)/(288.*cmath.pi**2) + (cw**2*ee**2*complex(0,1)*G**2)/(192.*cmath.pi**2*sw**2) + (5*ee**2*complex(0,1)*G**2*sw**2)/(1728.*cw**2*cmath.pi**2)',
4185+ order = {'QCD':2,'QED':2})
4186+
4187+R2GC_151_50 = Coupling(name = 'R2GC_151_50',
4188+ value = '-(ee**2*complex(0,1)*G**2)/(288.*cmath.pi**2) + (cw**2*ee**2*complex(0,1)*G**2)/(192.*cmath.pi**2*sw**2) + (17*ee**2*complex(0,1)*G**2*sw**2)/(1728.*cw**2*cmath.pi**2)',
4189+ order = {'QCD':2,'QED':2})
4190+
4191+R2GC_152_51 = Coupling(name = 'R2GC_152_51',
4192+ value = '-(complex(0,1)*G**2*MB*yb)/(8.*cmath.pi**2*cmath.sqrt(2))',
4193+ order = {'QCD':2,'QED':1})
4194+
4195+R2GC_152_52 = Coupling(name = 'R2GC_152_52',
4196+ value = '-(complex(0,1)*G**2*MC*yc)/(8.*cmath.pi**2*cmath.sqrt(2))',
4197+ order = {'QCD':2,'QED':1})
4198+
4199+R2GC_152_53 = Coupling(name = 'R2GC_152_53',
4200+ value = '-(complex(0,1)*G**2*MD*ydo)/(8.*cmath.pi**2*cmath.sqrt(2))',
4201+ order = {'QCD':2,'QED':1})
4202+
4203+R2GC_152_54 = Coupling(name = 'R2GC_152_54',
4204+ value = '-(complex(0,1)*G**2*MS*ys)/(8.*cmath.pi**2*cmath.sqrt(2))',
4205+ order = {'QCD':2,'QED':1})
4206+
4207+R2GC_152_55 = Coupling(name = 'R2GC_152_55',
4208+ value = '-(complex(0,1)*G**2*MT*yt)/(8.*cmath.pi**2*cmath.sqrt(2))',
4209+ order = {'QCD':2,'QED':1})
4210+
4211+R2GC_152_56 = Coupling(name = 'R2GC_152_56',
4212+ value = '-(complex(0,1)*G**2*MU*yup)/(8.*cmath.pi**2*cmath.sqrt(2))',
4213+ order = {'QCD':2,'QED':1})
4214+
4215+R2GC_153_57 = Coupling(name = 'R2GC_153_57',
4216+ value = '(complex(0,1)*G**2*gSd33*MB*yb)/(8.*cmath.pi**2*cmath.sqrt(2))',
4217+ order = {'DMS':1,'QCD':2,'QED':1})
4218+
4219+R2GC_153_58 = Coupling(name = 'R2GC_153_58',
4220+ value = '(complex(0,1)*G**2*gSu22*MC*yc)/(8.*cmath.pi**2*cmath.sqrt(2))',
4221+ order = {'DMS':1,'QCD':2,'QED':1})
4222+
4223+R2GC_153_59 = Coupling(name = 'R2GC_153_59',
4224+ value = '(complex(0,1)*G**2*gSd11*MD*ydo)/(8.*cmath.pi**2*cmath.sqrt(2))',
4225+ order = {'DMS':1,'QCD':2,'QED':1})
4226+
4227+R2GC_153_60 = Coupling(name = 'R2GC_153_60',
4228+ value = '(complex(0,1)*G**2*gSd22*MS*ys)/(8.*cmath.pi**2*cmath.sqrt(2))',
4229+ order = {'DMS':1,'QCD':2,'QED':1})
4230+
4231+R2GC_153_61 = Coupling(name = 'R2GC_153_61',
4232+ value = '(complex(0,1)*G**2*gSu33*MT*yt)/(8.*cmath.pi**2*cmath.sqrt(2))',
4233+ order = {'DMS':1,'QCD':2,'QED':1})
4234+
4235+R2GC_153_62 = Coupling(name = 'R2GC_153_62',
4236+ value = '(complex(0,1)*G**2*gSu11*MU*yup)/(8.*cmath.pi**2*cmath.sqrt(2))',
4237+ order = {'DMS':1,'QCD':2,'QED':1})
4238+
4239+R2GC_154_63 = Coupling(name = 'R2GC_154_63',
4240+ value = '-(complex(0,1)*G**2*yb**2)/(16.*cmath.pi**2)',
4241+ order = {'QCD':2,'QED':2})
4242+
4243+R2GC_154_64 = Coupling(name = 'R2GC_154_64',
4244+ value = '-(complex(0,1)*G**2*yc**2)/(16.*cmath.pi**2)',
4245+ order = {'QCD':2,'QED':2})
4246+
4247+R2GC_154_65 = Coupling(name = 'R2GC_154_65',
4248+ value = '-(complex(0,1)*G**2*ydo**2)/(16.*cmath.pi**2)',
4249+ order = {'QCD':2,'QED':2})
4250+
4251+R2GC_154_66 = Coupling(name = 'R2GC_154_66',
4252+ value = '-(complex(0,1)*G**2*ys**2)/(16.*cmath.pi**2)',
4253+ order = {'QCD':2,'QED':2})
4254+
4255+R2GC_154_67 = Coupling(name = 'R2GC_154_67',
4256+ value = '-(complex(0,1)*G**2*yt**2)/(16.*cmath.pi**2)',
4257+ order = {'QCD':2,'QED':2})
4258+
4259+R2GC_154_68 = Coupling(name = 'R2GC_154_68',
4260+ value = '-(complex(0,1)*G**2*yup**2)/(16.*cmath.pi**2)',
4261+ order = {'QCD':2,'QED':2})
4262+
4263+R2GC_155_69 = Coupling(name = 'R2GC_155_69',
4264+ value = '(complex(0,1)*G**2*gPd33*yb**2)/(16.*cmath.pi**2)',
4265+ order = {'DMS':1,'QCD':2,'QED':2})
4266+
4267+R2GC_155_70 = Coupling(name = 'R2GC_155_70',
4268+ value = '-(complex(0,1)*G**2*gPu22*yc**2)/(16.*cmath.pi**2)',
4269+ order = {'DMS':1,'QCD':2,'QED':2})
4270+
4271+R2GC_155_71 = Coupling(name = 'R2GC_155_71',
4272+ value = '(complex(0,1)*G**2*gPd11*ydo**2)/(16.*cmath.pi**2)',
4273+ order = {'DMS':1,'QCD':2,'QED':2})
4274+
4275+R2GC_155_72 = Coupling(name = 'R2GC_155_72',
4276+ value = '(complex(0,1)*G**2*gPd22*ys**2)/(16.*cmath.pi**2)',
4277+ order = {'DMS':1,'QCD':2,'QED':2})
4278+
4279+R2GC_155_73 = Coupling(name = 'R2GC_155_73',
4280+ value = '-(complex(0,1)*G**2*gPu33*yt**2)/(16.*cmath.pi**2)',
4281+ order = {'DMS':1,'QCD':2,'QED':2})
4282+
4283+R2GC_155_74 = Coupling(name = 'R2GC_155_74',
4284+ value = '-(complex(0,1)*G**2*gPu11*yup**2)/(16.*cmath.pi**2)',
4285+ order = {'DMS':1,'QCD':2,'QED':2})
4286+
4287+R2GC_156_75 = Coupling(name = 'R2GC_156_75',
4288+ value = '(complex(0,1)*G**2*gSd33*yb**2)/(16.*cmath.pi**2)',
4289+ order = {'DMS':1,'QCD':2,'QED':2})
4290+
4291+R2GC_156_76 = Coupling(name = 'R2GC_156_76',
4292+ value = '(complex(0,1)*G**2*gSu22*yc**2)/(16.*cmath.pi**2)',
4293+ order = {'DMS':1,'QCD':2,'QED':2})
4294+
4295+R2GC_156_77 = Coupling(name = 'R2GC_156_77',
4296+ value = '(complex(0,1)*G**2*gSd11*ydo**2)/(16.*cmath.pi**2)',
4297+ order = {'DMS':1,'QCD':2,'QED':2})
4298+
4299+R2GC_156_78 = Coupling(name = 'R2GC_156_78',
4300+ value = '(complex(0,1)*G**2*gSd22*ys**2)/(16.*cmath.pi**2)',
4301+ order = {'DMS':1,'QCD':2,'QED':2})
4302+
4303+R2GC_156_79 = Coupling(name = 'R2GC_156_79',
4304+ value = '(complex(0,1)*G**2*gSu33*yt**2)/(16.*cmath.pi**2)',
4305+ order = {'DMS':1,'QCD':2,'QED':2})
4306+
4307+R2GC_156_80 = Coupling(name = 'R2GC_156_80',
4308+ value = '(complex(0,1)*G**2*gSu11*yup**2)/(16.*cmath.pi**2)',
4309+ order = {'DMS':1,'QCD':2,'QED':2})
4310+
4311+R2GC_157_81 = Coupling(name = 'R2GC_157_81',
4312+ value = '-(complex(0,1)*G**2*gPd33**2*yb**2)/(16.*cmath.pi**2) - (complex(0,1)*G**2*gSd33**2*yb**2)/(16.*cmath.pi**2)',
4313+ order = {'DMS':2,'QCD':2,'QED':2})
4314+
4315+R2GC_157_82 = Coupling(name = 'R2GC_157_82',
4316+ value = '-(complex(0,1)*G**2*gPu22**2*yc**2)/(16.*cmath.pi**2) - (complex(0,1)*G**2*gSu22**2*yc**2)/(16.*cmath.pi**2)',
4317+ order = {'DMS':2,'QCD':2,'QED':2})
4318+
4319+R2GC_157_83 = Coupling(name = 'R2GC_157_83',
4320+ value = '-(complex(0,1)*G**2*gPd11**2*ydo**2)/(16.*cmath.pi**2) - (complex(0,1)*G**2*gSd11**2*ydo**2)/(16.*cmath.pi**2)',
4321+ order = {'DMS':2,'QCD':2,'QED':2})
4322+
4323+R2GC_157_84 = Coupling(name = 'R2GC_157_84',
4324+ value = '-(complex(0,1)*G**2*gPd22**2*ys**2)/(16.*cmath.pi**2) - (complex(0,1)*G**2*gSd22**2*ys**2)/(16.*cmath.pi**2)',
4325+ order = {'DMS':2,'QCD':2,'QED':2})
4326+
4327+R2GC_157_85 = Coupling(name = 'R2GC_157_85',
4328+ value = '-(complex(0,1)*G**2*gPu33**2*yt**2)/(16.*cmath.pi**2) - (complex(0,1)*G**2*gSu33**2*yt**2)/(16.*cmath.pi**2)',
4329+ order = {'DMS':2,'QCD':2,'QED':2})
4330+
4331+R2GC_157_86 = Coupling(name = 'R2GC_157_86',
4332+ value = '-(complex(0,1)*G**2*gPu11**2*yup**2)/(16.*cmath.pi**2) - (complex(0,1)*G**2*gSu11**2*yup**2)/(16.*cmath.pi**2)',
4333+ order = {'DMS':2,'QCD':2,'QED':2})
4334+
4335+R2GC_158_87 = Coupling(name = 'R2GC_158_87',
4336+ value = '(ee**2*complex(0,1)*G**2)/(96.*cmath.pi**2*sw**2)',
4337+ order = {'QCD':2,'QED':2})
4338+
4339+R2GC_158_88 = Coupling(name = 'R2GC_158_88',
4340+ value = '(CKM2x1*ee**2*complex(0,1)*G**2*complexconjugate(CKM2x1))/(96.*cmath.pi**2*sw**2)',
4341+ order = {'QCD':2,'QED':2})
4342+
4343+R2GC_158_89 = Coupling(name = 'R2GC_158_89',
4344+ value = '(CKM2x2*ee**2*complex(0,1)*G**2*complexconjugate(CKM2x2))/(96.*cmath.pi**2*sw**2)',
4345+ order = {'QCD':2,'QED':2})
4346+
4347+R2GC_158_90 = Coupling(name = 'R2GC_158_90',
4348+ value = '(CKM1x1*ee**2*complex(0,1)*G**2*complexconjugate(CKM1x1))/(96.*cmath.pi**2*sw**2)',
4349+ order = {'QCD':2,'QED':2})
4350+
4351+R2GC_158_91 = Coupling(name = 'R2GC_158_91',
4352+ value = '(CKM1x2*ee**2*complex(0,1)*G**2*complexconjugate(CKM1x2))/(96.*cmath.pi**2*sw**2)',
4353+ order = {'QCD':2,'QED':2})
4354+
4355+R2GC_159_92 = Coupling(name = 'R2GC_159_92',
4356+ value = '-(complex(0,1)*G**2*yb**2)/(16.*cmath.pi**2) - (complex(0,1)*G**2*yt**2)/(16.*cmath.pi**2)',
4357+ order = {'QCD':2,'QED':2})
4358+
4359+R2GC_159_93 = Coupling(name = 'R2GC_159_93',
4360+ value = '-(CKM2x1*complex(0,1)*G**2*yc**2*complexconjugate(CKM2x1))/(16.*cmath.pi**2) - (CKM2x1*complex(0,1)*G**2*ydo**2*complexconjugate(CKM2x1))/(16.*cmath.pi**2)',
4361+ order = {'QCD':2,'QED':2})
4362+
4363+R2GC_159_94 = Coupling(name = 'R2GC_159_94',
4364+ value = '-(CKM2x2*complex(0,1)*G**2*yc**2*complexconjugate(CKM2x2))/(16.*cmath.pi**2) - (CKM2x2*complex(0,1)*G**2*ys**2*complexconjugate(CKM2x2))/(16.*cmath.pi**2)',
4365+ order = {'QCD':2,'QED':2})
4366+
4367+R2GC_159_95 = Coupling(name = 'R2GC_159_95',
4368+ value = '-(CKM1x1*complex(0,1)*G**2*ydo**2*complexconjugate(CKM1x1))/(16.*cmath.pi**2) - (CKM1x1*complex(0,1)*G**2*yup**2*complexconjugate(CKM1x1))/(16.*cmath.pi**2)',
4369+ order = {'QCD':2,'QED':2})
4370+
4371+R2GC_159_96 = Coupling(name = 'R2GC_159_96',
4372+ value = '-(CKM1x2*complex(0,1)*G**2*ys**2*complexconjugate(CKM1x2))/(16.*cmath.pi**2) - (CKM1x2*complex(0,1)*G**2*yup**2*complexconjugate(CKM1x2))/(16.*cmath.pi**2)',
4373+ order = {'QCD':2,'QED':2})
4374+
4375+R2GC_163_97 = Coupling(name = 'R2GC_163_97',
4376+ value = '-G**4/(192.*cmath.pi**2)',
4377+ order = {'QCD':4})
4378+
4379+R2GC_163_98 = Coupling(name = 'R2GC_163_98',
4380+ value = 'G**4/(64.*cmath.pi**2)',
4381+ order = {'QCD':4})
4382+
4383+R2GC_164_99 = Coupling(name = 'R2GC_164_99',
4384+ value = '-(complex(0,1)*G**4)/(192.*cmath.pi**2)',
4385+ order = {'QCD':4})
4386+
4387+R2GC_164_100 = Coupling(name = 'R2GC_164_100',
4388+ value = '(complex(0,1)*G**4)/(64.*cmath.pi**2)',
4389+ order = {'QCD':4})
4390+
4391+R2GC_165_101 = Coupling(name = 'R2GC_165_101',
4392+ value = '(complex(0,1)*G**4)/(192.*cmath.pi**2)',
4393+ order = {'QCD':4})
4394+
4395+R2GC_165_102 = Coupling(name = 'R2GC_165_102',
4396+ value = '-(complex(0,1)*G**4)/(64.*cmath.pi**2)',
4397+ order = {'QCD':4})
4398+
4399+R2GC_166_103 = Coupling(name = 'R2GC_166_103',
4400+ value = '-(complex(0,1)*G**4)/(48.*cmath.pi**2)',
4401+ order = {'QCD':4})
4402+
4403+R2GC_167_104 = Coupling(name = 'R2GC_167_104',
4404+ value = '(complex(0,1)*G**4)/(288.*cmath.pi**2)',
4405+ order = {'QCD':4})
4406+
4407+R2GC_167_105 = Coupling(name = 'R2GC_167_105',
4408+ value = '-(complex(0,1)*G**4)/(32.*cmath.pi**2)',
4409+ order = {'QCD':4})
4410+
4411+R2GC_168_106 = Coupling(name = 'R2GC_168_106',
4412+ value = '-(complex(0,1)*G**4)/(16.*cmath.pi**2)',
4413+ order = {'QCD':4})
4414+
4415+R2GC_168_107 = Coupling(name = 'R2GC_168_107',
4416+ value = '(complex(0,1)*G**4)/(4.*cmath.pi**2)',
4417+ order = {'QCD':4})
4418+
4419+R2GC_169_108 = Coupling(name = 'R2GC_169_108',
4420+ value = '(-3*complex(0,1)*G**4)/(64.*cmath.pi**2)',
4421+ order = {'QCD':4})
4422+
4423+R2GC_169_109 = Coupling(name = 'R2GC_169_109',
4424+ value = '(-23*complex(0,1)*G**4)/(64.*cmath.pi**2)',
4425+ order = {'QCD':4})
4426+
4427+R2GC_170_110 = Coupling(name = 'R2GC_170_110',
4428+ value = '(ee*complex(0,1)*G**2)/(18.*cmath.pi**2)',
4429+ order = {'QCD':2,'QED':1})
4430+
4431+R2GC_171_111 = Coupling(name = 'R2GC_171_111',
4432+ value = '-(complex(0,1)*G**3)/(6.*cmath.pi**2)',
4433+ order = {'QCD':3})
4434+
4435+R2GC_172_112 = Coupling(name = 'R2GC_172_112',
4436+ value = '-(ee*complex(0,1)*G**2)/(9.*cmath.pi**2)',
4437+ order = {'QCD':2,'QED':1})
4438+
4439+R2GC_182_113 = Coupling(name = 'R2GC_182_113',
4440+ value = '(complex(0,1)*G**2)/(12.*cmath.pi**2)',
4441+ order = {'QCD':2})
4442+
4443+R2GC_185_114 = Coupling(name = 'R2GC_185_114',
4444+ value = '(complex(0,1)*G**2*gAd33)/(6.*cmath.pi**2)',
4445+ order = {'DMV':1,'QCD':2})
4446+
4447+R2GC_186_115 = Coupling(name = 'R2GC_186_115',
4448+ value = '-(complex(0,1)*G**2*gVd33)/(6.*cmath.pi**2)',
4449+ order = {'DMV':1,'QCD':2})
4450+
4451+R2GC_187_116 = Coupling(name = 'R2GC_187_116',
4452+ value = '(complex(0,1)*G**2*MB)/(6.*cmath.pi**2)',
4453+ order = {'QCD':2})
4454+
4455+R2GC_188_117 = Coupling(name = 'R2GC_188_117',
4456+ value = '(cw*ee*complex(0,1)*G**2)/(12.*cmath.pi**2*sw)',
4457+ order = {'QCD':2,'QED':1})
4458+
4459+R2GC_189_118 = Coupling(name = 'R2GC_189_118',
4460+ value = '(ee*complex(0,1)*G**2*sw)/(36.*cw*cmath.pi**2)',
4461+ order = {'QCD':2,'QED':1})
4462+
4463+R2GC_190_119 = Coupling(name = 'R2GC_190_119',
4464+ value = '(complex(0,1)*G**2*yb)/(3.*cmath.pi**2*cmath.sqrt(2))',
4465+ order = {'QCD':2,'QED':1})
4466+
4467+R2GC_191_120 = Coupling(name = 'R2GC_191_120',
4468+ value = '-(G**2*yb)/(3.*cmath.pi**2*cmath.sqrt(2))',
4469+ order = {'QCD':2,'QED':1})
4470+
4471+R2GC_192_121 = Coupling(name = 'R2GC_192_121',
4472+ value = '-(G**2*gPd33*yb)/(3.*cmath.pi**2*cmath.sqrt(2))',
4473+ order = {'DMS':1,'QCD':2,'QED':1})
4474+
4475+R2GC_193_122 = Coupling(name = 'R2GC_193_122',
4476+ value = '-(complex(0,1)*G**2*gSd33*yb)/(3.*cmath.pi**2*cmath.sqrt(2))',
4477+ order = {'DMS':1,'QCD':2,'QED':1})
4478+
4479+R2GC_197_123 = Coupling(name = 'R2GC_197_123',
4480+ value = '(complex(0,1)*G**2*gAu22)/(6.*cmath.pi**2)',
4481+ order = {'DMV':1,'QCD':2})
4482+
4483+R2GC_198_124 = Coupling(name = 'R2GC_198_124',
4484+ value = '-(complex(0,1)*G**2*gVu22)/(6.*cmath.pi**2)',
4485+ order = {'DMV':1,'QCD':2})
4486+
4487+R2GC_199_125 = Coupling(name = 'R2GC_199_125',
4488+ value = '(complex(0,1)*G**2*MC)/(6.*cmath.pi**2)',
4489+ order = {'QCD':2})
4490+
4491+R2GC_200_126 = Coupling(name = 'R2GC_200_126',
4492+ value = '-(cw*ee*complex(0,1)*G**2)/(12.*cmath.pi**2*sw)',
4493+ order = {'QCD':2,'QED':1})
4494+
4495+R2GC_202_127 = Coupling(name = 'R2GC_202_127',
4496+ value = '(G**2*yc)/(3.*cmath.pi**2*cmath.sqrt(2))',
4497+ order = {'QCD':2,'QED':1})
4498+
4499+R2GC_203_128 = Coupling(name = 'R2GC_203_128',
4500+ value = '(complex(0,1)*G**2*yc)/(3.*cmath.pi**2*cmath.sqrt(2))',
4501+ order = {'QCD':2,'QED':1})
4502+
4503+R2GC_204_129 = Coupling(name = 'R2GC_204_129',
4504+ value = '-(G**2*gPu22*yc)/(3.*cmath.pi**2*cmath.sqrt(2))',
4505+ order = {'DMS':1,'QCD':2,'QED':1})
4506+
4507+R2GC_205_130 = Coupling(name = 'R2GC_205_130',
4508+ value = '-(complex(0,1)*G**2*gSu22*yc)/(3.*cmath.pi**2*cmath.sqrt(2))',
4509+ order = {'DMS':1,'QCD':2,'QED':1})
4510+
4511+R2GC_209_131 = Coupling(name = 'R2GC_209_131',
4512+ value = '(complex(0,1)*G**2*gAd11)/(6.*cmath.pi**2)',
4513+ order = {'DMV':1,'QCD':2})
4514+
4515+R2GC_210_132 = Coupling(name = 'R2GC_210_132',
4516+ value = '-(complex(0,1)*G**2*gVd11)/(6.*cmath.pi**2)',
4517+ order = {'DMV':1,'QCD':2})
4518+
4519+R2GC_211_133 = Coupling(name = 'R2GC_211_133',
4520+ value = '(complex(0,1)*G**2*MD)/(6.*cmath.pi**2)',
4521+ order = {'QCD':2})
4522+
4523+R2GC_212_134 = Coupling(name = 'R2GC_212_134',
4524+ value = '-(CKM2x1*ee*complex(0,1)*G**2)/(6.*cmath.pi**2*sw*cmath.sqrt(2))',
4525+ order = {'QCD':2,'QED':1})
4526+
4527+R2GC_215_135 = Coupling(name = 'R2GC_215_135',
4528+ value = '-(CKM2x1*G**2*yc)/(3.*cmath.pi**2)',
4529+ order = {'QCD':2,'QED':1})
4530+
4531+R2GC_216_136 = Coupling(name = 'R2GC_216_136',
4532+ value = '(complex(0,1)*G**2*ydo)/(3.*cmath.pi**2*cmath.sqrt(2))',
4533+ order = {'QCD':2,'QED':1})
4534+
4535+R2GC_217_137 = Coupling(name = 'R2GC_217_137',
4536+ value = '-(G**2*ydo)/(3.*cmath.pi**2*cmath.sqrt(2))',
4537+ order = {'QCD':2,'QED':1})
4538+
4539+R2GC_218_138 = Coupling(name = 'R2GC_218_138',
4540+ value = '(CKM2x1*G**2*ydo)/(3.*cmath.pi**2)',
4541+ order = {'QCD':2,'QED':1})
4542+
4543+R2GC_219_139 = Coupling(name = 'R2GC_219_139',
4544+ value = '-(G**2*gPd11*ydo)/(3.*cmath.pi**2*cmath.sqrt(2))',
4545+ order = {'DMS':1,'QCD':2,'QED':1})
4546+
4547+R2GC_220_140 = Coupling(name = 'R2GC_220_140',
4548+ value = '-(complex(0,1)*G**2*gSd11*ydo)/(3.*cmath.pi**2*cmath.sqrt(2))',
4549+ order = {'DMS':1,'QCD':2,'QED':1})
4550+
4551+R2GC_221_141 = Coupling(name = 'R2GC_221_141',
4552+ value = '-(ee*complex(0,1)*G**2*complexconjugate(CKM2x1))/(6.*cmath.pi**2*sw*cmath.sqrt(2))',
4553+ order = {'QCD':2,'QED':1})
4554+
4555+R2GC_222_142 = Coupling(name = 'R2GC_222_142',
4556+ value = '(G**2*yc*complexconjugate(CKM2x1))/(3.*cmath.pi**2)',
4557+ order = {'QCD':2,'QED':1})
4558+
4559+R2GC_223_143 = Coupling(name = 'R2GC_223_143',
4560+ value = '-(G**2*ydo*complexconjugate(CKM2x1))/(3.*cmath.pi**2)',
4561+ order = {'QCD':2,'QED':1})
4562+
4563+R2GC_227_144 = Coupling(name = 'R2GC_227_144',
4564+ value = '(complex(0,1)*G**2*gAd22)/(6.*cmath.pi**2)',
4565+ order = {'DMV':1,'QCD':2})
4566+
4567+R2GC_228_145 = Coupling(name = 'R2GC_228_145',
4568+ value = '-(complex(0,1)*G**2*gVd22)/(6.*cmath.pi**2)',
4569+ order = {'DMV':1,'QCD':2})
4570+
4571+R2GC_229_146 = Coupling(name = 'R2GC_229_146',
4572+ value = '(complex(0,1)*G**2*MS)/(6.*cmath.pi**2)',
4573+ order = {'QCD':2})
4574+
4575+R2GC_230_147 = Coupling(name = 'R2GC_230_147',
4576+ value = '-(CKM2x2*ee*complex(0,1)*G**2)/(6.*cmath.pi**2*sw*cmath.sqrt(2))',
4577+ order = {'QCD':2,'QED':1})
4578+
4579+R2GC_233_148 = Coupling(name = 'R2GC_233_148',
4580+ value = '-(CKM2x2*G**2*yc)/(3.*cmath.pi**2)',
4581+ order = {'QCD':2,'QED':1})
4582+
4583+R2GC_234_149 = Coupling(name = 'R2GC_234_149',
4584+ value = '(complex(0,1)*G**2*ys)/(3.*cmath.pi**2*cmath.sqrt(2))',
4585+ order = {'QCD':2,'QED':1})
4586+
4587+R2GC_235_150 = Coupling(name = 'R2GC_235_150',
4588+ value = '-(G**2*ys)/(3.*cmath.pi**2*cmath.sqrt(2))',
4589+ order = {'QCD':2,'QED':1})
4590+
4591+R2GC_236_151 = Coupling(name = 'R2GC_236_151',
4592+ value = '(CKM2x2*G**2*ys)/(3.*cmath.pi**2)',
4593+ order = {'QCD':2,'QED':1})
4594+
4595+R2GC_237_152 = Coupling(name = 'R2GC_237_152',
4596+ value = '-(G**2*gPd22*ys)/(3.*cmath.pi**2*cmath.sqrt(2))',
4597+ order = {'DMS':1,'QCD':2,'QED':1})
4598+
4599+R2GC_238_153 = Coupling(name = 'R2GC_238_153',
4600+ value = '-(complex(0,1)*G**2*gSd22*ys)/(3.*cmath.pi**2*cmath.sqrt(2))',
4601+ order = {'DMS':1,'QCD':2,'QED':1})
4602+
4603+R2GC_239_154 = Coupling(name = 'R2GC_239_154',
4604+ value = '-(ee*complex(0,1)*G**2*complexconjugate(CKM2x2))/(6.*cmath.pi**2*sw*cmath.sqrt(2))',
4605+ order = {'QCD':2,'QED':1})
4606+
4607+R2GC_240_155 = Coupling(name = 'R2GC_240_155',
4608+ value = '(G**2*yc*complexconjugate(CKM2x2))/(3.*cmath.pi**2)',
4609+ order = {'QCD':2,'QED':1})
4610+
4611+R2GC_241_156 = Coupling(name = 'R2GC_241_156',
4612+ value = '-(G**2*ys*complexconjugate(CKM2x2))/(3.*cmath.pi**2)',
4613+ order = {'QCD':2,'QED':1})
4614+
4615+R2GC_245_157 = Coupling(name = 'R2GC_245_157',
4616+ value = '(complex(0,1)*G**2*gAu33)/(6.*cmath.pi**2)',
4617+ order = {'DMV':1,'QCD':2})
4618+
4619+R2GC_246_158 = Coupling(name = 'R2GC_246_158',
4620+ value = '-(complex(0,1)*G**2*gVu33)/(6.*cmath.pi**2)',
4621+ order = {'DMV':1,'QCD':2})
4622+
4623+R2GC_247_159 = Coupling(name = 'R2GC_247_159',
4624+ value = '(complex(0,1)*G**2*MT)/(6.*cmath.pi**2)',
4625+ order = {'QCD':2})
4626+
4627+R2GC_248_160 = Coupling(name = 'R2GC_248_160',
4628+ value = '-(ee*complex(0,1)*G**2)/(6.*cmath.pi**2*sw*cmath.sqrt(2))',
4629+ order = {'QCD':2,'QED':1})
4630+
4631+R2GC_251_161 = Coupling(name = 'R2GC_251_161',
4632+ value = '(G**2*yb)/(3.*cmath.pi**2)',
4633+ order = {'QCD':2,'QED':1})
4634+
4635+R2GC_252_162 = Coupling(name = 'R2GC_252_162',
4636+ value = '-(G**2*yb)/(3.*cmath.pi**2)',
4637+ order = {'QCD':2,'QED':1})
4638+
4639+R2GC_253_163 = Coupling(name = 'R2GC_253_163',
4640+ value = '(G**2*yt)/(3.*cmath.pi**2)',
4641+ order = {'QCD':2,'QED':1})
4642+
4643+R2GC_254_164 = Coupling(name = 'R2GC_254_164',
4644+ value = '-(G**2*yt)/(3.*cmath.pi**2)',
4645+ order = {'QCD':2,'QED':1})
4646+
4647+R2GC_255_165 = Coupling(name = 'R2GC_255_165',
4648+ value = '(G**2*yt)/(3.*cmath.pi**2*cmath.sqrt(2))',
4649+ order = {'QCD':2,'QED':1})
4650+
4651+R2GC_256_166 = Coupling(name = 'R2GC_256_166',
4652+ value = '(complex(0,1)*G**2*yt)/(3.*cmath.pi**2*cmath.sqrt(2))',
4653+ order = {'QCD':2,'QED':1})
4654+
4655+R2GC_257_167 = Coupling(name = 'R2GC_257_167',
4656+ value = '-(G**2*gPu33*yt)/(3.*cmath.pi**2*cmath.sqrt(2))',
4657+ order = {'DMS':1,'QCD':2,'QED':1})
4658+
4659+R2GC_258_168 = Coupling(name = 'R2GC_258_168',
4660+ value = '-(complex(0,1)*G**2*gSu33*yt)/(3.*cmath.pi**2*cmath.sqrt(2))',
4661+ order = {'DMS':1,'QCD':2,'QED':1})
4662+
4663+R2GC_260_169 = Coupling(name = 'R2GC_260_169',
4664+ value = 'G**3/(24.*cmath.pi**2)',
4665+ order = {'QCD':3})
4666+
4667+R2GC_260_170 = Coupling(name = 'R2GC_260_170',
4668+ value = '(11*G**3)/(64.*cmath.pi**2)',
4669+ order = {'QCD':3})
4670+
4671+R2GC_261_171 = Coupling(name = 'R2GC_261_171',
4672+ value = '(31*complex(0,1)*G**4)/(64.*cmath.pi**2)',
4673+ order = {'QCD':4})
4674+
4675+R2GC_262_172 = Coupling(name = 'R2GC_262_172',
4676+ value = '(5*complex(0,1)*G**4)/(48.*cmath.pi**2)',
4677+ order = {'QCD':4})
4678+
4679+R2GC_262_173 = Coupling(name = 'R2GC_262_173',
4680+ value = '(19*complex(0,1)*G**4)/(32.*cmath.pi**2)',
4681+ order = {'QCD':4})
4682+
4683+R2GC_263_174 = Coupling(name = 'R2GC_263_174',
4684+ value = '(23*complex(0,1)*G**4)/(192.*cmath.pi**2)',
4685+ order = {'QCD':4})
4686+
4687+R2GC_264_175 = Coupling(name = 'R2GC_264_175',
4688+ value = '(7*complex(0,1)*G**4)/(64.*cmath.pi**2)',
4689+ order = {'QCD':4})
4690+
4691+R2GC_265_176 = Coupling(name = 'R2GC_265_176',
4692+ value = '(-17*complex(0,1)*G**4)/(64.*cmath.pi**2)',
4693+ order = {'QCD':4})
4694+
4695+R2GC_266_177 = Coupling(name = 'R2GC_266_177',
4696+ value = '(-7*complex(0,1)*G**4)/(32.*cmath.pi**2)',
4697+ order = {'QCD':4})
4698+
4699+R2GC_270_178 = Coupling(name = 'R2GC_270_178',
4700+ value = '(complex(0,1)*G**2*gAu11)/(6.*cmath.pi**2)',
4701+ order = {'DMV':1,'QCD':2})
4702+
4703+R2GC_271_179 = Coupling(name = 'R2GC_271_179',
4704+ value = '-(complex(0,1)*G**2*gVu11)/(6.*cmath.pi**2)',
4705+ order = {'DMV':1,'QCD':2})
4706+
4707+R2GC_272_180 = Coupling(name = 'R2GC_272_180',
4708+ value = '(complex(0,1)*G**2*MU)/(6.*cmath.pi**2)',
4709+ order = {'QCD':2})
4710+
4711+R2GC_273_181 = Coupling(name = 'R2GC_273_181',
4712+ value = '-(CKM1x1*ee*complex(0,1)*G**2)/(6.*cmath.pi**2*sw*cmath.sqrt(2))',
4713+ order = {'QCD':2,'QED':1})
4714+
4715+R2GC_274_182 = Coupling(name = 'R2GC_274_182',
4716+ value = '-(CKM1x2*ee*complex(0,1)*G**2)/(6.*cmath.pi**2*sw*cmath.sqrt(2))',
4717+ order = {'QCD':2,'QED':1})
4718+
4719+R2GC_277_183 = Coupling(name = 'R2GC_277_183',
4720+ value = '(CKM1x1*G**2*ydo)/(3.*cmath.pi**2)',
4721+ order = {'QCD':2,'QED':1})
4722+
4723+R2GC_278_184 = Coupling(name = 'R2GC_278_184',
4724+ value = '(CKM1x2*G**2*ys)/(3.*cmath.pi**2)',
4725+ order = {'QCD':2,'QED':1})
4726+
4727+R2GC_279_185 = Coupling(name = 'R2GC_279_185',
4728+ value = '(G**2*yup)/(3.*cmath.pi**2*cmath.sqrt(2))',
4729+ order = {'QCD':2,'QED':1})
4730+
4731+R2GC_280_186 = Coupling(name = 'R2GC_280_186',
4732+ value = '(complex(0,1)*G**2*yup)/(3.*cmath.pi**2*cmath.sqrt(2))',
4733+ order = {'QCD':2,'QED':1})
4734+
4735+R2GC_281_187 = Coupling(name = 'R2GC_281_187',
4736+ value = '-(CKM1x1*G**2*yup)/(3.*cmath.pi**2)',
4737+ order = {'QCD':2,'QED':1})
4738+
4739+R2GC_282_188 = Coupling(name = 'R2GC_282_188',
4740+ value = '-(CKM1x2*G**2*yup)/(3.*cmath.pi**2)',
4741+ order = {'QCD':2,'QED':1})
4742+
4743+R2GC_283_189 = Coupling(name = 'R2GC_283_189',
4744+ value = '-(G**2*gPu11*yup)/(3.*cmath.pi**2*cmath.sqrt(2))',
4745+ order = {'DMS':1,'QCD':2,'QED':1})
4746+
4747+R2GC_284_190 = Coupling(name = 'R2GC_284_190',
4748+ value = '-(complex(0,1)*G**2*gSu11*yup)/(3.*cmath.pi**2*cmath.sqrt(2))',
4749+ order = {'DMS':1,'QCD':2,'QED':1})
4750+
4751+R2GC_285_191 = Coupling(name = 'R2GC_285_191',
4752+ value = '-(ee*complex(0,1)*G**2*complexconjugate(CKM1x1))/(6.*cmath.pi**2*sw*cmath.sqrt(2))',
4753+ order = {'QCD':2,'QED':1})
4754+
4755+R2GC_286_192 = Coupling(name = 'R2GC_286_192',
4756+ value = '-(G**2*ydo*complexconjugate(CKM1x1))/(3.*cmath.pi**2)',
4757+ order = {'QCD':2,'QED':1})
4758+
4759+R2GC_287_193 = Coupling(name = 'R2GC_287_193',
4760+ value = '(G**2*yup*complexconjugate(CKM1x1))/(3.*cmath.pi**2)',
4761+ order = {'QCD':2,'QED':1})
4762+
4763+R2GC_288_194 = Coupling(name = 'R2GC_288_194',
4764+ value = '-(ee*complex(0,1)*G**2*complexconjugate(CKM1x2))/(6.*cmath.pi**2*sw*cmath.sqrt(2))',
4765+ order = {'QCD':2,'QED':1})
4766+
4767+R2GC_289_195 = Coupling(name = 'R2GC_289_195',
4768+ value = '-(G**2*ys*complexconjugate(CKM1x2))/(3.*cmath.pi**2)',
4769+ order = {'QCD':2,'QED':1})
4770+
4771+R2GC_290_196 = Coupling(name = 'R2GC_290_196',
4772+ value = '(G**2*yup*complexconjugate(CKM1x2))/(3.*cmath.pi**2)',
4773+ order = {'QCD':2,'QED':1})
4774+
4775+UVGC_160_1 = Coupling(name = 'UVGC_160_1',
4776+ value = {-1:'(51*G**3)/(128.*cmath.pi**2)'},
4777+ order = {'QCD':3})
4778+
4779+UVGC_161_2 = Coupling(name = 'UVGC_161_2',
4780+ value = {-1:'G**3/(128.*cmath.pi**2)'},
4781+ order = {'QCD':3})
4782+
4783+UVGC_162_3 = Coupling(name = 'UVGC_162_3',
4784+ value = {-1:'(3*complex(0,1)*G**2)/(64.*cmath.pi**2)'},
4785+ order = {'QCD':2})
4786+
4787+UVGC_162_4 = Coupling(name = 'UVGC_162_4',
4788+ value = {-1:'(-3*complex(0,1)*G**2)/(64.*cmath.pi**2)'},
4789+ order = {'QCD':2})
4790+
4791+UVGC_163_5 = Coupling(name = 'UVGC_163_5',
4792+ value = {-1:'(3*G**4)/(512.*cmath.pi**2)'},
4793+ order = {'QCD':4})
4794+
4795+UVGC_163_6 = Coupling(name = 'UVGC_163_6',
4796+ value = {-1:'(-3*G**4)/(512.*cmath.pi**2)'},
4797+ order = {'QCD':4})
4798+
4799+UVGC_164_7 = Coupling(name = 'UVGC_164_7',
4800+ value = {-1:'(3*complex(0,1)*G**4)/(512.*cmath.pi**2)'},
4801+ order = {'QCD':4})
4802+
4803+UVGC_164_8 = Coupling(name = 'UVGC_164_8',
4804+ value = {-1:'(-3*complex(0,1)*G**4)/(512.*cmath.pi**2)'},
4805+ order = {'QCD':4})
4806+
4807+UVGC_166_9 = Coupling(name = 'UVGC_166_9',
4808+ value = {-1:'-(complex(0,1)*G**4)/(128.*cmath.pi**2)'},
4809+ order = {'QCD':4})
4810+
4811+UVGC_166_10 = Coupling(name = 'UVGC_166_10',
4812+ value = {-1:'(complex(0,1)*G**4)/(128.*cmath.pi**2)'},
4813+ order = {'QCD':4})
4814+
4815+UVGC_167_11 = Coupling(name = 'UVGC_167_11',
4816+ value = {-1:'(-3*complex(0,1)*G**4)/(256.*cmath.pi**2)'},
4817+ order = {'QCD':4})
4818+
4819+UVGC_167_12 = Coupling(name = 'UVGC_167_12',
4820+ value = {-1:'(3*complex(0,1)*G**4)/(256.*cmath.pi**2)'},
4821+ order = {'QCD':4})
4822+
4823+UVGC_168_13 = Coupling(name = 'UVGC_168_13',
4824+ value = {-1:'-(complex(0,1)*G**4)/(24.*cmath.pi**2)'},
4825+ order = {'QCD':4})
4826+
4827+UVGC_168_14 = Coupling(name = 'UVGC_168_14',
4828+ value = {-1:'(47*complex(0,1)*G**4)/(128.*cmath.pi**2)'},
4829+ order = {'QCD':4})
4830+
4831+UVGC_169_15 = Coupling(name = 'UVGC_169_15',
4832+ value = {-1:'(-253*complex(0,1)*G**4)/(512.*cmath.pi**2)'},
4833+ order = {'QCD':4})
4834+
4835+UVGC_169_16 = Coupling(name = 'UVGC_169_16',
4836+ value = {-1:'(5*complex(0,1)*G**4)/(512.*cmath.pi**2)'},
4837+ order = {'QCD':4})
4838+
4839+UVGC_170_17 = Coupling(name = 'UVGC_170_17',
4840+ value = {-1:'(ee*complex(0,1)*G**2)/(36.*cmath.pi**2)'},
4841+ order = {'QCD':2,'QED':1})
4842+
4843+UVGC_171_18 = Coupling(name = 'UVGC_171_18',
4844+ value = {-1:'(-13*complex(0,1)*G**3)/(48.*cmath.pi**2)'},
4845+ order = {'QCD':3})
4846+
4847+UVGC_172_19 = Coupling(name = 'UVGC_172_19',
4848+ value = {-1:'-(ee*complex(0,1)*G**2)/(18.*cmath.pi**2)'},
4849+ order = {'QCD':2,'QED':1})
4850+
4851+UVGC_182_20 = Coupling(name = 'UVGC_182_20',
4852+ value = {-1:'( (complex(0,1)*G**2)/(6.*cmath.pi**2) if MB else -(complex(0,1)*G**2)/(12.*cmath.pi**2) ) + (complex(0,1)*G**2)/(12.*cmath.pi**2)',0:'( (5*complex(0,1)*G**2)/(12.*cmath.pi**2) - (complex(0,1)*G**2*reglog(MB/MU_R))/(2.*cmath.pi**2) if MB else (complex(0,1)*G**2)/(12.*cmath.pi**2) ) - (complex(0,1)*G**2)/(12.*cmath.pi**2)'},
4853+ order = {'QCD':2})
4854+
4855+UVGC_183_21 = Coupling(name = 'UVGC_183_21',
4856+ value = {-1:'( (ee*complex(0,1)*G**2)/(18.*cmath.pi**2) if MB else -(ee*complex(0,1)*G**2)/(36.*cmath.pi**2) )',0:'( (5*ee*complex(0,1)*G**2)/(36.*cmath.pi**2) - (ee*complex(0,1)*G**2*reglog(MB/MU_R))/(6.*cmath.pi**2) if MB else (ee*complex(0,1)*G**2)/(36.*cmath.pi**2) ) - (ee*complex(0,1)*G**2)/(36.*cmath.pi**2)'},
4857+ order = {'QCD':2,'QED':1})
4858+
4859+UVGC_184_22 = Coupling(name = 'UVGC_184_22',
4860+ value = {-1:'( 0 if MB else (complex(0,1)*G**3)/(48.*cmath.pi**2) )'},
4861+ order = {'QCD':3})
4862+
4863+UVGC_184_23 = Coupling(name = 'UVGC_184_23',
4864+ value = {-1:'( 0 if MC else (complex(0,1)*G**3)/(48.*cmath.pi**2) )'},
4865+ order = {'QCD':3})
4866+
4867+UVGC_184_24 = Coupling(name = 'UVGC_184_24',
4868+ value = {-1:'( 0 if MD else (complex(0,1)*G**3)/(48.*cmath.pi**2) )'},
4869+ order = {'QCD':3})
4870+
4871+UVGC_184_25 = Coupling(name = 'UVGC_184_25',
4872+ value = {-1:'(-19*complex(0,1)*G**3)/(128.*cmath.pi**2)'},
4873+ order = {'QCD':3})
4874+
4875+UVGC_184_26 = Coupling(name = 'UVGC_184_26',
4876+ value = {-1:'-(complex(0,1)*G**3)/(128.*cmath.pi**2)'},
4877+ order = {'QCD':3})
4878+
4879+UVGC_184_27 = Coupling(name = 'UVGC_184_27',
4880+ value = {-1:'( 0 if MS else (complex(0,1)*G**3)/(48.*cmath.pi**2) )'},
4881+ order = {'QCD':3})
4882+
4883+UVGC_184_28 = Coupling(name = 'UVGC_184_28',
4884+ value = {-1:'( 0 if MT else (complex(0,1)*G**3)/(48.*cmath.pi**2) )'},
4885+ order = {'QCD':3})
4886+
4887+UVGC_184_29 = Coupling(name = 'UVGC_184_29',
4888+ value = {-1:'( 0 if MU else (complex(0,1)*G**3)/(48.*cmath.pi**2) )'},
4889+ order = {'QCD':3})
4890+
4891+UVGC_184_30 = Coupling(name = 'UVGC_184_30',
4892+ value = {-1:'( -(complex(0,1)*G**3)/(6.*cmath.pi**2) if MB else (complex(0,1)*G**3)/(12.*cmath.pi**2) )',0:'( (-5*complex(0,1)*G**3)/(12.*cmath.pi**2) + (complex(0,1)*G**3*reglog(MB/MU_R))/(2.*cmath.pi**2) if MB else -(complex(0,1)*G**3)/(12.*cmath.pi**2) ) + (complex(0,1)*G**3)/(12.*cmath.pi**2)'},
4893+ order = {'QCD':3})
4894+
4895+UVGC_185_31 = Coupling(name = 'UVGC_185_31',
4896+ value = {-1:'( (complex(0,1)*G**2*gAd33)/(6.*cmath.pi**2) if MB else -(complex(0,1)*G**2*gAd33)/(12.*cmath.pi**2) ) + (complex(0,1)*G**2*gAd33)/(12.*cmath.pi**2)',0:'( (5*complex(0,1)*G**2*gAd33)/(12.*cmath.pi**2) - (complex(0,1)*G**2*gAd33*reglog(MB/MU_R))/(2.*cmath.pi**2) if MB else (complex(0,1)*G**2*gAd33)/(12.*cmath.pi**2) ) - (complex(0,1)*G**2*gAd33)/(12.*cmath.pi**2)'},
4897+ order = {'DMV':1,'QCD':2})
4898+
4899+UVGC_186_32 = Coupling(name = 'UVGC_186_32',
4900+ value = {-1:'( -(complex(0,1)*G**2*gVd33)/(6.*cmath.pi**2) if MB else (complex(0,1)*G**2*gVd33)/(12.*cmath.pi**2) ) - (complex(0,1)*G**2*gVd33)/(12.*cmath.pi**2)',0:'( (-5*complex(0,1)*G**2*gVd33)/(12.*cmath.pi**2) + (complex(0,1)*G**2*gVd33*reglog(MB/MU_R))/(2.*cmath.pi**2) if MB else -(complex(0,1)*G**2*gVd33)/(12.*cmath.pi**2) ) + (complex(0,1)*G**2*gVd33)/(12.*cmath.pi**2)'},
4901+ order = {'DMV':1,'QCD':2})
4902+
4903+UVGC_187_33 = Coupling(name = 'UVGC_187_33',
4904+ value = {-1:'( (complex(0,1)*G**2*MB)/(6.*cmath.pi**2) if MB else -(complex(0,1)*G**2*MB)/(12.*cmath.pi**2) ) + (complex(0,1)*G**2*MB)/(3.*cmath.pi**2)',0:'( (3*complex(0,1)*G**2*MB)/(4.*cmath.pi**2) - (complex(0,1)*G**2*MB*reglog(MB/MU_R))/cmath.pi**2 if MB else (complex(0,1)*G**2*MB)/(12.*cmath.pi**2) ) - (complex(0,1)*G**2*MB)/(12.*cmath.pi**2)'},
4905+ order = {'QCD':2})
4906+
4907+UVGC_188_34 = Coupling(name = 'UVGC_188_34',
4908+ value = {-1:'( (cw*ee*complex(0,1)*G**2)/(12.*cmath.pi**2*sw) if MB else -(cw*ee*complex(0,1)*G**2)/(24.*cmath.pi**2*sw) ) + (cw*ee*complex(0,1)*G**2)/(24.*cmath.pi**2*sw)',0:'( (5*cw*ee*complex(0,1)*G**2)/(24.*cmath.pi**2*sw) - (cw*ee*complex(0,1)*G**2*reglog(MB/MU_R))/(4.*cmath.pi**2*sw) if MB else (cw*ee*complex(0,1)*G**2)/(24.*cmath.pi**2*sw) ) - (cw*ee*complex(0,1)*G**2)/(24.*cmath.pi**2*sw)'},
4909+ order = {'QCD':2,'QED':1})
4910+
4911+UVGC_189_35 = Coupling(name = 'UVGC_189_35',
4912+ value = {-1:'( (ee*complex(0,1)*G**2*sw)/(36.*cw*cmath.pi**2) if MB else -(ee*complex(0,1)*G**2*sw)/(72.*cw*cmath.pi**2) ) + (ee*complex(0,1)*G**2*sw)/(72.*cw*cmath.pi**2)',0:'( (5*ee*complex(0,1)*G**2*sw)/(72.*cw*cmath.pi**2) - (ee*complex(0,1)*G**2*sw*reglog(MB/MU_R))/(12.*cw*cmath.pi**2) if MB else (ee*complex(0,1)*G**2*sw)/(72.*cw*cmath.pi**2) ) - (ee*complex(0,1)*G**2*sw)/(72.*cw*cmath.pi**2)'},
4913+ order = {'QCD':2,'QED':1})
4914+
4915+UVGC_190_36 = Coupling(name = 'UVGC_190_36',
4916+ value = {-1:'( (complex(0,1)*G**2*yb)/(6.*cmath.pi**2*cmath.sqrt(2)) if MB else -(complex(0,1)*G**2*yb)/(12.*cmath.pi**2*cmath.sqrt(2)) ) + (complex(0,1)*G**2*yb)/(3.*cmath.pi**2*cmath.sqrt(2))',0:'( (3*complex(0,1)*G**2*yb)/(4.*cmath.pi**2*cmath.sqrt(2)) - (complex(0,1)*G**2*yb*reglog(MB/MU_R))/(cmath.pi**2*cmath.sqrt(2)) if MB else (complex(0,1)*G**2*yb)/(12.*cmath.pi**2*cmath.sqrt(2)) ) - (complex(0,1)*G**2*yb)/(12.*cmath.pi**2*cmath.sqrt(2))'},
4917+ order = {'QCD':2,'QED':1})
4918+
4919+UVGC_191_37 = Coupling(name = 'UVGC_191_37',
4920+ value = {-1:'( -(G**2*yb)/(6.*cmath.pi**2*cmath.sqrt(2)) if MB else (G**2*yb)/(12.*cmath.pi**2*cmath.sqrt(2)) ) - (G**2*yb)/(3.*cmath.pi**2*cmath.sqrt(2))',0:'( (-3*G**2*yb)/(4.*cmath.pi**2*cmath.sqrt(2)) + (G**2*yb*reglog(MB/MU_R))/(cmath.pi**2*cmath.sqrt(2)) if MB else -(G**2*yb)/(12.*cmath.pi**2*cmath.sqrt(2)) ) + (G**2*yb)/(12.*cmath.pi**2*cmath.sqrt(2))'},
4921+ order = {'QCD':2,'QED':1})
4922+
4923+UVGC_192_38 = Coupling(name = 'UVGC_192_38',
4924+ value = {-1:'( -(G**2*gPd33*yb)/(6.*cmath.pi**2*cmath.sqrt(2)) if MB else (G**2*gPd33*yb)/(12.*cmath.pi**2*cmath.sqrt(2)) ) - (G**2*gPd33*yb)/(3.*cmath.pi**2*cmath.sqrt(2))',0:'( (-5*G**2*gPd33*yb)/(12.*cmath.pi**2*cmath.sqrt(2)) + (G**2*gPd33*yb*reglog(MB/MU_R))/(2.*cmath.pi**2*cmath.sqrt(2)) if MB else -(G**2*gPd33*yb)/(12.*cmath.pi**2*cmath.sqrt(2)) ) + (G**2*gPd33*yb)/(12.*cmath.pi**2*cmath.sqrt(2))'},
4925+ order = {'DMS':1,'QCD':2,'QED':1})
4926+
4927+UVGC_193_39 = Coupling(name = 'UVGC_193_39',
4928+ value = {-1:'( -(complex(0,1)*G**2*gSd33*yb)/(6.*cmath.pi**2*cmath.sqrt(2)) if MB else (complex(0,1)*G**2*gSd33*yb)/(12.*cmath.pi**2*cmath.sqrt(2)) ) - (complex(0,1)*G**2*gSd33*yb)/(3.*cmath.pi**2*cmath.sqrt(2))',0:'( (-5*complex(0,1)*G**2*gSd33*yb)/(12.*cmath.pi**2*cmath.sqrt(2)) + (complex(0,1)*G**2*gSd33*yb*reglog(MB/MU_R))/(2.*cmath.pi**2*cmath.sqrt(2)) if MB else -(complex(0,1)*G**2*gSd33*yb)/(12.*cmath.pi**2*cmath.sqrt(2)) ) + (complex(0,1)*G**2*gSd33*yb)/(12.*cmath.pi**2*cmath.sqrt(2))'},
4929+ order = {'DMS':1,'QCD':2,'QED':1})
4930+
4931+UVGC_194_40 = Coupling(name = 'UVGC_194_40',
4932+ value = {-1:'( (complex(0,1)*G**2)/(6.*cmath.pi**2) if MC else -(complex(0,1)*G**2)/(12.*cmath.pi**2) ) + (complex(0,1)*G**2)/(12.*cmath.pi**2)',0:'( (5*complex(0,1)*G**2)/(12.*cmath.pi**2) - (complex(0,1)*G**2*reglog(MC/MU_R))/(2.*cmath.pi**2) if MC else (complex(0,1)*G**2)/(12.*cmath.pi**2) ) - (complex(0,1)*G**2)/(12.*cmath.pi**2)'},
4933+ order = {'QCD':2})
4934+
4935+UVGC_195_41 = Coupling(name = 'UVGC_195_41',
4936+ value = {-1:'( -(ee*complex(0,1)*G**2)/(9.*cmath.pi**2) if MC else (ee*complex(0,1)*G**2)/(18.*cmath.pi**2) )',0:'( (-5*ee*complex(0,1)*G**2)/(18.*cmath.pi**2) + (ee*complex(0,1)*G**2*reglog(MC/MU_R))/(3.*cmath.pi**2) if MC else -(ee*complex(0,1)*G**2)/(18.*cmath.pi**2) ) + (ee*complex(0,1)*G**2)/(18.*cmath.pi**2)'},
4937+ order = {'QCD':2,'QED':1})
4938+
4939+UVGC_196_42 = Coupling(name = 'UVGC_196_42',
4940+ value = {-1:'( -(complex(0,1)*G**3)/(6.*cmath.pi**2) if MC else (complex(0,1)*G**3)/(12.*cmath.pi**2) )',0:'( (-5*complex(0,1)*G**3)/(12.*cmath.pi**2) + (complex(0,1)*G**3*reglog(MC/MU_R))/(2.*cmath.pi**2) if MC else -(complex(0,1)*G**3)/(12.*cmath.pi**2) ) + (complex(0,1)*G**3)/(12.*cmath.pi**2)'},
4941+ order = {'QCD':3})
4942+
4943+UVGC_197_43 = Coupling(name = 'UVGC_197_43',
4944+ value = {-1:'( (complex(0,1)*G**2*gAu22)/(6.*cmath.pi**2) if MC else -(complex(0,1)*G**2*gAu22)/(12.*cmath.pi**2) ) + (complex(0,1)*G**2*gAu22)/(12.*cmath.pi**2)',0:'( (5*complex(0,1)*G**2*gAu22)/(12.*cmath.pi**2) - (complex(0,1)*G**2*gAu22*reglog(MC/MU_R))/(2.*cmath.pi**2) if MC else (complex(0,1)*G**2*gAu22)/(12.*cmath.pi**2) ) - (complex(0,1)*G**2*gAu22)/(12.*cmath.pi**2)'},
4945+ order = {'DMV':1,'QCD':2})
4946+
4947+UVGC_198_44 = Coupling(name = 'UVGC_198_44',
4948+ value = {-1:'( -(complex(0,1)*G**2*gVu22)/(6.*cmath.pi**2) if MC else (complex(0,1)*G**2*gVu22)/(12.*cmath.pi**2) ) - (complex(0,1)*G**2*gVu22)/(12.*cmath.pi**2)',0:'( (-5*complex(0,1)*G**2*gVu22)/(12.*cmath.pi**2) + (complex(0,1)*G**2*gVu22*reglog(MC/MU_R))/(2.*cmath.pi**2) if MC else -(complex(0,1)*G**2*gVu22)/(12.*cmath.pi**2) ) + (complex(0,1)*G**2*gVu22)/(12.*cmath.pi**2)'},
4949+ order = {'DMV':1,'QCD':2})
4950+
4951+UVGC_199_45 = Coupling(name = 'UVGC_199_45',
4952+ value = {-1:'( (complex(0,1)*G**2*MC)/(6.*cmath.pi**2) if MC else -(complex(0,1)*G**2*MC)/(12.*cmath.pi**2) ) + (complex(0,1)*G**2*MC)/(3.*cmath.pi**2)',0:'( (3*complex(0,1)*G**2*MC)/(4.*cmath.pi**2) - (complex(0,1)*G**2*MC*reglog(MC/MU_R))/cmath.pi**2 if MC else (complex(0,1)*G**2*MC)/(12.*cmath.pi**2) ) - (complex(0,1)*G**2*MC)/(12.*cmath.pi**2)'},
4953+ order = {'QCD':2})
4954+
4955+UVGC_200_46 = Coupling(name = 'UVGC_200_46',
4956+ value = {-1:'( -(cw*ee*complex(0,1)*G**2)/(12.*cmath.pi**2*sw) if MC else (cw*ee*complex(0,1)*G**2)/(24.*cmath.pi**2*sw) ) - (cw*ee*complex(0,1)*G**2)/(24.*cmath.pi**2*sw)',0:'( (-5*cw*ee*complex(0,1)*G**2)/(24.*cmath.pi**2*sw) + (cw*ee*complex(0,1)*G**2*reglog(MC/MU_R))/(4.*cmath.pi**2*sw) if MC else -(cw*ee*complex(0,1)*G**2)/(24.*cmath.pi**2*sw) ) + (cw*ee*complex(0,1)*G**2)/(24.*cmath.pi**2*sw)'},
4957+ order = {'QCD':2,'QED':1})
4958+
4959+UVGC_201_47 = Coupling(name = 'UVGC_201_47',
4960+ value = {-1:'( (ee*complex(0,1)*G**2*sw)/(36.*cw*cmath.pi**2) if MC else -(ee*complex(0,1)*G**2*sw)/(72.*cw*cmath.pi**2) ) + (ee*complex(0,1)*G**2*sw)/(72.*cw*cmath.pi**2)',0:'( (5*ee*complex(0,1)*G**2*sw)/(72.*cw*cmath.pi**2) - (ee*complex(0,1)*G**2*sw*reglog(MC/MU_R))/(12.*cw*cmath.pi**2) if MC else (ee*complex(0,1)*G**2*sw)/(72.*cw*cmath.pi**2) ) - (ee*complex(0,1)*G**2*sw)/(72.*cw*cmath.pi**2)'},
4961+ order = {'QCD':2,'QED':1})
4962+
4963+UVGC_202_48 = Coupling(name = 'UVGC_202_48',
4964+ value = {-1:'( (G**2*yc)/(6.*cmath.pi**2*cmath.sqrt(2)) if MC else -(G**2*yc)/(12.*cmath.pi**2*cmath.sqrt(2)) ) + (G**2*yc)/(3.*cmath.pi**2*cmath.sqrt(2))',0:'( (3*G**2*yc)/(4.*cmath.pi**2*cmath.sqrt(2)) - (G**2*yc*reglog(MC/MU_R))/(cmath.pi**2*cmath.sqrt(2)) if MC else (G**2*yc)/(12.*cmath.pi**2*cmath.sqrt(2)) ) - (G**2*yc)/(12.*cmath.pi**2*cmath.sqrt(2))'},
4965+ order = {'QCD':2,'QED':1})
4966+
4967+UVGC_203_49 = Coupling(name = 'UVGC_203_49',
4968+ value = {-1:'( (complex(0,1)*G**2*yc)/(6.*cmath.pi**2*cmath.sqrt(2)) if MC else -(complex(0,1)*G**2*yc)/(12.*cmath.pi**2*cmath.sqrt(2)) ) + (complex(0,1)*G**2*yc)/(3.*cmath.pi**2*cmath.sqrt(2))',0:'( (3*complex(0,1)*G**2*yc)/(4.*cmath.pi**2*cmath.sqrt(2)) - (complex(0,1)*G**2*yc*reglog(MC/MU_R))/(cmath.pi**2*cmath.sqrt(2)) if MC else (complex(0,1)*G**2*yc)/(12.*cmath.pi**2*cmath.sqrt(2)) ) - (complex(0,1)*G**2*yc)/(12.*cmath.pi**2*cmath.sqrt(2))'},
4969+ order = {'QCD':2,'QED':1})
4970+
4971+UVGC_204_50 = Coupling(name = 'UVGC_204_50',
4972+ value = {-1:'( -(G**2*gPu22*yc)/(6.*cmath.pi**2*cmath.sqrt(2)) if MC else (G**2*gPu22*yc)/(12.*cmath.pi**2*cmath.sqrt(2)) ) - (G**2*gPu22*yc)/(3.*cmath.pi**2*cmath.sqrt(2))',0:'( (-5*G**2*gPu22*yc)/(12.*cmath.pi**2*cmath.sqrt(2)) + (G**2*gPu22*yc*reglog(MC/MU_R))/(2.*cmath.pi**2*cmath.sqrt(2)) if MC else -(G**2*gPu22*yc)/(12.*cmath.pi**2*cmath.sqrt(2)) ) + (G**2*gPu22*yc)/(12.*cmath.pi**2*cmath.sqrt(2))'},
4973+ order = {'DMS':1,'QCD':2,'QED':1})
4974+
4975+UVGC_205_51 = Coupling(name = 'UVGC_205_51',
4976+ value = {-1:'( -(complex(0,1)*G**2*gSu22*yc)/(6.*cmath.pi**2*cmath.sqrt(2)) if MC else (complex(0,1)*G**2*gSu22*yc)/(12.*cmath.pi**2*cmath.sqrt(2)) ) - (complex(0,1)*G**2*gSu22*yc)/(3.*cmath.pi**2*cmath.sqrt(2))',0:'( (-5*complex(0,1)*G**2*gSu22*yc)/(12.*cmath.pi**2*cmath.sqrt(2)) + (complex(0,1)*G**2*gSu22*yc*reglog(MC/MU_R))/(2.*cmath.pi**2*cmath.sqrt(2)) if MC else -(complex(0,1)*G**2*gSu22*yc)/(12.*cmath.pi**2*cmath.sqrt(2)) ) + (complex(0,1)*G**2*gSu22*yc)/(12.*cmath.pi**2*cmath.sqrt(2))'},
4977+ order = {'DMS':1,'QCD':2,'QED':1})
4978+
4979+UVGC_206_52 = Coupling(name = 'UVGC_206_52',
4980+ value = {-1:'( (complex(0,1)*G**2)/(6.*cmath.pi**2) if MD else -(complex(0,1)*G**2)/(12.*cmath.pi**2) ) + (complex(0,1)*G**2)/(12.*cmath.pi**2)',0:'( (5*complex(0,1)*G**2)/(12.*cmath.pi**2) - (complex(0,1)*G**2*reglog(MD/MU_R))/(2.*cmath.pi**2) if MD else (complex(0,1)*G**2)/(12.*cmath.pi**2) ) - (complex(0,1)*G**2)/(12.*cmath.pi**2)'},
4981+ order = {'QCD':2})
4982+
4983+UVGC_207_53 = Coupling(name = 'UVGC_207_53',
4984+ value = {-1:'( (ee*complex(0,1)*G**2)/(18.*cmath.pi**2) if MD else -(ee*complex(0,1)*G**2)/(36.*cmath.pi**2) )',0:'( (5*ee*complex(0,1)*G**2)/(36.*cmath.pi**2) - (ee*complex(0,1)*G**2*reglog(MD/MU_R))/(6.*cmath.pi**2) if MD else (ee*complex(0,1)*G**2)/(36.*cmath.pi**2) ) - (ee*complex(0,1)*G**2)/(36.*cmath.pi**2)'},
4985+ order = {'QCD':2,'QED':1})
4986+
4987+UVGC_208_54 = Coupling(name = 'UVGC_208_54',
4988+ value = {-1:'( -(complex(0,1)*G**3)/(6.*cmath.pi**2) if MD else (complex(0,1)*G**3)/(12.*cmath.pi**2) )',0:'( (-5*complex(0,1)*G**3)/(12.*cmath.pi**2) + (complex(0,1)*G**3*reglog(MD/MU_R))/(2.*cmath.pi**2) if MD else -(complex(0,1)*G**3)/(12.*cmath.pi**2) ) + (complex(0,1)*G**3)/(12.*cmath.pi**2)'},
4989+ order = {'QCD':3})
4990+
4991+UVGC_209_55 = Coupling(name = 'UVGC_209_55',
4992+ value = {-1:'( (complex(0,1)*G**2*gAd11)/(6.*cmath.pi**2) if MD else -(complex(0,1)*G**2*gAd11)/(12.*cmath.pi**2) ) + (complex(0,1)*G**2*gAd11)/(12.*cmath.pi**2)',0:'( (5*complex(0,1)*G**2*gAd11)/(12.*cmath.pi**2) - (complex(0,1)*G**2*gAd11*reglog(MD/MU_R))/(2.*cmath.pi**2) if MD else (complex(0,1)*G**2*gAd11)/(12.*cmath.pi**2) ) - (complex(0,1)*G**2*gAd11)/(12.*cmath.pi**2)'},
4993+ order = {'DMV':1,'QCD':2})
4994+
4995+UVGC_210_56 = Coupling(name = 'UVGC_210_56',
4996+ value = {-1:'( -(complex(0,1)*G**2*gVd11)/(6.*cmath.pi**2) if MD else (complex(0,1)*G**2*gVd11)/(12.*cmath.pi**2) ) - (complex(0,1)*G**2*gVd11)/(12.*cmath.pi**2)',0:'( (-5*complex(0,1)*G**2*gVd11)/(12.*cmath.pi**2) + (complex(0,1)*G**2*gVd11*reglog(MD/MU_R))/(2.*cmath.pi**2) if MD else -(complex(0,1)*G**2*gVd11)/(12.*cmath.pi**2) ) + (complex(0,1)*G**2*gVd11)/(12.*cmath.pi**2)'},
4997+ order = {'DMV':1,'QCD':2})
4998+
4999+UVGC_211_57 = Coupling(name = 'UVGC_211_57',
5000+ value = {-1:'( (complex(0,1)*G**2*MD)/(6.*cmath.pi**2) if MD else -(complex(0,1)*G**2*MD)/(12.*cmath.pi**2) ) + (complex(0,1)*G**2*MD)/(3.*cmath.pi**2)',0:'( (3*complex(0,1)*G**2*MD)/(4.*cmath.pi**2) - (complex(0,1)*G**2*MD*reglog(MD/MU_R))/cmath.pi**2 if MD else (complex(0,1)*G**2*MD)/(12.*cmath.pi**2) ) - (complex(0,1)*G**2*MD)/(12.*cmath.pi**2)'},
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to all changes: