Merge lp:~maddevelopers/mg5amcnlo/2.3.4_fix_bug_madspin into lp:~maddevelopers/mg5amcnlo/2.3.4

Proposed by Pierre Artoisenet
Status: Merged
Merged at revision: 300
Proposed branch: lp:~maddevelopers/mg5amcnlo/2.3.4_fix_bug_madspin
Merge into: lp:~maddevelopers/mg5amcnlo/2.3.4
Diff against target: 64 lines (+25/-14)
1 file modified
MadSpin/decay.py (+25/-14)
To merge this branch: bzr merge lp:~maddevelopers/mg5amcnlo/2.3.4_fix_bug_madspin
Reviewer Review Type Date Requested Status
Olivier Mattelaer Pending
Review via email: mp+276424@code.launchpad.net

Description of the change

Hi Olivier,

this is a fix to a madspin bug reported by Sebastien Wertz.
If 2.3.4 is not the correct branch to push the fix,
just let me know where the fix should be made

Cheers,

Pierre

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 'MadSpin/decay.py'
2--- MadSpin/decay.py 2015-08-26 23:03:01 +0000
3+++ MadSpin/decay.py 2015-11-02 17:08:08 +0000
4@@ -1749,7 +1749,7 @@
5
6 return finalfound
7
8-
9+
10 def reorder_branch(self,branch):
11 """ branch is a string with the definition of a decay chain
12 If branch contains " A > B C , B > ... "
13@@ -1764,19 +1764,31 @@
14 if list_branch[index]==' ' or list_branch[index]=='': del list_branch[index]
15 #print list_branch
16 for index, item in enumerate(list_branch):
17- if item =="," and list_branch[index+1]!="(":
18- if list_branch[index-2]==list_branch[index+1]:
19- # swap the two particles before the comma:
20- temp=list_branch[index-2]
21- list_branch[index-2]=list_branch[index-1]
22- list_branch[index-1]=temp
23- if item =="," and list_branch[index+1]=="(":
24- if list_branch[index-2]==list_branch[index+2]:
25- # swap the two particles before the comma:
26- temp=list_branch[index-2]
27- list_branch[index-2]=list_branch[index-1]
28- list_branch[index-1]=temp
29
30+ if item[-1] =="," and list_branch[index+1]!="(":
31+ # search pos of B and C
32+ counter=1
33+ while 1:
34+ if list_branch[index-counter].find("=")<0:
35+ break
36+ counter+=1
37+ if list_branch[index-counter-1]==list_branch[index+1]:
38+ # swap the two particles before the comma:
39+ temp=list_branch[index-counter-1]
40+ list_branch[index-counter-1]=list_branch[index-counter]
41+ list_branch[index-counter]=temp
42+ if item[-1] =="," and list_branch[index+1]=="(":
43+ # search pos of B and C
44+ counter=1
45+ while 1:
46+ if list_branch[index-counter].find("=")<0:
47+ break
48+ counter+=1
49+ if list_branch[index-counter -1]==list_branch[index+2]:
50+ # swap the two particles before the comma:
51+ temp=list_branch[index-counter-1]
52+ list_branch[index-counter-1]=list_branch[index-counter]
53+ list_branch[index-counter]=temp
54
55 new_branch=""
56 for item in list_branch:
57@@ -1784,7 +1796,6 @@
58
59 return new_branch, list_branch[0]
60
61-
62 def set_light_parton_massless(self,topo):
63 """ masses of light partons are set to zero for
64 the evaluation of the matrix elements

Subscribers

People subscribed via source and target branches

to all changes: