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

Proposed by Olivier Mattelaer
Status: Merged
Merge reported by: Olivier Mattelaer
Merged at revision: not available
Proposed branch: lp:~maddevelopers/mg5amcnlo/flip_particle_antiparticle
Merge into: lp:~madteam/mg5amcnlo/trunk
Diff against target: 52 lines (+24/-3)
1 file modified
models/import_ufo.py (+24/-3)
To merge this branch: bzr merge lp:~maddevelopers/mg5amcnlo/flip_particle_antiparticle
Reviewer Review Type Date Requested Status
Johan Alwall (community) Approve
Review via email: mp+92608@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Johan Alwall (johan-alwall) wrote :

Hello Olivier,

Excellent. This is indeed a very nice solution. The only problem is of course if there are different orderings between different interactions, but let's take that if and when it happens.

Cheers,
Johan

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

Yes sure,

but at least the model will fail to be imported.
So this is not too bad.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'models/import_ufo.py'
2--- models/import_ufo.py 2012-02-06 19:57:04 +0000
3+++ models/import_ufo.py 2012-02-11 06:16:19 +0000
4@@ -218,6 +218,9 @@
5 [p.antiname.lower() for p in self.ufomodel.all_particles])):
6 self.use_lower_part_names = True
7
8+ # check which of the fermion/anti-fermion should be set as incoming
9+ self.detect_incoming_fermion()
10+
11 for particle_info in self.ufomodel.all_particles:
12 self.add_particle(particle_info)
13
14@@ -268,9 +271,10 @@
15
16 # MG5 have only one entry for particle and anti particles.
17 #UFO has two. use the color to avoid duplictions
18- if particle_info.pdg_code < 0:
19+ pdg = particle_info.pdg_code
20+ if pdg in self.incoming or (pdg not in self.outcoming and pdg <0):
21 return
22-
23+
24 # MG5 doesn't use ghost (use unitary gauges)
25 if particle_info.spin < 0:
26 return
27@@ -369,7 +373,24 @@
28 output[anticolor.pdg_code] = -3
29
30 return output
31-
32+
33+ def detect_incoming_fermion(self):
34+ """define which fermion should be incoming
35+ for that we look at F F~ X interactions
36+ """
37+ self.incoming = []
38+ self.outcoming = []
39+ for interaction_info in self.ufomodel.all_vertices:
40+ # check if the interation meet requirements:
41+ pdg = [p.pdg_code for p in interaction_info.particles if p.spin==2]
42+ for i in range(0, len(pdg),2):
43+ if pdg[i] == - pdg[i+1]:
44+ if pdg[i] in self.outcoming:
45+ raise UFOImportError, 'Input output not coherent'
46+ elif not pdg[i] in self.incoming:
47+ self.incoming.append(pdg[i])
48+ self.outcoming.append(pdg[i+1])
49+
50
51 def add_interaction(self, interaction_info, color_info):
52 """add an interaction in the MG5 model. interaction_info is the

Subscribers

People subscribed via source and target branches