Merge lp:~madteam/mg5amcnlo/extended_drawing into lp:~madteam/mg5amcnlo/trunk

Proposed by Olivier Mattelaer
Status: Merged
Merge reported by: Olivier Mattelaer
Merged at revision: not available
Proposed branch: lp:~madteam/mg5amcnlo/extended_drawing
Merge into: lp:~madteam/mg5amcnlo/trunk
Diff against target: 1441 lines (+174/-353)
8 files modified
madgraph/core/base_objects.py (+1/-1)
madgraph/core/drawing.py (+5/-2)
madgraph/iolibs/drawing_eps.py (+42/-10)
madgraph/iolibs/template_files/drawing_eps_header.inc (+24/-6)
models/mssm/object_library.py (+43/-5)
models/mssm/particles.py (+45/-100)
models/sm/object_library.py (+0/-191)
models/sm/particles.py (+14/-38)
To merge this branch: bzr merge lp:~madteam/mg5amcnlo/extended_drawing
Reviewer Review Type Date Requested Status
Johan Alwall Pending
Review via email: mp+51294@code.launchpad.net

Description of the change

new way for drawing gravitino, chargino, neutralino,...

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 'madgraph/core/base_objects.py'
2--- madgraph/core/base_objects.py 2011-01-26 13:23:54 +0000
3+++ madgraph/core/base_objects.py 2011-02-25 13:52:35 +0000
4@@ -263,7 +263,7 @@
5 if not isinstance(value, str):
6 raise self.PhysicsObjectError, \
7 "Line type %s is not a string" % repr(value)
8- if value not in ['dashed', 'straight', 'wavy', 'curly', 'double']:
9+ if value not in ['dashed', 'straight', 'wavy', 'curly', 'double','swavy','scurly']:
10 raise self.PhysicsObjectError, \
11 "Line type %s is unknown" % value
12
13
14=== modified file 'madgraph/core/drawing.py'
15--- madgraph/core/drawing.py 2010-12-01 09:33:43 +0000
16+++ madgraph/core/drawing.py 2011-02-25 13:52:35 +0000
17@@ -1809,8 +1809,11 @@
18 # Find the type line of the particle [straight, wavy, ...]
19 line_type = line.get_info('line')
20 # Call the routine associate to this type [self.draw_straight, ...]
21- getattr(self, 'draw_' + line_type)(line)
22-
23+ if hasattr(self, 'draw_' + line_type):
24+ getattr(self, 'draw_' + line_type)(line)
25+ else:
26+ self.draw_straight(line)
27+
28 # Finalize the line representation with adding the name of the particle
29 name = line.get_name()
30 self.associate_name(line, name)
31
32=== modified file 'madgraph/iolibs/drawing_eps.py'
33--- madgraph/iolibs/drawing_eps.py 2010-12-09 15:12:32 +0000
34+++ madgraph/iolibs/drawing_eps.py 2011-02-25 13:52:35 +0000
35@@ -40,7 +40,7 @@
36 from __future__ import division
37
38 import os
39-
40+import math
41 import madgraph.core.drawing as draw
42 import madgraph.core.base_objects as base_objects
43
44@@ -166,15 +166,15 @@
45 line.end.pos_x, line.end.pos_y, 'Fhiggs')
46
47
48- def draw_wavy(self, line):
49+ def draw_wavy(self, line, opt=0, type='d'):
50 """ADD the EPS code for this photon line."""
51
52 #add the code in the correct format
53 self.text += self.line_format(line.start.pos_x, line.start.pos_y,
54- line.end.pos_x, line.end.pos_y, '0 Fphotond')
55-
56-
57- def draw_curly(self, line):
58+ line.end.pos_x, line.end.pos_y, '%d Fphoton%s' % (opt,type))
59+
60+
61+ def draw_curly(self, line, type=''):
62 """ADD the EPS code for this gluon line."""
63
64 # Due to the asymmetry in the way to draw the gluon (everything is draw
65@@ -185,13 +185,45 @@
66 line.start.pos_y > line.end.pos_y):
67 self.text += self.line_format(line.start.pos_x,
68 line.start.pos_y, line.end.pos_x,
69- line.end.pos_y, '0 Fgluon')
70+ line.end.pos_y, '0 Fgluon%s' % type)
71 else:
72 self.text += self.line_format(line.end.pos_x,
73 line.end.pos_y, line.start.pos_x,
74- line.start.pos_y, '0 Fgluon')
75-
76-
77+ line.start.pos_y, '0 Fgluon%s' % type)
78+
79+ def draw_scurly(self, line):
80+ """ADD the EPS code for this gluino line."""
81+ self.draw_curly(line, type='r'
82+ )
83+ self.draw_straight(line)
84+
85+ def draw_swavy(self, line):
86+ """ADD the EPS code for this neutralino line."""
87+ self.draw_wavy(line, type='r')
88+ self.draw_straight(line)
89+
90+ def draw_double(self, line, type='r'):
91+ """ADD the EPS code for this neutralino line."""
92+
93+
94+ length = math.sqrt((line.end.pos_y - line.start.pos_y)**2 + (line.end.pos_x - line.start.pos_x) **2)
95+ c1 = (line.end.pos_x - line.start.pos_x)/length
96+ c2 = (line.end.pos_y - line.start.pos_y)/length
97+
98+ gap = 0.013
99+ start2_x = line.start.pos_x + gap * c1
100+ start2_y = line.start.pos_y + gap * c2
101+ stop1_x = line.end.pos_x - gap * c1
102+ stop1_y = line.end.pos_y - gap * c2
103+
104+
105+ self.text += self.line_format(line.start.pos_x, line.start.pos_y,
106+ stop1_x, stop1_y, '0 Fphoton%s' % (type))
107+ #add the code in the correct format
108+ self.text += self.line_format(start2_x, start2_y,
109+ line.end.pos_x, line.end.pos_y, '0 Fphoton%s' % (type))
110+
111+
112 def put_diagram_number(self, number=0):
113 """ADD the comment 'diagram [number]' just below the diagram."""
114
115
116=== modified file 'madgraph/iolibs/template_files/drawing_eps_header.inc'
117--- madgraph/iolibs/template_files/drawing_eps_header.inc 2010-08-06 09:18:24 +0000
118+++ madgraph/iolibs/template_files/drawing_eps_header.inc 2011-02-25 13:52:35 +0000
119@@ -30,7 +30,7 @@
120 def /Fx2 exch def /Fy1 exch def /Fx1 exch def
121 Fx2 Fx1 sub Fy2 Fy1 sub Fbasis /Fttype 1
122 Ftype 2 mod 2 mul abs sub def Ftype 0 ge
123-{/Fddist Fdist Fr div def /Fn Fddist round
124+{/Fddist Fdist Fr div 2 div def /Fn Fddist round
125 def Ftype 1 gt {/Fn Fn Fddist Fn sub Fsign
126 add def} if} {/Fn Fdist Fr div 2 div round 2
127 mul def} ifelse Fx1 Fy1 moveto 0 1 Fnopoints
128@@ -70,18 +70,25 @@
129
130 /Fphoton
131 {{ Fx1 Fx2 Fx1 sub Fi mul Fnopoints div Fn
132+div Fxt Fi 360 mul Fnopoints div Frmod sin
133+mul Fttype mul 2 div add add Fy1 Fy2 Fy1 sub
134+Fi mul Fnopoints div Fn div Fyt Fi 360 mul
135+Fnopoints div Frmod sin mul Fttype mul 2 div
136+add add } Fstraight } def
137+
138+/Fphotonr
139+{{ Fx1 Fx2 Fx1 sub Fi mul Fnopoints div Fn
140 div Fxt Fi 180 mul Fnopoints div Frmod sin
141-mul Fttype mul 2 div add add Fy1 Fy2 Fy1 sub
142+mul Fttype mul 1 div add add Fy1 Fy2 Fy1 sub
143 Fi mul Fnopoints div Fn div Fyt Fi 180 mul
144-Fnopoints div Frmod sin mul Fttype mul 2 div
145+Fnopoints div Frmod sin mul Fttype mul 1 div
146 add add } Fstraight } def
147
148-
149 /Fphotond
150 {{ Fx1 Fx2 Fx1 sub Fi mul Fnopoints div Fn
151-div Fxt Fi 180 mul Fnopoints div Frmod sin
152+div Fxt Fi 360 mul Fnopoints div Frmod sin
153 mul Fttype mul 2 div add add Fy1 Fy2 Fy1 sub
154-Fi mul Fnopoints div Fn div Fyt Fi 180 mul
155+Fi mul Fnopoints div Fn div Fyt Fi 360 mul
156 Fnopoints div Frmod sin mul Fttype mul 2 div
157 add add } Fstraight Fx1
158 Fx2 add 2 div Fy1 Fy2 add 2 div Farrow} def
159@@ -108,6 +115,17 @@
160 180 mul Fnopoints div sin mul add add add }
161 Fstraight } def
162
163+/Fgluonr
164+{2 sub { Fx1 Fx2 Fx1 sub Fi mul Fnopoints div
165+Fn div Fxt 0 Fi 120 mul Fnopoints div cos sub
166+mul Fttype mul Fxl Fi 120 mul Fnopoints div
167+sin mul add add add Fy1 Fy2 Fy1 sub Fi mul
168+Fnopoints div Fn div Fyt 0 Fi 120 mul
169+Fnopoints div cos sub mul Fttype mul Fyl Fi
170+120 mul Fnopoints div sin mul add add add }
171+Fstraight } def
172+
173+
174 /Fgluonl
175 {exch 2 sub exch { Fxc Fth cos Frr mul Fxt 1
176 Fi 180 mul Fnopoints div cos sub mul Fttype
177
178=== modified file 'models/mssm/object_library.py'
179--- models/mssm/object_library.py 2010-12-05 05:38:08 +0000
180+++ models/mssm/object_library.py 2011-02-25 13:52:35 +0000
181@@ -65,15 +65,15 @@
182 class Particle(FRBaseClass):
183 """A standard Particle"""
184
185- require_args=['pdg_code', 'name', 'antiname', 'spin', 'color', 'mass', 'width', 'texname', 'antitexname', 'line', 'charge']
186+ require_args=['pdg_code', 'name', 'antiname', 'spin', 'color', 'mass', 'width', 'texname', 'antitexname', 'charge']
187
188- require_args_all = ['pdg_code', 'name', 'antiname', 'spin', 'color', 'mass', 'width', 'texname', 'antitexname', 'line', 'charge', 'propagating', 'goldstoneboson']
189+ require_args_all = ['pdg_code', 'name', 'antiname', 'spin', 'color', 'mass', 'width', 'texname', 'antitexname', 'charge', 'line', 'propagating', 'goldstoneboson']
190
191 def __init__(self, pdg_code, name, antiname, spin, color, mass, width, texname,
192- antitexname, line, charge , propagating=True, goldstoneboson=False, **options):
193+ antitexname, charge , line=None, propagating=True, goldstoneboson=False, **options):
194
195 args= (pdg_code, name, antiname, spin, color, mass, width, texname,
196- antitexname, line, float(charge))
197+ antitexname, float(charge))
198
199 FRBaseClass.__init__(self, *args, **options)
200
201@@ -84,6 +84,44 @@
202 self.goldstoneboson= goldstoneboson
203
204 self.selfconjugate = (name == antiname)
205+ if not line:
206+ self.line = self.find_line_type()
207+ else:
208+ self.line = line
209+
210+
211+
212+
213+ def find_line_type(self):
214+ """ find how we draw a line if not defined
215+ valid output: dashed/straight/wavy/curly/double/swavy/scurly
216+ """
217+
218+ spin = self.spin
219+ color = self.color
220+
221+ #use default
222+ if spin == 1:
223+ return 'dashed'
224+ elif spin == 2:
225+ if not self.selfconjugate:
226+ return 'straight'
227+ elif color == 1:
228+ return 'swavy'
229+ else:
230+ return 'scurly'
231+ elif spin == 3:
232+ if color == 1:
233+ return 'wavy'
234+
235+ else:
236+ return 'curly'
237+ elif spin == 5:
238+ return 'double'
239+ elif spin == -1:
240+ return 'dotted'
241+ else:
242+ return 'dashed' # not supported yet
243
244 def anti(self):
245 if self.selfconjugate:
246@@ -98,7 +136,7 @@
247 newcolor = -self.color
248
249 return Particle(-self.pdg_code, self.antiname, self.name, self.spin, newcolor, self.mass, self.width,
250- self.antitexname, self.texname, self.line, -self.charge, self.propagating, self.goldstoneboson, **outdic)
251+ self.antitexname, self.texname, -self.charge, self.line, self.propagating, self.goldstoneboson, **outdic)
252
253
254
255
256=== modified file 'models/mssm/particles.py'
257--- models/mssm/particles.py 2010-12-20 23:00:11 +0000
258+++ models/mssm/particles.py 2011-02-25 13:52:35 +0000
259@@ -15,7 +15,6 @@
260 width = 'ZERO',
261 texname = 've',
262 antitexname = 've',
263- line = 'straight',
264 charge = 0,
265 GhostNumber = 0)
266
267@@ -30,8 +29,7 @@
268 width = 'ZERO',
269 texname = 'vm',
270 antitexname = 'vm',
271- line = 'straight',
272- charge = 0,
273+ charge = 0,
274 GhostNumber = 0)
275
276 vm__tilde__ = vm.anti()
277@@ -45,8 +43,7 @@
278 width = 'ZERO',
279 texname = 'vt',
280 antitexname = 'vt',
281- line = 'straight',
282- charge = 0,
283+ charge = 0,
284 GhostNumber = 0)
285
286 vt__tilde__ = vt.anti()
287@@ -60,8 +57,7 @@
288 width = 'ZERO',
289 texname = 'e-',
290 antitexname = 'e-',
291- line = 'straight',
292- charge = -1,
293+ charge = -1,
294 GhostNumber = 0)
295
296 e__plus__ = e__minus__.anti()
297@@ -75,8 +71,7 @@
298 width = 'ZERO',
299 texname = 'mu-',
300 antitexname = 'mu-',
301- line = 'straight',
302- charge = -1,
303+ charge = -1,
304 GhostNumber = 0)
305
306 mu__plus__ = mu__minus__.anti()
307@@ -90,8 +85,7 @@
308 width = 'ZERO',
309 texname = 'tau-',
310 antitexname = 'tau-',
311- line = 'straight',
312- charge = -1,
313+ charge = -1,
314 GhostNumber = 0)
315
316 tau__plus__ = tau__minus__.anti()
317@@ -105,7 +99,6 @@
318 width = 'ZERO',
319 texname = 'u',
320 antitexname = 'u',
321- line = 'straight',
322 charge = 2/3,
323 GhostNumber = 0)
324
325@@ -120,7 +113,6 @@
326 width = 'ZERO',
327 texname = 'c',
328 antitexname = 'c',
329- line = 'straight',
330 charge = 2/3,
331 GhostNumber = 0)
332
333@@ -135,7 +127,6 @@
334 width = 'WT',
335 texname = 't',
336 antitexname = 't',
337- line = 'straight',
338 charge = 2/3,
339 GhostNumber = 0)
340
341@@ -150,7 +141,6 @@
342 width = 'ZERO',
343 texname = 'd',
344 antitexname = 'd',
345- line = 'straight',
346 charge = -1/3,
347 GhostNumber = 0)
348
349@@ -165,7 +155,6 @@
350 width = 'ZERO',
351 texname = 's',
352 antitexname = 's',
353- line = 'straight',
354 charge = -1/3,
355 GhostNumber = 0)
356
357@@ -180,7 +169,6 @@
358 width = 'ZERO',
359 texname = 'b',
360 antitexname = 'b',
361- line = 'straight',
362 charge = -1/3,
363 GhostNumber = 0)
364
365@@ -195,8 +183,7 @@
366 width = 'Wneu1',
367 texname = 'n1',
368 antitexname = 'n1',
369- line = 'straight',
370- charge = 0,
371+ charge = 0,
372 GhostNumber = 0)
373
374 n2 = Particle(pdg_code = 1000023,
375@@ -208,8 +195,7 @@
376 width = 'Wneu2',
377 texname = 'n2',
378 antitexname = 'n2',
379- line = 'straight',
380- charge = 0,
381+ charge = 0,
382 GhostNumber = 0)
383
384 n3 = Particle(pdg_code = 1000025,
385@@ -221,8 +207,7 @@
386 width = 'Wneu3',
387 texname = 'n3',
388 antitexname = 'n3',
389- line = 'straight',
390- charge = 0,
391+ charge = 0,
392 GhostNumber = 0)
393
394 n4 = Particle(pdg_code = 1000035,
395@@ -234,8 +219,7 @@
396 width = 'Wneu4',
397 texname = 'n4',
398 antitexname = 'n4',
399- line = 'straight',
400- charge = 0,
401+ charge = 0,
402 GhostNumber = 0)
403
404 x1__plus__ = Particle(pdg_code = 1000024,
405@@ -247,8 +231,7 @@
406 width = 'Wch1',
407 texname = 'x1+',
408 antitexname = 'x1+',
409- line = 'straight',
410- charge = 1,
411+ charge = 1,
412 GhostNumber = 0)
413
414 x1__minus__ = x1__plus__.anti()
415@@ -262,8 +245,7 @@
416 width = 'Wch2',
417 texname = 'x2+',
418 antitexname = 'x2+',
419- line = 'straight',
420- charge = 1,
421+ charge = 1,
422 GhostNumber = 0)
423
424 x2__minus__ = x2__plus__.anti()
425@@ -277,8 +259,7 @@
426 width = 'Wglu',
427 texname = 'go',
428 antitexname = 'go',
429- line = 'straight',
430- charge = 0,
431+ charge = 0,
432 GhostNumber = 0)
433
434 sv1 = Particle(pdg_code = 1000012,
435@@ -290,8 +271,7 @@
436 width = 'Wsn1',
437 texname = 'sv1',
438 antitexname = 'sv1',
439- line = 'dashed',
440- charge = 0,
441+ charge = 0,
442 GhostNumber = 0)
443
444 sv1__tilde__ = sv1.anti()
445@@ -305,8 +285,7 @@
446 width = 'Wsn2',
447 texname = 'sv2',
448 antitexname = 'sv2',
449- line = 'dashed',
450- charge = 0,
451+ charge = 0,
452 GhostNumber = 0)
453
454 sv2__tilde__ = sv2.anti()
455@@ -320,8 +299,7 @@
456 width = 'Wsn3',
457 texname = 'sv3',
458 antitexname = 'sv3',
459- line = 'dashed',
460- charge = 0,
461+ charge = 0,
462 GhostNumber = 0)
463
464 sv3__tilde__ = sv3.anti()
465@@ -335,8 +313,7 @@
466 width = 'Wsl1',
467 texname = 'sl1-',
468 antitexname = 'sl1-',
469- line = 'dashed',
470- charge = -1,
471+ charge = -1,
472 GhostNumber = 0)
473
474 sl1__plus__ = sl1__minus__.anti()
475@@ -350,8 +327,7 @@
476 width = 'Wsl2',
477 texname = 'sl2-',
478 antitexname = 'sl2-',
479- line = 'dashed',
480- charge = -1,
481+ charge = -1,
482 GhostNumber = 0)
483
484 sl2__plus__ = sl2__minus__.anti()
485@@ -365,8 +341,7 @@
486 width = 'Wsl3',
487 texname = 'sl3-',
488 antitexname = 'sl3-',
489- line = 'dashed',
490- charge = -1,
491+ charge = -1,
492 GhostNumber = 0)
493
494 sl3__plus__ = sl3__minus__.anti()
495@@ -380,8 +355,7 @@
496 width = 'Wsl4',
497 texname = 'sl4-',
498 antitexname = 'sl4-',
499- line = 'dashed',
500- charge = -1,
501+ charge = -1,
502 GhostNumber = 0)
503
504 sl4__plus__ = sl4__minus__.anti()
505@@ -395,8 +369,7 @@
506 width = 'Wsl5',
507 texname = 'sl5-',
508 antitexname = 'sl5-',
509- line = 'dashed',
510- charge = -1,
511+ charge = -1,
512 GhostNumber = 0)
513
514 sl5__plus__ = sl5__minus__.anti()
515@@ -410,8 +383,7 @@
516 width = 'Wsl6',
517 texname = 'sl6-',
518 antitexname = 'sl6-',
519- line = 'dashed',
520- charge = -1,
521+ charge = -1,
522 GhostNumber = 0)
523
524 sl6__plus__ = sl6__minus__.anti()
525@@ -425,8 +397,7 @@
526 width = 'Wusq1',
527 texname = 'su1',
528 antitexname = 'su1',
529- line = 'dashed',
530- charge = 2/3,
531+ charge = 2/3,
532 GhostNumber = 0)
533
534 su1__tilde__ = su1.anti()
535@@ -440,8 +411,7 @@
536 width = 'Wusq2',
537 texname = 'su2',
538 antitexname = 'su2',
539- line = 'dashed',
540- charge = 2/3,
541+ charge = 2/3,
542 GhostNumber = 0)
543
544 su2__tilde__ = su2.anti()
545@@ -455,8 +425,7 @@
546 width = 'Wusq3',
547 texname = 'su3',
548 antitexname = 'su3',
549- line = 'dashed',
550- charge = 2/3,
551+ charge = 2/3,
552 GhostNumber = 0)
553
554 su3__tilde__ = su3.anti()
555@@ -470,8 +439,7 @@
556 width = 'Wusq4',
557 texname = 'su4',
558 antitexname = 'su4',
559- line = 'dashed',
560- charge = 2/3,
561+ charge = 2/3,
562 GhostNumber = 0)
563
564 su4__tilde__ = su4.anti()
565@@ -485,8 +453,7 @@
566 width = 'Wusq5',
567 texname = 'su5',
568 antitexname = 'su5',
569- line = 'dashed',
570- charge = 2/3,
571+ charge = 2/3,
572 GhostNumber = 0)
573
574 su5__tilde__ = su5.anti()
575@@ -500,8 +467,7 @@
576 width = 'Wusq6',
577 texname = 'su6',
578 antitexname = 'su6',
579- line = 'dashed',
580- charge = 2/3,
581+ charge = 2/3,
582 GhostNumber = 0)
583
584 su6__tilde__ = su6.anti()
585@@ -515,8 +481,7 @@
586 width = 'Wdsq1',
587 texname = 'sd1',
588 antitexname = 'sd1',
589- line = 'dashed',
590- charge = -1/3,
591+ charge = -1/3,
592 GhostNumber = 0)
593
594 sd1__tilde__ = sd1.anti()
595@@ -530,8 +495,7 @@
596 width = 'Wdsq2',
597 texname = 'sd2',
598 antitexname = 'sd2',
599- line = 'dashed',
600- charge = -1/3,
601+ charge = -1/3,
602 GhostNumber = 0)
603
604 sd2__tilde__ = sd2.anti()
605@@ -545,8 +509,7 @@
606 width = 'Wdsq3',
607 texname = 'sd3',
608 antitexname = 'sd3',
609- line = 'dashed',
610- charge = -1/3,
611+ charge = -1/3,
612 GhostNumber = 0)
613
614 sd3__tilde__ = sd3.anti()
615@@ -560,8 +523,7 @@
616 width = 'Wdsq4',
617 texname = 'sd4',
618 antitexname = 'sd4',
619- line = 'dashed',
620- charge = -1/3,
621+ charge = -1/3,
622 GhostNumber = 0)
623
624 sd4__tilde__ = sd4.anti()
625@@ -575,8 +537,7 @@
626 width = 'Wdsq5',
627 texname = 'sd5',
628 antitexname = 'sd5',
629- line = 'dashed',
630- charge = -1/3,
631+ charge = -1/3,
632 GhostNumber = 0)
633
634 sd5__tilde__ = sd5.anti()
635@@ -590,8 +551,7 @@
636 width = 'Wdsq6',
637 texname = 'sd6',
638 antitexname = 'sd6',
639- line = 'dashed',
640- charge = -1/3,
641+ charge = -1/3,
642 GhostNumber = 0)
643
644 sd6__tilde__ = sd6.anti()
645@@ -605,8 +565,7 @@
646 width = 'Wh01',
647 texname = 'h1',
648 antitexname = 'h1',
649- line = 'dashed',
650- charge = 0,
651+ charge = 0,
652 GhostNumber = 0)
653
654 h2 = Particle(pdg_code = 35,
655@@ -618,8 +577,7 @@
656 width = 'Wh02',
657 texname = 'h2',
658 antitexname = 'h2',
659- line = 'dashed',
660- charge = 0,
661+ charge = 0,
662 GhostNumber = 0)
663
664 h3 = Particle(pdg_code = 36,
665@@ -631,8 +589,7 @@
666 width = 'WA0',
667 texname = 'h3',
668 antitexname = 'h3',
669- line = 'dashed',
670- charge = 0,
671+ charge = 0,
672 GhostNumber = 0)
673
674 H__plus__ = Particle(pdg_code = 37,
675@@ -644,8 +601,7 @@
676 width = 'WH',
677 texname = 'H+',
678 antitexname = 'H+',
679- line = 'dashed',
680- charge = 1,
681+ charge = 1,
682 GhostNumber = 0)
683
684 H__minus__ = H__plus__.anti()
685@@ -659,8 +615,7 @@
686 width = 'Wphi',
687 texname = 'phi0',
688 antitexname = 'phi0',
689- line = 'dashed',
690- GoldstoneBoson = True,
691+ GoldstoneBoson = True,
692 charge = 0,
693 GhostNumber = 0)
694
695@@ -673,8 +628,7 @@
696 width = 'Wphi2',
697 texname = '\\phi^+',
698 antitexname = '\\phi^+',
699- line = 'dashed',
700- GoldstoneBoson = True,
701+ GoldstoneBoson = True,
702 charge = 1,
703 GhostNumber = 0)
704
705@@ -689,7 +643,6 @@
706 width = 'ZERO',
707 texname = 'a',
708 antitexname = 'a',
709- line = 'wavy',
710 charge = 0,
711 GhostNumber = 0)
712
713@@ -702,7 +655,6 @@
714 width = 'WZ',
715 texname = 'Z',
716 antitexname = 'Z',
717- line = 'wavy',
718 charge = 0,
719 GhostNumber = 0)
720
721@@ -715,8 +667,7 @@
722 width = 'WW',
723 texname = 'W+',
724 antitexname = 'W+',
725- line = 'wavy',
726- charge = 1,
727+ charge = 1,
728 GhostNumber = 0)
729
730 W__minus__ = W__plus__.anti()
731@@ -730,7 +681,6 @@
732 width = 'ZERO',
733 texname = 'g',
734 antitexname = 'g',
735- line = 'curly',
736 charge = 0,
737 GhostNumber = 0)
738
739@@ -743,8 +693,7 @@
740 width = 'ZERO',
741 texname = 'ghG',
742 antitexname = 'ghG',
743- line = 'dotted',
744- charge = 0,
745+ charge = 0,
746 GhostNumber = 1)
747
748 ghG__tilde__ = ghG.anti()
749@@ -758,8 +707,7 @@
750 width = 'WghA',
751 texname = 'ghA',
752 antitexname = 'ghA',
753- line = 'dotted',
754- charge = 0,
755+ charge = 0,
756 GhostNumber = 1)
757
758 ghA__tilde__ = ghA.anti()
759@@ -773,8 +721,7 @@
760 width = 'WghZ',
761 texname = 'ghZ',
762 antitexname = 'ghZ',
763- line = 'dotted',
764- charge = 0,
765+ charge = 0,
766 GhostNumber = 1)
767
768 ghZ__tilde__ = ghZ.anti()
769@@ -788,8 +735,7 @@
770 width = 'WghWp',
771 texname = 'ghWp',
772 antitexname = 'ghWp',
773- line = 'dotted',
774- charge = 1,
775+ charge = 1,
776 GhostNumber = 1)
777
778 ghWp__tilde__ = ghWp.anti()
779@@ -803,8 +749,7 @@
780 width = 'WghWm',
781 texname = 'ghWm',
782 antitexname = 'ghWm',
783- line = 'dotted',
784- charge = -1,
785+ charge = -1,
786 GhostNumber = 1)
787
788 ghWm__tilde__ = ghWm.anti()
789
790=== added file 'models/sm/object_library.py'
791--- models/sm/object_library.py 1970-01-01 00:00:00 +0000
792+++ models/sm/object_library.py 2011-02-25 13:52:35 +0000
793@@ -0,0 +1,228 @@
794+##
795+##
796+## Feynrules Header
797+##
798+##
799+##
800+##
801+##
802+
803+import cmath
804+
805+
806+class FRBaseClass(object):
807+ """The class from which all FeynRules classes are derived."""
808+
809+ require_args = []
810+
811+ def __init__(self, *args, **options):
812+ assert(len(self.require_args) == len (args))
813+
814+ for i, name in enumerate(self.require_args):
815+ setattr(self, name, args[i])
816+
817+ for (option, value) in options.items():
818+ setattr(self, option, value)
819+
820+ def get(self, name):
821+ return getattr(self, name)
822+
823+ def set(self, name, value):
824+ setattr(self, name, value)
825+
826+ def get_all(self):
827+ """Return a dictionary containing all the information of the object"""
828+ return self.__dict__
829+
830+ def __str__(self):
831+ return self.name
832+
833+ def nice_string(self):
834+ """ return string with the full information """
835+ return '\n'.join(['%s \t: %s' %(name, value) for name, value in self.__dict__.items()])
836+
837+ def __repr__(self):
838+ replacements = [
839+ ('+','__plus__'),
840+ ('-','__minus__'),
841+ ('@','__at__'),
842+ ('!','__exclam__'),
843+ ('?','__quest__'),
844+ ('*','__star__'),
845+ ('~','__tilde__')
846+ ]
847+ text = self.name
848+ for orig,sub in replacements:
849+ text = text.replace(orig,sub)
850+ return text
851+
852+
853+
854+all_particles = []
855+
856+
857+
858+class Particle(FRBaseClass):
859+ """A standard Particle"""
860+
861+ require_args=['pdg_code', 'name', 'antiname', 'spin', 'color', 'mass', 'width', 'texname', 'antitexname', 'charge']
862+
863+ require_args_all = ['pdg_code', 'name', 'antiname', 'spin', 'color', 'mass', 'width', 'texname', 'antitexname', 'charge', 'line', 'propagating', 'goldstoneboson']
864+
865+ def __init__(self, pdg_code, name, antiname, spin, color, mass, width, texname,
866+ antitexname, charge , line=None, propagating=True, goldstoneboson=False, **options):
867+
868+ args= (pdg_code, name, antiname, spin, color, mass, width, texname,
869+ antitexname, float(charge))
870+
871+ FRBaseClass.__init__(self, *args, **options)
872+
873+ global all_particles
874+ all_particles.append(self)
875+
876+ self.propagating = propagating
877+ self.goldstoneboson= goldstoneboson
878+
879+ self.selfconjugate = (name == antiname)
880+ if not line:
881+ self.line = self.find_line_type()
882+ else:
883+ self.line = line
884+
885+
886+ def find_line_type(self):
887+ """ find how we draw a line if not defined
888+ valid output: dashed/straight/wavy/curly/double/swavy/scurly
889+ """
890+
891+ spin = self.spin
892+ color = self.color
893+
894+ #use default
895+ if spin == 1:
896+ return 'dashed'
897+ elif spin == 2:
898+ if not self.selfconjugate:
899+ return 'straight'
900+ elif color == 1:
901+ return 'swavy'
902+ else:
903+ return 'scurly'
904+ elif spin == 3:
905+ if color == 1:
906+ return 'wavy'
907+
908+ else:
909+ return 'curly'
910+ elif spin == 5:
911+ return 'double'
912+ else:
913+ return 'dashed' # not supported yet
914+
915+ def anti(self):
916+ if self.selfconjugate:
917+ raise Exception('%s has no anti particle.' % self.name)
918+ outdic = {}
919+ for k,v in self.__dict__.iteritems():
920+ if k not in self.require_args_all:
921+ outdic[k] = -v
922+ if self.color in [1,8]:
923+ newcolor = self.color
924+ else:
925+ newcolor = -self.color
926+
927+ return Particle(-self.pdg_code, self.antiname, self.name, self.spin, newcolor, self.mass, self.width,
928+ self.antitexname, self.texname, -self.charge, self.line, self.propagating, self.goldstoneboson, **outdic)
929+
930+
931+
932+all_parameters = []
933+
934+class Parameter(FRBaseClass):
935+
936+ require_args=['name', 'nature', 'type', 'value', 'texname']
937+
938+ def __init__(self, name, nature, type, value, texname, lhablock=None, lhacode=None):
939+
940+ args = (name,nature,type,value,texname)
941+
942+ FRBaseClass.__init__(self, *args)
943+
944+ args=(name,nature,type,value,texname)
945+
946+ global all_parameters
947+ all_parameters.append(self)
948+
949+ if (lhablock is None or lhacode is None) and nature == 'external':
950+ raise Exception('Need LHA information for external parameter "%s".' % name)
951+ self.lhablock = lhablock
952+ self.lhacode = lhacode
953+
954+all_vertices = []
955+
956+class Vertex(FRBaseClass):
957+
958+ require_args=['name', 'particles', 'color', 'lorentz', 'couplings']
959+
960+ def __init__(self, name, particles, color, lorentz, couplings, **opt):
961+
962+ args = (name, particles, color, lorentz, couplings)
963+
964+ FRBaseClass.__init__(self, *args, **opt)
965+
966+ args=(particles,color,lorentz,couplings)
967+
968+ global all_vertices
969+ all_vertices.append(self)
970+
971+all_couplings = []
972+
973+class Coupling(FRBaseClass):
974+
975+ require_args=['name', 'value', 'order']
976+
977+ def __init__(self, name, value, order, **opt):
978+
979+ args =(name, value, order)
980+ FRBaseClass.__init__(self, *args, **opt)
981+ global all_couplings
982+ all_couplings.append(self)
983+
984+
985+
986+all_lorentz = []
987+
988+class Lorentz(FRBaseClass):
989+
990+ require_args=['name','spins','structure']
991+
992+ def __init__(self, name, spins, structure='external', **opt):
993+ args = (name, spins, structure)
994+ FRBaseClass.__init__(self, *args, **opt)
995+
996+ global all_lorentz
997+ all_lorentz.append(self)
998+
999+
1000+all_functions = []
1001+
1002+class Function(object):
1003+
1004+ def __init__(self, name, arguments, expression):
1005+
1006+ global all_functions
1007+ all_functions.append(self)
1008+
1009+ self.name = name
1010+ self.arguments = arguments
1011+ self.expr = expression
1012+
1013+ def __call__(self, *opt):
1014+
1015+ for i, arg in enumerate(self.arguments):
1016+ exec('%s = %s' % (arg, opt[i] ))
1017+
1018+ return eval(self.expr)
1019+
1020+
1021+
1022
1023=== removed file 'models/sm/object_library.py'
1024--- models/sm/object_library.py 2010-09-01 04:20:15 +0000
1025+++ models/sm/object_library.py 1970-01-01 00:00:00 +0000
1026@@ -1,191 +0,0 @@
1027-##
1028-##
1029-## Feynrules Header
1030-##
1031-##
1032-##
1033-##
1034-##
1035-
1036-import cmath
1037-
1038-
1039-class FRBaseClass(object):
1040- """The class from which all FeynRules classes are derived."""
1041-
1042- require_args = []
1043-
1044- def __init__(self, *args, **options):
1045- assert(len(self.require_args) == len (args))
1046-
1047- for i, name in enumerate(self.require_args):
1048- setattr(self, name, args[i])
1049-
1050- for (option, value) in options.items():
1051- setattr(self, option, value)
1052-
1053- def get(self, name):
1054- return getattr(self, name)
1055-
1056- def set(self, name, value):
1057- setattr(self, name, value)
1058-
1059- def get_all(self):
1060- """Return a dictionary containing all the information of the object"""
1061- return self.__dict__
1062-
1063- def __str__(self):
1064- return self.name
1065-
1066-
1067- def __repr__(self):
1068- replacements = [
1069- ('+','__plus__'),
1070- ('-','__minus__'),
1071- ('@','__at__'),
1072- ('!','__exclam__'),
1073- ('?','__quest__'),
1074- ('*','__star__'),
1075- ('~','__tilde__')
1076- ]
1077- text = self.name
1078- for orig,sub in replacements:
1079- text = text.replace(orig,sub)
1080- return text
1081-
1082-
1083-
1084-all_particles = []
1085-
1086-
1087-
1088-class Particle(FRBaseClass):
1089- """A standard Particle"""
1090-
1091- require_args=['pdg_code', 'name', 'antiname', 'spin', 'color', 'mass', 'width', 'texname', 'antitexname', 'line', 'charge']
1092-
1093- require_args_all = ['pdg_code', 'name', 'antiname', 'spin', 'color', 'mass', 'width', 'texname', 'antitexname', 'line', 'charge', 'propagating', 'goldstoneboson']
1094-
1095- def __init__(self, pdg_code, name, antiname, spin, color, mass, width, texname,
1096- antitexname, line, charge , propagating=True, goldstoneboson=False, **options):
1097-
1098- args= (pdg_code, name, antiname, spin, color, mass, width, texname,
1099- antitexname, line, float(charge))
1100-
1101- FRBaseClass.__init__(self, *args, **options)
1102-
1103- global all_particles
1104- all_particles.append(self)
1105-
1106- self.propagating = propagating
1107- self.goldstoneboson= goldstoneboson
1108-
1109- self.selfconjugate = (name == antiname)
1110-
1111- def anti(self):
1112- if self.selfconjugate:
1113- raise Exception('%s has no anti particle.' % self.name)
1114- outdic = {}
1115- for k,v in self.__dict__.iteritems():
1116- if k not in self.require_args_all:
1117- outdic[k] = -v
1118- if self.color in [1,8]:
1119- newcolor = self.color
1120- else:
1121- newcolor = -self.color
1122-
1123- return Particle(-self.pdg_code, self.antiname, self.name, self.spin, newcolor, self.mass, self.width,
1124- self.antitexname, self.texname, self.line, -self.charge, self.propagating, self.goldstoneboson, **outdic)
1125-
1126-
1127-
1128-all_parameters = []
1129-
1130-class Parameter(FRBaseClass):
1131-
1132- require_args=['name', 'nature', 'type', 'value', 'texname']
1133-
1134- def __init__(self, name, nature, type, value, texname, lhablock=None, lhacode=None):
1135-
1136- args = (name,nature,type,value,texname)
1137-
1138- FRBaseClass.__init__(self, *args)
1139-
1140- args=(name,nature,type,value,texname)
1141-
1142- global all_parameters
1143- all_parameters.append(self)
1144-
1145- if (lhablock is None or lhacode is None) and nature == 'external':
1146- raise Exception('Need LHA information for external parameter "%s".' % name)
1147- self.lhablock = lhablock
1148- self.lhacode = lhacode
1149-
1150-all_vertices = []
1151-
1152-class Vertex(FRBaseClass):
1153-
1154- require_args=['name', 'particles', 'color', 'lorentz', 'couplings']
1155-
1156- def __init__(self, name, particles, color, lorentz, couplings, **opt):
1157-
1158- args = (name, particles, color, lorentz, couplings)
1159-
1160- FRBaseClass.__init__(self, *args, **opt)
1161-
1162- args=(particles,color,lorentz,couplings)
1163-
1164- global all_vertices
1165- all_vertices.append(self)
1166-
1167-all_couplings = []
1168-
1169-class Coupling(FRBaseClass):
1170-
1171- require_args=['name', 'value', 'order']
1172-
1173- def __init__(self, name, value, order, **opt):
1174-
1175- args =(name, value, order)
1176- FRBaseClass.__init__(self, *args, **opt)
1177- global all_couplings
1178- all_couplings.append(self)
1179-
1180-
1181-
1182-all_lorentz = []
1183-
1184-class Lorentz(FRBaseClass):
1185-
1186- require_args=['name','spins','structure']
1187-
1188- def __init__(self, name, spins, structure, **opt):
1189- args = (name, spins, structure)
1190- FRBaseClass.__init__(self, *args, **opt)
1191-
1192- global all_lorentz
1193- all_lorentz.append(self)
1194-
1195-
1196-all_functions = []
1197-
1198-class Function(object):
1199-
1200- def __init__(self, name, arguments, expression):
1201-
1202- global all_functions
1203- all_functions.append(self)
1204-
1205- self.name = name
1206- self.arguments = arguments
1207- self.expr = expression
1208-
1209- def __call__(self, *opt):
1210-
1211- for i, arg in enumerate(self.arguments):
1212- exec('%s = %s' % (arg, opt[i] ))
1213-
1214- return eval(self.expr)
1215-
1216-
1217-
1218
1219=== modified file 'models/sm/particles.py'
1220--- models/sm/particles.py 2010-09-01 04:20:15 +0000
1221+++ models/sm/particles.py 2011-02-25 13:52:35 +0000
1222@@ -15,8 +15,7 @@
1223 width = 'ZERO',
1224 texname = 've',
1225 antitexname = 've',
1226- line = 'straight',
1227- charge = 0,
1228+ charge = 0,
1229 LeptonNumber = 1,
1230 GhostNumber = 0)
1231
1232@@ -31,8 +30,7 @@
1233 width = 'ZERO',
1234 texname = 'vm',
1235 antitexname = 'vm',
1236- line = 'straight',
1237- charge = 0,
1238+ charge = 0,
1239 LeptonNumber = 1,
1240 GhostNumber = 0)
1241
1242@@ -47,8 +45,7 @@
1243 width = 'ZERO',
1244 texname = 'vt',
1245 antitexname = 'vt',
1246- line = 'straight',
1247- charge = 0,
1248+ charge = 0,
1249 LeptonNumber = 1,
1250 GhostNumber = 0)
1251
1252@@ -63,8 +60,7 @@
1253 width = 'ZERO',
1254 texname = 'e-',
1255 antitexname = 'e-',
1256- line = 'straight',
1257- charge = -1,
1258+ charge = -1,
1259 LeptonNumber = 1,
1260 GhostNumber = 0)
1261
1262@@ -79,8 +75,7 @@
1263 width = 'ZERO',
1264 texname = 'm-',
1265 antitexname = 'm-',
1266- line = 'straight',
1267- charge = -1,
1268+ charge = -1,
1269 LeptonNumber = 1,
1270 GhostNumber = 0)
1271
1272@@ -95,8 +90,7 @@
1273 width = 'ZERO',
1274 texname = 'tt-',
1275 antitexname = 'tt-',
1276- line = 'straight',
1277- charge = -1,
1278+ charge = -1,
1279 LeptonNumber = 1,
1280 GhostNumber = 0)
1281
1282@@ -111,7 +105,6 @@
1283 width = 'ZERO',
1284 texname = 'u',
1285 antitexname = 'u',
1286- line = 'straight',
1287 charge = 2/3,
1288 LeptonNumber = 0,
1289 GhostNumber = 0)
1290@@ -127,7 +120,6 @@
1291 width = 'ZERO',
1292 texname = 'c',
1293 antitexname = 'c',
1294- line = 'straight',
1295 charge = 2/3,
1296 LeptonNumber = 0,
1297 GhostNumber = 0)
1298@@ -143,7 +135,6 @@
1299 width = 'WT',
1300 texname = 't',
1301 antitexname = 't',
1302- line = 'straight',
1303 charge = 2/3,
1304 LeptonNumber = 0,
1305 GhostNumber = 0)
1306@@ -159,7 +150,6 @@
1307 width = 'ZERO',
1308 texname = 'd',
1309 antitexname = 'd',
1310- line = 'straight',
1311 charge = -1/3,
1312 LeptonNumber = 0,
1313 GhostNumber = 0)
1314@@ -175,7 +165,6 @@
1315 width = 'ZERO',
1316 texname = 's',
1317 antitexname = 's',
1318- line = 'straight',
1319 charge = -1/3,
1320 LeptonNumber = 0,
1321 GhostNumber = 0)
1322@@ -191,7 +180,6 @@
1323 width = 'ZERO',
1324 texname = 'b',
1325 antitexname = 'b',
1326- line = 'straight',
1327 charge = -1/3,
1328 LeptonNumber = 0,
1329 GhostNumber = 0)
1330@@ -207,8 +195,7 @@
1331 width = 'WghA',
1332 texname = 'ghA',
1333 antitexname = 'ghA',
1334- line = 'dotted',
1335- charge = 0,
1336+ charge = 0,
1337 LeptonNumber = 0,
1338 GhostNumber = 1)
1339
1340@@ -223,8 +210,7 @@
1341 width = 'WghZ',
1342 texname = 'ghZ',
1343 antitexname = 'ghZ',
1344- line = 'dotted',
1345- charge = 0,
1346+ charge = 0,
1347 LeptonNumber = 0,
1348 GhostNumber = 1)
1349
1350@@ -239,8 +225,7 @@
1351 width = 'WghWp',
1352 texname = 'ghWp',
1353 antitexname = 'ghWp',
1354- line = 'dotted',
1355- charge = 1,
1356+ charge = 1,
1357 LeptonNumber = 0,
1358 GhostNumber = 1)
1359
1360@@ -255,8 +240,7 @@
1361 width = 'WghWm',
1362 texname = 'ghWm',
1363 antitexname = 'ghWm',
1364- line = 'dotted',
1365- charge = -1,
1366+ charge = -1,
1367 LeptonNumber = 0,
1368 GhostNumber = 1)
1369
1370@@ -271,8 +255,7 @@
1371 width = 'WghG',
1372 texname = 'ghG',
1373 antitexname = 'ghG',
1374- line = 'dotted',
1375- charge = 0,
1376+ charge = 0,
1377 LeptonNumber = 0,
1378 GhostNumber = 1)
1379
1380@@ -287,7 +270,6 @@
1381 width = 'ZERO',
1382 texname = 'A',
1383 antitexname = 'A',
1384- line = 'wavy',
1385 charge = 0,
1386 LeptonNumber = 0,
1387 GhostNumber = 0)
1388@@ -301,7 +283,6 @@
1389 width = 'WZ',
1390 texname = 'Z',
1391 antitexname = 'Z',
1392- line = 'wavy',
1393 charge = 0,
1394 LeptonNumber = 0,
1395 GhostNumber = 0)
1396@@ -315,8 +296,7 @@
1397 width = 'WW',
1398 texname = 'W+',
1399 antitexname = 'W+',
1400- line = 'wavy',
1401- charge = 1,
1402+ charge = 1,
1403 LeptonNumber = 0,
1404 GhostNumber = 0)
1405
1406@@ -331,7 +311,6 @@
1407 width = 'ZERO',
1408 texname = 'G',
1409 antitexname = 'G',
1410- line = 'curly',
1411 charge = 0,
1412 LeptonNumber = 0,
1413 GhostNumber = 0)
1414@@ -345,7 +324,6 @@
1415 width = 'WH',
1416 texname = '\\phi',
1417 antitexname = '\\phi',
1418- line = 'dashed',
1419 charge = 0,
1420 LeptonNumber = 0,
1421 GhostNumber = 0)
1422@@ -359,8 +337,7 @@
1423 width = 'Wphi',
1424 texname = 'phi0',
1425 antitexname = 'phi0',
1426- line = 'dashed',
1427- GoldstoneBoson = True,
1428+ GoldstoneBoson = True,
1429 charge = 0,
1430 LeptonNumber = 0,
1431 GhostNumber = 0)
1432@@ -374,8 +351,7 @@
1433 width = 'Wphi2',
1434 texname = '\\phi^+',
1435 antitexname = '\\phi^+',
1436- line = 'dashed',
1437- GoldstoneBoson = True,
1438+ GoldstoneBoson = True,
1439 charge = 1,
1440 LeptonNumber = 0,
1441 GhostNumber = 0)

Subscribers

People subscribed via source and target branches