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

Proposed by Olivier Mattelaer
Status: Merged
Merged at revision: 99
Proposed branch: lp:~maddevelopers/mg5amcnlo/qnumbers
Merge into: lp:~madteam/mg5amcnlo/trunk
Diff against target: 59292 lines (+24194/-21396)
63 files modified
bin/mg5 (+2/-1)
madgraph/VERSION (+2/-2)
madgraph/__init__.py (+3/-0)
madgraph/core/base_objects.py (+61/-70)
madgraph/core/diagram_generation.py (+48/-14)
madgraph/core/drawing.py (+5/-2)
madgraph/interface/cmd_interface.py (+392/-388)
madgraph/interface/extended_cmd.py (+381/-0)
madgraph/interface/launch_ext_program.py (+296/-0)
madgraph/interface/tutorial_text.py (+15/-8)
madgraph/iolibs/drawing_eps.py (+42/-10)
madgraph/iolibs/export_cpp.py (+5/-2)
madgraph/iolibs/export_v4.py (+43/-23)
madgraph/iolibs/files.py (+1/-1)
madgraph/iolibs/misc.py (+38/-0)
madgraph/iolibs/template_files/drawing_eps_header.inc (+24/-6)
madgraph/iolibs/ufo_expression_parsers.py (+1/-0)
madgraph/various/process_checks.py (+18/-4)
models/import_ufo.py (+307/-20)
models/model_reader.py (+6/-5)
models/mssm/MSSM_UFO.log (+14/-12)
models/mssm/__init__.py (+5/-0)
models/mssm/couplings.py (+1251/-1723)
models/mssm/lorentz.py (+5/-13)
models/mssm/object_library.py (+0/-194)
models/mssm/parameters.py (+1469/-1613)
models/mssm/particles.py (+354/-350)
models/mssm/restrict_simplified.dat (+525/-0)
models/mssm/vertices.py (+2800/-3454)
models/mssm/write_param_card.py (+86/-6)
models/sm/__init__.py (+5/-0)
models/sm/couplings.py (+471/-31)
models/sm/lorentz.py (+35/-7)
models/sm/object_library.py (+0/-191)
models/sm/parameters.py (+170/-8)
models/sm/particles.py (+51/-74)
models/sm/restrict_default.dat (+50/-0)
models/sm/restrict_no_b_mass.dat (+50/-0)
models/sm/restrict_no_masses.dat (+50/-0)
models/sm/restrict_no_tau_mass.dat (+50/-0)
models/sm/vertices.py (+844/-196)
models/sm/write_param_card.py (+127/-11)
models/template_files/fortran/lha_read.f (+2/-2)
models/write_param_card.py (+245/-0)
tests/acceptance_tests/test_cmd.py (+7/-7)
tests/acceptance_tests/test_model_equivalence.py (+16/-19)
tests/input_files/e+e-_e+e-.pkl (+8568/-8557)
tests/input_files/restrict_sm.dat (+50/-0)
tests/input_files/restrict_sm_new.dat (+50/-0)
tests/input_files/sm.pkl (+4584/-4346)
tests/parallel_tests/sample_script.py (+12/-10)
tests/unit_tests/core/test_base_objects.py (+29/-1)
tests/unit_tests/core/test_diagram_generation.py (+2/-2)
tests/unit_tests/iolibs/test_export_cpp.py (+4/-2)
tests/unit_tests/iolibs/test_export_python.py (+2/-1)
tests/unit_tests/iolibs/test_export_v4.py (+2/-2)
tests/unit_tests/iolibs/test_link_to_ufo.py (+4/-2)
tests/unit_tests/various/test_aloha.py (+1/-1)
tests/unit_tests/various/test_diquark_models.py (+4/-2)
tests/unit_tests/various/test_import_ufo.py (+267/-0)
tests/unit_tests/various/test_model_reader.py (+3/-1)
tests/unit_tests/various/test_process_checks.py (+6/-2)
tests/unit_tests/various/test_write_param.py (+234/-0)
To merge this branch: bzr merge lp:~maddevelopers/mg5amcnlo/qnumbers
Reviewer Review Type Date Requested Status
MadTeam Pending
Review via email: mp+54165@code.launchpad.net

Description of the change

The created param_card follow the SLHA convention:
- presence of QNUMBERS
- all particles have mass/width defined

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/mg5'
2--- bin/mg5 2011-01-19 12:10:40 +0000
3+++ bin/mg5 2011-03-21 08:51:32 +0000
4@@ -43,7 +43,7 @@
5
6 # charge history file
7 try:
8- history_file = os.path.join(os.environ['HOME'], '.pythonhistory')
9+ history_file = os.path.join(os.environ['HOME'], '.mg5history')
10 readline.read_history_file(history_file)
11 except:
12 pass
13@@ -123,6 +123,7 @@
14 cmd_interface.MadGraphCmdShell(mgme_dir = options.mgme_dir).cmdloop()
15
16 try:
17+ readline.set_history_length(100)
18 readline.write_history_file(history_file)
19 except:
20 pass
21
22=== modified file 'madgraph/VERSION'
23--- madgraph/VERSION 2011-03-09 20:12:43 +0000
24+++ madgraph/VERSION 2011-03-21 08:51:32 +0000
25@@ -1,4 +1,4 @@
26-version = 0.6.2.3
27-date = 2011-03-09
28+version = 0.7.0-beta
29+date = 2011-03-18
30
31
32
33=== modified file 'madgraph/__init__.py'
34--- madgraph/__init__.py 2010-10-19 14:51:20 +0000
35+++ madgraph/__init__.py 2011-03-21 08:51:32 +0000
36@@ -16,6 +16,9 @@
37 """Exception raised if an exception is find
38 Those Types of error will stop nicely in the cmd interface"""
39
40+class InvalidCmd(MadGraph5Error):
41+ """a class for the invalid syntax call"""
42+
43 import os
44
45 #Look for basic file position MG5DIR and MG4DIR
46
47=== modified file 'madgraph/core/base_objects.py'
48--- madgraph/core/base_objects.py 2011-01-26 13:23:54 +0000
49+++ madgraph/core/base_objects.py 2011-03-21 08:51:32 +0000
50@@ -22,6 +22,7 @@
51 import numbers
52 import os
53 import re
54+import StringIO
55 import madgraph.core.color_algebra as color
56 from madgraph import MadGraph5Error, MG5DIR
57
58@@ -87,12 +88,12 @@
59
60 return self[name]
61
62- def set(self, name, value):
63+ def set(self, name, value, force=False):
64 """Set the value of the property name. First check if value
65 is a valid value for the considered property. Return True if the
66 value has been correctly set, False otherwise."""
67
68- if not __debug__:
69+ if not __debug__ or force:
70 self[name] = value
71 return True
72
73@@ -263,7 +264,7 @@
74 if not isinstance(value, str):
75 raise self.PhysicsObjectError, \
76 "Line type %s is not a string" % repr(value)
77- if value not in ['dashed', 'straight', 'wavy', 'curly', 'double']:
78+ if value not in ['dashed', 'straight', 'wavy', 'curly', 'double','swavy','scurly']:
79 raise self.PhysicsObjectError, \
80 "Line type %s is unknown" % value
81
82@@ -665,6 +666,7 @@
83 self['ref_dict_to0'] = {}
84 self['ref_dict_to1'] = {}
85 self['got_majoranas'] = None
86+ self['conserved_charge'] = set()
87
88 def filter(self, name, value):
89 """Filter for model property values"""
90@@ -674,43 +676,45 @@
91 raise self.PhysicsObjectError, \
92 "Object of type %s is not a string" % \
93 type(value)
94- if name == 'particles':
95+ elif name == 'particles':
96 if not isinstance(value, ParticleList):
97 raise self.PhysicsObjectError, \
98 "Object of type %s is not a ParticleList object" % \
99 type(value)
100- if name == 'interactions':
101+ elif name == 'interactions':
102 if not isinstance(value, InteractionList):
103 raise self.PhysicsObjectError, \
104 "Object of type %s is not a InteractionList object" % \
105 type(value)
106- if name == 'particle_dict':
107- if not isinstance(value, dict):
108- raise self.PhysicsObjectError, \
109- "Object of type %s is not a dictionary" % \
110- type(value)
111- if name == 'interaction_dict':
112- if not isinstance(value, dict):
113- raise self.PhysicsObjectError, \
114- "Object of type %s is not a dictionary" % \
115- type(value)
116-
117- if name == 'ref_dict_to0':
118- if not isinstance(value, dict):
119- raise self.PhysicsObjectError, \
120- "Object of type %s is not a dictionary" % \
121- type(value)
122- if name == 'ref_dict_to1':
123- if not isinstance(value, dict):
124- raise self.PhysicsObjectError, \
125- "Object of type %s is not a dictionary" % \
126- type(value)
127-
128- if name == 'got_majoranas':
129+ elif name == 'particle_dict':
130+ if not isinstance(value, dict):
131+ raise self.PhysicsObjectError, \
132+ "Object of type %s is not a dictionary" % \
133+ type(value)
134+ elif name == 'interaction_dict':
135+ if not isinstance(value, dict):
136+ raise self.PhysicsObjectError, \
137+ "Object of type %s is not a dictionary" % type(value)
138+
139+ elif name == 'ref_dict_to0':
140+ if not isinstance(value, dict):
141+ raise self.PhysicsObjectError, \
142+ "Object of type %s is not a dictionary" % type(value)
143+
144+ elif name == 'ref_dict_to1':
145+ if not isinstance(value, dict):
146+ raise self.PhysicsObjectError, \
147+ "Object of type %s is not a dictionary" % type(value)
148+
149+ elif name == 'got_majoranas':
150 if not (isinstance(value, bool) or value == None):
151 raise self.PhysicsObjectError, \
152- "Object of type %s is not a boolean" % \
153- type(value)
154+ "Object of type %s is not a boolean" % type(value)
155+
156+ elif name == 'conserved_charge':
157+ if not (isinstance(value, set)):
158+ raise self.PhysicsObjectError, \
159+ "Object of type %s is not a set" % type(value)
160
161 return True
162
163@@ -867,45 +871,19 @@
164
165 def write_param_card(self):
166 """Write out the param_card, and return as string."""
167-
168- def write_param(param, lhablock):
169-
170- lhacode=' '.join(['%3s' % key for key in param.lhacode])
171- if lhablock == 'DECAY':
172- return 'DECAY %s %e # %s' % (lhacode, param.value, param.name)
173- else:
174- return " %s %e # %s" % (lhacode, param.value, param.name )
175-
176- if not self.get('parameters'):
177- raise self.PhysicsObjectError,\
178- "Attempt to write param_card from non-UFO model"
179-
180- external_params = self.get('parameters')[('external',)]
181-
182- # list all lhablock
183- all_lhablock = set([param.lhablock for param in external_params])
184-
185- # sort lhablock alphabeticaly
186- all_lhablock = sorted(list(all_lhablock))
187- # place DECAY blocks last
188- all_lhablock.remove('DECAY')
189- all_lhablock.append('DECAY')
190-
191- ret_list = ["# SLHA param_card for %s written by MadGraph 5" % \
192- self.get('name')]
193-
194- for lhablock in all_lhablock:
195- if lhablock != 'DECAY':
196- ret_list.append("BLOCK %s" % lhablock)
197- ret_list.extend(sorted([write_param(param, lhablock) \
198- for param in external_params if \
199- param.lhablock == lhablock]))
200- return "\n".join(ret_list) + "\n"
201+
202+ import models.write_param_card as writter
203+ out = StringIO.StringIO() # it's suppose to be written in a file
204+ param = writter.ParamCardWriter(self)
205+ param.define_output_file(out)
206+ param.write_card()
207+ return out.getvalue()
208
209 @ staticmethod
210 def load_default_name():
211 """ load the default for name convention """
212
213+ logger.info('Change particles name to pass to MG5 convention')
214 default = {}
215 for line in open(os.path.join(MG5DIR, 'input', \
216 'particles_name_default.txt')):
217@@ -1385,6 +1363,7 @@
218 self['model'] = Model()
219 # Optional number to identify the process
220 self['id'] = 0
221+ self['uid'] = 0 # should be a uniq id number
222 # Required s-channels are given as a list of id lists. Only
223 # diagrams with all s-channels in any of the lists are
224 # allowed. This enables generating e.g. Z/gamma as s-channel
225@@ -1412,10 +1391,10 @@
226 if not isinstance(value, Model):
227 raise self.PhysicsObjectError, \
228 "%s is not a valid Model object" % str(value)
229- if name == 'id':
230+ if name in ['id', 'uid']:
231 if not isinstance(value, int):
232 raise self.PhysicsObjectError, \
233- "Process id %s is not an integer" % repr(value)
234+ "Process %s %s is not an integer" % (name, repr(value))
235
236 if name == 'required_s_channels':
237 if not isinstance(value, list):
238@@ -1637,7 +1616,7 @@
239 # Remove last space
240 return mystr[:-1]
241
242- def shell_string(self):
243+ def shell_string(self, schannel=True, forbid=True, main=True):
244 """Returns process as string with '~' -> 'x', '>' -> '_',
245 '+' -> 'p' and '-' -> 'm', including process number,
246 intermediate s-channels and forbidden particles"""
247@@ -1655,7 +1634,7 @@
248 mystr = mystr + '_'
249 # Add required s-channels
250 if self['required_s_channels'] and \
251- self['required_s_channels'][0]:
252+ self['required_s_channels'][0] and schannel:
253 mystr += "_or_".join(["".join([self['model'].\
254 get('particle_dict')[req_id].get_name() \
255 for req_id in id_list]) \
256@@ -1668,7 +1647,7 @@
257 prevleg = leg
258
259 # Check for forbidden particles
260- if self['forbidden_particles']:
261+ if self['forbidden_particles'] and forbid:
262 mystr = mystr + '_no_'
263 for forb_id in self['forbidden_particles']:
264 forbpart = self['model'].get('particle_dict')[forb_id]
265@@ -1684,7 +1663,19 @@
266 mystr = mystr.replace(' ', '')
267
268 for decay in self.get('decay_chains'):
269- mystr = mystr + "_" + decay.shell_string()
270+ mystr = mystr + "_" + decay.shell_string(schannel,forbid, main=False)
271+
272+ # Too long name are problematic so restrict them to a maximal of 70 char
273+ if len(mystr) > 64 and main:
274+ if schannel and forbid:
275+ return self.shell_string(True, False, False)+ '-%s' % self['uid']
276+ elif schannel:
277+ return self.shell_string(False, False, False)+'-%s' % self['uid']
278+ else:
279+ return mystr[:64]+'-%s' % self['uid']
280+
281+
282+
283
284 return mystr
285
286
287=== modified file 'madgraph/core/diagram_generation.py'
288--- madgraph/core/diagram_generation.py 2010-12-19 03:57:07 +0000
289+++ madgraph/core/diagram_generation.py 2011-03-21 08:51:32 +0000
290@@ -24,7 +24,7 @@
291
292 import madgraph.core.base_objects as base_objects
293
294-from madgraph import MadGraph5Error
295+from madgraph import MadGraph5Error, InvalidCmd
296 logger = logging.getLogger('madgraph.diagram_generation')
297
298 #===============================================================================
299@@ -165,11 +165,11 @@
300
301
302 res = base_objects.DiagramList()
303-
304 # First check that the number of fermions is even
305 if len(filter(lambda leg: model.get('particle_dict')[\
306 leg.get('id')].is_fermion(), legs)) % 2 == 1:
307 self['diagrams'] = res
308+ raise InvalidCmd, 'The number of fermion is odd'
309 return res
310
311 # Then check same number of incoming and outgoing fermions (if
312@@ -178,8 +178,30 @@
313 len(filter(lambda leg: leg.is_incoming_fermion(model), legs)) != \
314 len(filter(lambda leg: leg.is_outgoing_fermion(model), legs)):
315 self['diagrams'] = res
316+ raise InvalidCmd, 'The number of of incoming/outcoming fermions are different'
317 return res
318+
319+ # Finally check that charge (conserve by all interactions) of the process
320+ #is globally conserve for this process.
321+ for charge in model.get('conserved_charge'):
322+ total = 0
323+ for leg in legs:
324+ part = model.get('particle_dict')[leg.get('id')]
325+ try:
326+ value = part.get(charge)
327+ except AttributeError:
328+ value = 0
329+
330+ if (leg.get('id') != part['pdg_code']) != leg['state']:
331+ total -= value
332+ else:
333+ total += value
334
335+ if abs(total) > 1e-10:
336+ self['diagrams'] = res
337+ raise InvalidCmd, 'No %s conservation for this process ' % charge
338+ return res
339+
340 logger.info("Trying %s " % process.nice_string().replace('Process', 'process'))
341
342 # Give numbers to legs in process
343@@ -623,7 +645,7 @@
344 """Test if object obj is a valid Amplitude for the list."""
345
346 return isinstance(obj, Amplitude)
347-
348+
349 #===============================================================================
350 # DecayChainAmplitude
351 #===============================================================================
352@@ -920,15 +942,23 @@
353 continue
354
355 amplitude = Amplitude({"process": process})
356- if not amplitude.generate_diagrams():
357- # Add process to failed_procs
358+ try:
359+ result = amplitude.generate_diagrams()
360+ except InvalidCmd as error:
361 failed_procs.append(tuple(sorted_legs))
362- if amplitude.get('diagrams'):
363- amplitudes.append(amplitude)
364+ else:
365+ if amplitude.get('diagrams'):
366+ amplitudes.append(amplitude)
367+ elif not result:
368+ failed_procs.append(tuple(sorted_legs))
369+
370
371 # Raise exception if there are no amplitudes for this process
372 if not amplitudes:
373- raise MadGraph5Error, \
374+ if len(failed_procs) == 1 and 'error' in locals():
375+ raise error
376+ else:
377+ raise MadGraph5Error, \
378 "No amplitudes generated from process %s. Please enter a valid process" % \
379 process_definition.nice_string()
380
381@@ -1092,14 +1122,18 @@
382 continue
383
384 amplitude = Amplitude({"process": process})
385- if not amplitude.generate_diagrams():
386- # Add process to failed_procs
387+ try:
388+ amplitude.generate_diagrams()
389+ except InvalidCmd:
390 failed_procs.append(tuple(sorted_legs))
391+ else:
392+ if amplitude.get('diagrams'):
393+ # We found a valid amplitude. Return this order number
394+ logger.setLevel(oldloglevel)
395+ return {coupling: max_order_now}
396+ else:
397+ failed_procs.append(tuple(sorted_legs))
398
399- if amplitude.get('diagrams'):
400- # We found a valid amplitude. Return this order number
401- logger.setLevel(oldloglevel)
402- return {coupling: max_order_now}
403 # No processes found, increase max_order_now
404 max_order_now += 1
405 logger.setLevel(oldloglevel)
406
407=== modified file 'madgraph/core/drawing.py'
408--- madgraph/core/drawing.py 2010-12-01 09:33:43 +0000
409+++ madgraph/core/drawing.py 2011-03-21 08:51:32 +0000
410@@ -1809,8 +1809,11 @@
411 # Find the type line of the particle [straight, wavy, ...]
412 line_type = line.get_info('line')
413 # Call the routine associate to this type [self.draw_straight, ...]
414- getattr(self, 'draw_' + line_type)(line)
415-
416+ if hasattr(self, 'draw_' + line_type):
417+ getattr(self, 'draw_' + line_type)(line)
418+ else:
419+ self.draw_straight(line)
420+
421 # Finalize the line representation with adding the name of the particle
422 name = line.get_name()
423 self.associate_name(line, name)
424
425=== modified file 'madgraph/interface/cmd_interface.py'
426--- madgraph/interface/cmd_interface.py 2011-01-27 12:30:18 +0000
427+++ madgraph/interface/cmd_interface.py 2011-03-21 08:51:32 +0000
428@@ -17,25 +17,18 @@
429 """
430
431 import atexit
432-import cmd
433 import logging
434 import optparse
435 import os
436 import pydoc
437 import re
438-import signal
439 import subprocess
440 import sys
441 import traceback
442 import time
443
444-# Optional Library (not present on all platform)
445-try:
446- import readline
447-except:
448- readline = None
449-
450-from madgraph import MG4DIR, MG5DIR, MadGraph5Error
451+
452+from madgraph import MG4DIR, MG5DIR, MadGraph5Error, InvalidCmd
453
454 import madgraph.core.base_objects as base_objects
455 import madgraph.core.diagram_generation as diagram_generation
456@@ -52,8 +45,9 @@
457 import madgraph.iolibs.misc as misc
458 import madgraph.iolibs.save_load_object as save_load_object
459
460+import madgraph.interface.extended_cmd as cmd
461 import madgraph.interface.tutorial_text as tutorial_text
462-
463+import madgraph.interface.launch_ext_program as launch_ext
464 import madgraph.various.process_checks as process_checks
465
466 import models as ufomodels
467@@ -69,13 +63,11 @@
468 # CmdExtended
469 #===============================================================================
470 class CmdExtended(cmd.Cmd):
471- """Extension of the cmd.Cmd command line.
472- This extensions supports line breaking, history, comments,
473- internal call to cmdline,..."""
474+ """Particularisation of the cmd command for MG5"""
475
476 #suggested list of command
477 next_possibility = {
478- 'mg5_start': ['import model ModelName', 'import command PATH',
479+ 'start': ['import model ModelName', 'import command PATH',
480 'import proc_v4 PATH', 'tutorial'],
481 'import model' : ['generate PROCESS','define MULTIPART PART1 PART2 ...',
482 'display particles', 'display interactions'],
483@@ -83,20 +75,29 @@
484 'display multiparticles'],
485 'generate': ['add process PROCESS','output [OUTPUT_TYPE] [PATH]','draw .'],
486 'add process':['output [OUTPUT_TYPE] [PATH]', 'display processes'],
487- 'output':['history PATH', 'exit'],
488+ 'output':['launch','history PATH', 'exit'],
489 'display': ['generate PROCESS', 'add process PROCESS', 'output [OUTPUT_TYPE] [PATH]'],
490 'draw': ['shell CMD'],
491- 'export':['history PATH', 'exit'],
492- 'import proc_v4' : ['exit'],
493+ 'import proc_v4' : ['launch','exit'],
494 'tutorial': ['generate PROCESS', 'import model MODEL', 'help TOPIC']
495 }
496-
497+
498+ debug_output = 'MG5_debug'
499+ error_debug = 'Please report this bug on https://bugs.launchpad.net/madgraph5\n'
500+ error_debug += 'More information is found in \'%s\'.\n'
501+ error_debug += 'Please attach this file to your report.'
502+
503+ keyboard_stop_msg = """stopping all operation
504+ in order to quit mg5 please enter exit"""
505+
506+ class InvalidCmd(MadGraph5Error):
507+ pass
508+
509 def __init__(self, *arg, **opt):
510 """Init history and line continuation"""
511
512 # If possible, build an info line with current version number
513 # and date, from the VERSION text file
514-
515 info = misc.get_pkg_info()
516 info_line = ""
517
518@@ -162,128 +163,7 @@
519 "* *\n" + \
520 "************************************************************")
521
522- self.log = True
523- self.history = []
524- self.save_line = ''
525 cmd.Cmd.__init__(self, *arg, **opt)
526- self.__initpos = os.path.abspath(os.getcwd())
527-
528- def precmd(self, line):
529- """ A suite of additional function needed for in the cmd
530- this implement history, line breaking, comment treatment,...
531- """
532-
533- if not line:
534- return line
535- line = line.lstrip()
536-
537- # Update the history of this suite of command,
538- # except for useless commands (empty history and help calls)
539- if line != "history" and \
540- not line.startswith('help') and \
541- not line.startswith('#*'):
542- self.history.append(line)
543-
544- # Check if we are continuing a line:
545- if self.save_line:
546- line = self.save_line + line
547- self.save_line = ''
548-
549- # Check if the line is complete
550- if line.endswith('\\'):
551- self.save_line = line[:-1]
552- return '' # do nothing
553-
554- # Remove comment
555- if '#' in line:
556- line = line.split('#')[0]
557-
558- # Deal with line splitting
559- if ';' in line and not (line.startswith('!') or line.startswith('shell')):
560- for subline in line.split(';'):
561- stop = self.onecmd(subline)
562- stop = self.postcmd(stop, subline)
563- return ''
564-
565- # execute the line command
566- return line
567-
568- def nice_error_handling(self, error, line):
569- """ """
570- # Make sure that we are at the initial position
571- os.chdir(self.__initpos)
572- # Create the debug files
573- self.log = False
574- cmd.Cmd.onecmd(self, 'history MG5_debug')
575- debug_file = open('MG5_debug', 'a')
576- traceback.print_exc(file=debug_file)
577- # Create a nice error output
578- if self.history and line == self.history[-1]:
579- error_text = 'Command \"%s\" interrupted with error:\n' % line
580- elif self.history:
581- error_text = 'Command \"%s\" interrupted in sub-command:\n' %line
582- error_text += '\"%s\" with error:\n' % self.history[-1]
583- else:
584- error_text = ''
585- error_text += '%s : %s\n' % (error.__class__.__name__, str(error).replace('\n','\n\t'))
586- error_text += 'Please report this bug on https://bugs.launchpad.net/madgraph5\n'
587- error_text += 'More information is found in \'%s\'.\n' % \
588- os.path.realpath("MG5_debug")
589- error_text += 'Please attach this file to your report.'
590- logger_stderr.critical(error_text)
591- #stop the execution if on a non interactive mode
592- if self.use_rawinput == False:
593- sys.exit('Exit on error')
594- return False
595-
596- def nice_user_error(self, error, line):
597- # Make sure that we are at the initial position
598- os.chdir(self.__initpos)
599- if line == self.history[-1]:
600- error_text = 'Command \"%s\" interrupted with error:\n' % line
601- else:
602- error_text = 'Command \"%s\" interrupted in sub-command:\n' %line
603- error_text += '\"%s\" with error:\n' % self.history[-1]
604- error_text += '%s : %s' % (error.__class__.__name__, str(error).replace('\n','\n\t'))
605- logger_stderr.error(error_text)
606- #stop the execution if on a non interactive mode
607- if self.use_rawinput == False:
608- sys.exit()
609- # Remove failed command from history
610- self.history.pop()
611- return False
612-
613-
614- def onecmd(self, line):
615- """catch all error and stop properly command accordingly"""
616-
617- try:
618- cmd.Cmd.onecmd(self, line)
619- except MadGraph5Error as error:
620- if __debug__:
621- self.nice_error_handling(error, line)
622- else:
623- self.nice_user_error(error, line)
624- except Exception as error:
625- self.nice_error_handling(error, line)
626-
627- def exec_cmd(self, line):
628- """for third party call, call the line with pre and postfix treatment"""
629-
630- logger.info(line)
631- line = self.precmd(line)
632- stop = cmd.Cmd.onecmd(self, line)
633- stop = self.postcmd(stop, line)
634- return stop
635-
636- def run_cmd(self, line):
637- """for third party call, call the line with pre and postfix treatment"""
638-
639- logger.info(line)
640- line = self.precmd(line)
641- stop = self.onecmd(line)
642- stop = self.postcmd(stop, line)
643- return stop
644
645 def postcmd(self,stop, line):
646 """ finishing a command
647@@ -313,96 +193,17 @@
648 logger_tuto.info(getattr(tutorial_text, args[0]).replace('\n','\n\t'))
649 except:
650 pass
651-
652-
653-
654- def emptyline(self):
655- """If empty line, do nothing. Default is repeat previous command."""
656- pass
657-
658- def default(self, line):
659- """Default action if line is not recognized"""
660-
661- # Faulty command
662- logger.warning("Command \"%s\" not recognized, please try again" % \
663- line.split()[0])
664- # Quit
665- def do_quit(self, line):
666- sys.exit(1)
667-
668- do_exit = do_quit
669-
670- # Aliases
671- do_EOF = do_quit
672- do_exit = do_quit
673-
674- def do_help(self, line):
675- """ propose some usefull possible action """
676-
677- cmd.Cmd.do_help(self,line)
678-
679- # if not basic help -> simple call is enough
680- if line:
681- return
682-
683- if len(self.history) == 0:
684- last_action_2 = last_action = 'mg5_start'
685- else:
686- last_action_2 = last_action = 'none'
687-
688- pos = 0
689- authorize = self.next_possibility.keys()
690- while last_action_2 not in authorize and last_action not in authorize:
691- pos += 1
692- if pos > len(self.history):
693- last_action_2 = last_action = 'mg5_start'
694- break
695-
696- args = self.history[-1 * pos].split()
697- last_action = args[0]
698- if len(args)>1:
699- last_action_2 = '%s %s' % (last_action, args[1])
700- else:
701- last_action_2 = 'none'
702-
703- print 'Contextual Help'
704- print '==============='
705- if last_action_2 in authorize:
706- options = self.next_possibility[last_action_2]
707- elif last_action in authorize:
708- options = self.next_possibility[last_action]
709-
710- text = 'The following command(s) may be useful in order to continue.\n'
711- for option in options:
712- text+='\t %s \n' % option
713- print text
714-
715+
716+ return stop
717
718 def timed_input(self, question, default, timeout=None):
719 """ a question with a maximal time to answer take default otherwise"""
720- class TimeOutError(Exception):
721- """Class for run-time error"""
722- pass
723- def handle_alarm(signum, frame):
724- raise TimeOutError
725- if timeout is None:
726+
727+ if not timeout:
728 timeout = self.timeout
729- signal.signal(signal.SIGALRM, handle_alarm)
730- signal.alarm(timeout)
731- if timeout:
732- question += '[%ss to answer] ' % timeout
733- try:
734- result = raw_input(question)
735- except TimeOutError:
736- print default
737- return default
738- finally:
739- signal.alarm(0)
740- return result
741-
742-
743-
744-
745+
746+ return misc.timed_input(question, default, timeout)
747+
748
749 #===============================================================================
750 # Helper function
751@@ -474,6 +275,10 @@
752 logger.info(" example display particles e+.")
753 logger.info(" For \"checks\", can specify only to see failed checks.")
754
755+ def help_launch(self):
756+ """help for launch command"""
757+ _launch_parser.print_help()
758+
759 def help_tutorial(self):
760 logger.info("syntax: tutorial [" + "|".join(self._tutorial_opts) + "]")
761 logger.info("-- start/stop the tutorial mode")
762@@ -562,6 +367,13 @@
763 logger.info("-- define a multiparticle")
764 logger.info(" Example: define p = g u u~ c c~ d d~ s s~ b b~")
765
766+ def help_restrict(self):
767+ logger.info("syntax: restrict [model] param_card")
768+ logger.info(' Suppress in the model all the interactions with zero')
769+ logger.info(' couplings according to the param_card given in parameter.')
770+ logger.info(' All zero parameter of the param_card are also suppress of')
771+ logger.info(' the model.')
772+
773 def help_history(self):
774 logger.info("syntax: history [FILEPATH|clean|.] ")
775 logger.info(" If FILEPATH is \'.\' and \'output\' is done,")
776@@ -592,9 +404,6 @@
777 class CheckValidForCmd(object):
778 """ The Series of help routine for the MadGraphCmd"""
779
780- class InvalidCmd(MadGraph5Error):
781- """a class for the invalid syntax call"""
782-
783 class RWError(MadGraph5Error):
784 """a class for read/write errors"""
785
786@@ -605,10 +414,10 @@
787
788 if len(args) < 2:
789 self.help_add()
790- raise self.InvalidCmd('\"add\" requires two arguments')
791+ raise InvalidCmd('\"add\" requires two arguments')
792
793 if args[0] != 'process':
794- raise self.InvalidCmd('\"add\" requires the argument \"process\"')
795+ raise InvalidCmd('\"add\" requires the argument \"process\"')
796
797 if not self._curr_model:
798 raise MadGraph5Error, \
799@@ -624,20 +433,21 @@
800
801 if len(args) < 2:
802 self.help_define()
803- raise self.InvalidCmd('\"define\" command requires at least two arguments')
804+ raise InvalidCmd('\"define\" command requires at least two arguments')
805
806 if args[1] == '=':
807 del args[1]
808 if len(args) < 2:
809 self.help_define()
810- raise self.InvalidCmd('\"define\" command requires at least one particles name after \"=\"')
811+ raise InvalidCmd('\"define\" command requires at least one particles name after \"=\"')
812
813 if '=' in args:
814 self.help_define()
815- raise self.InvalidCmd('\"define\" command requires symbols \"=\" at the second position')
816+ raise InvalidCmd('\"define\" command requires symbols \"=\" at the second position')
817
818 if not self._curr_model:
819- raise self.InvalidCmd("No particle list currently active, please import a model first")
820+ logger.info('No model currently active. Try with the Standard Model')
821+ self.do_import('model sm')
822
823 if self._curr_model['particles'].find_name(args[0]):
824 raise MadGraph5Error("label %s is a particle name in this model\n\
825@@ -650,15 +460,15 @@
826
827 if len(args) < 1 or args[0] not in self._display_opts:
828 self.help_display()
829- raise self.InvalidCmd
830+ raise InvalidCmd
831
832 if not self._curr_model:
833- raise self.InvalidCmd("No model currently active, please import a model!")
834+ raise InvalidCmd("No model currently active, please import a model!")
835
836 if args[0] in ['processes', 'diagrams'] and not self._curr_amps:
837- raise self.InvalidCmd("No process generated, please generate a process!")
838+ raise InvalidCmd("No process generated, please generate a process!")
839 if args[0] == 'checks' and not self._comparisons:
840- raise self.InvalidCmd("No check results to display.")
841+ raise InvalidCmd("No check results to display.")
842
843
844 def check_draw(self, args):
845@@ -668,13 +478,13 @@
846
847 if len(args) < 1:
848 self.help_draw()
849- raise self.InvalidCmd('\"draw\" command requires a directory path')
850+ raise InvalidCmd('\"draw\" command requires a directory path')
851
852 if not self._curr_amps:
853- raise self.InvalidCmd("No process generated, please generate a process!")
854+ raise InvalidCmd("No process generated, please generate a process!")
855
856 if not os.path.isdir(args[0]):
857- raise self.InvalidCmd( "%s is not a valid directory for export file" % args[0])
858+ raise InvalidCmd( "%s is not a valid directory for export file" % args[0])
859
860 def check_check(self, args):
861 """check the validity of args"""
862@@ -684,12 +494,12 @@
863 self.do_import('model sm')
864
865 if self._model_v4_path:
866- raise self.InvalidCmd(\
867+ raise InvalidCmd(\
868 "\"check\" not possible for v4 models")
869
870 if len(args) < 2:
871 self.help_check()
872- raise self.InvalidCmd("\"check\" requires an argument and a process.")
873+ raise InvalidCmd("\"check\" requires an argument and a process.")
874
875 param_card = None
876 if os.path.isfile(args[1]):
877@@ -697,7 +507,7 @@
878
879 if args[0] not in self._check_opts:
880 self.help_check()
881- raise self.InvalidCmd("\"check\" called with wrong argument")
882+ raise InvalidCmd("\"check\" called with wrong argument")
883
884 if any([',' in elem for elem in args]):
885 raise MadGraph5Error('Decay chains not allowed in check')
886@@ -715,7 +525,7 @@
887
888 if len(args) < 1:
889 self.help_generate()
890- raise self.InvalidCmd("\"generate\" requires a process.")
891+ raise InvalidCmd("\"generate\" requires a process.")
892
893 self.check_process_format(" ".join(args))
894
895@@ -726,7 +536,7 @@
896
897 #check balance of paranthesis
898 if process.count('(') != process.count(')'):
899- raise self.InvalidCmd('Invalid Format, no balance between open and close parenthesis')
900+ raise InvalidCmd('Invalid Format, no balance between open and close parenthesis')
901 #remove parenthesis for fututre introspection
902 process = process.replace('(',' ').replace(')',' ')
903
904@@ -739,7 +549,7 @@
905
906 # request that we have one or two > in the process
907 if process.count('>') not in [1,2]:
908- raise self.InvalidCmd(
909+ raise InvalidCmd(
910 'wrong format for \"%s\" this part requires one or two symbols \'>\', %s found'
911 % (process, process.count('>')))
912
913@@ -747,16 +557,16 @@
914 particles_parts = process.split('>')
915 for particles in particles_parts:
916 if re.match(r'^\s*$', particles):
917- raise self.InvalidCmd(
918+ raise InvalidCmd(
919 '\"%s\" is a wrong process format. Please try again' % process)
920
921 # '/' and '$' sould be used only after the process definition
922 for particles in particles_parts[:-1]:
923 if re.search('\D/', particles):
924- raise self.InvalidCmd(
925+ raise InvalidCmd(
926 'wrong process format: restriction should be place after the final states')
927 if re.search('\D\$', particles):
928- raise self.InvalidCmd(
929+ raise InvalidCmd(
930 'wrong process format: restriction should be place after the final states')
931
932
933@@ -766,62 +576,119 @@
934
935 if len(args) > 1:
936 self.help_history()
937- raise self.InvalidCmd('\"history\" command takes at most one argument')
938+ raise InvalidCmd('\"history\" command takes at most one argument')
939
940 if not len(args):
941 return
942
943 if args[0] =='.':
944 if not self._export_dir:
945- raise self.InvalidCmd("No default directory is defined for \'.\' option")
946+ raise InvalidCmd("No default directory is defined for \'.\' option")
947 elif args[0] != 'clean':
948 dirpath = os.path.dirname(args[0])
949 if dirpath and not os.path.exists(dirpath) or \
950 os.path.isdir(args[0]):
951- raise self.InvalidCmd("invalid path %s " % dirpath)
952+ raise InvalidCmd("invalid path %s " % dirpath)
953
954 def check_import(self, args):
955 """check the validity of line"""
956+
957+ if '-modelname' in args:
958+ if args[-1] != '-modelname':
959+ args.remove('-modelname')
960+ args.append('-modelname')
961
962 if not args or args[0] not in self._import_formats:
963 self.help_import()
964- raise self.InvalidCmd('wrong \"import\" format')
965+ raise InvalidCmd('wrong \"import\" format')
966
967 if args[0].startswith('model') and len(args) != 2:
968 if not (len(args) == 3 and args[-1] == '-modelname'):
969 self.help_import()
970- raise self.InvalidCmd('incorrect number of arguments')
971+ raise InvalidCmd('incorrect number of arguments')
972
973 if args[0] == 'proc_v4' and len(args) != 2 and not self._export_dir:
974 self.help_import()
975- raise self.InvalidCmd('PATH is mandatory in the current context\n' + \
976+ raise InvalidCmd('PATH is mandatory in the current context\n' + \
977 'Did you forget to run the \"output\" command')
978
979- if '-modelname' in args:
980- if args[-1] != '-modelname':
981- args.remove('-modelname')
982- args.append('-modelname')
983+
984+ def check_launch(self, args, options):
985+ """check the validity of the line"""
986+ # modify args in order to be MODE DIR
987+ # mode being either standalone or madevent
988+ if not( 0 <= int(options.cluster) <= 2):
989+ return self.InvalidCmd, 'cluster mode should be between 0 and 2'
990+
991+ if not args:
992+ if self._done_export:
993+ args.append(self._done_export[1])
994+ args.append(self._done_export[0])
995+ return
996+ else:
997+ self.help_launch()
998+ raise self.InvalidCmd, \
999+ 'Impossible to use default location: No output command runned'
1000+
1001+ if len(args) != 1:
1002+ self.help_launch()
1003+ return self.InvalidCmd, 'Invalid Syntax: Too many argument'
1004+
1005+ # search for a valid path
1006+ if os.path.sep in args[0] and os.path.isdir(args[0]):
1007+ path = args[0]
1008+ elif os.path.isdir(os.path.join(MG5DIR,args[0])):
1009+ path = os.path.join(MG5DIR,args[0])
1010+ elif MG4DIR and os.path.isdir(os.path.join(MG4DIR,args[0])):
1011+ path = os.path.join(MG4DIR,args[0])
1012+ elif os.path.isdir(args[0]):
1013+ path = args[0]
1014+ else:
1015+ raise self.InvalidCmd, '%s is not a valid directory' % args[0]
1016+
1017+ mode = self.find_output_type(path)
1018+ args[0] = mode
1019+ args.append(path)
1020+
1021+
1022+ def find_output_type(self, path):
1023+ """ identify the type of output of a given directory:
1024+ valid output: madevent/standalone/standalone_cpp"""
1025+
1026+ card_path = os.path.join(path,'Cards')
1027+ bin_path = os.path.join(path,'bin')
1028+ subproc_path = os.path.join(path,'SubProcesses')
1029+
1030+ if not os.path.isdir(card_path) or not os.path.isdir(subproc_path):
1031+ raise self.InvalidCmd, '%s : Not a valid directory' % path
1032+
1033+ if not os.path.isdir(bin_path):
1034+ return 'standalone_cpp'
1035+ elif os.path.isfile(os.path.join(bin_path,'generate_events')):
1036+ return 'madevent'
1037+ else:
1038+ return 'standalone'
1039
1040 def check_load(self, args):
1041 """ check the validity of the line"""
1042
1043 if len(args) != 2 or args[0] not in self._save_opts:
1044 self.help_load()
1045- raise self.InvalidCmd('wrong \"load\" format')
1046+ raise InvalidCmd('wrong \"load\" format')
1047
1048
1049 def check_save(self, args):
1050 """ check the validity of the line"""
1051 if len(args) != 2 or args[0] not in self._save_opts:
1052 self.help_save()
1053- raise self.InvalidCmd('wrong \"save\" format')
1054+ raise InvalidCmd('wrong \"save\" format')
1055
1056 def check_output(self, args):
1057 """ check the validity of the line"""
1058
1059 if not self._curr_model:
1060 text = 'No model found. Please import a model first and then retry.'
1061- raise self.InvalidCmd(text)
1062+ raise InvalidCmd(text)
1063
1064 if args and args[0] in self._export_formats:
1065 self._export_format = args.pop(0)
1066@@ -833,7 +700,7 @@
1067 text += " output for " + args[0] + ", you have to use a UFO model.\n"
1068 text += " Those model can be imported with mg5> import model NAME."
1069 logger.warning(text)
1070- raise self.InvalidCmd('')
1071+ raise InvalidCmd('')
1072
1073 if args and args[0][0] != '-':
1074 # This is a path
1075@@ -859,8 +726,34 @@
1076
1077 if not self._curr_amps and self._export_format != "pythia8_model":
1078 text = 'No processes generated. Please generate a process first.'
1079- raise self.InvalidCmd(text)
1080-
1081+ raise InvalidCmd(text)
1082+
1083+ def check_restrict(self,args):
1084+ """ check the format: restrict [model] param_card.dat"""
1085+
1086+ if len(args) > 2:
1087+ self.help_restrict()
1088+ raise self.InvalidCmd, 'Wrong restrict format'
1089+
1090+ if len(args) == 2:
1091+ if args[0] != "model":
1092+ self.help_restrict()
1093+ raise self.InvalidCmd, 'Wrong restrict format'
1094+ else:
1095+ del args[0]
1096+
1097+ if self._model_v4_path:
1098+ raise self.InvalidCmd, 'Operation not possible with v4 model. ' + \
1099+ 'Please use a UFO model as a starting point'
1100+
1101+ if self._restrict_file:
1102+ raise MadGraph5Error, 'This model is already restricted to the ' + \
1103+ 'card %s. In order to always keep track ' % self._restrict_file + \
1104+ 'of model modifications. We forbids multiple restrictions files.'
1105+
1106+ if not os.path.isfile(args[0]):
1107+ raise self.InvalidCmd, 'path \"%s\" is not a file' % args[0]
1108+
1109 def get_default_path(self):
1110 """Set self._export_dir to the default (\'auto\') path"""
1111
1112@@ -889,7 +782,7 @@
1113 self._export_dir = auto_path(i)
1114 break
1115 if not self._export_dir:
1116- raise self.InvalidCmd('Can\'t use auto path,' + \
1117+ raise InvalidCmd('Can\'t use auto path,' + \
1118 'more than 500 dirs already')
1119
1120
1121@@ -908,7 +801,12 @@
1122 syntax: draw FILEPATH [option=value]
1123 """
1124 raise self.WebRestriction('direct call to draw is forbidden on the web')
1125-
1126+
1127+ def check_check(self, args):
1128+ """ Not authorize for the Web"""
1129+
1130+ raise self.WebRestriction('Check call is forbidden on the web')
1131+
1132 def check_history(self, args):
1133 """check the validity of line
1134 No Path authorize for the Web"""
1135@@ -977,41 +875,15 @@
1136 for f in list
1137 if f.startswith(text)
1138 ]
1139- return completions
1140-
1141- def path_completion(self, text, base_dir = None, only_dirs = False):
1142- """Propose completions of text to compose a valid path"""
1143-
1144- if base_dir is None:
1145- base_dir = os.getcwd()
1146-
1147- if only_dirs:
1148- completion = [f
1149- for f in os.listdir(base_dir)
1150- if f.startswith(text) and \
1151- os.path.isdir(os.path.join(base_dir, f)) and \
1152- (not f.startswith('.') or text.startswith('.'))
1153- ]
1154- else:
1155- completion = [f
1156- for f in os.listdir(base_dir)
1157- if f.startswith(text) and \
1158- os.path.isfile(os.path.join(base_dir, f)) and \
1159- (not f.startswith('.') or text.startswith('.'))
1160- ]
1161-
1162- completion = completion + \
1163- [f + os.path.sep
1164- for f in os.listdir(base_dir)
1165- if f.startswith(text) and \
1166- os.path.isdir(os.path.join(base_dir, f)) and \
1167- (not f.startswith('.') or text.startswith('.'))
1168- ]
1169-
1170- completion += [f for f in ['.'+os.path.sep, '..'+os.path.sep] if \
1171- f.startswith(text)]
1172-
1173- return completion
1174+
1175+ def put_space(name):
1176+ if name.endswith(' '):
1177+ return name
1178+ else:
1179+ return '%s ' % name
1180+
1181+ return [put_space(name) for name in completions]
1182+
1183
1184 def model_completion(self, text, process):
1185 """ complete the line with model information """
1186@@ -1089,7 +961,21 @@
1187 couplings = [c + "=" for c in self._couplings] + ['@','$','/','>']
1188 return self.list_completion(text, self._particle_names + \
1189 self._multiparticles.keys() + couplings)
1190-
1191+
1192+ def complete_restrict(self, text, line, begidx, endidx):
1193+ "Complete the restrict command"
1194+
1195+ args = split_arg(line[0:begidx])
1196+
1197+ if len(args) == 1 and text == 'model'[:len(text)]:
1198+ return ['model ']
1199+
1200+ # Directory continuation
1201+ return self.path_completion(text,
1202+ os.path.join('.',*[a for a in args if a.endswith(os.path.sep)]),
1203+ only_dirs = False)
1204+
1205+
1206 def complete_check(self, text, line, begidx, endidx):
1207 "Complete the add command"
1208
1209@@ -1163,6 +1049,33 @@
1210 'non_propagating', '--']
1211 return self.list_completion(text, opt)
1212
1213+ def complete_launch(self, text, line, begidx, endidx):
1214+ """ complete the launch command"""
1215+
1216+ args = split_arg(line[0:begidx])
1217+
1218+ # Directory continuation
1219+ if args[-1].endswith(os.path.sep):
1220+ return self.path_completion(text,
1221+ os.path.join('.',*[a for a in args if a.endswith(os.path.sep)]),
1222+ only_dirs = True)
1223+ # Format
1224+ if len(args) == 1:
1225+ complete = self.path_completion(text, '.', only_dirs = True)
1226+ if MG5DIR != os.path.realpath('.'):
1227+ complete += self.path_completion(text, MG5DIR, only_dirs = True,
1228+ relative=False)
1229+ if MG4DIR and MG4DIR != os.path.realpath('.'):
1230+ complete += self.path_completion(text, MG4DIR, only_dirs = True,
1231+ relative=False)
1232+ return complete
1233+
1234+ #option
1235+ if len(args) >= 2:
1236+ opt = ['--cluster=', '--name=', '-f']
1237+ return self.list_completion(text, opt)
1238+
1239+
1240 def complete_load(self, text, line, begidx, endidx):
1241 "Complete the load command"
1242
1243@@ -1259,22 +1172,48 @@
1244 "Complete the import command"
1245
1246 args=split_arg(line[0:begidx])
1247-
1248+
1249 # Format
1250 if len(args) == 1:
1251 return self.list_completion(text, self._import_formats)
1252
1253 # Directory continuation
1254- if args[-1].endswith(os.path.sep):
1255+ if os.path.sep in args[-1] + text:
1256 if args[1].startswith('model'):
1257- return self.path_completion(text,
1258- os.path.join('.',*[a for a in args if \
1259- a.endswith(os.path.sep)]),
1260- only_dirs = True)
1261+ # Directory continuation
1262+ return self.path_completion(text, os.path.join('.',*[a for a in args \
1263+ if a.endswith(os.path.sep)]),
1264+ only_dirs = True)
1265 else:
1266 return self.path_completion(text,
1267 os.path.join('.',*[a for a in args if \
1268 a.endswith(os.path.sep)]))
1269+
1270+ # restriction continuation (for UFO)
1271+ if args[1] == 'model' and ('-' in args[-1] + text):
1272+ # deal with - in 2.7 as in 2.6
1273+ if sys.version_info[1] == 7:
1274+ prefix = '-'.join([part for part in text.split('-')[:-1]])+'-'
1275+ args.append(prefix)
1276+ text = text.split('-')[-1]
1277+ #model name
1278+ path = args[-1][:-1] # remove the final - for the model name
1279+ # find the different possibilities
1280+ all_name = self.find_restrict_card(path, no_restrict=False)
1281+ all_name += self.find_restrict_card(path, no_restrict=False,
1282+ base_dir=os.path.join(MG5DIR,'models'))
1283+
1284+ # select the possibility according to the current line
1285+ all_name = [name.split('-')[-1] for name in all_name ]
1286+ all_name = [name+' ' for name in all_name if name.startswith(text)
1287+ and name.strip() != text]
1288+ # adapt output for python2.7 (due to different splitting)
1289+ if sys.version_info[1] == 7:
1290+ all_name = [prefix + name for name in all_name ]
1291+
1292+ if all_name:
1293+ return all_name
1294+
1295 # Model directory name if directory is not given
1296 if len(split_arg(line[0:begidx])) == 2:
1297 if args[1] == 'model':
1298@@ -1287,22 +1226,64 @@
1299 else:
1300 return []
1301
1302- return [mod_name(name) for name in \
1303- self.path_completion(text,
1304+ model_list = [mod_name(name) for name in \
1305+ self.path_completion(text,
1306 os.path.join(MG5DIR,'models'),
1307 only_dirs = True) \
1308- if file_cond(name)]
1309-
1310+ if file_cond(name)]
1311+
1312+ if args[1] == 'model_v4':
1313+ return model_list
1314+ else:
1315+ # need to update the list with the possible restriction
1316+ all_name = []
1317+ for model_name in model_list:
1318+ all_name += self.find_restrict_card(model_name,
1319+ base_dir=os.path.join(MG5DIR,'models'))
1320+ return all_name
1321
1322 # Options
1323 if len(args) > 2 and args[1].startswith('model') and args[-1][0] != '-':
1324 return ['-modelname']
1325+
1326 if len(args) > 3 and args[1].startswith('model') and args[-1][0] == '-':
1327- return ['modelname']
1328-
1329-
1330-
1331-
1332+ if sys.version_info[1] == 6:
1333+ return ['modelname']
1334+ else:
1335+ return ['-modelname']
1336+
1337+ def find_restrict_card(self, model_name, base_dir='./', no_restrict=True):
1338+ """find the restriction file associate to a given model"""
1339+
1340+ # check if the model_name should be keeped as a possibility
1341+ if no_restrict:
1342+ output = [model_name]
1343+ else:
1344+ output = []
1345+
1346+ # check that the model is a valid model
1347+ if not os.path.exists(os.path.join(base_dir, model_name, 'couplings.py')):
1348+ # not valid UFO model
1349+ return output
1350+
1351+ if model_name.endswith(os.path.sep):
1352+ model_name = model_name[:-1]
1353+
1354+ # look for _default and treat this case
1355+ if os.path.exists(os.path.join(base_dir, model_name, 'restrict_default.dat')):
1356+ output.append('%s-full' % model_name)
1357+
1358+ # look for other restrict_file
1359+ for name in os.listdir(os.path.join(base_dir, model_name)):
1360+ if name.startswith('restrict_') and not name.endswith('default.dat') \
1361+ and name.endswith('.dat'):
1362+ tag = name[9:-4] #remove restrict and .dat
1363+ while model_name.endswith(os.path.sep):
1364+ model_name = model_name[:-1]
1365+ output.append('%s-%s' % (model_name, tag))
1366+
1367+ # return
1368+ return output
1369
1370 #===============================================================================
1371 # MadGraphCmd
1372@@ -1342,6 +1323,7 @@
1373 _export_format = 'madevent'
1374 _mgme_dir = MG4DIR
1375 _comparisons = None
1376+ _restrict_file = None
1377
1378 def __init__(self, mgme_dir = '', *completekey, **stdin):
1379 """ add a tracker of the history """
1380@@ -1422,6 +1404,7 @@
1381 amp.nice_string_processes()
1382 logger.warning(warning)
1383
1384+
1385 # Reset _done_export, since we have new process
1386 self._done_export = False
1387
1388@@ -1488,7 +1471,7 @@
1389 else:
1390 particle = self._curr_model['particles'].find_name(arg)
1391 if not particle:
1392- raise self.InvalidCmd, 'no particle %s in current model' % arg
1393+ raise InvalidCmd, 'no particle %s in current model' % arg
1394
1395 print "Particle %s has the following properties:" % particle.get_name()
1396 print str(particle)
1397@@ -1496,8 +1479,8 @@
1398 elif args[0] == 'interactions' and len(args) == 1:
1399 text = "Current model contains %i interactions\n" % \
1400 len(self._curr_model['interactions'])
1401- for inter in self._curr_model['interactions']:
1402- text += str(inter['id']) + ':'
1403+ for i, inter in enumerate(self._curr_model['interactions']):
1404+ text += str(i+1) + ':'
1405 for part in inter['particles']:
1406 if part['is_part']:
1407 text += part['name']
1408@@ -1512,7 +1495,7 @@
1409 elif args[0] == 'interactions':
1410 for arg in args[1:]:
1411 if int(arg) > len(self._curr_model['interactions']):
1412- raise self.InvalidCmd, 'no interaction %s in current model' % arg
1413+ raise InvalidCmd, 'no interaction %s in current model' % arg
1414 if int(arg) == 0:
1415 print 'Special interactions which identify two particles'
1416 else:
1417@@ -1567,21 +1550,21 @@
1418 ufomodel = ufomodels.load_model(self._curr_model.get('name'))
1419 print eval('ufomodel.couplings.%s.nice_string()'%args[1])
1420 except:
1421- raise self.InvalidCmd, 'no couplings %s in current model' % args[1]
1422+ raise InvalidCmd, 'no couplings %s in current model' % args[1]
1423
1424 elif args[0] == 'lorentz':
1425 if self._model_v4_path:
1426 print 'No lorentz information available in V4 model'
1427 return
1428 elif len(args) == 1:
1429- raise self.InvalidCmd,\
1430+ raise InvalidCmd,\
1431 'display lorentz require an argument: the name of the lorentz structure.'
1432 return
1433 try:
1434 ufomodel = ufomodels.load_model(self._curr_model.get('name'))
1435 print eval('ufomodel.lorentz.%s.nice_string()'%args[1])
1436 except:
1437- raise self.InvalidCmd, 'no lorentz %s in current model' % args[1]
1438+ raise InvalidCmd, 'no lorentz %s in current model' % args[1]
1439
1440 elif args[0] == 'checks':
1441 comparisons = self._comparisons[0]
1442@@ -1804,7 +1787,7 @@
1443 if not line.count('>') in [1,2]:
1444 self.do_help('generate')
1445 print
1446- raise self.InvalidCmd('Wrong use of \">\" special character.')
1447+ raise InvalidCmd('Wrong use of \">\" special character.')
1448
1449
1450 # Perform sanity modifications on the lines:
1451@@ -2112,20 +2095,16 @@
1452
1453 if args[0].startswith('model'):
1454 self._model_v4_path = None
1455+ self._restrict_file = None
1456 if args[0].endswith('_v4'):
1457 self._curr_model, self._model_v4_path = \
1458 import_v4.import_model(args[1], self._mgme_dir)
1459 self._curr_fortran_model = \
1460 helas_call_writers.FortranHelasCallWriter(\
1461- self._curr_model)
1462+ self._curr_model)
1463 else:
1464- self._curr_model = import_ufo.import_model(args[1])
1465- self._curr_fortran_model = \
1466- helas_call_writers.FortranUFOHelasCallWriter(\
1467- self._curr_model)
1468- self._curr_cpp_model = \
1469- helas_call_writers.CPPUFOHelasCallWriter(\
1470- self._curr_model)
1471+ self.import_ufo_model(args[1])
1472+
1473 if '-modelname' not in args:
1474 self._curr_model.pass_particles_name_in_mg_default()
1475
1476@@ -2141,7 +2120,7 @@
1477 if not os.path.isfile(args[1]):
1478 raise MadGraph5Error("Path %s is not a valid pathname" % args[1])
1479 else:
1480- # Check the status of export and try to use file position is no
1481+ # Check the status of export and try to use file position if no
1482 #self._export dir are define
1483 self.check_for_export_dir(args[1])
1484 # Execute the card
1485@@ -2166,7 +2145,16 @@
1486
1487 #convert and excecute the card
1488 self.import_mg4_proc_card(proc_card)
1489-
1490+
1491+ def import_ufo_model(self, model_name):
1492+ """ import the UFO model """
1493+
1494+ self._curr_model = import_ufo.import_model(model_name)
1495+ self._curr_fortran_model = \
1496+ helas_call_writers.FortranUFOHelasCallWriter(self._curr_model)
1497+ self._curr_cpp_model = \
1498+ helas_call_writers.CPPUFOHelasCallWriter(self._curr_model)
1499+
1500 def process_model(self):
1501 """Set variables _particle_names and _couplings for tab
1502 completion, defined multiparticles"""
1503@@ -2220,7 +2208,7 @@
1504 self.timeout, old_time_out = 20, self.timeout
1505
1506 # Read the lines of the file and execute them
1507- for line in CmdFile(filepath):
1508+ for line in cmd.CmdFile(filepath):
1509 #remove pointless spaces and \n
1510 line = line.replace('\n', '').strip()
1511 # execute the line
1512@@ -2287,6 +2275,32 @@
1513 self._export_dir = os.path.sep.join(path_split[:-2])
1514
1515
1516+ def do_launch(self, line):
1517+ """Ask for editing the parameter and then
1518+ Execute the code (madevent/standalone/...)
1519+ """
1520+
1521+ args = split_arg(line)
1522+ # check argument validity and normalise argument
1523+ (options, args) = _launch_parser.parse_args(args)
1524+ self.check_launch(args, options)
1525+ options = options.__dict__
1526+ # args is now MODE PATH
1527+
1528+ if args[0].startswith('standalone'):
1529+ ext_program = launch_ext.SALauncher(args[1], self.timeout, **options)
1530+ elif args[0] == 'madevent':
1531+ ext_program = launch_ext.MELauncher(args[1], self.timeout, **options)
1532+ else:
1533+ raise self.InvalidCmd , '%s cannot be run from MG5 interface' % args[0]
1534+
1535+
1536+
1537+ ext_program.run()
1538+
1539+
1540+
1541+
1542 def do_load(self, line):
1543 """Load information from file"""
1544
1545@@ -2366,13 +2380,13 @@
1546 if save_load_object.save_to_file(args[1], self._curr_model):
1547 logger.info('Saved model to file %s' % args[1])
1548 else:
1549- raise self.InvalidCmd('No model to save!')
1550+ raise InvalidCmd('No model to save!')
1551 elif args[0] == 'processes':
1552 if self._curr_amps:
1553 if save_load_object.save_to_file(args[1], self._curr_amps):
1554 logger.info('Saved processes to file %s' % args[1])
1555 else:
1556- raise self.InvalidCmd('No processes to save!')
1557+ raise InvalidCmd('No processes to save!')
1558
1559 def do_output(self, line):
1560 """Initialize a new Template or reinitialize one"""
1561@@ -2403,9 +2417,11 @@
1562 if self._export_format == 'madevent':
1563 export_v4.copy_v4template(self._mgme_dir, self._export_dir,
1564 not noclean)
1565+ export_v4.cp_model_restriction(self._restrict_file, self._export_dir)
1566 elif self._export_format == 'standalone':
1567 export_v4.copy_v4standalone(self._mgme_dir, self._export_dir,
1568 not noclean)
1569+ export_v4.cp_model_restriction(self._restrict_file, self._export_dir)
1570 elif self._export_format == 'standalone_cpp':
1571 export_cpp.setup_cpp_standalone_dir(self._export_dir, self._curr_model)
1572 elif not os.path.isdir(self._export_dir):
1573@@ -2419,7 +2435,7 @@
1574 if nojpeg:
1575 options = '-nojpeg'
1576
1577- self.export(options)
1578+ self.export(options)
1579
1580 # Export a matrix element
1581 def export(self, line):
1582@@ -2473,10 +2489,14 @@
1583 path = self._export_dir
1584 if self._export_format in ['madevent', 'standalone', 'standalone_cpp']:
1585 path = os.path.join(path, 'SubProcesses')
1586-
1587+
1588 if self._export_format == 'madevent':
1589+ uid = 0 # assign a unique id number to all process
1590 for ime, me in \
1591 enumerate(self._curr_matrix_elements.get('matrix_elements')):
1592+ for proc in me.get('processes'):
1593+ uid += 1 # update the identification number
1594+ proc.set('uid', uid) # assign it to the process
1595 calls = calls + \
1596 export_v4.generate_subprocess_directory_v4_madevent(\
1597 me, self._curr_fortran_model, ime, path)
1598@@ -2607,6 +2627,21 @@
1599 if self._export_format == 'madevent':
1600 logger.info('Please see ' + self._export_dir + '/README')
1601 logger.info('for information about how to generate events from this process.')
1602+ logger.info('You can also use the launch command.')
1603+
1604+ def do_restrict(self, line):
1605+ """ from a param_card.dat remove all zero interactions
1606+ and all zero external parameter."""
1607+
1608+ args = split_arg(line)
1609+ # Check args validity
1610+ self.check_restrict(args)
1611+
1612+
1613+ self._curr_model = import_ufo.RestrictModel(self._curr_model)
1614+ self._curr_model.restrict_model(args[0])
1615+ self._restrict_file = args[0]
1616+
1617
1618 def do_help(self, line):
1619 """ propose some usefull possible action """
1620@@ -2661,18 +2696,6 @@
1621
1622 self.prompt = 'mg5>'
1623
1624- if readline:
1625- readline.parse_and_bind("tab: complete")
1626-
1627- # initialize command history if HOME exists
1628- if os.environ.has_key('HOME') and readline:
1629- history_file = os.path.join(os.environ['HOME'], '.mg5history')
1630- try:
1631- readline.read_history_file(history_file)
1632- except IOError:
1633- pass
1634- atexit.register(readline.write_history_file, history_file)
1635-
1636 # By default, load the UFO Standard Model
1637 logger.info("Loading default model: sm")
1638 self.do_import('model sm')
1639@@ -2688,38 +2711,7 @@
1640 logging.info("running shell command: " + line)
1641 subprocess.call(line, shell=True)
1642
1643-#===============================================================================
1644-#
1645-#===============================================================================
1646-class CmdFile(file):
1647- """ a class for command input file -in order to debug cmd \n problem"""
1648-
1649- def __init__(self, name, opt='rU'):
1650-
1651- file.__init__(self, name, opt)
1652- self.text = file.read(self)
1653- self.close()
1654- self.lines = self.text.split('\n')
1655-
1656- def readline(self, *arg, **opt):
1657- """readline method treating correctly a line whithout \n at the end
1658- (add it)
1659- """
1660- if self.lines:
1661- line = self.lines.pop(0)
1662- else:
1663- return ''
1664-
1665- if line.endswith('\n'):
1666- return line
1667- else:
1668- return line + '\n'
1669-
1670- def __next__(self):
1671- return self.lines.__next__()
1672- def __iter__(self):
1673- return self.lines.__iter__()
1674-
1675+
1676 #===============================================================================
1677 # Command Parser
1678 #===============================================================================
1679@@ -2743,7 +2735,18 @@
1680 _draw_parser.add_option("", "--add_gap", default=0, type='float', \
1681 help="set the x-distance between external particles")
1682
1683-
1684+# LAUNCH PROGRAM
1685+_launch_usage = "launch [DIRPATH] [options]\n" + \
1686+ "-- execute the madevent/standalone output present in DIRPATH\n" + \
1687+ " By default DIRPATH is the latest created directory \n" + \
1688+ " Example: launch PROC_SM_1 --name=run2 \n"
1689+_launch_parser = optparse.OptionParser(usage=_launch_usage)
1690+_launch_parser.add_option("-f", "--force", default=False, action='store_true',
1691+ help="Use the card present in the directory in order to launch the different program")
1692+_launch_parser.add_option("-n", "--name", default='', type='str',
1693+ help="Provide a name to the run (for madevent run)")
1694+_launch_parser.add_option("-c", "--cluster", default='0', type='str',
1695+ help="Choose the cluster mode (0: single machine, 1: qsub cluster, 2: multi-core) (for madevent run)")
1696
1697
1698 #===============================================================================
1699@@ -2752,6 +2755,7 @@
1700
1701 if __name__ == '__main__':
1702
1703+ print 'pass here'
1704 run_option = sys.argv
1705 if len(run_option) > 1:
1706 # The first argument of sys.argv is the name of the program
1707
1708=== added file 'madgraph/interface/extended_cmd.py'
1709--- madgraph/interface/extended_cmd.py 1970-01-01 00:00:00 +0000
1710+++ madgraph/interface/extended_cmd.py 2011-03-21 08:51:32 +0000
1711@@ -0,0 +1,381 @@
1712+################################################################################
1713+#
1714+# Copyright (c) 2011 The MadGraph Development team and Contributors
1715+#
1716+# This file is a part of the MadGraph 5 project, an application which
1717+# automatically generates Feynman diagrams and matrix elements for arbitrary
1718+# high-energy processes in the Standard Model and beyond.
1719+#
1720+# It is subject to the MadGraph license which should accompany this
1721+# distribution.
1722+#
1723+# For more information, please visit: http://madgraph.phys.ucl.ac.be
1724+#
1725+################################################################################
1726+""" A file containing different extension of the cmd basic python library"""
1727+
1728+
1729+import cmd
1730+import logging
1731+import os
1732+import signal
1733+import traceback
1734+logger = logging.getLogger('cmdprint') # for stdout
1735+logger_stderr = logging.getLogger('fatalerror') # for stderr
1736+
1737+#===============================================================================
1738+# CmdExtended
1739+#===============================================================================
1740+class Cmd(cmd.Cmd):
1741+ """Extension of the cmd.Cmd command line.
1742+ This extensions supports line breaking, history, comments,
1743+ internal call to cmdline, path completion,...
1744+ this class should be MG5 independent"""
1745+
1746+ #suggested list of command
1747+ next_possibility = {} # command : [list of suggested command]
1748+
1749+ class InvalidCmd(Exception):
1750+ """expected error for wrong command"""
1751+ pass
1752+
1753+ debug_output = 'debug'
1754+ error_debug = """Please report this bug to developers\n
1755+ More information is found in '%s'.\n
1756+ Please attach this file to your report."""
1757+
1758+ keyboard_stop_msg = """stopping all current operation
1759+ in order to quit the program please enter exit"""
1760+
1761+
1762+ def __init__(self, *arg, **opt):
1763+ """Init history and line continuation"""
1764+
1765+ self.log = True
1766+ self.history = []
1767+ self.save_line = ''
1768+ cmd.Cmd.__init__(self, *arg, **opt)
1769+ self.__initpos = os.path.abspath(os.getcwd())
1770+
1771+
1772+
1773+
1774+ def precmd(self, line):
1775+ """ A suite of additional function needed for in the cmd
1776+ this implement history, line breaking, comment treatment,...
1777+ """
1778+
1779+ if not line:
1780+ return line
1781+ line = line.lstrip()
1782+
1783+ # Update the history of this suite of command,
1784+ # except for useless commands (empty history and help calls)
1785+ if line != "history" and \
1786+ not line.startswith('help') and \
1787+ not line.startswith('#*'):
1788+ self.history.append(line)
1789+
1790+ # Check if we are continuing a line:
1791+ if self.save_line:
1792+ line = self.save_line + line
1793+ self.save_line = ''
1794+
1795+ # Check if the line is complete
1796+ if line.endswith('\\'):
1797+ self.save_line = line[:-1]
1798+ return '' # do nothing
1799+
1800+ # Remove comment
1801+ if '#' in line:
1802+ line = line.split('#')[0]
1803+
1804+ # Deal with line splitting
1805+ if ';' in line and not (line.startswith('!') or line.startswith('shell')):
1806+ for subline in line.split(';'):
1807+ stop = self.onecmd(subline)
1808+ stop = self.postcmd(stop, subline)
1809+ return ''
1810+
1811+ # execute the line command
1812+ return line
1813+
1814+ def nice_error_handling(self, error, line):
1815+ """ """
1816+ # Make sure that we are at the initial position
1817+ os.chdir(self.__initpos)
1818+ # Create the debug files
1819+ self.log = False
1820+ cmd.Cmd.onecmd(self, 'history %s' % self.debug_output)
1821+ debug_file = open(self.debug_output, 'a')
1822+ traceback.print_exc(file=debug_file)
1823+ # Create a nice error output
1824+ if self.history and line == self.history[-1]:
1825+ error_text = 'Command \"%s\" interrupted with error:\n' % line
1826+ elif self.history:
1827+ error_text = 'Command \"%s\" interrupted in sub-command:\n' %line
1828+ error_text += '\"%s\" with error:\n' % self.history[-1]
1829+ else:
1830+ error_text = ''
1831+ error_text += '%s : %s\n' % (error.__class__.__name__,
1832+ str(error).replace('\n','\n\t'))
1833+ error_text += self.error_debug % self.debug_output
1834+ logger_stderr.critical(error_text)
1835+ #stop the execution if on a non interactive mode
1836+ if self.use_rawinput == False:
1837+ return True
1838+ return False
1839+
1840+ def nice_user_error(self, error, line):
1841+ # Make sure that we are at the initial position
1842+ os.chdir(self.__initpos)
1843+ if line == self.history[-1]:
1844+ error_text = 'Command \"%s\" interrupted with error:\n' % line
1845+ else:
1846+ error_text = 'Command \"%s\" interrupted in sub-command:\n' %line
1847+ error_text += '\"%s\" with error:\n' % self.history[-1]
1848+ error_text += '%s : %s' % (error.__class__.__name__,
1849+ str(error).replace('\n','\n\t'))
1850+ logger_stderr.error(error_text)
1851+ #stop the execution if on a non interactive mode
1852+ if self.use_rawinput == False:
1853+ return True
1854+ # Remove failed command from history
1855+ self.history.pop()
1856+ return False
1857+
1858+ def onecmd(self, line):
1859+ """catch all error and stop properly command accordingly"""
1860+
1861+ try:
1862+ return cmd.Cmd.onecmd(self, line)
1863+ except self.InvalidCmd as error:
1864+ if __debug__:
1865+ self.nice_error_handling(error, line)
1866+ else:
1867+ self.nice_user_error(error, line)
1868+ except Exception as error:
1869+ self.nice_error_handling(error, line)
1870+ except KeyboardInterrupt:
1871+ print self.keyboard_stop_msg
1872+
1873+ def exec_cmd(self, line, errorhandling=False):
1874+ """for third party call, call the line with pre and postfix treatment
1875+ without global error handling """
1876+
1877+ logger.info(line)
1878+ line = self.precmd(line)
1879+ if errorhandling:
1880+ stop = self.onecmd(line)
1881+ else:
1882+ stop = cmd.Cmd.onecmd(self, line)
1883+ stop = self.postcmd(stop, line)
1884+ return stop
1885+
1886+ def run_cmd(self, line):
1887+ """for third party call, call the line with pre and postfix treatment
1888+ with global error handling"""
1889+
1890+ return self.exec_cmd(line, errorhandling=True)
1891+
1892+ def emptyline(self):
1893+ """If empty line, do nothing. Default is repeat previous command."""
1894+ pass
1895+
1896+ def default(self, line):
1897+ """Default action if line is not recognized"""
1898+
1899+ # Faulty command
1900+ logger.warning("Command \"%s\" not recognized, please try again" % \
1901+ line.split()[0])
1902+ # Quit
1903+ def do_quit(self, line):
1904+ """ exit the mainloop() """
1905+ print
1906+ return True
1907+
1908+ # Aliases
1909+ do_EOF = do_quit
1910+ do_exit = do_quit
1911+
1912+ def do_help(self, line):
1913+ """ propose some usefull possible action """
1914+
1915+ cmd.Cmd.do_help(self,line)
1916+
1917+ # if not basic help -> simple call is enough
1918+ if line:
1919+ return
1920+
1921+ if len(self.history) == 0:
1922+ last_action_2 = last_action = 'start'
1923+ else:
1924+ last_action_2 = last_action = 'none'
1925+
1926+ pos = 0
1927+ authorize = self.next_possibility.keys()
1928+ while last_action_2 not in authorize and last_action not in authorize:
1929+ pos += 1
1930+ if pos > len(self.history):
1931+ last_action_2 = last_action = 'start'
1932+ break
1933+
1934+ args = self.history[-1 * pos].split()
1935+ last_action = args[0]
1936+ if len(args)>1:
1937+ last_action_2 = '%s %s' % (last_action, args[1])
1938+ else:
1939+ last_action_2 = 'none'
1940+
1941+ print 'Contextual Help'
1942+ print '==============='
1943+ if last_action_2 in authorize:
1944+ options = self.next_possibility[last_action_2]
1945+ elif last_action in authorize:
1946+ options = self.next_possibility[last_action]
1947+
1948+ text = 'The following command(s) may be useful in order to continue.\n'
1949+ for option in options:
1950+ text+='\t %s \n' % option
1951+ print text
1952+
1953+ def list_completion(self, text, list):
1954+ """Propose completions of text in list"""
1955+ if not text:
1956+ completions = list
1957+ else:
1958+ completions = [ f
1959+ for f in list
1960+ if f.startswith(text)
1961+ ]
1962+ return completions
1963+
1964+ @staticmethod
1965+ def path_completion(text, base_dir = None, only_dirs = False,
1966+ relative=True):
1967+ """Propose completions of text to compose a valid path"""
1968+
1969+ if base_dir is None:
1970+ base_dir = os.getcwd()
1971+
1972+ prefix, text = os.path.split(text)
1973+ base_dir = os.path.join(base_dir, prefix)
1974+ if prefix:
1975+ prefix += os.path.sep
1976+
1977+
1978+
1979+ if only_dirs:
1980+ completion = [prefix + f
1981+ for f in os.listdir(base_dir)
1982+ if f.startswith(text) and \
1983+ os.path.isdir(os.path.join(base_dir, f)) and \
1984+ (not f.startswith('.') or text.startswith('.'))
1985+ ]
1986+ else:
1987+ completion = [ prefix + f
1988+ for f in os.listdir(base_dir)
1989+ if f.startswith(text) and \
1990+ os.path.isfile(os.path.join(base_dir, f)) and \
1991+ (not f.startswith('.') or text.startswith('.'))
1992+ ]
1993+
1994+ completion = completion + \
1995+ [prefix + f + os.path.sep
1996+ for f in os.listdir(base_dir)
1997+ if f.startswith(text) and \
1998+ os.path.isdir(os.path.join(base_dir, f)) and \
1999+ (not f.startswith('.') or text.startswith('.'))
2000+ ]
2001+
2002+ if relative:
2003+ completion += [prefix + f for f in ['.'+os.path.sep, '..'+os.path.sep] if \
2004+ f.startswith(text) and not prefix.startswith('.')]
2005+
2006+ return completion
2007+
2008+
2009+
2010+
2011+
2012+#===============================================================================
2013+# Question in order to return a path with auto-completion
2014+#===============================================================================
2015+class OneLinePathCompletion(cmd.Cmd):
2016+ """ a class for answering a question with the path autocompletion"""
2017+
2018+ def preloop(self):
2019+ """Initializing before starting the main loop"""
2020+ self.prompt = ''
2021+ self.value = None
2022+
2023+ def __init__(self, allow_arg=[],*arg, **opt):
2024+ self.allow_arg = allow_arg
2025+ self.history_header = ''
2026+ cmd.Cmd.__init__(self, *arg, **opt)
2027+
2028+ def completenames(self, text, *ignored):
2029+ signal.alarm(0) # avoid timer if any
2030+ try:
2031+ return Cmd.path_completion(text,'.', only_dirs = False)
2032+ except Exception, error:
2033+ print error
2034+
2035+ def default(self, line):
2036+ """Default action if line is not recognized"""
2037+ self.value = line
2038+
2039+ def postcmd(self, stop, line):
2040+
2041+ try:
2042+ if self.value in self.allow_arg or os.path.isfile(self.value):
2043+ return True
2044+ else:
2045+ raise Exception
2046+ except Exception:
2047+ print """not valid argument. Valid argument are file path or value in (%s).""" \
2048+ % ','.join(self.allow_arg)
2049+ print 'please retry'
2050+ return False
2051+
2052+ def cmdloop(self, intro=None):
2053+ cmd.Cmd.cmdloop(self, intro)
2054+ return self.value
2055+
2056+# a function helper
2057+def raw_path_input(input_text, allow_arg=[]):
2058+ print input_text
2059+ obj = OneLinePathCompletion(allow_arg=allow_arg)
2060+ return os.path.relpath(obj.cmdloop())
2061+
2062+#===============================================================================
2063+#
2064+#===============================================================================
2065+class CmdFile(file):
2066+ """ a class for command input file -in order to debug cmd \n problem"""
2067+
2068+ def __init__(self, name, opt='rU'):
2069+
2070+ file.__init__(self, name, opt)
2071+ self.text = file.read(self)
2072+ self.close()
2073+ self.lines = self.text.split('\n')
2074+
2075+ def readline(self, *arg, **opt):
2076+ """readline method treating correctly a line whithout \n at the end
2077+ (add it)
2078+ """
2079+ if self.lines:
2080+ line = self.lines.pop(0)
2081+ else:
2082+ return ''
2083+
2084+ if line.endswith('\n'):
2085+ return line
2086+ else:
2087+ return line + '\n'
2088+
2089+ def __next__(self):
2090+ return self.lines.__next__()
2091+ def __iter__(self):
2092+ return self.lines.__iter__()
2093
2094=== added file 'madgraph/interface/launch_ext_program.py'
2095--- madgraph/interface/launch_ext_program.py 1970-01-01 00:00:00 +0000
2096+++ madgraph/interface/launch_ext_program.py 2011-03-21 08:51:32 +0000
2097@@ -0,0 +1,296 @@
2098+################################################################################
2099+#
2100+# Copyright (c) 2009 The MadGraph Development team and Contributors
2101+#
2102+# This file is a part of the MadGraph 5 project, an application which
2103+# automatically generates Feynman diagrams and matrix elements for arbitrary
2104+# high-energy processes in the Standard Model and beyond.
2105+#
2106+# It is subject to the MadGraph license which should accompany this
2107+# distribution.
2108+#
2109+# For more information, please visit: http://madgraph.phys.ucl.ac.be
2110+#
2111+################################################################################
2112+
2113+import logging
2114+import os
2115+import subprocess
2116+
2117+
2118+import madgraph.iolibs.files as files
2119+import madgraph.iolibs.misc as misc
2120+import madgraph.interface.extended_cmd as cmd
2121+from madgraph import MG4DIR, MG5DIR, MadGraph5Error
2122+from madgraph.iolibs.files import cp
2123+
2124+logger = logging.getLogger('cmdprint.ext_program')
2125+
2126+class ExtLauncher(object):
2127+ """ Generic Class for executing external program """
2128+
2129+ program_dir = ''
2130+ executable = '' # path from program_dir
2131+
2132+ cards = [] # files can be modified (path from self.card_dir)
2133+ force = False
2134+
2135+ def __init__(self, running_dir, card_dir='', timeout=None, **options):
2136+ """ initialize an object """
2137+
2138+ self.running_dir = running_dir
2139+ self.card_dir = os.path.join(self.running_dir, card_dir)
2140+ self.timeout = timeout
2141+ self.found_editor()
2142+
2143+ #include/overwrite options
2144+ for key,value in options.items():
2145+ setattr(self, key, value)
2146+
2147+
2148+ def found_editor(self):
2149+ """ found a (shell) program for editing file """
2150+
2151+ # let first try to use the prefer editor (if EDITOR is define)
2152+ # if not define use the first define in a pre-define list
2153+
2154+ if os.environ.has_key('EDITOR') and misc.which(os.environ['EDITOR']):
2155+ self.editor = os.environ['EDITOR']
2156+ return
2157+
2158+ logger.info('INFO: You can choose your prefered editor by defining the shell variable EDITOR')
2159+
2160+ possibility = ['vi', 'emacs', 'vim', 'gedit', 'nano']
2161+ for editor in possibility:
2162+ if misc.which(editor):
2163+ self.editor = editor
2164+ return
2165+
2166+ logger.warning(
2167+ 'No valid editor detected. Please configure the shell variable EDITOR')
2168+
2169+ def run(self):
2170+ """ execute the main code """
2171+
2172+ self.prepare_run()
2173+ for card in self.cards:
2174+ self.treat_input_file(card, default = 'n')
2175+
2176+ self.launch_program()
2177+
2178+
2179+ def prepare_run(self):
2180+ """ aditional way to prepare the run"""
2181+ pass
2182+
2183+ def launch_program(self):
2184+ """launch the main program"""
2185+ subprocess.call([self.executable], cwd=self.running_dir)
2186+
2187+ def edit_file(self, path):
2188+ """edit a file"""
2189+
2190+ path = os.path.realpath(path)
2191+ subprocess.call([self.editor, path], cwd=os.getcwd())
2192+
2193+ def ask(self, question, default):
2194+ """ ask a question """
2195+
2196+ if not self.force:
2197+ try:
2198+ out = misc.timed_input(question, default, timeout=self.timeout,
2199+ noerror=False)
2200+ except misc.TimeOutError:
2201+ # avoid to always wait a given time for the next answer
2202+ self.force = True
2203+ else:
2204+ self.timeout=None # answer at least one question so wait...
2205+ return out
2206+ else:
2207+ return default
2208+
2209+ def treat_input_file(self, filename, default=None, msg=''):
2210+ """ask to edit a file"""
2211+
2212+ if msg == '' and filename == 'param_card.dat':
2213+ msg = \
2214+ """WARNING: If you edit this file don\'t forget to modify
2215+ consistently the different parameters, especially
2216+ the width of all particles."""
2217+
2218+ fct = lambda q: cmd.raw_path_input(q, allow_arg=['y','n'])
2219+
2220+ if not self.force:
2221+ if msg: print msg
2222+ question = 'Do you want to edit file: %(card)s? [y/n/path of the new %(card)s]'
2223+ question = question % {'card':filename}
2224+ try:
2225+ ans = misc.timed_input(question, default, timeout=self.timeout,
2226+ noerror=False, fct=fct)
2227+ except misc.TimeOutError:
2228+ # avoid to always wait a given time for the next answer
2229+ self.force = True
2230+ else:
2231+ self.timeout=None # answer at least one question so wait...
2232+ else:
2233+ ans = default
2234+
2235+ if ans == 'y':
2236+ path = os.path.join(self.card_dir, filename)
2237+ self.edit_file(path)
2238+ elif ans == 'n':
2239+ return
2240+ else:
2241+ path = os.path.join(self.card_dir, filename)
2242+ files.cp(ans, path)
2243+
2244+
2245+
2246+
2247+class SALauncher(ExtLauncher):
2248+ """ A class to launch a simple Standalone test """
2249+
2250+ cards = ['param_card.dat']
2251+
2252+ def __init__(self, running_dir, timeout, **options):
2253+ """ initialize the StandAlone Version"""
2254+
2255+ ExtLauncher.__init__(self, running_dir, './Cards', timeout, **options)
2256+
2257+ def launch_program(self):
2258+ """launch the main program"""
2259+ sub_path = os.path.join(self.running_dir, 'SubProcesses')
2260+ for path in os.listdir(sub_path):
2261+ if path.startswith('P') and \
2262+ os.path.isdir(os.path.join(sub_path, path)):
2263+ cur_path = os.path.join(sub_path, path)
2264+ # make
2265+ subprocess.call(['make'], cwd=cur_path)
2266+ # check
2267+ subprocess.call(['./check'], cwd=cur_path)
2268+
2269+
2270+class MELauncher(ExtLauncher):
2271+ """A class to launch MadEvent run"""
2272+
2273+ cards = ['param_card.dat', 'run_card.dat']
2274+
2275+ def __init__(self, running_dir, timeout, **option):
2276+ """ initialize the StandAlone Version"""
2277+
2278+
2279+ ExtLauncher.__init__(self, running_dir, './Cards', timeout, **option)
2280+ self.executable = os.path.join('.', 'bin','generate_events')
2281+
2282+ assert hasattr(self, 'cluster')
2283+ assert hasattr(self, 'name')
2284+
2285+ # Check for pythia-pgs directory
2286+ if os.path.isdir(os.path.join(MG5DIR,'pythia-pgs')):
2287+ self.pythia = os.path.join(MG5DIR,'pythia-pgs')
2288+ elif MG4DIR and os.path.isdir(os.path.join(MG4DIR,'pythia-pgs')):
2289+ self.pythia = os.path.join(MG4DIR,'pythia-pgs')
2290+ else:
2291+ self.pythia = None
2292+
2293+ # Check for DELPHES directory
2294+ if os.path.isdir(os.path.join(MG5DIR,'Delphes')):
2295+ self.delphes = os.path.join(MG5DIR,'Delphes')
2296+ elif MG4DIR and os.path.isdir(os.path.join(MG4DIR,'Delphes')):
2297+ self.delphes = os.path.join(MG4DIR,'Delphes')
2298+ else:
2299+ self.delphes = None
2300+
2301+
2302+ # Assign a valid run name if not put in options
2303+ if self.name == '':
2304+ for i in range(1000):
2305+ path = os.path.join(self.running_dir, 'Events','run_%02i_banner.txt' % i)
2306+ if not os.path.exists(path):
2307+ self.name = 'run%s' % i
2308+ break
2309+
2310+ if self.name == '':
2311+ raise MadGraph5Error, 'too much run in this directory'
2312+
2313+
2314+ def copy_default_card(self, name):
2315+
2316+ dico = {'dir': self.card_dir, 'name': name }
2317+
2318+ if not os.path.exists('%(dir)s/%(name)s_card.dat' % dico):
2319+ cp('%(dir)s/%(name)s_card_default.dat' % dico,
2320+ '%(dir)s/%(name)s_card.dat' % dico)
2321+
2322+
2323+ def prepare_run(self):
2324+ """ ask for pythia-pgs/delphes run """
2325+
2326+ # Check If we Need to run pythia
2327+ if not self.pythia or self.force:
2328+ return
2329+
2330+ answer = self.ask('Do you want to run pythia? [y/n]','n')
2331+ if answer == 'y':
2332+ self.copy_default_card('pythia')
2333+ self.cards.append('pythia_card.dat')
2334+ else:
2335+ path = os.path.join(self.card_dir, 'pythia_card.dat')
2336+ try: os.remove(path)
2337+ except OSError: pass
2338+ return # no Need to ask for PGS
2339+
2340+ answer = self.ask('Do you want to run PGS? [y/n]','n')
2341+ if answer == 'y':
2342+ self.copy_default_card('pgs')
2343+ self.cards.append('pgs_card.dat')
2344+ return # No Need to ask for Delphes
2345+ else:
2346+ path = os.path.join(self.card_dir, 'pgs_card.dat')
2347+ try: os.remove(path)
2348+ except OSError: pass
2349+
2350+ if not self.delphes:
2351+ return
2352+
2353+ answer = self.ask('Do you want to run Delphes? [y/n]','n')
2354+ if answer == 'y':
2355+ self.copy_default_card('delphes')
2356+ self.cards.append('delphes_card.dat')
2357+ else:
2358+ path = os.path.join(self.card_dir, 'delphes_card.dat')
2359+ try: os.remove(path)
2360+ except OSError: pass
2361+
2362+ def launch_program(self):
2363+ """launch the main program"""
2364+
2365+ mode = str(self.cluster)
2366+ if mode == "0":
2367+ subprocess.call([self.executable, mode, self.name],
2368+ cwd=self.running_dir)
2369+ elif mode == "1":
2370+ subprocess.call([self.executable, mode, self.name, self.name],
2371+ cwd=self.running_dir)
2372+ elif mode == "2":
2373+ nb_node = self.ask('How many core do you want to use?', '2')
2374+ subprocess.call([self.executable, mode, nb_node, self.name],
2375+ cwd=self.running_dir)
2376+
2377+ # Display the cross-section to the screen
2378+ path = os.path.join(self.running_dir, 'SubProcesses', '%s_results.dat'
2379+ % self.name)
2380+ fsock = open(path)
2381+ line = fsock.readline()
2382+ cross, error = line.split()[0:2]
2383+
2384+ logger.info('The total cross-section is %s +- %s pb' % (cross, error))
2385+ logger.info('more information in %s'
2386+ % os.path.join(self.running_dir, 'index.html'))
2387+
2388+
2389+
2390+
2391+
2392+
2393+
2394
2395=== modified file 'madgraph/interface/tutorial_text.py'
2396--- madgraph/interface/tutorial_text.py 2010-10-07 00:08:46 +0000
2397+++ madgraph/interface/tutorial_text.py 2011-03-21 08:51:32 +0000
2398@@ -26,6 +26,7 @@
2399 produce the output for MadEvent. In this part we will learn
2400 a) How to generate a process
2401 b) How to create output for MadEvent
2402+c) How to run the MadEvent output
2403
2404 Let's start with the first point, how to generate a process:
2405 mg5>generate p p > t t~
2406@@ -77,9 +78,15 @@
2407 output = """
2408 If you are following the tutorial, a directory MY_FIRST_MG5_RUN has
2409 been created which can be used in order to run MadEvent exactly as if
2410-it was coming from MG4, see MY_FIRST_MG5_RUN/README.
2411-
2412-This step ends the tutorial of the basic commands of MG5. You can
2413+it was coming from MG4.
2414+
2415+Additionally to the MG4 command (see MY_FIRST_MG5_RUN/README), you can also
2416+generate your events/compute the cross-section from this interface:
2417+Please Enter:
2418+mg5> launch MY_FIRST_MG5_RUN
2419+"""
2420+
2421+launch = """This step ends the tutorial of the basic commands of MG5. You can
2422 always use the help to see the options available for different
2423 commands. For example, if you want to know all valid output formats,
2424 you can enter
2425@@ -92,11 +99,11 @@
2426
2427 But you can also continue the tutorial to learn some other useful
2428 commands:
2429-c) How to load a model
2430-d) How to define a multi-particle label
2431-e) How to store a history of the commands in a session
2432-f) How to call shell commands from MG5
2433-g) How to draw the diagrams for your processes without generating
2434+d) How to load a model
2435+e) How to define a multi-particle label
2436+f) How to store a history of the commands in a session
2437+g) How to call shell commands from MG5
2438+h) How to draw the diagrams for your processes without generating
2439 MadEvent output
2440
2441 To import a model, write:
2442
2443=== modified file 'madgraph/iolibs/drawing_eps.py'
2444--- madgraph/iolibs/drawing_eps.py 2010-12-09 15:12:32 +0000
2445+++ madgraph/iolibs/drawing_eps.py 2011-03-21 08:51:32 +0000
2446@@ -40,7 +40,7 @@
2447 from __future__ import division
2448
2449 import os
2450-
2451+import math
2452 import madgraph.core.drawing as draw
2453 import madgraph.core.base_objects as base_objects
2454
2455@@ -166,15 +166,15 @@
2456 line.end.pos_x, line.end.pos_y, 'Fhiggs')
2457
2458
2459- def draw_wavy(self, line):
2460+ def draw_wavy(self, line, opt=0, type='d'):
2461 """ADD the EPS code for this photon line."""
2462
2463 #add the code in the correct format
2464 self.text += self.line_format(line.start.pos_x, line.start.pos_y,
2465- line.end.pos_x, line.end.pos_y, '0 Fphotond')
2466-
2467-
2468- def draw_curly(self, line):
2469+ line.end.pos_x, line.end.pos_y, '%d Fphoton%s' % (opt,type))
2470+
2471+
2472+ def draw_curly(self, line, type=''):
2473 """ADD the EPS code for this gluon line."""
2474
2475 # Due to the asymmetry in the way to draw the gluon (everything is draw
2476@@ -185,13 +185,45 @@
2477 line.start.pos_y > line.end.pos_y):
2478 self.text += self.line_format(line.start.pos_x,
2479 line.start.pos_y, line.end.pos_x,
2480- line.end.pos_y, '0 Fgluon')
2481+ line.end.pos_y, '0 Fgluon%s' % type)
2482 else:
2483 self.text += self.line_format(line.end.pos_x,
2484 line.end.pos_y, line.start.pos_x,
2485- line.start.pos_y, '0 Fgluon')
2486-
2487-
2488+ line.start.pos_y, '0 Fgluon%s' % type)
2489+
2490+ def draw_scurly(self, line):
2491+ """ADD the EPS code for this gluino line."""
2492+ self.draw_curly(line, type='r'
2493+ )
2494+ self.draw_straight(line)
2495+
2496+ def draw_swavy(self, line):
2497+ """ADD the EPS code for this neutralino line."""
2498+ self.draw_wavy(line, type='r')
2499+ self.draw_straight(line)
2500+
2501+ def draw_double(self, line, type='r'):
2502+ """ADD the EPS code for this neutralino line."""
2503+
2504+
2505+ length = math.sqrt((line.end.pos_y - line.start.pos_y)**2 + (line.end.pos_x - line.start.pos_x) **2)
2506+ c1 = (line.end.pos_x - line.start.pos_x)/length
2507+ c2 = (line.end.pos_y - line.start.pos_y)/length
2508+
2509+ gap = 0.013
2510+ start2_x = line.start.pos_x + gap * c1
2511+ start2_y = line.start.pos_y + gap * c2
2512+ stop1_x = line.end.pos_x - gap * c1
2513+ stop1_y = line.end.pos_y - gap * c2
2514+
2515+
2516+ self.text += self.line_format(line.start.pos_x, line.start.pos_y,
2517+ stop1_x, stop1_y, '0 Fphoton%s' % (type))
2518+ #add the code in the correct format
2519+ self.text += self.line_format(start2_x, start2_y,
2520+ line.end.pos_x, line.end.pos_y, '0 Fphoton%s' % (type))
2521+
2522+
2523 def put_diagram_number(self, number=0):
2524 """ADD the comment 'diagram [number]' just below the diagram."""
2525
2526
2527=== modified file 'madgraph/iolibs/export_cpp.py'
2528--- madgraph/iolibs/export_cpp.py 2010-11-24 20:10:07 +0000
2529+++ madgraph/iolibs/export_cpp.py 2011-03-21 08:51:32 +0000
2530@@ -1469,6 +1469,8 @@
2531 p.depend))
2532 else:
2533 for p in self.model['parameters'][key]:
2534+ if p.name == 'ZERO':
2535+ continue
2536 self.params_indep.append(base_objects.ModelVariable(p.name,
2537 self.p_to_cpp.parse(p.expr),
2538 p.type,
2539@@ -1479,15 +1481,16 @@
2540 param = params_ext.pop(0)
2541 # Read value from the slha variable
2542 expression = ""
2543+ assert param.value.imag == 0
2544 if len(param.lhacode) == 1:
2545 expression = "slha.get_block_entry(\"%s\", %d, %e);" % \
2546 (param.lhablock.lower(), param.lhacode[0],
2547- param.value)
2548+ param.value.real)
2549 elif len(param.lhacode) == 2:
2550 expression = "indices[0] = %d;\nindices[1] = %d;\n" % \
2551 (param.lhacode[0], param.lhacode[1])
2552 expression += "%s=slha.get_block_entry(\"%s\", indices, %e);" \
2553- % (param.name, param.lhablock.lower(), param.value)
2554+ % (param.name, param.lhablock.lower(), param.value.real)
2555 else:
2556 raise MadGraph5Error("Only support for SLHA blocks with 1 or 2 indices")
2557 self.params_indep.insert(0,
2558
2559=== modified file 'madgraph/iolibs/export_v4.py'
2560--- madgraph/iolibs/export_v4.py 2011-03-09 20:12:43 +0000
2561+++ madgraph/iolibs/export_v4.py 2011-03-21 08:51:32 +0000
2562@@ -32,8 +32,7 @@
2563 import madgraph.iolibs.ufo_expression_parsers as parsers
2564
2565 import aloha.create_aloha as create_aloha
2566-
2567-import models.sm.write_param_card as write_param_card
2568+import models.write_param_card as param_writer
2569 from madgraph import MadGraph5Error, MG5DIR
2570 from madgraph.iolibs.files import cp, ln, mv
2571 _file_path = os.path.split(os.path.dirname(os.path.realpath(__file__)))[0] + '/'
2572@@ -125,7 +124,34 @@
2573 open(os.path.join(dir_path, 'SubProcesses', 'MGVersion.txt'), 'w').write(
2574 MG_version['version'])
2575
2576-
2577+#===============================================================================
2578+# Copy the model restriction in the Model Directory
2579+#===============================================================================
2580+def cp_model_restriction(file_path, dir_path):
2581+ """Copy the model restriction in the Model Directory."""
2582+
2583+ if not file_path:
2584+ return
2585+
2586+ assert os.path.isfile(file_path)
2587+ assert os.path.isdir(os.path.join(dir_path,'Source','MODEL'))
2588+
2589+ output_path = os.path.join(dir_path,'Source','MODEL','restrict_model.dat')
2590+
2591+ header="""#*********************************************************************
2592+# THIS FILE WAS USED TO RESTRICT THE ORIGINAL MODEL
2593+# PLEASE DON'T EDIT THIS FILE. HE IS IMPORTANT IN ORDER TO BE ABLE
2594+# TO REPRODUCE THE RESULT IN THE FUTURE.
2595+#*********************************************************************\n"""
2596+ ff = open(output_path,'w')
2597+ ff.writelines(header)
2598+ ff.writelines(open(file_path).read())
2599+ ff.close()
2600+
2601+
2602+
2603+
2604+
2605 #===============================================================================
2606 # Make the Helas and Model directories for Standalone directory
2607 #===============================================================================
2608@@ -1507,7 +1533,6 @@
2609
2610 self.model = model
2611 self.model_name = model['name']
2612-
2613 self.dir_path = output_path
2614
2615 self.coups_dep = [] # (name, expression, type)
2616@@ -1588,14 +1613,15 @@
2617 index = self.params_dep.index('sqrt__aS')
2618 self.params_indep.insert(0, self.params_dep.pop(index))
2619
2620- def build(self, wanted_couplings = []):
2621+ def build(self, wanted_couplings = [], full=True):
2622 """modify the couplings to fit with MG4 convention and creates all the
2623 different files"""
2624
2625 self.pass_parameter_to_case_insensitive()
2626 self.refactorize(wanted_couplings)
2627 # write the files
2628- self.write_all()
2629+ if full:
2630+ self.write_all()
2631
2632 def open(self, name, comment='c', format='default'):
2633 """ Open the file name in the correct directory and with a valid
2634@@ -1641,6 +1667,7 @@
2635
2636 # All the standard files
2637 self.copy_standard_file()
2638+
2639 ############################################################################
2640 ## ROUTINE CREATING THE FILES ############################################
2641 ############################################################################
2642@@ -1760,6 +1787,8 @@
2643 fsock.writelines("if(readlha) then\n")
2644
2645 for param in self.params_indep:
2646+ if param.name == 'ZERO':
2647+ continue
2648 fsock.writelines("%s = %s\n" % (param.name,
2649 self.p_to_f.parse(param.expr)))
2650
2651@@ -1885,7 +1914,8 @@
2652 fsock.writelines("""write(*,*) ' Internal Params'
2653 write(*,*) ' ---------------------------------'
2654 write(*,*) ' '""")
2655- lines = [format(data.name) for data in self.params_indep]
2656+ lines = [format(data.name) for data in self.params_indep
2657+ if data.name != 'ZERO']
2658 fsock.writelines('\n'.join(lines))
2659 fsock.writelines("""write(*,*) ' Internal Params evaluated point by point'
2660 write(*,*) ' ----------------------------------------'
2661@@ -1901,7 +1931,7 @@
2662
2663 def format(parameter):
2664 """return the line for the ident_card corresponding to this parameter"""
2665- colum = [parameter.lhablock] + \
2666+ colum = [parameter.lhablock.lower()] + \
2667 [str(value) for value in parameter.lhacode] + \
2668 [parameter.name]
2669 return ' '.join(colum)+'\n'
2670@@ -1918,11 +1948,10 @@
2671 def format_line(parameter):
2672 """return the line for the ident_card corresponding to this
2673 parameter"""
2674-
2675 template = \
2676 """ call LHA_get_real(npara,param,value,'%(name)s',%(name)s,%(value)s)""" \
2677 % {'name': parameter.name,
2678- 'value': self.p_to_f.parse(str(parameter.value))}
2679+ 'value': self.p_to_f.parse(str(parameter.value.real))}
2680
2681 return template
2682
2683@@ -1944,19 +1973,10 @@
2684
2685 def create_param_card(self):
2686 """ create the param_card.dat """
2687-
2688- write_param_card.ParamCardWriter(
2689- os.path.join(self.dir_path, 'param_card.dat'),
2690- self.params_ext)
2691-
2692-# def search_type(self, expr):
2693-# """return the type associate to the expression"""
2694-#
2695-# for param in self.model.all_parameters:
2696-# if param.name == expr:
2697-# return param.type
2698-#
2699-# return CompactifyExpression.search_type(self, expr)
2700+
2701+ out_path = os.path.join(self.dir_path, 'param_card.dat')
2702+ param_writer.ParamCardWriter(self.model, out_path)
2703+
2704
2705
2706
2707
2708=== modified file 'madgraph/iolibs/files.py'
2709--- madgraph/iolibs/files.py 2010-11-06 18:34:32 +0000
2710+++ madgraph/iolibs/files.py 2011-03-21 08:51:32 +0000
2711@@ -88,7 +88,7 @@
2712 #===============================================================================
2713 # check piclke validity
2714 #===============================================================================
2715-def is_uptodate(picklefile, path_list=None, min_time=1289300000):
2716+def is_uptodate(picklefile, path_list=None, min_time=1300120445):
2717 """Check if the pickle files is uptodate compare to a list of files.
2718 If no files are given, the pickle files is checked against it\' current
2719 directory"""
2720
2721=== modified file 'madgraph/iolibs/misc.py'
2722--- madgraph/iolibs/misc.py 2010-06-16 08:51:57 +0000
2723+++ madgraph/iolibs/misc.py 2011-03-21 08:51:32 +0000
2724@@ -17,6 +17,7 @@
2725
2726 import os
2727 import re
2728+import signal
2729 import StringIO
2730 import time
2731
2732@@ -85,6 +86,9 @@
2733 def is_exe(fpath):
2734 return os.path.exists(fpath) and os.access(fpath, os.X_OK)
2735
2736+ if not program:
2737+ return None
2738+
2739 fpath, fname = os.path.split(program)
2740 if fpath:
2741 if is_exe(program):
2742@@ -96,3 +100,37 @@
2743 return exe_file
2744
2745 return None
2746+
2747+#===============================================================================
2748+# Ask a question with a maximum amount of time to answer
2749+#===============================================================================
2750+class TimeOutError(Exception):
2751+ """Class for run-time error"""
2752+
2753+def timed_input(question, default, timeout=None, noerror=True, fct=None):
2754+ """ a question with a maximal time to answer take default otherwise"""
2755+
2756+ def handle_alarm(signum, frame):
2757+ raise TimeOutError
2758+
2759+ signal.signal(signal.SIGALRM, handle_alarm)
2760+
2761+ if fct is None:
2762+ fct = raw_input
2763+
2764+ if timeout:
2765+ signal.alarm(timeout)
2766+ question += '[%ss to answer [%s]] ' % (timeout, str(default))
2767+ try:
2768+ result = fct(question)
2769+ except TimeOutError:
2770+ if noerror:
2771+ print '\nuse %s' % default
2772+ return default
2773+ else:
2774+ signal.alarm(0)
2775+ raise
2776+ finally:
2777+ signal.alarm(0)
2778+ return result
2779+
2780
2781=== modified file 'madgraph/iolibs/template_files/drawing_eps_header.inc'
2782--- madgraph/iolibs/template_files/drawing_eps_header.inc 2010-08-06 09:18:24 +0000
2783+++ madgraph/iolibs/template_files/drawing_eps_header.inc 2011-03-21 08:51:32 +0000
2784@@ -30,7 +30,7 @@
2785 def /Fx2 exch def /Fy1 exch def /Fx1 exch def
2786 Fx2 Fx1 sub Fy2 Fy1 sub Fbasis /Fttype 1
2787 Ftype 2 mod 2 mul abs sub def Ftype 0 ge
2788-{/Fddist Fdist Fr div def /Fn Fddist round
2789+{/Fddist Fdist Fr div 2 div def /Fn Fddist round
2790 def Ftype 1 gt {/Fn Fn Fddist Fn sub Fsign
2791 add def} if} {/Fn Fdist Fr div 2 div round 2
2792 mul def} ifelse Fx1 Fy1 moveto 0 1 Fnopoints
2793@@ -70,18 +70,25 @@
2794
2795 /Fphoton
2796 {{ Fx1 Fx2 Fx1 sub Fi mul Fnopoints div Fn
2797+div Fxt Fi 360 mul Fnopoints div Frmod sin
2798+mul Fttype mul 2 div add add Fy1 Fy2 Fy1 sub
2799+Fi mul Fnopoints div Fn div Fyt Fi 360 mul
2800+Fnopoints div Frmod sin mul Fttype mul 2 div
2801+add add } Fstraight } def
2802+
2803+/Fphotonr
2804+{{ Fx1 Fx2 Fx1 sub Fi mul Fnopoints div Fn
2805 div Fxt Fi 180 mul Fnopoints div Frmod sin
2806-mul Fttype mul 2 div add add Fy1 Fy2 Fy1 sub
2807+mul Fttype mul 1 div add add Fy1 Fy2 Fy1 sub
2808 Fi mul Fnopoints div Fn div Fyt Fi 180 mul
2809-Fnopoints div Frmod sin mul Fttype mul 2 div
2810+Fnopoints div Frmod sin mul Fttype mul 1 div
2811 add add } Fstraight } def
2812
2813-
2814 /Fphotond
2815 {{ Fx1 Fx2 Fx1 sub Fi mul Fnopoints div Fn
2816-div Fxt Fi 180 mul Fnopoints div Frmod sin
2817+div Fxt Fi 360 mul Fnopoints div Frmod sin
2818 mul Fttype mul 2 div add add Fy1 Fy2 Fy1 sub
2819-Fi mul Fnopoints div Fn div Fyt Fi 180 mul
2820+Fi mul Fnopoints div Fn div Fyt Fi 360 mul
2821 Fnopoints div Frmod sin mul Fttype mul 2 div
2822 add add } Fstraight Fx1
2823 Fx2 add 2 div Fy1 Fy2 add 2 div Farrow} def
2824@@ -108,6 +115,17 @@
2825 180 mul Fnopoints div sin mul add add add }
2826 Fstraight } def
2827
2828+/Fgluonr
2829+{2 sub { Fx1 Fx2 Fx1 sub Fi mul Fnopoints div
2830+Fn div Fxt 0 Fi 120 mul Fnopoints div cos sub
2831+mul Fttype mul Fxl Fi 120 mul Fnopoints div
2832+sin mul add add add Fy1 Fy2 Fy1 sub Fi mul
2833+Fnopoints div Fn div Fyt 0 Fi 120 mul
2834+Fnopoints div cos sub mul Fttype mul Fyl Fi
2835+120 mul Fnopoints div sin mul add add add }
2836+Fstraight } def
2837+
2838+
2839 /Fgluonl
2840 {exch 2 sub exch { Fxc Fth cos Frr mul Fxt 1
2841 Fi 180 mul Fnopoints div cos sub mul Fttype
2842
2843=== modified file 'madgraph/iolibs/ufo_expression_parsers.py'
2844--- madgraph/iolibs/ufo_expression_parsers.py 2010-10-26 20:13:20 +0000
2845+++ madgraph/iolibs/ufo_expression_parsers.py 2011-03-21 08:51:32 +0000
2846@@ -182,6 +182,7 @@
2847 def p_error(self, p):
2848 if p:
2849 logger.error("Syntax error at '%s'" % p.value)
2850+ raise MadGraph5Error
2851 else:
2852 logger.error("Syntax error at EOF")
2853 self.parsed_string = "Error"
2854
2855=== modified file 'madgraph/various/process_checks.py'
2856--- madgraph/various/process_checks.py 2011-01-26 13:23:54 +0000
2857+++ madgraph/various/process_checks.py 2011-03-21 08:51:32 +0000
2858@@ -41,7 +41,7 @@
2859
2860 import madgraph.various.rambo as rambo
2861
2862-from madgraph import MG5DIR, MadGraph5Error
2863+from madgraph import MG5DIR, MadGraph5Error, InvalidCmd
2864
2865 import models.model_reader as model_reader
2866 import aloha.template_files.wavefunctions as wavefunctions
2867@@ -191,7 +191,9 @@
2868 multiprocess.get('is_decay_chain'),
2869 'overall_orders': \
2870 multiprocess.get('overall_orders')})
2871+
2872 result = function(process, stored_quantities, *args)
2873+
2874 if result:
2875 results.append(result)
2876
2877@@ -478,8 +480,14 @@
2878 newproc.set('legs', legs)
2879
2880 # Generate the amplitude for this process
2881- amplitude = diagram_generation.Amplitude(newproc)
2882- if not amplitude.get('diagrams'):
2883+ try:
2884+ amplitude = diagram_generation.Amplitude(newproc)
2885+ except InvalidCmd:
2886+ result=False
2887+ else:
2888+ result = amplitude.get('diagrams')
2889+
2890+ if not result:
2891 # This process has no diagrams; go to next process
2892 logging.info("No diagrams for %s" % \
2893 process.nice_string().replace('Process', 'process'))
2894@@ -905,7 +913,13 @@
2895 legs = process.get('legs')
2896 # Generate a process with these legs
2897 # Generate the amplitude for this process
2898- amplitude = diagram_generation.Amplitude(process)
2899+ try:
2900+ amplitude = diagram_generation.Amplitude(process)
2901+ except InvalidCmd:
2902+ logging.info("No diagrams for %s" % \
2903+ process.nice_string().replace('Process', 'process'))
2904+ return None
2905+
2906 if not amplitude.get('diagrams'):
2907 # This process has no diagrams; go to next process
2908 logging.info("No diagrams for %s" % \
2909
2910=== modified file 'models/import_ufo.py'
2911--- models/import_ufo.py 2011-03-01 12:51:49 +0000
2912+++ models/import_ufo.py 2011-03-21 08:51:32 +0000
2913@@ -28,17 +28,22 @@
2914 import madgraph.iolibs.save_load_object as save_load_object
2915 from madgraph.core.color_algebra import *
2916
2917+
2918 import aloha.create_aloha as create_aloha
2919
2920 import models as ufomodels
2921-
2922+import models.model_reader as model_reader
2923 logger = logging.getLogger('models.import_ufo')
2924-
2925-class UFOFormatError(Exception):
2926- pass
2927-
2928-def import_model(model_name):
2929- """ a practical and efficient way to import one of those models """
2930+logger_mod = logging.getLogger('madgraph.model')
2931+
2932+root_path = os.path.dirname(os.path.realpath( __file__ ))
2933+sys.path.append(root_path)
2934+
2935+class UFOImportError(MadGraph5Error):
2936+ """ a error class for wrong import of UFO model"""
2937+
2938+def find_ufo_path(model_name):
2939+ """ find the path to a model """
2940
2941 # Check for a valid directory
2942 if model_name.startswith('./') and os.path.isdir(model_name):
2943@@ -48,7 +53,58 @@
2944 elif os.path.isdir(model_name):
2945 model_path = model_name
2946 else:
2947- raise MadGraph5Error("Path %s is not a valid pathname" % model_name)
2948+ raise UFOImportError("Path %s is not a valid pathname" % model_name)
2949+
2950+ return model_path
2951+
2952+def import_model(model_name):
2953+ """ a practical and efficient way to import a model"""
2954+
2955+ # check if this is a valid path or if this include restriction file
2956+ try:
2957+ model_path = find_ufo_path(model_name)
2958+ except UFOImportError:
2959+ if '-' not in model_name:
2960+ raise
2961+ split = model_name.split('-')
2962+ model_name = '-'.join([text for text in split[:-1]])
2963+ model_path = find_ufo_path(model_name)
2964+
2965+ restrict_file = os.path.join(model_path, 'restrict_%s.dat'% split[-1])
2966+ #if restriction is full, then we by pass restriction (avoid default)
2967+ if split[-1] == 'full':
2968+ restrict_file = None
2969+ else:
2970+ # Check if by default we need some restrictions
2971+ if os.path.exists(os.path.join(model_path,'restrict_default.dat')):
2972+ restrict_file = os.path.join(model_path,'restrict_default.dat')
2973+ else:
2974+ restrict_file = None
2975+
2976+ #import the FULL model
2977+ model = import_full_model(model_path)
2978+
2979+ #restrict it if needed
2980+ if restrict_file:
2981+ # but doing this in silence
2982+ old_level = logger_mod.level
2983+ if old_level < 30:
2984+ logger_mod.setLevel(30) # WARNING
2985+
2986+ # Modify the mother class of the object in order to allow restriction
2987+ model = RestrictModel(model)
2988+ model.restrict_model(restrict_file)
2989+
2990+ # put logger in normal mode
2991+ logger_mod.setLevel(old_level)
2992+
2993+ return model
2994+
2995+def import_full_model(model_path):
2996+ """ a practical and efficient way to import one of those models
2997+ (no restriction file use)"""
2998+
2999+ assert model_path == find_ufo_path(model_path)
3000
3001 # Check the validity of the model
3002 files_list_prov = ['couplings.py','lorentz.py','parameters.py',
3003@@ -57,7 +113,7 @@
3004 for filename in files_list_prov:
3005 filepath = os.path.join(model_path, filename)
3006 if not os.path.isfile(filepath):
3007- raise MadGraph5Error, "%s directory is not a valid UFO model: \n %s is missing" % \
3008+ raise UFOImportError, "%s directory is not a valid UFO model: \n %s is missing" % \
3009 (model_path, filename)
3010 files_list.append(filepath)
3011
3012@@ -66,22 +122,20 @@
3013 try:
3014 model = save_load_object.load_from_file( \
3015 os.path.join(model_path, 'model.pkl'))
3016- except Exception:
3017+ except Exception, error:
3018+ print error
3019 logger.info('failed to load model from pickle file. Try importing UFO from File')
3020 else:
3021 return model
3022
3023 # Load basic information
3024- ufo_model = ufomodels.load_model(model_name)
3025+ ufo_model = ufomodels.load_model(model_path)
3026 ufo2mg5_converter = UFOMG5Converter(ufo_model)
3027 model = ufo2mg5_converter.load_model()
3028- model.set('name', os.path.split(model_name)[-1])
3029+
3030+ if model_path[-1] == '/': model_path = model_path[:-1] #avoid empty name
3031+ model.set('name', os.path.split(model_path)[-1])
3032
3033- # Load Abstract Helas routine from Aloha
3034- #abstract_model = create_aloha.AbstractALOHAModel(model_name)
3035- #abstract_model.compute_all(save=False)
3036- #model.set('lorentz', abstract_model)
3037-
3038 # Load the Parameter/Coupling in a convinient format.
3039 parameters, couplings = OrganizeModelExpression(ufo_model).main()
3040 model.set('parameters', parameters)
3041@@ -91,6 +145,10 @@
3042 # save in a pickle files to fasten future usage
3043 save_load_object.save_to_file(os.path.join(model_path, 'model.pkl'), model)
3044
3045+ #if default and os.path.exists(os.path.join(model_path, 'restrict_default.dat')):
3046+ # restrict_file = os.path.join(model_path, 'restrict_default.dat')
3047+ # model = import_ufo.RestrictModel(model)
3048+ # model.restrict_model(restrict_file)
3049 return model
3050
3051
3052@@ -107,6 +165,7 @@
3053 self.model = base_objects.Model()
3054 self.model.set('particles', self.particles)
3055 self.model.set('interactions', self.interactions)
3056+ self.conservecharge = set(['charge'])
3057
3058 self.ufomodel = model
3059
3060@@ -132,6 +191,7 @@
3061 for interaction_info in self.ufomodel.all_vertices:
3062 self.add_interaction(interaction_info)
3063
3064+ self.model.set('conserved_charge', self.conservecharge)
3065 return self.model
3066
3067
3068@@ -146,6 +206,7 @@
3069 # MG5 doesn't use ghost (use unitary gauges)
3070 if particle_info.spin < 0:
3071 return
3072+
3073 # MG5 doesn't use goldstone boson
3074 if hasattr(particle_info, 'GoldstoneBoson'):
3075 if particle_info.GoldstoneBoson:
3076@@ -167,10 +228,14 @@
3077 particle.set(key, value)
3078 elif key == 'charge':
3079 particle.set(key, float(value))
3080- elif key in ['charge','width']:
3081+ elif key in ['mass','width']:
3082 particle.set(key, str(value))
3083 else:
3084 particle.set(key, value)
3085+ elif key not in ('GhostNumber','selfconjugate','goldstoneboson'):
3086+ # add charge -we will check later if those are conserve
3087+ self.conservecharge.add(key)
3088+ particle.set(key,value, force=True)
3089
3090 assert(12 == nb_property) #basic check that all the information is there
3091
3092@@ -181,7 +246,6 @@
3093 # Add the particles to the list
3094 self.particles.append(particle)
3095
3096-
3097 def add_interaction(self, interaction_info):
3098 """add an interaction in the MG5 model. interaction_info is the
3099 UFO vertices information."""
3100@@ -224,6 +288,17 @@
3101 # add to the interactions
3102 self.interactions.append(interaction)
3103
3104+ # check if this interaction conserve the charge defined
3105+ for charge in list(self.conservecharge): #duplicate to allow modification
3106+ total = 0
3107+ for part in interaction_info.particles:
3108+ try:
3109+ total += getattr(part, charge)
3110+ except AttributeError:
3111+ pass
3112+ if abs(total) > 1e-12:
3113+ logger.info('The model has interaction violating the charge: %s' % charge)
3114+ self.conservecharge.discard(charge)
3115
3116 _pat_T = re.compile(r'T\((?P<first>\d*),(?P<second>\d*)\)')
3117 _pat_id = re.compile(r'Identity\((?P<first>\d*),(?P<second>\d*)\)')
3118@@ -501,7 +576,219 @@
3119 except:
3120 return 'complex'
3121
3122-
3123+class RestrictModel(model_reader.ModelReader):
3124+ """ A class for restricting a model for a given param_card.
3125+ Two rules apply:
3126+ - Vertex with zero couplings are throw away
3127+ - external parameter with zero input are changed into internal parameter."""
3128+
3129+ def restrict_model(self, param_card):
3130+ """apply the model restriction following param_card"""
3131+
3132+ # compute the value of all parameters
3133+ self.set_parameters_and_couplings(param_card)
3134+
3135+ # deal with couplings
3136+ zero_couplings = self.detect_zero_couplings()
3137+ self.remove_couplings(zero_couplings)
3138+
3139+ # deal with parameters
3140+ parameters = self.detect_special_parameters()
3141+ self.fix_parameter_values(*parameters)
3142+
3143+ # deal with identical parameters
3144+ iden_parameters = self.detect_identical_parameters()
3145+ for iden_param in iden_parameters:
3146+ self.merge_identical_parameters(iden_param)
3147+
3148+
3149+ def detect_zero_couplings(self):
3150+ """return a list with the name of all vanishing couplings"""
3151+
3152+ zero_coupling = []
3153+
3154+ for name, value in self['coupling_dict'].items():
3155+ if value == 0:
3156+ zero_coupling.append(name)
3157+ return zero_coupling
3158+
3159+
3160+ def detect_special_parameters(self):
3161+ """ return the list of (name of) parameter which are zero """
3162+
3163+ null_parameters = []
3164+ one_parameters = []
3165+ for name, value in self['parameter_dict'].items():
3166+ if value == 0 and name != 'ZERO':
3167+ null_parameters.append(name)
3168+ elif value == 1:
3169+ one_parameters.append(name)
3170+
3171+ return null_parameters, one_parameters
3172+
3173+ def detect_identical_parameters(self):
3174+ """ return the list of tuple of name of parameter with the same
3175+ input value """
3176+
3177+ # Extract external parameters
3178+ external_parameters = self['parameters'][('external',)]
3179+
3180+ # define usefull variable to detect identical input
3181+ block_value_to_var={} #(lhablok, value): list_of_var
3182+ mult_param = set([]) # key of the previous dict with more than one
3183+ #parameter.
3184+
3185+ #detect identical parameter and remove the duplicate parameter
3186+ for param in external_parameters[:]:
3187+ value = self['parameter_dict'][param.name]
3188+ if value == 0:
3189+ continue
3190+ key = (param.lhablock, value)
3191+ if key in block_value_to_var:
3192+ block_value_to_var[key].append(param)
3193+ mult_param.add(key)
3194+ #remove the duplicate parameter
3195+ #external_parameters.remove(param)
3196+ else:
3197+ block_value_to_var[key] = [param]
3198+
3199+ output=[]
3200+ for key in mult_param:
3201+ output.append(block_value_to_var[key])
3202+
3203+ return output
3204+
3205+ def merge_identical_parameters(self, parameters):
3206+ """ merge the identical parameters given in argument """
3207+
3208+ logger_mod.info('Parameters set to identical values: %s '% \
3209+ ', '.join([obj.name for obj in parameters]))
3210+
3211+ # Extract external parameters
3212+ external_parameters = self['parameters'][('external',)]
3213+ for i, obj in enumerate(parameters):
3214+ # Keeped intact the first one and store information
3215+ if i == 0:
3216+ obj.info = 'set of param :' + \
3217+ ', '.join([param.name for param in parameters])
3218+ expr = obj.name
3219+ continue
3220+ # delete the old parameters
3221+ external_parameters.remove(obj)
3222+ # replace by the new one pointing of the first obj of the class
3223+ new_param = base_objects.ModelVariable(obj.name, expr, 'real')
3224+ self['parameters'][()].insert(0, new_param)
3225+
3226+
3227+ def remove_couplings(self, zero_couplings):
3228+ """ remove the interactions associated to couplings"""
3229+
3230+ # clean the interactions
3231+ for interaction in self['interactions'][:]:
3232+ modified = False
3233+ for key, coupling in interaction['couplings'].items()[:]:
3234+ if coupling in zero_couplings:
3235+ modified = True
3236+ del interaction['couplings'][key]
3237+
3238+ if modified:
3239+ part_name = [part['name'] for part in interaction['particles']]
3240+ orders = ['%s=%s' % (order,value)
3241+ for order,value in interaction['orders'].items()]
3242+ if not interaction['couplings']:
3243+ logger_mod.info('remove interactions: %s at order: %s' % \
3244+ (' '.join(part_name),', '.join(orders)))
3245+ self['interactions'].remove(interaction)
3246+ elif modified:
3247+ logger_mod.info('modify interactions: %s at order: %s' % \
3248+ (' '.join(part_name),', '.join(orders)))
3249+ #clean the coupling list:
3250+ for name, data in self['couplings'].items():
3251+ for coupling in data[:]:
3252+ if coupling.name in zero_couplings:
3253+ data.remove(coupling)
3254+
3255+ def fix_parameter_values(self, zero_parameters, one_parameters):
3256+ """ Remove all instance of the parameters in the model and replace it by
3257+ zero when needed."""
3258+
3259+ special_parameters = zero_parameters + one_parameters
3260+
3261+ # treat specific cases for masses and width
3262+ for particle in self['particles']:
3263+ if particle['mass'] in zero_parameters:
3264+ particle['mass'] = 'ZERO'
3265+ if particle['width'] in zero_parameters:
3266+ particle['width'] = 'ZERO'
3267+ for pdg, particle in self['particle_dict'].items():
3268+ if particle['mass'] in zero_parameters:
3269+ particle['mass'] = 'ZERO'
3270+ if particle['width'] in zero_parameters:
3271+ particle['width'] = 'ZERO'
3272+
3273+ # check if the parameters is still usefull:
3274+ re_str = '|'.join(special_parameters)
3275+ re_pat = re.compile(r'''\b(%s)\b''' % re_str)
3276+ used = set()
3277+ # check in coupling
3278+ for name, coupling_list in self['couplings'].items():
3279+ for coupling in coupling_list:
3280+ for use in re_pat.findall(coupling.expr):
3281+ used.add(use)
3282+
3283+ # simplify the regular expression
3284+ re_str = '|'.join([param for param in special_parameters
3285+ if param not in used])
3286+ re_pat = re.compile(r'''\b(%s)\b''' % re_str)
3287+
3288+ param_info = {}
3289+ # check in parameters
3290+ for dep, param_list in self['parameters'].items():
3291+ for tag, parameter in enumerate(param_list):
3292+ # update information concerning zero/one parameters
3293+ if parameter.name in special_parameters:
3294+ param_info[parameter.name]= {'dep': dep, 'tag': tag,
3295+ 'obj': parameter}
3296+ continue
3297+
3298+ # Bypass all external parameter
3299+ if isinstance(parameter, base_objects.ParamCardVariable):
3300+ continue
3301+
3302+ # check the presence of zero/one parameter
3303+ for use in re_pat.findall(parameter.expr):
3304+ used.add(use)
3305+
3306+ # modify the object for those which are still used
3307+ for param in used:
3308+ data = self['parameters'][param_info[param]['dep']]
3309+ data.remove(param_info[param]['obj'])
3310+ tag = param_info[param]['tag']
3311+ data = self['parameters'][()]
3312+ if param in zero_parameters:
3313+ data.insert(0, base_objects.ModelVariable(param, '0.0', 'real'))
3314+ else:
3315+ data.insert(0, base_objects.ModelVariable(param, '1.0', 'real'))
3316+
3317+ # remove completely useless parameters
3318+ for param in special_parameters:
3319+ #by pass parameter still in use
3320+ if param in used:
3321+ logger_mod.info('fix parameter value: %s' % param)
3322+ continue
3323+ logger_mod.info('remove parameters: %s' % param)
3324+ data = self['parameters'][param_info[param]['dep']]
3325+ data.remove(param_info[param]['obj'])
3326+
3327+
3328+
3329+
3330+
3331+
3332+
3333+
3334+
3335+
3336
3337
3338
3339
3340=== modified file 'models/model_reader.py'
3341--- models/model_reader.py 2010-12-02 15:45:16 +0000
3342+++ models/model_reader.py 2011-03-21 08:51:32 +0000
3343@@ -104,7 +104,8 @@
3344 value))
3345 parameter_dict['decay'][(pid,)].value = complex(value)
3346 except KeyError:
3347- logger.warning('No decay parameter found for %d' % pid)
3348+ pass
3349+ #logger.warning('No decay parameter found for %d' % pid)
3350 continue
3351 # Look for blocks
3352 block_match = re_block.match(line)
3353@@ -121,9 +122,8 @@
3354 exec("locals()[\'%s\'] = %s" % (parameter_dict[block][(i1,i2)].name,
3355 value))
3356 parameter_dict[block][(i1,i2)].value = float(value)
3357-
3358 except KeyError:
3359- logger.warning('No parameter found for block %s index %d %d' %\
3360+ logger.warning('No parameter found for block %s index %d %d' %\
3361 (block, i1, i2))
3362 continue
3363 # Look for single indices
3364@@ -136,7 +136,8 @@
3365 value))
3366 parameter_dict[block][(i1,)].value = complex(value)
3367 except KeyError:
3368- logger.warning('No parameter found for block %s index %d' %\
3369+ if block not in ['qnumbers','mass']:
3370+ logger.warning('No parameter found for block %s index %d' %\
3371 (block, i1))
3372 continue
3373 else:
3374@@ -193,7 +194,7 @@
3375 derived_parameters]))
3376
3377 # Add "zero"
3378- self.get('parameter_dict')['ZERO'] = 0.
3379+ self.get('parameter_dict')['ZERO'] = complex(0.)
3380
3381 self.set('coupling_dict', dict([(coup.name, coup.value) \
3382 for coup in couplings]))
3383
3384=== modified file 'models/mssm/MSSM_UFO.log'
3385--- models/mssm/MSSM_UFO.log 2010-12-05 05:38:08 +0000
3386+++ models/mssm/MSSM_UFO.log 2011-03-21 08:51:32 +0000
3387@@ -1,13 +1,13 @@
3388-# This file was automatically created by FeynRules $Revision: 364 $
3389-# Mathematica version: 7.0 for Linux x86 (32-bit) (February 18, 2009)
3390-# Date: Sat 4 Dec 2010 11:43:16
3391+# This file was automatically created by FeynRules $Revision: 510 $
3392+# Mathematica version: 7.0 for Linux x86 (64-bit) (February 18, 2009)
3393+# Date: Wed 2 Mar 2011 15:02:57
3394
3395
3396 #
3397 # This is the logfile for the model MSSM
3398
3399-# Authors: Benjamin Fuks, Neil D. Christensen
3400-# Model version: 1.1.9
3401+# Authors: Benjamin Fuks
3402+# Model version: 1.3.0
3403 # Checking the Lagrangians
3404 * All Lagrangians are ok.
3405 #
3406@@ -33,34 +33,36 @@
3407 # Parameter definitions
3408 #
3409
3410- * All parameters are ok.
3411+ * Parameter gp has no value. Default value 1 assigned.
3412+ * Parameter gw has no value. Default value 1 assigned.
3413
3414
3415 # Vertices
3416- * Calling FeynmanRules for 10 Lagrangians.
3417- * Number of classes vertices: 268
3418- * Number of flavored vertices: 931
3419+ * Calling FeynmanRules for 1 Lagrangians.
3420+ * Number of classes vertices: 174
3421+ * Number of flavored vertices: 822
3422 * Saved vertices in InterfaceRun[ 1 ].
3423 * Checked QNumber conservation.
3424 - Quantum number GhostNumber conserved in all vertices.
3425 - Quantum number Q conserved in all vertices.
3426+ - Quantum number Y conserved in all vertices.
3427 * particles.py written.
3428 * parameters.py written.
3429 #
3430 # Vertex definitions
3431 #
3432
3433- * 931 vertices written.
3434+ * 822 vertices written.
3435 * vertices.py written.
3436 #
3437 # Lorentz structure definitions
3438 #
3439
3440- * 19 lorentz structures written.
3441+ * 17 lorentz structures written.
3442 * lorentz.py written.
3443 #
3444 # Coupling definitions
3445 #
3446
3447- * 1063 couplings written.
3448+ * 945 couplings written.
3449 * couplings.py written.
3450
3451=== modified file 'models/mssm/__init__.py'
3452--- models/mssm/__init__.py 2010-08-19 09:06:28 +0000
3453+++ models/mssm/__init__.py 2011-03-21 08:51:32 +0000
3454@@ -13,3 +13,8 @@
3455 all_lorentz = lorentz.all_lorentz
3456 all_parameters = parameters.all_parameters
3457 all_functions = function_library.all_functions
3458+
3459+
3460+__author__ = "Benjamin Fuks"
3461+__version__ = "1.3.0"
3462+__email__ = "fuks@cern.ch"
3463
3464=== modified file 'models/mssm/couplings.py'
3465--- models/mssm/couplings.py 2010-12-05 05:38:08 +0000
3466+++ models/mssm/couplings.py 2011-03-21 08:51:32 +0000
3467@@ -1,6 +1,6 @@
3468-# This file was automatically created by FeynRules $Revision: 364 $
3469-# Mathematica version: 7.0 for Linux x86 (32-bit) (February 18, 2009)
3470-# Date: Sat 4 Dec 2010 12:26:08
3471+# This file was automatically created by FeynRules $Revision: 510 $
3472+# Mathematica version: 7.0 for Linux x86 (64-bit) (February 18, 2009)
3473+# Date: Wed 2 Mar 2011 15:09:56
3474
3475
3476 from object_library import all_couplings, Coupling
3477@@ -46,4218 +46,3746 @@
3478 order = {'QCD':2})
3479
3480 GC_10 = Coupling(name = 'GC_10',
3481- value = '-(complex(0,1)*G*I1044)',
3482- order = {'QCD':1})
3483+ value = '(2*ee**2*complex(0,1)*I1211)/9.',
3484+ order = {'QED':2})
3485
3486 GC_11 = Coupling(name = 'GC_11',
3487- value = 'complex(0,1)*G**2*I1044',
3488- order = {'QCD':2})
3489+ value = '(-2*ee*complex(0,1)*G*I1211)/3.',
3490+ order = {'QCD':1,'QED':1})
3491
3492 GC_12 = Coupling(name = 'GC_12',
3493- value = '-(complex(0,1)*G*I1055)',
3494- order = {'QCD':1})
3495+ value = 'complex(0,1)*G**2*I1211',
3496+ order = {'QCD':2})
3497
3498 GC_13 = Coupling(name = 'GC_13',
3499- value = 'complex(0,1)*G**2*I1055',
3500- order = {'QCD':2})
3501+ value = '(2*ee**2*complex(0,1)*I1222)/9.',
3502+ order = {'QED':2})
3503
3504 GC_14 = Coupling(name = 'GC_14',
3505- value = '(ee*complex(0,1)*I111)/3.',
3506- order = {'QED':1})
3507+ value = '(-2*ee*complex(0,1)*G*I1222)/3.',
3508+ order = {'QCD':1,'QED':1})
3509
3510 GC_15 = Coupling(name = 'GC_15',
3511- value = '(-2*ee*complex(0,1)*G*I111)/3.',
3512- order = {'QCD':1,'QED':1})
3513+ value = 'complex(0,1)*G**2*I1222',
3514+ order = {'QCD':2})
3515
3516 GC_16 = Coupling(name = 'GC_16',
3517- value = '(-2*ee*complex(0,1)*I1111)/3.',
3518- order = {'QED':1})
3519+ value = '(2*ee**2*complex(0,1)*I1233)/9. + (2*ee**2*complex(0,1)*I1333)/9.',
3520+ order = {'QED':2})
3521
3522 GC_17 = Coupling(name = 'GC_17',
3523- value = '-(complex(0,1)*G*I1111)',
3524- order = {'QCD':1})
3525+ value = '(-2*ee*complex(0,1)*G*I1233)/3. - (2*ee*complex(0,1)*G*I1333)/3.',
3526+ order = {'QCD':1,'QED':1})
3527
3528 GC_18 = Coupling(name = 'GC_18',
3529- value = '(-2*ee*complex(0,1)*I1122)/3.',
3530- order = {'QED':1})
3531+ value = 'complex(0,1)*G**2*I1233 + complex(0,1)*G**2*I1333',
3532+ order = {'QCD':2})
3533
3534 GC_19 = Coupling(name = 'GC_19',
3535- value = '-(complex(0,1)*G*I1122)',
3536- order = {'QCD':1})
3537+ value = '(2*ee**2*complex(0,1)*I1236)/9. + (2*ee**2*complex(0,1)*I1336)/9.',
3538+ order = {'QED':2})
3539
3540 GC_20 = Coupling(name = 'GC_20',
3541- value = '(ee*complex(0,1)*I122)/3.',
3542- order = {'QED':1})
3543+ value = '(-2*ee*complex(0,1)*G*I1236)/3. - (2*ee*complex(0,1)*G*I1336)/3.',
3544+ order = {'QCD':1,'QED':1})
3545
3546 GC_21 = Coupling(name = 'GC_21',
3547- value = '(-2*ee*complex(0,1)*G*I122)/3.',
3548- order = {'QCD':1,'QED':1})
3549+ value = 'complex(0,1)*G**2*I1236 + complex(0,1)*G**2*I1336',
3550+ order = {'QCD':2})
3551
3552 GC_22 = Coupling(name = 'GC_22',
3553- value = '(-2*ee*complex(0,1)*I1133)/3. - (2*ee*complex(0,1)*I1233)/3.',
3554- order = {'QED':1})
3555+ value = '(2*ee**2*complex(0,1)*I1344)/9.',
3556+ order = {'QED':2})
3557
3558 GC_23 = Coupling(name = 'GC_23',
3559- value = '-(complex(0,1)*G*I1133) - complex(0,1)*G*I1233',
3560- order = {'QCD':1})
3561+ value = '(-2*ee*complex(0,1)*G*I1344)/3.',
3562+ order = {'QCD':1,'QED':1})
3563
3564 GC_24 = Coupling(name = 'GC_24',
3565- value = '(-2*ee*complex(0,1)*I1136)/3. - (2*ee*complex(0,1)*I1236)/3.',
3566- order = {'QED':1})
3567+ value = 'complex(0,1)*G**2*I1344',
3568+ order = {'QCD':2})
3569
3570 GC_25 = Coupling(name = 'GC_25',
3571- value = '-(complex(0,1)*G*I1136) - complex(0,1)*G*I1236',
3572- order = {'QCD':1})
3573+ value = '(2*ee**2*complex(0,1)*I1355)/9.',
3574+ order = {'QED':2})
3575
3576 GC_26 = Coupling(name = 'GC_26',
3577- value = '(-2*ee*complex(0,1)*I1244)/3.',
3578- order = {'QED':1})
3579+ value = '(-2*ee*complex(0,1)*G*I1355)/3.',
3580+ order = {'QCD':1,'QED':1})
3581
3582 GC_27 = Coupling(name = 'GC_27',
3583- value = '-(complex(0,1)*G*I1244)',
3584- order = {'QCD':1})
3585+ value = 'complex(0,1)*G**2*I1355',
3586+ order = {'QCD':2})
3587
3588 GC_28 = Coupling(name = 'GC_28',
3589- value = '(-2*ee*complex(0,1)*I1255)/3.',
3590- order = {'QED':1})
3591+ value = '(2*ee**2*complex(0,1)*I1263)/9. + (2*ee**2*complex(0,1)*I1363)/9.',
3592+ order = {'QED':2})
3593
3594 GC_29 = Coupling(name = 'GC_29',
3595- value = '-(complex(0,1)*G*I1255)',
3596- order = {'QCD':1})
3597+ value = '(-2*ee*complex(0,1)*G*I1263)/3. - (2*ee*complex(0,1)*G*I1363)/3.',
3598+ order = {'QCD':1,'QED':1})
3599
3600 GC_30 = Coupling(name = 'GC_30',
3601- value = '(2*ee*complex(0,1)*I1163)/3. + (2*ee*complex(0,1)*I1263)/3.',
3602- order = {'QED':1})
3603+ value = 'complex(0,1)*G**2*I1263 + complex(0,1)*G**2*I1363',
3604+ order = {'QCD':2})
3605
3606 GC_31 = Coupling(name = 'GC_31',
3607- value = 'complex(0,1)*G*I1163 + complex(0,1)*G*I1263',
3608- order = {'QCD':1})
3609+ value = '(2*ee**2*complex(0,1)*I1266)/9. + (2*ee**2*complex(0,1)*I1366)/9.',
3610+ order = {'QED':2})
3611
3612 GC_32 = Coupling(name = 'GC_32',
3613- value = '(-2*ee*complex(0,1)*I1166)/3. - (2*ee*complex(0,1)*I1266)/3.',
3614- order = {'QED':1})
3615+ value = '(-2*ee*complex(0,1)*G*I1266)/3. - (2*ee*complex(0,1)*G*I1366)/3.',
3616+ order = {'QCD':1,'QED':1})
3617
3618 GC_33 = Coupling(name = 'GC_33',
3619- value = '-(complex(0,1)*G*I1166) - complex(0,1)*G*I1266',
3620- order = {'QCD':1})
3621+ value = 'complex(0,1)*G**2*I1266 + complex(0,1)*G**2*I1366',
3622+ order = {'QCD':2})
3623
3624 GC_34 = Coupling(name = 'GC_34',
3625- value = '(8*ee**2*complex(0,1)*I1311)/9.',
3626- order = {'QED':2})
3627+ value = 'ee*complex(0,1)*I2511',
3628+ order = {'QED':1})
3629
3630 GC_35 = Coupling(name = 'GC_35',
3631- value = '(4*ee*complex(0,1)*G*I1311)/3.',
3632- order = {'QCD':1,'QED':1})
3633+ value = 'ee*complex(0,1)*I2522',
3634+ order = {'QED':1})
3635
3636 GC_36 = Coupling(name = 'GC_36',
3637- value = 'complex(0,1)*G**2*I1311',
3638- order = {'QCD':2})
3639+ value = 'ee*complex(0,1)*I2533 + ee*complex(0,1)*I2633',
3640+ order = {'QED':1})
3641
3642 GC_37 = Coupling(name = 'GC_37',
3643- value = '(8*ee**2*complex(0,1)*I1322)/9.',
3644- order = {'QED':2})
3645+ value = 'ee*complex(0,1)*I2536 + ee*complex(0,1)*I2636',
3646+ order = {'QED':1})
3647
3648 GC_38 = Coupling(name = 'GC_38',
3649- value = '(4*ee*complex(0,1)*G*I1322)/3.',
3650- order = {'QCD':1,'QED':1})
3651+ value = 'ee*complex(0,1)*I2644',
3652+ order = {'QED':1})
3653
3654 GC_39 = Coupling(name = 'GC_39',
3655- value = 'complex(0,1)*G**2*I1322',
3656- order = {'QCD':2})
3657+ value = 'ee*complex(0,1)*I2655',
3658+ order = {'QED':1})
3659
3660 GC_40 = Coupling(name = 'GC_40',
3661- value = '(8*ee**2*complex(0,1)*I1333)/9. + (8*ee**2*complex(0,1)*I1433)/9.',
3662- order = {'QED':2})
3663+ value = '-(ee*complex(0,1)*I2563) - ee*complex(0,1)*I2663',
3664+ order = {'QED':1})
3665
3666 GC_41 = Coupling(name = 'GC_41',
3667- value = '(4*ee*complex(0,1)*G*I1333)/3. + (4*ee*complex(0,1)*G*I1433)/3.',
3668- order = {'QCD':1,'QED':1})
3669+ value = 'ee*complex(0,1)*I2566 + ee*complex(0,1)*I2666',
3670+ order = {'QED':1})
3671
3672 GC_42 = Coupling(name = 'GC_42',
3673- value = 'complex(0,1)*G**2*I1333 + complex(0,1)*G**2*I1433',
3674- order = {'QCD':2})
3675+ value = '2*ee**2*complex(0,1)*I3111',
3676+ order = {'QED':2})
3677
3678 GC_43 = Coupling(name = 'GC_43',
3679- value = '(8*ee**2*complex(0,1)*I1336)/9. + (8*ee**2*complex(0,1)*I1436)/9.',
3680+ value = '2*ee**2*complex(0,1)*I3122',
3681 order = {'QED':2})
3682
3683 GC_44 = Coupling(name = 'GC_44',
3684- value = '(4*ee*complex(0,1)*G*I1336)/3. + (4*ee*complex(0,1)*G*I1436)/3.',
3685- order = {'QCD':1,'QED':1})
3686+ value = '2*ee**2*complex(0,1)*I3133 + 2*ee**2*complex(0,1)*I3233',
3687+ order = {'QED':2})
3688
3689 GC_45 = Coupling(name = 'GC_45',
3690- value = 'complex(0,1)*G**2*I1336 + complex(0,1)*G**2*I1436',
3691- order = {'QCD':2})
3692+ value = '2*ee**2*complex(0,1)*I3136 + 2*ee**2*complex(0,1)*I3236',
3693+ order = {'QED':2})
3694
3695 GC_46 = Coupling(name = 'GC_46',
3696- value = '(8*ee**2*complex(0,1)*I1444)/9.',
3697+ value = '2*ee**2*complex(0,1)*I3244',
3698 order = {'QED':2})
3699
3700 GC_47 = Coupling(name = 'GC_47',
3701- value = '(4*ee*complex(0,1)*G*I1444)/3.',
3702- order = {'QCD':1,'QED':1})
3703+ value = '2*ee**2*complex(0,1)*I3255',
3704+ order = {'QED':2})
3705
3706 GC_48 = Coupling(name = 'GC_48',
3707- value = 'complex(0,1)*G**2*I1444',
3708- order = {'QCD':2})
3709+ value = '2*ee**2*complex(0,1)*I3163 + 2*ee**2*complex(0,1)*I3263',
3710+ order = {'QED':2})
3711
3712 GC_49 = Coupling(name = 'GC_49',
3713- value = '(8*ee**2*complex(0,1)*I1455)/9.',
3714+ value = '2*ee**2*complex(0,1)*I3166 + 2*ee**2*complex(0,1)*I3266',
3715 order = {'QED':2})
3716
3717 GC_50 = Coupling(name = 'GC_50',
3718- value = '(4*ee*complex(0,1)*G*I1455)/3.',
3719- order = {'QCD':1,'QED':1})
3720+ value = '(ee*complex(0,1)*I511)/3.',
3721+ order = {'QED':1})
3722
3723 GC_51 = Coupling(name = 'GC_51',
3724- value = 'complex(0,1)*G**2*I1455',
3725- order = {'QCD':2})
3726+ value = '-(complex(0,1)*G*I511)',
3727+ order = {'QCD':1})
3728
3729 GC_52 = Coupling(name = 'GC_52',
3730- value = '(8*ee**2*complex(0,1)*I1363)/9. + (8*ee**2*complex(0,1)*I1463)/9.',
3731- order = {'QED':2})
3732+ value = '(-2*ee*complex(0,1)*I5111)/3.',
3733+ order = {'QED':1})
3734
3735 GC_53 = Coupling(name = 'GC_53',
3736- value = '(4*ee*complex(0,1)*G*I1363)/3. + (4*ee*complex(0,1)*G*I1463)/3.',
3737- order = {'QCD':1,'QED':1})
3738+ value = '-(complex(0,1)*G*I5111)',
3739+ order = {'QCD':1})
3740
3741 GC_54 = Coupling(name = 'GC_54',
3742- value = 'complex(0,1)*G**2*I1363 + complex(0,1)*G**2*I1463',
3743- order = {'QCD':2})
3744+ value = '(-2*ee*complex(0,1)*I5122)/3.',
3745+ order = {'QED':1})
3746
3747 GC_55 = Coupling(name = 'GC_55',
3748- value = '(8*ee**2*complex(0,1)*I1366)/9. + (8*ee**2*complex(0,1)*I1466)/9.',
3749- order = {'QED':2})
3750+ value = '-(complex(0,1)*G*I5122)',
3751+ order = {'QCD':1})
3752
3753 GC_56 = Coupling(name = 'GC_56',
3754- value = '(4*ee*complex(0,1)*G*I1366)/3. + (4*ee*complex(0,1)*G*I1466)/3.',
3755- order = {'QCD':1,'QED':1})
3756+ value = '(ee*complex(0,1)*I522)/3.',
3757+ order = {'QED':1})
3758
3759 GC_57 = Coupling(name = 'GC_57',
3760- value = 'complex(0,1)*G**2*I1366 + complex(0,1)*G**2*I1466',
3761- order = {'QCD':2})
3762+ value = '-(complex(0,1)*G*I522)',
3763+ order = {'QCD':1})
3764
3765 GC_58 = Coupling(name = 'GC_58',
3766- value = '-(ee**2*complex(0,1)*I1511)/(3.*cw*cmath.sqrt(2))',
3767- order = {'QED':2})
3768+ value = '(-2*ee*complex(0,1)*I5133)/3. - (2*ee*complex(0,1)*I5233)/3.',
3769+ order = {'QED':1})
3770
3771 GC_59 = Coupling(name = 'GC_59',
3772- value = '-(ee**2*complex(0,1)*I1522)/(3.*cw*cmath.sqrt(2))',
3773- order = {'QED':2})
3774+ value = '-(complex(0,1)*G*I5133) - complex(0,1)*G*I5233',
3775+ order = {'QCD':1})
3776
3777 GC_60 = Coupling(name = 'GC_60',
3778- value = '-(ee**2*complex(0,1)*I1533)/(3.*cw*cmath.sqrt(2))',
3779- order = {'QED':2})
3780+ value = '(-2*ee*complex(0,1)*I5136)/3. - (2*ee*complex(0,1)*I5236)/3.',
3781+ order = {'QED':1})
3782
3783 GC_61 = Coupling(name = 'GC_61',
3784- value = '-(ee**2*complex(0,1)*I1536)/(3.*cw*cmath.sqrt(2))',
3785- order = {'QED':2})
3786+ value = '-(complex(0,1)*G*I5136) - complex(0,1)*G*I5236',
3787+ order = {'QCD':1})
3788
3789 GC_62 = Coupling(name = 'GC_62',
3790- value = '-(ee**2*complex(0,1)*I1563)/(3.*cw*cmath.sqrt(2))',
3791- order = {'QED':2})
3792+ value = '(-2*ee*complex(0,1)*I5244)/3.',
3793+ order = {'QED':1})
3794
3795 GC_63 = Coupling(name = 'GC_63',
3796- value = '-(ee**2*complex(0,1)*I1566)/(3.*cw*cmath.sqrt(2))',
3797- order = {'QED':2})
3798+ value = '-(complex(0,1)*G*I5244)',
3799+ order = {'QCD':1})
3800
3801 GC_64 = Coupling(name = 'GC_64',
3802- value = '-(ee**2*complex(0,1)*I1611)/(3.*cw*cmath.sqrt(2))',
3803- order = {'QED':2})
3804+ value = '(-2*ee*complex(0,1)*I5255)/3.',
3805+ order = {'QED':1})
3806
3807 GC_65 = Coupling(name = 'GC_65',
3808- value = '-(ee**2*complex(0,1)*I1622)/(3.*cw*cmath.sqrt(2))',
3809- order = {'QED':2})
3810+ value = '-(complex(0,1)*G*I5255)',
3811+ order = {'QCD':1})
3812
3813 GC_66 = Coupling(name = 'GC_66',
3814- value = '-(ee**2*complex(0,1)*I1633)/(3.*cw*cmath.sqrt(2))',
3815- order = {'QED':2})
3816+ value = '(2*ee*complex(0,1)*I5163)/3. + (2*ee*complex(0,1)*I5263)/3.',
3817+ order = {'QED':1})
3818
3819 GC_67 = Coupling(name = 'GC_67',
3820- value = '-(ee**2*complex(0,1)*I1636)/(3.*cw*cmath.sqrt(2))',
3821- order = {'QED':2})
3822+ value = 'complex(0,1)*G*I5163 + complex(0,1)*G*I5263',
3823+ order = {'QCD':1})
3824
3825 GC_68 = Coupling(name = 'GC_68',
3826- value = '-(ee**2*complex(0,1)*I1663)/(3.*cw*cmath.sqrt(2))',
3827- order = {'QED':2})
3828+ value = '(-2*ee*complex(0,1)*I5166)/3. - (2*ee*complex(0,1)*I5266)/3.',
3829+ order = {'QED':1})
3830
3831 GC_69 = Coupling(name = 'GC_69',
3832- value = '-(ee**2*complex(0,1)*I1666)/(3.*cw*cmath.sqrt(2))',
3833- order = {'QED':2})
3834+ value = '-(complex(0,1)*G*I5166) - complex(0,1)*G*I5266',
3835+ order = {'QCD':1})
3836
3837 GC_70 = Coupling(name = 'GC_70',
3838- value = '(ee**2*complex(0,1)*I1711)/(cw*cmath.sqrt(2))',
3839- order = {'QED':2})
3840+ value = '(ee*complex(0,1)*I533)/3. + (ee*complex(0,1)*I633)/3.',
3841+ order = {'QED':1})
3842
3843 GC_71 = Coupling(name = 'GC_71',
3844- value = '(ee**2*complex(0,1)*I1722)/(cw*cmath.sqrt(2))',
3845- order = {'QED':2})
3846+ value = '-(complex(0,1)*G*I533) - complex(0,1)*G*I633',
3847+ order = {'QCD':1})
3848
3849 GC_72 = Coupling(name = 'GC_72',
3850- value = '(ee**2*complex(0,1)*I1733)/(cw*cmath.sqrt(2))',
3851- order = {'QED':2})
3852+ value = '(ee*complex(0,1)*I536)/3. + (ee*complex(0,1)*I636)/3.',
3853+ order = {'QED':1})
3854
3855 GC_73 = Coupling(name = 'GC_73',
3856- value = '(ee**2*complex(0,1)*I1736)/(cw*cmath.sqrt(2))',
3857- order = {'QED':2})
3858+ value = '-(complex(0,1)*G*I536) - complex(0,1)*G*I636',
3859+ order = {'QCD':1})
3860
3861 GC_74 = Coupling(name = 'GC_74',
3862- value = '(ee**2*complex(0,1)*I1811)/(cw*cmath.sqrt(2))',
3863- order = {'QED':2})
3864+ value = '(ee*complex(0,1)*I644)/3.',
3865+ order = {'QED':1})
3866
3867 GC_75 = Coupling(name = 'GC_75',
3868- value = '(ee**2*complex(0,1)*I1822)/(cw*cmath.sqrt(2))',
3869- order = {'QED':2})
3870+ value = '-(complex(0,1)*G*I644)',
3871+ order = {'QCD':1})
3872
3873 GC_76 = Coupling(name = 'GC_76',
3874- value = '(ee**2*complex(0,1)*I1833)/(cw*cmath.sqrt(2))',
3875- order = {'QED':2})
3876+ value = '(ee*complex(0,1)*I655)/3.',
3877+ order = {'QED':1})
3878
3879 GC_77 = Coupling(name = 'GC_77',
3880- value = '(ee**2*complex(0,1)*I1836)/(cw*cmath.sqrt(2))',
3881- order = {'QED':2})
3882+ value = '-(complex(0,1)*G*I655)',
3883+ order = {'QCD':1})
3884
3885 GC_78 = Coupling(name = 'GC_78',
3886- value = '(ee*complex(0,1)*I133)/3. + (ee*complex(0,1)*I233)/3.',
3887+ value = '-(ee*complex(0,1)*I563)/3. - (ee*complex(0,1)*I663)/3.',
3888 order = {'QED':1})
3889
3890 GC_79 = Coupling(name = 'GC_79',
3891- value = '(-2*ee*complex(0,1)*G*I133)/3. - (2*ee*complex(0,1)*G*I233)/3.',
3892- order = {'QCD':1,'QED':1})
3893+ value = 'complex(0,1)*G*I563 + complex(0,1)*G*I663',
3894+ order = {'QCD':1})
3895
3896 GC_80 = Coupling(name = 'GC_80',
3897- value = '(ee*complex(0,1)*I136)/3. + (ee*complex(0,1)*I236)/3.',
3898+ value = '(ee*complex(0,1)*I566)/3. + (ee*complex(0,1)*I666)/3.',
3899 order = {'QED':1})
3900
3901 GC_81 = Coupling(name = 'GC_81',
3902- value = '(-2*ee*complex(0,1)*G*I136)/3. - (2*ee*complex(0,1)*G*I236)/3.',
3903- order = {'QCD':1,'QED':1})
3904+ value = '-(complex(0,1)*G*I566) - complex(0,1)*G*I666',
3905+ order = {'QCD':1})
3906
3907 GC_82 = Coupling(name = 'GC_82',
3908- value = '(ee*complex(0,1)*I244)/3.',
3909- order = {'QED':1})
3910+ value = '(8*ee**2*complex(0,1)*I7411)/9.',
3911+ order = {'QED':2})
3912
3913 GC_83 = Coupling(name = 'GC_83',
3914- value = '(-2*ee*complex(0,1)*G*I244)/3.',
3915+ value = '(4*ee*complex(0,1)*G*I7411)/3.',
3916 order = {'QCD':1,'QED':1})
3917
3918 GC_84 = Coupling(name = 'GC_84',
3919- value = '(ee*complex(0,1)*I255)/3.',
3920- order = {'QED':1})
3921+ value = 'complex(0,1)*G**2*I7411',
3922+ order = {'QCD':2})
3923
3924 GC_85 = Coupling(name = 'GC_85',
3925- value = '(-2*ee*complex(0,1)*G*I255)/3.',
3926- order = {'QCD':1,'QED':1})
3927+ value = '(8*ee**2*complex(0,1)*I7422)/9.',
3928+ order = {'QED':2})
3929
3930 GC_86 = Coupling(name = 'GC_86',
3931- value = '-(ee*complex(0,1)*I163)/3. - (ee*complex(0,1)*I263)/3.',
3932- order = {'QED':1})
3933+ value = '(4*ee*complex(0,1)*G*I7422)/3.',
3934+ order = {'QCD':1,'QED':1})
3935
3936 GC_87 = Coupling(name = 'GC_87',
3937- value = '(-2*ee*complex(0,1)*G*I163)/3. - (2*ee*complex(0,1)*G*I263)/3.',
3938- order = {'QCD':1,'QED':1})
3939+ value = 'complex(0,1)*G**2*I7422',
3940+ order = {'QCD':2})
3941
3942 GC_88 = Coupling(name = 'GC_88',
3943- value = '(ee*complex(0,1)*I166)/3. + (ee*complex(0,1)*I266)/3.',
3944- order = {'QED':1})
3945+ value = '(8*ee**2*complex(0,1)*I7433)/9. + (8*ee**2*complex(0,1)*I7533)/9.',
3946+ order = {'QED':2})
3947
3948 GC_89 = Coupling(name = 'GC_89',
3949- value = '(-2*ee*complex(0,1)*G*I166)/3. - (2*ee*complex(0,1)*G*I266)/3.',
3950+ value = '(4*ee*complex(0,1)*G*I7433)/3. + (4*ee*complex(0,1)*G*I7533)/3.',
3951 order = {'QCD':1,'QED':1})
3952
3953 GC_90 = Coupling(name = 'GC_90',
3954- value = '(2*ee**2*complex(0,1)*I311)/9.',
3955- order = {'QED':2})
3956+ value = 'complex(0,1)*G**2*I7433 + complex(0,1)*G**2*I7533',
3957+ order = {'QCD':2})
3958
3959 GC_91 = Coupling(name = 'GC_91',
3960- value = '(2*ee**2*complex(0,1)*I322)/9.',
3961+ value = '(8*ee**2*complex(0,1)*I7436)/9. + (8*ee**2*complex(0,1)*I7536)/9.',
3962 order = {'QED':2})
3963
3964 GC_92 = Coupling(name = 'GC_92',
3965- value = '(2*ee**2*complex(0,1)*I333)/9. + (2*ee**2*complex(0,1)*I433)/9.',
3966- order = {'QED':2})
3967+ value = '(4*ee*complex(0,1)*G*I7436)/3. + (4*ee*complex(0,1)*G*I7536)/3.',
3968+ order = {'QCD':1,'QED':1})
3969
3970 GC_93 = Coupling(name = 'GC_93',
3971- value = '(2*ee**2*complex(0,1)*I336)/9. + (2*ee**2*complex(0,1)*I436)/9.',
3972- order = {'QED':2})
3973+ value = 'complex(0,1)*G**2*I7436 + complex(0,1)*G**2*I7536',
3974+ order = {'QCD':2})
3975
3976 GC_94 = Coupling(name = 'GC_94',
3977- value = '(2*ee**2*complex(0,1)*I444)/9.',
3978+ value = '(8*ee**2*complex(0,1)*I7544)/9.',
3979 order = {'QED':2})
3980
3981 GC_95 = Coupling(name = 'GC_95',
3982- value = '(2*ee**2*complex(0,1)*I455)/9.',
3983- order = {'QED':2})
3984+ value = '(4*ee*complex(0,1)*G*I7544)/3.',
3985+ order = {'QCD':1,'QED':1})
3986
3987 GC_96 = Coupling(name = 'GC_96',
3988- value = '(2*ee**2*complex(0,1)*I363)/9. + (2*ee**2*complex(0,1)*I463)/9.',
3989- order = {'QED':2})
3990+ value = 'complex(0,1)*G**2*I7544',
3991+ order = {'QCD':2})
3992
3993 GC_97 = Coupling(name = 'GC_97',
3994- value = '(2*ee**2*complex(0,1)*I366)/9. + (2*ee**2*complex(0,1)*I466)/9.',
3995+ value = '(8*ee**2*complex(0,1)*I7555)/9.',
3996 order = {'QED':2})
3997
3998 GC_98 = Coupling(name = 'GC_98',
3999- value = 'ee*complex(0,1)*I511',
4000- order = {'QED':1})
4001+ value = '(4*ee*complex(0,1)*G*I7555)/3.',
4002+ order = {'QCD':1,'QED':1})
4003
4004 GC_99 = Coupling(name = 'GC_99',
4005- value = 'ee*complex(0,1)*I522',
4006- order = {'QED':1})
4007+ value = 'complex(0,1)*G**2*I7555',
4008+ order = {'QCD':2})
4009
4010 GC_100 = Coupling(name = 'GC_100',
4011- value = 'ee*complex(0,1)*I533 + ee*complex(0,1)*I633',
4012- order = {'QED':1})
4013+ value = '(8*ee**2*complex(0,1)*I7463)/9. + (8*ee**2*complex(0,1)*I7563)/9.',
4014+ order = {'QED':2})
4015
4016 GC_101 = Coupling(name = 'GC_101',
4017- value = 'ee*complex(0,1)*I536 + ee*complex(0,1)*I636',
4018- order = {'QED':1})
4019+ value = '(4*ee*complex(0,1)*G*I7463)/3. + (4*ee*complex(0,1)*G*I7563)/3.',
4020+ order = {'QCD':1,'QED':1})
4021
4022 GC_102 = Coupling(name = 'GC_102',
4023- value = 'ee*complex(0,1)*I644',
4024- order = {'QED':1})
4025+ value = 'complex(0,1)*G**2*I7463 + complex(0,1)*G**2*I7563',
4026+ order = {'QCD':2})
4027
4028 GC_103 = Coupling(name = 'GC_103',
4029- value = 'ee*complex(0,1)*I655',
4030- order = {'QED':1})
4031+ value = '(8*ee**2*complex(0,1)*I7466)/9. + (8*ee**2*complex(0,1)*I7566)/9.',
4032+ order = {'QED':2})
4033
4034 GC_104 = Coupling(name = 'GC_104',
4035- value = '-(ee*complex(0,1)*I563) - ee*complex(0,1)*I663',
4036- order = {'QED':1})
4037+ value = '(4*ee*complex(0,1)*G*I7466)/3. + (4*ee*complex(0,1)*G*I7566)/3.',
4038+ order = {'QCD':1,'QED':1})
4039
4040 GC_105 = Coupling(name = 'GC_105',
4041- value = 'ee*complex(0,1)*I566 + ee*complex(0,1)*I666',
4042- order = {'QED':1})
4043+ value = 'complex(0,1)*G**2*I7466 + complex(0,1)*G**2*I7566',
4044+ order = {'QCD':2})
4045
4046 GC_106 = Coupling(name = 'GC_106',
4047- value = '2*ee**2*complex(0,1)*I711',
4048- order = {'QED':2})
4049+ value = '-(complex(0,1)*G*Rd11*cmath.sqrt(2))',
4050+ order = {'QCD':1})
4051
4052 GC_107 = Coupling(name = 'GC_107',
4053- value = '2*ee**2*complex(0,1)*I722',
4054- order = {'QED':2})
4055+ value = '-(complex(0,1)*G*Rd22*cmath.sqrt(2))',
4056+ order = {'QCD':1})
4057
4058 GC_108 = Coupling(name = 'GC_108',
4059- value = '2*ee**2*complex(0,1)*I733 + 2*ee**2*complex(0,1)*I833',
4060- order = {'QED':2})
4061+ value = '-(complex(0,1)*G*Rd33*cmath.sqrt(2))',
4062+ order = {'QCD':1})
4063
4064 GC_109 = Coupling(name = 'GC_109',
4065- value = '2*ee**2*complex(0,1)*I736 + 2*ee**2*complex(0,1)*I836',
4066- order = {'QED':2})
4067+ value = 'complex(0,1)*G*Rd36*cmath.sqrt(2)',
4068+ order = {'QCD':1})
4069
4070 GC_110 = Coupling(name = 'GC_110',
4071- value = '2*ee**2*complex(0,1)*I844',
4072- order = {'QED':2})
4073+ value = 'complex(0,1)*G*Rd44*cmath.sqrt(2)',
4074+ order = {'QCD':1})
4075
4076 GC_111 = Coupling(name = 'GC_111',
4077- value = '2*ee**2*complex(0,1)*I855',
4078- order = {'QED':2})
4079+ value = 'complex(0,1)*G*Rd55*cmath.sqrt(2)',
4080+ order = {'QCD':1})
4081
4082 GC_112 = Coupling(name = 'GC_112',
4083- value = '2*ee**2*complex(0,1)*I763 + 2*ee**2*complex(0,1)*I863',
4084- order = {'QED':2})
4085+ value = '-(complex(0,1)*G*Rd63*cmath.sqrt(2))',
4086+ order = {'QCD':1})
4087
4088 GC_113 = Coupling(name = 'GC_113',
4089- value = '2*ee**2*complex(0,1)*I766 + 2*ee**2*complex(0,1)*I866',
4090- order = {'QED':2})
4091+ value = 'complex(0,1)*G*Rd66*cmath.sqrt(2)',
4092+ order = {'QCD':1})
4093
4094 GC_114 = Coupling(name = 'GC_114',
4095- value = '-(complex(0,1)*G*I911)',
4096+ value = '-(complex(0,1)*G*Ru11*cmath.sqrt(2))',
4097 order = {'QCD':1})
4098
4099 GC_115 = Coupling(name = 'GC_115',
4100- value = 'complex(0,1)*G**2*I911',
4101- order = {'QCD':2})
4102+ value = '-(complex(0,1)*G*Ru22*cmath.sqrt(2))',
4103+ order = {'QCD':1})
4104
4105 GC_116 = Coupling(name = 'GC_116',
4106- value = '-(complex(0,1)*G*I922)',
4107+ value = '-(complex(0,1)*G*Ru33*cmath.sqrt(2))',
4108 order = {'QCD':1})
4109
4110 GC_117 = Coupling(name = 'GC_117',
4111- value = 'complex(0,1)*G**2*I922',
4112- order = {'QCD':2})
4113+ value = 'complex(0,1)*G*Ru36*cmath.sqrt(2)',
4114+ order = {'QCD':1})
4115
4116 GC_118 = Coupling(name = 'GC_118',
4117- value = '-(complex(0,1)*G*I1033) - complex(0,1)*G*I933',
4118+ value = 'complex(0,1)*G*Ru44*cmath.sqrt(2)',
4119 order = {'QCD':1})
4120
4121 GC_119 = Coupling(name = 'GC_119',
4122- value = 'complex(0,1)*G**2*I1033 + complex(0,1)*G**2*I933',
4123- order = {'QCD':2})
4124+ value = 'complex(0,1)*G*Ru55*cmath.sqrt(2)',
4125+ order = {'QCD':1})
4126
4127 GC_120 = Coupling(name = 'GC_120',
4128- value = '-(complex(0,1)*G*I1036) - complex(0,1)*G*I936',
4129+ value = '-(complex(0,1)*G*Ru63*cmath.sqrt(2))',
4130 order = {'QCD':1})
4131
4132 GC_121 = Coupling(name = 'GC_121',
4133- value = 'complex(0,1)*G**2*I1036 + complex(0,1)*G**2*I936',
4134- order = {'QCD':2})
4135+ value = 'complex(0,1)*G*Ru66*cmath.sqrt(2)',
4136+ order = {'QCD':1})
4137
4138 GC_122 = Coupling(name = 'GC_122',
4139- value = 'complex(0,1)*G*I1063 + complex(0,1)*G*I963',
4140- order = {'QCD':1})
4141+ value = '-(ee**2*complex(0,1)) + (ee**2*complex(0,1))/sw**2',
4142+ order = {'QED':2})
4143
4144 GC_123 = Coupling(name = 'GC_123',
4145- value = 'complex(0,1)*G**2*I1063 + complex(0,1)*G**2*I963',
4146- order = {'QCD':2})
4147+ value = '(ee**2*complex(0,1))/(2.*sw**2)',
4148+ order = {'QED':2})
4149
4150 GC_124 = Coupling(name = 'GC_124',
4151- value = '-(complex(0,1)*G*I1066) - complex(0,1)*G*I966',
4152- order = {'QCD':1})
4153+ value = '-((ee**2*complex(0,1))/sw**2)',
4154+ order = {'QED':2})
4155
4156 GC_125 = Coupling(name = 'GC_125',
4157- value = 'complex(0,1)*G**2*I1066 + complex(0,1)*G**2*I966',
4158- order = {'QCD':2})
4159+ value = '(ee**2*complex(0,1)*I9611)/(2.*sw**2)',
4160+ order = {'QED':2})
4161
4162 GC_126 = Coupling(name = 'GC_126',
4163- value = '-(complex(0,1)*G*Rd11*cmath.sqrt(2))',
4164- order = {'QCD':1})
4165+ value = '(ee**2*complex(0,1)*I9622)/(2.*sw**2)',
4166+ order = {'QED':2})
4167
4168 GC_127 = Coupling(name = 'GC_127',
4169- value = '-(complex(0,1)*G*Rd22*cmath.sqrt(2))',
4170- order = {'QCD':1})
4171+ value = '(ee**2*complex(0,1)*I9633)/(2.*sw**2)',
4172+ order = {'QED':2})
4173
4174 GC_128 = Coupling(name = 'GC_128',
4175- value = '-(complex(0,1)*G*Rd33*cmath.sqrt(2))',
4176- order = {'QCD':1})
4177+ value = '(ee**2*complex(0,1)*I9636)/(2.*sw**2)',
4178+ order = {'QED':2})
4179
4180 GC_129 = Coupling(name = 'GC_129',
4181- value = 'complex(0,1)*G*Rd36*cmath.sqrt(2)',
4182- order = {'QCD':1})
4183+ value = '(ee**2*complex(0,1)*I9663)/(2.*sw**2)',
4184+ order = {'QED':2})
4185
4186 GC_130 = Coupling(name = 'GC_130',
4187- value = '-(complex(0,1)*I3133*NN13) - (ee*complex(0,1)*NN11*Rd36*cmath.sqrt(2))/(3.*cw)',
4188- order = {'QED':1})
4189+ value = '(ee**2*complex(0,1)*I9666)/(2.*sw**2)',
4190+ order = {'QED':2})
4191
4192 GC_131 = Coupling(name = 'GC_131',
4193- value = '-(complex(0,1)*I3133*NN23) - (ee*complex(0,1)*NN21*Rd36*cmath.sqrt(2))/(3.*cw)',
4194- order = {'QED':1})
4195+ value = '(ee**2*complex(0,1)*I9711)/(2.*sw**2)',
4196+ order = {'QED':2})
4197
4198 GC_132 = Coupling(name = 'GC_132',
4199- value = '-(complex(0,1)*I3133*NN33) - (ee*complex(0,1)*NN31*Rd36*cmath.sqrt(2))/(3.*cw)',
4200- order = {'QED':1})
4201+ value = '(ee**2*complex(0,1)*I9722)/(2.*sw**2)',
4202+ order = {'QED':2})
4203
4204 GC_133 = Coupling(name = 'GC_133',
4205- value = '-(complex(0,1)*I3133*NN43) - (ee*complex(0,1)*NN41*Rd36*cmath.sqrt(2))/(3.*cw)',
4206- order = {'QED':1})
4207+ value = '(ee**2*complex(0,1)*I9733)/(2.*sw**2)',
4208+ order = {'QED':2})
4209
4210 GC_134 = Coupling(name = 'GC_134',
4211- value = 'complex(0,1)*G*Rd44*cmath.sqrt(2)',
4212- order = {'QCD':1})
4213+ value = '(ee**2*complex(0,1)*I9736)/(2.*sw**2)',
4214+ order = {'QED':2})
4215
4216 GC_135 = Coupling(name = 'GC_135',
4217- value = '-(ee*complex(0,1)*NN11*Rd44*cmath.sqrt(2))/(3.*cw)',
4218- order = {'QED':1})
4219+ value = '(ee**2*complex(0,1)*I9763)/(2.*sw**2)',
4220+ order = {'QED':2})
4221
4222 GC_136 = Coupling(name = 'GC_136',
4223- value = '-(ee*complex(0,1)*NN21*Rd44*cmath.sqrt(2))/(3.*cw)',
4224- order = {'QED':1})
4225+ value = '(ee**2*complex(0,1)*I9766)/(2.*sw**2)',
4226+ order = {'QED':2})
4227
4228 GC_137 = Coupling(name = 'GC_137',
4229- value = '-(ee*complex(0,1)*NN31*Rd44*cmath.sqrt(2))/(3.*cw)',
4230- order = {'QED':1})
4231+ value = '(ee**2*complex(0,1)*I9811)/(2.*sw**2)',
4232+ order = {'QED':2})
4233
4234 GC_138 = Coupling(name = 'GC_138',
4235- value = '-(ee*complex(0,1)*NN41*Rd44*cmath.sqrt(2))/(3.*cw)',
4236- order = {'QED':1})
4237+ value = '(ee**2*complex(0,1)*I9822)/(2.*sw**2)',
4238+ order = {'QED':2})
4239
4240 GC_139 = Coupling(name = 'GC_139',
4241- value = 'complex(0,1)*G*Rd55*cmath.sqrt(2)',
4242- order = {'QCD':1})
4243+ value = '(ee**2*complex(0,1)*I9833)/(2.*sw**2)',
4244+ order = {'QED':2})
4245
4246 GC_140 = Coupling(name = 'GC_140',
4247- value = '-(ee*complex(0,1)*NN11*Rd55*cmath.sqrt(2))/(3.*cw)',
4248- order = {'QED':1})
4249+ value = '(ee**2*complex(0,1)*I9836)/(2.*sw**2)',
4250+ order = {'QED':2})
4251
4252 GC_141 = Coupling(name = 'GC_141',
4253- value = '-(ee*complex(0,1)*NN21*Rd55*cmath.sqrt(2))/(3.*cw)',
4254- order = {'QED':1})
4255+ value = '(ee**2*complex(0,1)*I9863)/(2.*sw**2)',
4256+ order = {'QED':2})
4257
4258 GC_142 = Coupling(name = 'GC_142',
4259- value = '-(ee*complex(0,1)*NN31*Rd55*cmath.sqrt(2))/(3.*cw)',
4260- order = {'QED':1})
4261+ value = '(ee**2*complex(0,1)*I9866)/(2.*sw**2)',
4262+ order = {'QED':2})
4263
4264 GC_143 = Coupling(name = 'GC_143',
4265- value = '-(ee*complex(0,1)*NN41*Rd55*cmath.sqrt(2))/(3.*cw)',
4266+ value = '(ee*complex(0,1))/(sw*cmath.sqrt(2))',
4267 order = {'QED':1})
4268
4269 GC_144 = Coupling(name = 'GC_144',
4270- value = '-(complex(0,1)*G*Rd63*cmath.sqrt(2))',
4271- order = {'QCD':1})
4272+ value = '(cw*ee*complex(0,1))/sw',
4273+ order = {'QED':1})
4274
4275 GC_145 = Coupling(name = 'GC_145',
4276- value = 'complex(0,1)*G*Rd66*cmath.sqrt(2)',
4277- order = {'QCD':1})
4278+ value = '(-2*cw*ee**2*complex(0,1))/sw',
4279+ order = {'QED':2})
4280
4281 GC_146 = Coupling(name = 'GC_146',
4282- value = '-(complex(0,1)*I3136*NN13) - (ee*complex(0,1)*NN11*Rd66*cmath.sqrt(2))/(3.*cw)',
4283- order = {'QED':1})
4284+ value = '-((ee**2*complex(0,1)*I3911)/(sw*cmath.sqrt(2)))',
4285+ order = {'QED':2})
4286
4287 GC_147 = Coupling(name = 'GC_147',
4288- value = '-(complex(0,1)*I3136*NN23) - (ee*complex(0,1)*NN21*Rd66*cmath.sqrt(2))/(3.*cw)',
4289- order = {'QED':1})
4290+ value = '-((ee**2*complex(0,1)*I3922)/(sw*cmath.sqrt(2)))',
4291+ order = {'QED':2})
4292
4293 GC_148 = Coupling(name = 'GC_148',
4294- value = '-(complex(0,1)*I3136*NN33) - (ee*complex(0,1)*NN31*Rd66*cmath.sqrt(2))/(3.*cw)',
4295- order = {'QED':1})
4296+ value = '-((ee**2*complex(0,1)*I3933)/(sw*cmath.sqrt(2)))',
4297+ order = {'QED':2})
4298
4299 GC_149 = Coupling(name = 'GC_149',
4300- value = '-(complex(0,1)*I3136*NN43) - (ee*complex(0,1)*NN41*Rd66*cmath.sqrt(2))/(3.*cw)',
4301- order = {'QED':1})
4302+ value = '-((ee**2*complex(0,1)*I3936)/(sw*cmath.sqrt(2)))',
4303+ order = {'QED':2})
4304
4305 GC_150 = Coupling(name = 'GC_150',
4306- value = '-(complex(0,1)*I3833*NN13) - (ee*complex(0,1)*NN11*Rl36*cmath.sqrt(2))/cw',
4307- order = {'QED':1})
4308+ value = '-((ee**2*complex(0,1)*I4511)/(sw*cmath.sqrt(2)))',
4309+ order = {'QED':2})
4310
4311 GC_151 = Coupling(name = 'GC_151',
4312- value = '-(complex(0,1)*I3833*NN23) - (ee*complex(0,1)*NN21*Rl36*cmath.sqrt(2))/cw',
4313- order = {'QED':1})
4314+ value = '-((ee**2*complex(0,1)*I4522)/(sw*cmath.sqrt(2)))',
4315+ order = {'QED':2})
4316
4317 GC_152 = Coupling(name = 'GC_152',
4318- value = '-(complex(0,1)*I3833*NN33) - (ee*complex(0,1)*NN31*Rl36*cmath.sqrt(2))/cw',
4319- order = {'QED':1})
4320+ value = '-((ee**2*complex(0,1)*I4533)/(sw*cmath.sqrt(2)))',
4321+ order = {'QED':2})
4322
4323 GC_153 = Coupling(name = 'GC_153',
4324- value = '-(complex(0,1)*I3833*NN43) - (ee*complex(0,1)*NN41*Rl36*cmath.sqrt(2))/cw',
4325- order = {'QED':1})
4326+ value = '-((ee**2*complex(0,1)*I4536)/(sw*cmath.sqrt(2)))',
4327+ order = {'QED':2})
4328
4329 GC_154 = Coupling(name = 'GC_154',
4330- value = '-((ee*complex(0,1)*NN11*Rl44*cmath.sqrt(2))/cw)',
4331- order = {'QED':1})
4332+ value = '(ee**2*complex(0,1)*I5311)/(3.*sw*cmath.sqrt(2))',
4333+ order = {'QED':2})
4334
4335 GC_155 = Coupling(name = 'GC_155',
4336- value = '-((ee*complex(0,1)*NN21*Rl44*cmath.sqrt(2))/cw)',
4337- order = {'QED':1})
4338+ value = '(ee*complex(0,1)*G*I5311*cmath.sqrt(2))/sw',
4339+ order = {'QCD':1,'QED':1})
4340
4341 GC_156 = Coupling(name = 'GC_156',
4342- value = '-((ee*complex(0,1)*NN31*Rl44*cmath.sqrt(2))/cw)',
4343- order = {'QED':1})
4344+ value = '(ee**2*complex(0,1)*I5322)/(3.*sw*cmath.sqrt(2))',
4345+ order = {'QED':2})
4346
4347 GC_157 = Coupling(name = 'GC_157',
4348- value = '-((ee*complex(0,1)*NN41*Rl44*cmath.sqrt(2))/cw)',
4349- order = {'QED':1})
4350+ value = '(ee*complex(0,1)*G*I5322*cmath.sqrt(2))/sw',
4351+ order = {'QCD':1,'QED':1})
4352
4353 GC_158 = Coupling(name = 'GC_158',
4354- value = '-((ee*complex(0,1)*NN11*Rl55*cmath.sqrt(2))/cw)',
4355- order = {'QED':1})
4356+ value = '(ee**2*complex(0,1)*I5333)/(3.*sw*cmath.sqrt(2))',
4357+ order = {'QED':2})
4358
4359 GC_159 = Coupling(name = 'GC_159',
4360- value = '-((ee*complex(0,1)*NN21*Rl55*cmath.sqrt(2))/cw)',
4361- order = {'QED':1})
4362+ value = '(ee*complex(0,1)*G*I5333*cmath.sqrt(2))/sw',
4363+ order = {'QCD':1,'QED':1})
4364
4365 GC_160 = Coupling(name = 'GC_160',
4366- value = '-((ee*complex(0,1)*NN31*Rl55*cmath.sqrt(2))/cw)',
4367- order = {'QED':1})
4368+ value = '(ee**2*complex(0,1)*I5336)/(3.*sw*cmath.sqrt(2))',
4369+ order = {'QED':2})
4370
4371 GC_161 = Coupling(name = 'GC_161',
4372- value = '-((ee*complex(0,1)*NN41*Rl55*cmath.sqrt(2))/cw)',
4373- order = {'QED':1})
4374+ value = '(ee*complex(0,1)*G*I5336*cmath.sqrt(2))/sw',
4375+ order = {'QCD':1,'QED':1})
4376
4377 GC_162 = Coupling(name = 'GC_162',
4378- value = '-(complex(0,1)*I3836*NN13) - (ee*complex(0,1)*NN11*Rl66*cmath.sqrt(2))/cw',
4379- order = {'QED':1})
4380+ value = '(ee**2*complex(0,1)*I5363)/(3.*sw*cmath.sqrt(2))',
4381+ order = {'QED':2})
4382
4383 GC_163 = Coupling(name = 'GC_163',
4384- value = '-(complex(0,1)*I3836*NN23) - (ee*complex(0,1)*NN21*Rl66*cmath.sqrt(2))/cw',
4385- order = {'QED':1})
4386+ value = '(ee*complex(0,1)*G*I5363*cmath.sqrt(2))/sw',
4387+ order = {'QCD':1,'QED':1})
4388
4389 GC_164 = Coupling(name = 'GC_164',
4390- value = '-(complex(0,1)*I3836*NN33) - (ee*complex(0,1)*NN31*Rl66*cmath.sqrt(2))/cw',
4391- order = {'QED':1})
4392+ value = '(ee**2*complex(0,1)*I5366)/(3.*sw*cmath.sqrt(2))',
4393+ order = {'QED':2})
4394
4395 GC_165 = Coupling(name = 'GC_165',
4396- value = '-(complex(0,1)*I3836*NN43) - (ee*complex(0,1)*NN41*Rl66*cmath.sqrt(2))/cw',
4397- order = {'QED':1})
4398+ value = '(ee*complex(0,1)*G*I5366*cmath.sqrt(2))/sw',
4399+ order = {'QCD':1,'QED':1})
4400
4401 GC_166 = Coupling(name = 'GC_166',
4402- value = '-(complex(0,1)*G*Ru11*cmath.sqrt(2))',
4403- order = {'QCD':1})
4404+ value = '(ee**2*complex(0,1)*I6611)/(3.*sw*cmath.sqrt(2))',
4405+ order = {'QED':2})
4406
4407 GC_167 = Coupling(name = 'GC_167',
4408- value = '-(complex(0,1)*G*Ru22*cmath.sqrt(2))',
4409- order = {'QCD':1})
4410+ value = '(ee*complex(0,1)*G*I6611*cmath.sqrt(2))/sw',
4411+ order = {'QCD':1,'QED':1})
4412
4413 GC_168 = Coupling(name = 'GC_168',
4414- value = '-(complex(0,1)*G*Ru33*cmath.sqrt(2))',
4415- order = {'QCD':1})
4416+ value = '(ee**2*complex(0,1)*I6622)/(3.*sw*cmath.sqrt(2))',
4417+ order = {'QED':2})
4418
4419 GC_169 = Coupling(name = 'GC_169',
4420- value = 'complex(0,1)*G*Ru36*cmath.sqrt(2)',
4421- order = {'QCD':1})
4422+ value = '(ee*complex(0,1)*G*I6622*cmath.sqrt(2))/sw',
4423+ order = {'QCD':1,'QED':1})
4424
4425 GC_170 = Coupling(name = 'GC_170',
4426- value = '-(complex(0,1)*I4933*NN14) + (2*ee*complex(0,1)*NN11*Ru36*cmath.sqrt(2))/(3.*cw)',
4427- order = {'QED':1})
4428+ value = '(ee**2*complex(0,1)*I6633)/(3.*sw*cmath.sqrt(2))',
4429+ order = {'QED':2})
4430
4431 GC_171 = Coupling(name = 'GC_171',
4432- value = '-(complex(0,1)*I4933*NN24) + (2*ee*complex(0,1)*NN21*Ru36*cmath.sqrt(2))/(3.*cw)',
4433- order = {'QED':1})
4434+ value = '(ee*complex(0,1)*G*I6633*cmath.sqrt(2))/sw',
4435+ order = {'QCD':1,'QED':1})
4436
4437 GC_172 = Coupling(name = 'GC_172',
4438- value = '-(complex(0,1)*I4933*NN34) + (2*ee*complex(0,1)*NN31*Ru36*cmath.sqrt(2))/(3.*cw)',
4439- order = {'QED':1})
4440+ value = '(ee**2*complex(0,1)*I6636)/(3.*sw*cmath.sqrt(2))',
4441+ order = {'QED':2})
4442
4443 GC_173 = Coupling(name = 'GC_173',
4444- value = '-(complex(0,1)*I4933*NN44) + (2*ee*complex(0,1)*NN41*Ru36*cmath.sqrt(2))/(3.*cw)',
4445- order = {'QED':1})
4446+ value = '(ee*complex(0,1)*G*I6636*cmath.sqrt(2))/sw',
4447+ order = {'QCD':1,'QED':1})
4448
4449 GC_174 = Coupling(name = 'GC_174',
4450- value = 'complex(0,1)*G*Ru44*cmath.sqrt(2)',
4451- order = {'QCD':1})
4452+ value = '(ee**2*complex(0,1)*I6663)/(3.*sw*cmath.sqrt(2))',
4453+ order = {'QED':2})
4454
4455 GC_175 = Coupling(name = 'GC_175',
4456- value = '(2*ee*complex(0,1)*NN11*Ru44*cmath.sqrt(2))/(3.*cw)',
4457- order = {'QED':1})
4458+ value = '(ee*complex(0,1)*G*I6663*cmath.sqrt(2))/sw',
4459+ order = {'QCD':1,'QED':1})
4460
4461 GC_176 = Coupling(name = 'GC_176',
4462- value = '(2*ee*complex(0,1)*NN21*Ru44*cmath.sqrt(2))/(3.*cw)',
4463- order = {'QED':1})
4464+ value = '(ee**2*complex(0,1)*I6666)/(3.*sw*cmath.sqrt(2))',
4465+ order = {'QED':2})
4466
4467 GC_177 = Coupling(name = 'GC_177',
4468- value = '(2*ee*complex(0,1)*NN31*Ru44*cmath.sqrt(2))/(3.*cw)',
4469- order = {'QED':1})
4470+ value = '(ee*complex(0,1)*G*I6666*cmath.sqrt(2))/sw',
4471+ order = {'QCD':1,'QED':1})
4472
4473 GC_178 = Coupling(name = 'GC_178',
4474- value = '(2*ee*complex(0,1)*NN41*Ru44*cmath.sqrt(2))/(3.*cw)',
4475+ value = '-((ee*complex(0,1)*I9211)/(sw*cmath.sqrt(2)))',
4476 order = {'QED':1})
4477
4478 GC_179 = Coupling(name = 'GC_179',
4479- value = 'complex(0,1)*G*Ru55*cmath.sqrt(2)',
4480- order = {'QCD':1})
4481+ value = '-((ee*complex(0,1)*I9222)/(sw*cmath.sqrt(2)))',
4482+ order = {'QED':1})
4483
4484 GC_180 = Coupling(name = 'GC_180',
4485- value = '(2*ee*complex(0,1)*NN11*Ru55*cmath.sqrt(2))/(3.*cw)',
4486+ value = '-((ee*complex(0,1)*I9233)/(sw*cmath.sqrt(2)))',
4487 order = {'QED':1})
4488
4489 GC_181 = Coupling(name = 'GC_181',
4490- value = '(2*ee*complex(0,1)*NN21*Ru55*cmath.sqrt(2))/(3.*cw)',
4491+ value = '-((ee*complex(0,1)*I9236)/(sw*cmath.sqrt(2)))',
4492 order = {'QED':1})
4493
4494 GC_182 = Coupling(name = 'GC_182',
4495- value = '(2*ee*complex(0,1)*NN31*Ru55*cmath.sqrt(2))/(3.*cw)',
4496+ value = '-((ee*complex(0,1)*I9263)/(sw*cmath.sqrt(2)))',
4497 order = {'QED':1})
4498
4499 GC_183 = Coupling(name = 'GC_183',
4500- value = '(2*ee*complex(0,1)*NN41*Ru55*cmath.sqrt(2))/(3.*cw)',
4501+ value = '-((ee*complex(0,1)*I9266)/(sw*cmath.sqrt(2)))',
4502 order = {'QED':1})
4503
4504 GC_184 = Coupling(name = 'GC_184',
4505- value = '-(complex(0,1)*G*Ru63*cmath.sqrt(2))',
4506- order = {'QCD':1})
4507+ value = '-((ee*complex(0,1)*I9311)/(sw*cmath.sqrt(2)))',
4508+ order = {'QED':1})
4509
4510 GC_185 = Coupling(name = 'GC_185',
4511- value = 'complex(0,1)*G*Ru66*cmath.sqrt(2)',
4512- order = {'QCD':1})
4513+ value = '-((ee*complex(0,1)*I9322)/(sw*cmath.sqrt(2)))',
4514+ order = {'QED':1})
4515
4516 GC_186 = Coupling(name = 'GC_186',
4517- value = '-(complex(0,1)*I4936*NN14) + (2*ee*complex(0,1)*NN11*Ru66*cmath.sqrt(2))/(3.*cw)',
4518+ value = '-((ee*complex(0,1)*I9333)/(sw*cmath.sqrt(2)))',
4519 order = {'QED':1})
4520
4521 GC_187 = Coupling(name = 'GC_187',
4522- value = '-(complex(0,1)*I4936*NN24) + (2*ee*complex(0,1)*NN21*Ru66*cmath.sqrt(2))/(3.*cw)',
4523+ value = '-((ee*complex(0,1)*I9336)/(sw*cmath.sqrt(2)))',
4524 order = {'QED':1})
4525
4526 GC_188 = Coupling(name = 'GC_188',
4527- value = '-(complex(0,1)*I4936*NN34) + (2*ee*complex(0,1)*NN31*Ru66*cmath.sqrt(2))/(3.*cw)',
4528+ value = '(ee*complex(0,1)*I9411)/(sw*cmath.sqrt(2))',
4529 order = {'QED':1})
4530
4531 GC_189 = Coupling(name = 'GC_189',
4532- value = '-(complex(0,1)*I4936*NN44) + (2*ee*complex(0,1)*NN41*Ru66*cmath.sqrt(2))/(3.*cw)',
4533+ value = '(ee*complex(0,1)*I9422)/(sw*cmath.sqrt(2))',
4534 order = {'QED':1})
4535
4536 GC_190 = Coupling(name = 'GC_190',
4537- value = '(ee**2*complex(0,1))/(2.*sw**2)',
4538- order = {'QED':2})
4539+ value = '(ee*complex(0,1)*I9433)/(sw*cmath.sqrt(2))',
4540+ order = {'QED':1})
4541
4542 GC_191 = Coupling(name = 'GC_191',
4543- value = '-((ee**2*complex(0,1))/sw**2)',
4544- order = {'QED':2})
4545+ value = '(ee*complex(0,1)*I9436)/(sw*cmath.sqrt(2))',
4546+ order = {'QED':1})
4547
4548 GC_192 = Coupling(name = 'GC_192',
4549- value = '(cw**2*ee**2*complex(0,1))/sw**2',
4550- order = {'QED':2})
4551+ value = '(ee*complex(0,1)*I9463)/(sw*cmath.sqrt(2))',
4552+ order = {'QED':1})
4553
4554 GC_193 = Coupling(name = 'GC_193',
4555- value = '(ee**2*complex(0,1)*I2511)/(2.*sw**2)',
4556- order = {'QED':2})
4557+ value = '(ee*complex(0,1)*I9466)/(sw*cmath.sqrt(2))',
4558+ order = {'QED':1})
4559
4560 GC_194 = Coupling(name = 'GC_194',
4561- value = '(ee**2*complex(0,1)*I2522)/(2.*sw**2)',
4562- order = {'QED':2})
4563+ value = '(ee*complex(0,1)*I9511)/(sw*cmath.sqrt(2))',
4564+ order = {'QED':1})
4565
4566 GC_195 = Coupling(name = 'GC_195',
4567- value = '(ee**2*complex(0,1)*I2533)/(2.*sw**2)',
4568- order = {'QED':2})
4569+ value = '(ee*complex(0,1)*I9522)/(sw*cmath.sqrt(2))',
4570+ order = {'QED':1})
4571
4572 GC_196 = Coupling(name = 'GC_196',
4573- value = '(ee**2*complex(0,1)*I2536)/(2.*sw**2)',
4574- order = {'QED':2})
4575+ value = '(ee*complex(0,1)*I9533)/(sw*cmath.sqrt(2))',
4576+ order = {'QED':1})
4577
4578 GC_197 = Coupling(name = 'GC_197',
4579- value = '(ee**2*complex(0,1)*I2563)/(2.*sw**2)',
4580- order = {'QED':2})
4581+ value = '(ee*complex(0,1)*I9536)/(sw*cmath.sqrt(2))',
4582+ order = {'QED':1})
4583
4584 GC_198 = Coupling(name = 'GC_198',
4585- value = '(ee**2*complex(0,1)*I2566)/(2.*sw**2)',
4586+ value = '(cw*ee**2*complex(0,1)*I9211)/(3.*(-1 + sw)*(1 + sw)*cmath.sqrt(2))',
4587 order = {'QED':2})
4588
4589 GC_199 = Coupling(name = 'GC_199',
4590- value = '(ee**2*complex(0,1)*I2611)/(2.*sw**2)',
4591+ value = '(cw*ee**2*complex(0,1)*I9222)/(3.*(-1 + sw)*(1 + sw)*cmath.sqrt(2))',
4592 order = {'QED':2})
4593
4594 GC_200 = Coupling(name = 'GC_200',
4595- value = '(ee**2*complex(0,1)*I2622)/(2.*sw**2)',
4596+ value = '(cw*ee**2*complex(0,1)*I9233)/(3.*(-1 + sw)*(1 + sw)*cmath.sqrt(2))',
4597 order = {'QED':2})
4598
4599 GC_201 = Coupling(name = 'GC_201',
4600- value = '(ee**2*complex(0,1)*I2633)/(2.*sw**2)',
4601+ value = '(cw*ee**2*complex(0,1)*I9236)/(3.*(-1 + sw)*(1 + sw)*cmath.sqrt(2))',
4602 order = {'QED':2})
4603
4604 GC_202 = Coupling(name = 'GC_202',
4605- value = '(ee**2*complex(0,1)*I2636)/(2.*sw**2)',
4606+ value = '(cw*ee**2*complex(0,1)*I9263)/(3.*(-1 + sw)*(1 + sw)*cmath.sqrt(2))',
4607 order = {'QED':2})
4608
4609 GC_203 = Coupling(name = 'GC_203',
4610- value = '(ee**2*complex(0,1)*I2663)/(2.*sw**2)',
4611+ value = '(cw*ee**2*complex(0,1)*I9266)/(3.*(-1 + sw)*(1 + sw)*cmath.sqrt(2))',
4612 order = {'QED':2})
4613
4614 GC_204 = Coupling(name = 'GC_204',
4615- value = '(ee**2*complex(0,1)*I2666)/(2.*sw**2)',
4616+ value = '-((cw*ee**2*complex(0,1)*I9311)/((-1 + sw)*(1 + sw)*cmath.sqrt(2)))',
4617 order = {'QED':2})
4618
4619 GC_205 = Coupling(name = 'GC_205',
4620- value = '(ee**2*complex(0,1)*I911)/(2.*sw**2)',
4621+ value = '-((cw*ee**2*complex(0,1)*I9322)/((-1 + sw)*(1 + sw)*cmath.sqrt(2)))',
4622 order = {'QED':2})
4623
4624 GC_206 = Coupling(name = 'GC_206',
4625- value = '(ee**2*complex(0,1)*I922)/(2.*sw**2)',
4626+ value = '-((cw*ee**2*complex(0,1)*I9333)/((-1 + sw)*(1 + sw)*cmath.sqrt(2)))',
4627 order = {'QED':2})
4628
4629 GC_207 = Coupling(name = 'GC_207',
4630- value = '(ee**2*complex(0,1)*I933)/(2.*sw**2)',
4631+ value = '-((cw*ee**2*complex(0,1)*I9336)/((-1 + sw)*(1 + sw)*cmath.sqrt(2)))',
4632 order = {'QED':2})
4633
4634 GC_208 = Coupling(name = 'GC_208',
4635- value = '(ee**2*complex(0,1)*I936)/(2.*sw**2)',
4636+ value = '(cw*ee**2*complex(0,1)*I9411)/(3.*(-1 + sw)*(1 + sw)*cmath.sqrt(2))',
4637 order = {'QED':2})
4638
4639 GC_209 = Coupling(name = 'GC_209',
4640- value = '(ee**2*complex(0,1)*I963)/(2.*sw**2)',
4641+ value = '(cw*ee**2*complex(0,1)*I9422)/(3.*(-1 + sw)*(1 + sw)*cmath.sqrt(2))',
4642 order = {'QED':2})
4643
4644 GC_210 = Coupling(name = 'GC_210',
4645- value = '(ee**2*complex(0,1)*I966)/(2.*sw**2)',
4646+ value = '(cw*ee**2*complex(0,1)*I9433)/(3.*(-1 + sw)*(1 + sw)*cmath.sqrt(2))',
4647 order = {'QED':2})
4648
4649 GC_211 = Coupling(name = 'GC_211',
4650- value = '(ee*complex(0,1))/(sw*cmath.sqrt(2))',
4651- order = {'QED':1})
4652+ value = '(cw*ee**2*complex(0,1)*I9436)/(3.*(-1 + sw)*(1 + sw)*cmath.sqrt(2))',
4653+ order = {'QED':2})
4654
4655 GC_212 = Coupling(name = 'GC_212',
4656- value = '-(cw*ee*complex(0,1))/(2.*sw)',
4657- order = {'QED':1})
4658+ value = '(cw*ee**2*complex(0,1)*I9463)/(3.*(-1 + sw)*(1 + sw)*cmath.sqrt(2))',
4659+ order = {'QED':2})
4660
4661 GC_213 = Coupling(name = 'GC_213',
4662- value = '(cw*ee*complex(0,1))/(2.*sw)',
4663- order = {'QED':1})
4664+ value = '(cw*ee**2*complex(0,1)*I9466)/(3.*(-1 + sw)*(1 + sw)*cmath.sqrt(2))',
4665+ order = {'QED':2})
4666
4667 GC_214 = Coupling(name = 'GC_214',
4668- value = '(cw*ee*complex(0,1))/sw',
4669- order = {'QED':1})
4670+ value = '-((cw*ee**2*complex(0,1)*I9511)/((-1 + sw)*(1 + sw)*cmath.sqrt(2)))',
4671+ order = {'QED':2})
4672
4673 GC_215 = Coupling(name = 'GC_215',
4674- value = '(-2*cw*ee**2*complex(0,1))/sw',
4675+ value = '-((cw*ee**2*complex(0,1)*I9522)/((-1 + sw)*(1 + sw)*cmath.sqrt(2)))',
4676 order = {'QED':2})
4677
4678 GC_216 = Coupling(name = 'GC_216',
4679- value = '(ee*complex(0,1)*I1511)/(sw*cmath.sqrt(2))',
4680- order = {'QED':1})
4681+ value = '-((cw*ee**2*complex(0,1)*I9533)/((-1 + sw)*(1 + sw)*cmath.sqrt(2)))',
4682+ order = {'QED':2})
4683
4684 GC_217 = Coupling(name = 'GC_217',
4685- value = '(ee*complex(0,1)*I1522)/(sw*cmath.sqrt(2))',
4686- order = {'QED':1})
4687+ value = '-((cw*ee**2*complex(0,1)*I9536)/((-1 + sw)*(1 + sw)*cmath.sqrt(2)))',
4688+ order = {'QED':2})
4689
4690 GC_218 = Coupling(name = 'GC_218',
4691- value = '(ee*complex(0,1)*I1533)/(sw*cmath.sqrt(2))',
4692+ value = '(cw*ee*complex(0,1)*NN11*Rd44*cmath.sqrt(2))/(3.*(-1 + sw)*(1 + sw))',
4693 order = {'QED':1})
4694
4695 GC_219 = Coupling(name = 'GC_219',
4696- value = '(ee*complex(0,1)*I1536)/(sw*cmath.sqrt(2))',
4697+ value = '(cw*ee*complex(0,1)*NN21*Rd44*cmath.sqrt(2))/(3.*(-1 + sw)*(1 + sw))',
4698 order = {'QED':1})
4699
4700 GC_220 = Coupling(name = 'GC_220',
4701- value = '(ee*complex(0,1)*I1563)/(sw*cmath.sqrt(2))',
4702+ value = '(cw*ee*complex(0,1)*NN31*Rd44*cmath.sqrt(2))/(3.*(-1 + sw)*(1 + sw))',
4703 order = {'QED':1})
4704
4705 GC_221 = Coupling(name = 'GC_221',
4706- value = '(ee*complex(0,1)*I1566)/(sw*cmath.sqrt(2))',
4707+ value = '(cw*ee*complex(0,1)*NN41*Rd44*cmath.sqrt(2))/(3.*(-1 + sw)*(1 + sw))',
4708 order = {'QED':1})
4709
4710 GC_222 = Coupling(name = 'GC_222',
4711- value = '-((ee*complex(0,1)*I1611)/(sw*cmath.sqrt(2)))',
4712+ value = '(cw*ee*complex(0,1)*NN11*Rd55*cmath.sqrt(2))/(3.*(-1 + sw)*(1 + sw))',
4713 order = {'QED':1})
4714
4715 GC_223 = Coupling(name = 'GC_223',
4716- value = '-((ee*complex(0,1)*I1622)/(sw*cmath.sqrt(2)))',
4717+ value = '(cw*ee*complex(0,1)*NN21*Rd55*cmath.sqrt(2))/(3.*(-1 + sw)*(1 + sw))',
4718 order = {'QED':1})
4719
4720 GC_224 = Coupling(name = 'GC_224',
4721- value = '-((ee*complex(0,1)*I1633)/(sw*cmath.sqrt(2)))',
4722+ value = '(cw*ee*complex(0,1)*NN31*Rd55*cmath.sqrt(2))/(3.*(-1 + sw)*(1 + sw))',
4723 order = {'QED':1})
4724
4725 GC_225 = Coupling(name = 'GC_225',
4726- value = '-((ee*complex(0,1)*I1636)/(sw*cmath.sqrt(2)))',
4727+ value = '(cw*ee*complex(0,1)*NN41*Rd55*cmath.sqrt(2))/(3.*(-1 + sw)*(1 + sw))',
4728 order = {'QED':1})
4729
4730 GC_226 = Coupling(name = 'GC_226',
4731- value = '-((ee*complex(0,1)*I1663)/(sw*cmath.sqrt(2)))',
4732+ value = '(cw*ee*complex(0,1)*NN11*Rl44*cmath.sqrt(2))/((-1 + sw)*(1 + sw))',
4733 order = {'QED':1})
4734
4735 GC_227 = Coupling(name = 'GC_227',
4736- value = '-((ee*complex(0,1)*I1666)/(sw*cmath.sqrt(2)))',
4737+ value = '(cw*ee*complex(0,1)*NN21*Rl44*cmath.sqrt(2))/((-1 + sw)*(1 + sw))',
4738 order = {'QED':1})
4739
4740 GC_228 = Coupling(name = 'GC_228',
4741- value = '-((ee*complex(0,1)*I1711)/(sw*cmath.sqrt(2)))',
4742+ value = '(cw*ee*complex(0,1)*NN31*Rl44*cmath.sqrt(2))/((-1 + sw)*(1 + sw))',
4743 order = {'QED':1})
4744
4745 GC_229 = Coupling(name = 'GC_229',
4746- value = '-((ee*complex(0,1)*I1722)/(sw*cmath.sqrt(2)))',
4747+ value = '(cw*ee*complex(0,1)*NN41*Rl44*cmath.sqrt(2))/((-1 + sw)*(1 + sw))',
4748 order = {'QED':1})
4749
4750 GC_230 = Coupling(name = 'GC_230',
4751- value = '-((ee*complex(0,1)*I1733)/(sw*cmath.sqrt(2)))',
4752+ value = '(cw*ee*complex(0,1)*NN11*Rl55*cmath.sqrt(2))/((-1 + sw)*(1 + sw))',
4753 order = {'QED':1})
4754
4755 GC_231 = Coupling(name = 'GC_231',
4756- value = '-((ee*complex(0,1)*I1736)/(sw*cmath.sqrt(2)))',
4757+ value = '(cw*ee*complex(0,1)*NN21*Rl55*cmath.sqrt(2))/((-1 + sw)*(1 + sw))',
4758 order = {'QED':1})
4759
4760 GC_232 = Coupling(name = 'GC_232',
4761- value = '(ee*complex(0,1)*I1811)/(sw*cmath.sqrt(2))',
4762+ value = '(cw*ee*complex(0,1)*NN31*Rl55*cmath.sqrt(2))/((-1 + sw)*(1 + sw))',
4763 order = {'QED':1})
4764
4765 GC_233 = Coupling(name = 'GC_233',
4766- value = '(ee*complex(0,1)*I1822)/(sw*cmath.sqrt(2))',
4767+ value = '(cw*ee*complex(0,1)*NN41*Rl55*cmath.sqrt(2))/((-1 + sw)*(1 + sw))',
4768 order = {'QED':1})
4769
4770 GC_234 = Coupling(name = 'GC_234',
4771- value = '(ee*complex(0,1)*I1833)/(sw*cmath.sqrt(2))',
4772+ value = '(-2*cw*ee*complex(0,1)*NN11*Ru44*cmath.sqrt(2))/(3.*(-1 + sw)*(1 + sw))',
4773 order = {'QED':1})
4774
4775 GC_235 = Coupling(name = 'GC_235',
4776- value = '(ee*complex(0,1)*I1836)/(sw*cmath.sqrt(2))',
4777+ value = '(-2*cw*ee*complex(0,1)*NN21*Ru44*cmath.sqrt(2))/(3.*(-1 + sw)*(1 + sw))',
4778 order = {'QED':1})
4779
4780 GC_236 = Coupling(name = 'GC_236',
4781- value = '-((ee**2*complex(0,1)*I1911)/(sw*cmath.sqrt(2)))',
4782- order = {'QED':2})
4783+ value = '(-2*cw*ee*complex(0,1)*NN31*Ru44*cmath.sqrt(2))/(3.*(-1 + sw)*(1 + sw))',
4784+ order = {'QED':1})
4785
4786 GC_237 = Coupling(name = 'GC_237',
4787- value = '-((ee**2*complex(0,1)*I1922)/(sw*cmath.sqrt(2)))',
4788- order = {'QED':2})
4789+ value = '(-2*cw*ee*complex(0,1)*NN41*Ru44*cmath.sqrt(2))/(3.*(-1 + sw)*(1 + sw))',
4790+ order = {'QED':1})
4791
4792 GC_238 = Coupling(name = 'GC_238',
4793- value = '-((ee**2*complex(0,1)*I1933)/(sw*cmath.sqrt(2)))',
4794- order = {'QED':2})
4795+ value = '(-2*cw*ee*complex(0,1)*NN11*Ru55*cmath.sqrt(2))/(3.*(-1 + sw)*(1 + sw))',
4796+ order = {'QED':1})
4797
4798 GC_239 = Coupling(name = 'GC_239',
4799- value = '-((ee**2*complex(0,1)*I1936)/(sw*cmath.sqrt(2)))',
4800- order = {'QED':2})
4801+ value = '(-2*cw*ee*complex(0,1)*NN21*Ru55*cmath.sqrt(2))/(3.*(-1 + sw)*(1 + sw))',
4802+ order = {'QED':1})
4803
4804 GC_240 = Coupling(name = 'GC_240',
4805- value = '-((ee**2*complex(0,1)*I2011)/(sw*cmath.sqrt(2)))',
4806- order = {'QED':2})
4807+ value = '(-2*cw*ee*complex(0,1)*NN31*Ru55*cmath.sqrt(2))/(3.*(-1 + sw)*(1 + sw))',
4808+ order = {'QED':1})
4809
4810 GC_241 = Coupling(name = 'GC_241',
4811- value = '-((ee**2*complex(0,1)*I2022)/(sw*cmath.sqrt(2)))',
4812- order = {'QED':2})
4813+ value = '(-2*cw*ee*complex(0,1)*NN41*Ru55*cmath.sqrt(2))/(3.*(-1 + sw)*(1 + sw))',
4814+ order = {'QED':1})
4815
4816 GC_242 = Coupling(name = 'GC_242',
4817- value = '-((ee**2*complex(0,1)*I2033)/(sw*cmath.sqrt(2)))',
4818+ value = '-(ee**2*complex(0,1))/(2.*(-1 + sw)*sw**2*(1 + sw))',
4819 order = {'QED':2})
4820
4821 GC_243 = Coupling(name = 'GC_243',
4822- value = '-((ee**2*complex(0,1)*I2036)/(sw*cmath.sqrt(2)))',
4823- order = {'QED':2})
4824+ value = '-(cw*ee*complex(0,1))/(2.*(-1 + sw)*sw*(1 + sw))',
4825+ order = {'QED':1})
4826
4827 GC_244 = Coupling(name = 'GC_244',
4828- value = '(ee*complex(0,1)*G*I2111*cmath.sqrt(2))/sw',
4829- order = {'QCD':1,'QED':1})
4830+ value = '(cw*ee*complex(0,1))/(2.*(-1 + sw)*sw*(1 + sw))',
4831+ order = {'QED':1})
4832
4833 GC_245 = Coupling(name = 'GC_245',
4834- value = '(ee*complex(0,1)*G*I2122*cmath.sqrt(2))/sw',
4835- order = {'QCD':1,'QED':1})
4836+ value = '-(cw*ee*complex(0,1)*sw)/(3.*(-1 + sw)*(1 + sw))',
4837+ order = {'QED':1})
4838
4839 GC_246 = Coupling(name = 'GC_246',
4840- value = '(ee*complex(0,1)*G*I2133*cmath.sqrt(2))/sw',
4841- order = {'QCD':1,'QED':1})
4842+ value = '(2*cw*ee*complex(0,1)*sw)/(3.*(-1 + sw)*(1 + sw))',
4843+ order = {'QED':1})
4844
4845 GC_247 = Coupling(name = 'GC_247',
4846- value = '(ee*complex(0,1)*G*I2136*cmath.sqrt(2))/sw',
4847- order = {'QCD':1,'QED':1})
4848+ value = '-((cw*ee*complex(0,1)*sw)/((-1 + sw)*(1 + sw)))',
4849+ order = {'QED':1})
4850
4851 GC_248 = Coupling(name = 'GC_248',
4852- value = '(ee*complex(0,1)*G*I2163*cmath.sqrt(2))/sw',
4853- order = {'QCD':1,'QED':1})
4854+ value = '(cw*ee*complex(0,1)*I10044*sw)/(3.*(-1 + sw)*(1 + sw))',
4855+ order = {'QED':1})
4856
4857 GC_249 = Coupling(name = 'GC_249',
4858- value = '(ee*complex(0,1)*G*I2166*cmath.sqrt(2))/sw',
4859- order = {'QCD':1,'QED':1})
4860+ value = '(cw*ee*complex(0,1)*I10055*sw)/(3.*(-1 + sw)*(1 + sw))',
4861+ order = {'QED':1})
4862
4863 GC_250 = Coupling(name = 'GC_250',
4864- value = '(ee**2*complex(0,1)*I2211)/(3.*sw*cmath.sqrt(2))',
4865- order = {'QED':2})
4866+ value = '(cw*ee*complex(0,1)*I10144*sw)/((-1 + sw)*(1 + sw))',
4867+ order = {'QED':1})
4868
4869 GC_251 = Coupling(name = 'GC_251',
4870- value = '(ee**2*complex(0,1)*I2222)/(3.*sw*cmath.sqrt(2))',
4871- order = {'QED':2})
4872+ value = '(cw*ee*complex(0,1)*I10155*sw)/((-1 + sw)*(1 + sw))',
4873+ order = {'QED':1})
4874
4875 GC_252 = Coupling(name = 'GC_252',
4876- value = '(ee**2*complex(0,1)*I2233)/(3.*sw*cmath.sqrt(2))',
4877- order = {'QED':2})
4878+ value = '(-2*cw*ee*complex(0,1)*I10244*sw)/(3.*(-1 + sw)*(1 + sw))',
4879+ order = {'QED':1})
4880
4881 GC_253 = Coupling(name = 'GC_253',
4882- value = '(ee**2*complex(0,1)*I2236)/(3.*sw*cmath.sqrt(2))',
4883- order = {'QED':2})
4884+ value = '(-2*cw*ee*complex(0,1)*I10255*sw)/(3.*(-1 + sw)*(1 + sw))',
4885+ order = {'QED':1})
4886
4887 GC_254 = Coupling(name = 'GC_254',
4888- value = '(ee**2*complex(0,1)*I2263)/(3.*sw*cmath.sqrt(2))',
4889+ value = '(2*cw*ee**2*complex(0,1)*I2644*sw)/((-1 + sw)*(1 + sw))',
4890 order = {'QED':2})
4891
4892 GC_255 = Coupling(name = 'GC_255',
4893- value = '(ee**2*complex(0,1)*I2266)/(3.*sw*cmath.sqrt(2))',
4894+ value = '(2*cw*ee**2*complex(0,1)*I2655*sw)/((-1 + sw)*(1 + sw))',
4895 order = {'QED':2})
4896
4897 GC_256 = Coupling(name = 'GC_256',
4898- value = '(ee*complex(0,1)*G*I2311*cmath.sqrt(2))/sw',
4899- order = {'QCD':1,'QED':1})
4900+ value = '(8*cw*ee**2*complex(0,1)*I5244*sw)/(9.*(-1 + sw)*(1 + sw))',
4901+ order = {'QED':2})
4902
4903 GC_257 = Coupling(name = 'GC_257',
4904- value = '(ee*complex(0,1)*G*I2322*cmath.sqrt(2))/sw',
4905+ value = '(4*cw*ee*complex(0,1)*G*I5244*sw)/(3.*(-1 + sw)*(1 + sw))',
4906 order = {'QCD':1,'QED':1})
4907
4908 GC_258 = Coupling(name = 'GC_258',
4909- value = '(ee*complex(0,1)*G*I2333*cmath.sqrt(2))/sw',
4910- order = {'QCD':1,'QED':1})
4911+ value = '(8*cw*ee**2*complex(0,1)*I5255*sw)/(9.*(-1 + sw)*(1 + sw))',
4912+ order = {'QED':2})
4913
4914 GC_259 = Coupling(name = 'GC_259',
4915- value = '(ee*complex(0,1)*G*I2336*cmath.sqrt(2))/sw',
4916+ value = '(4*cw*ee*complex(0,1)*G*I5255*sw)/(3.*(-1 + sw)*(1 + sw))',
4917 order = {'QCD':1,'QED':1})
4918
4919 GC_260 = Coupling(name = 'GC_260',
4920- value = '(ee*complex(0,1)*G*I2363*cmath.sqrt(2))/sw',
4921- order = {'QCD':1,'QED':1})
4922+ value = '(2*cw*ee**2*complex(0,1)*I644*sw)/(9.*(-1 + sw)*(1 + sw))',
4923+ order = {'QED':2})
4924
4925 GC_261 = Coupling(name = 'GC_261',
4926- value = '(ee*complex(0,1)*G*I2366*cmath.sqrt(2))/sw',
4927+ value = '(-2*cw*ee*complex(0,1)*G*I644*sw)/(3.*(-1 + sw)*(1 + sw))',
4928 order = {'QCD':1,'QED':1})
4929
4930 GC_262 = Coupling(name = 'GC_262',
4931- value = '(ee**2*complex(0,1)*I2411)/(3.*sw*cmath.sqrt(2))',
4932+ value = '(2*cw*ee**2*complex(0,1)*I655*sw)/(9.*(-1 + sw)*(1 + sw))',
4933 order = {'QED':2})
4934
4935 GC_263 = Coupling(name = 'GC_263',
4936- value = '(ee**2*complex(0,1)*I2422)/(3.*sw*cmath.sqrt(2))',
4937- order = {'QED':2})
4938+ value = '(-2*cw*ee*complex(0,1)*G*I655*sw)/(3.*(-1 + sw)*(1 + sw))',
4939+ order = {'QCD':1,'QED':1})
4940
4941 GC_264 = Coupling(name = 'GC_264',
4942- value = '(ee**2*complex(0,1)*I2433)/(3.*sw*cmath.sqrt(2))',
4943+ value = '(-2*ee**2*complex(0,1)*I10044*sw**2)/(9.*(-1 + sw)*(1 + sw))',
4944 order = {'QED':2})
4945
4946 GC_265 = Coupling(name = 'GC_265',
4947- value = '(ee**2*complex(0,1)*I2436)/(3.*sw*cmath.sqrt(2))',
4948+ value = '(-2*ee**2*complex(0,1)*I10055*sw**2)/(9.*(-1 + sw)*(1 + sw))',
4949 order = {'QED':2})
4950
4951 GC_266 = Coupling(name = 'GC_266',
4952- value = '(ee**2*complex(0,1)*I2463)/(3.*sw*cmath.sqrt(2))',
4953+ value = '(-2*ee**2*complex(0,1)*I10144*sw**2)/((-1 + sw)*(1 + sw))',
4954 order = {'QED':2})
4955
4956 GC_267 = Coupling(name = 'GC_267',
4957- value = '(ee**2*complex(0,1)*I2466)/(3.*sw*cmath.sqrt(2))',
4958+ value = '(-2*ee**2*complex(0,1)*I10155*sw**2)/((-1 + sw)*(1 + sw))',
4959 order = {'QED':2})
4960
4961 GC_268 = Coupling(name = 'GC_268',
4962- value = '-(ee*complex(0,1)*sw)/(6.*cw)',
4963- order = {'QED':1})
4964+ value = '(-8*ee**2*complex(0,1)*I10244*sw**2)/(9.*(-1 + sw)*(1 + sw))',
4965+ order = {'QED':2})
4966
4967 GC_269 = Coupling(name = 'GC_269',
4968- value = '(ee*complex(0,1)*sw)/(2.*cw)',
4969- order = {'QED':1})
4970+ value = '(-8*ee**2*complex(0,1)*I10255*sw**2)/(9.*(-1 + sw)*(1 + sw))',
4971+ order = {'QED':2})
4972
4973 GC_270 = Coupling(name = 'GC_270',
4974- value = '-(ee*complex(0,1)*I1044*sw)/(3.*cw)',
4975- order = {'QED':1})
4976+ value = '-((cw*ee**2*complex(0,1)*I2511)/((-1 + sw)*sw*(1 + sw))) + (2*cw*ee**2*complex(0,1)*I2511*sw)/((-1 + sw)*(1 + sw))',
4977+ order = {'QED':2})
4978
4979 GC_271 = Coupling(name = 'GC_271',
4980- value = '(2*ee*complex(0,1)*G*I1044*sw)/(3.*cw)',
4981- order = {'QCD':1,'QED':1})
4982+ value = '-((cw*ee**2*complex(0,1)*I2522)/((-1 + sw)*sw*(1 + sw))) + (2*cw*ee**2*complex(0,1)*I2522*sw)/((-1 + sw)*(1 + sw))',
4983+ order = {'QED':2})
4984
4985 GC_272 = Coupling(name = 'GC_272',
4986- value = '-(ee*complex(0,1)*I1055*sw)/(3.*cw)',
4987- order = {'QED':1})
4988+ value = '-((cw*ee**2*complex(0,1)*I2533)/((-1 + sw)*sw*(1 + sw))) + (2*cw*ee**2*complex(0,1)*I2533*sw)/((-1 + sw)*(1 + sw)) + (2*cw*ee**2*complex(0,1)*I2633*sw)/((-1 + sw)*(1 + sw))',
4989+ order = {'QED':2})
4990
4991 GC_273 = Coupling(name = 'GC_273',
4992- value = '(2*ee*complex(0,1)*G*I1055*sw)/(3.*cw)',
4993- order = {'QCD':1,'QED':1})
4994+ value = '-((cw*ee**2*complex(0,1)*I2536)/((-1 + sw)*sw*(1 + sw))) + (2*cw*ee**2*complex(0,1)*I2536*sw)/((-1 + sw)*(1 + sw)) + (2*cw*ee**2*complex(0,1)*I2636*sw)/((-1 + sw)*(1 + sw))',
4995+ order = {'QED':2})
4996
4997 GC_274 = Coupling(name = 'GC_274',
4998- value = '(-8*ee**2*complex(0,1)*I1244*sw)/(9.*cw)',
4999+ value = '-((cw*ee**2*complex(0,1)*I2563)/((-1 + sw)*sw*(1 + sw))) + (2*cw*ee**2*complex(0,1)*I2563*sw)/((-1 + sw)*(1 + sw)) + (2*cw*ee**2*complex(0,1)*I2663*sw)/((-1 + sw)*(1 + sw))',
5000 order = {'QED':2})
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches