~maddevelopers/mg5amcnlo/2.9.4

« back to all changes in this revision

Viewing changes to aloha/WriteHelas.py

working version of creating the model. and start of instalation of the aloha

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
import madgraph.iolibs.export_v4 as FortranWriter 
2
 
import helas.helasamp_object as Helas
3
 
import helas.helasamp_lib as Helas_Lib
 
1
try:
 
2
    import madgraph.iolibs.export_v4 as FortranWriter 
 
3
except:
 
4
    import aloha.Writter as FortranWriter
 
5
import aloha.helasamp_object as Helas
 
6
import aloha.helasamp_lib as Helas_Lib
4
7
import re 
5
8
from numbers import Number
6
9
class WriteHelas: 
120
123
        MomentumConserve = []
121
124
        DeclareDict = {'F':'double complex f', 'V':'double complex V', \
122
125
                                'S':'double complex s', 'T':'double complex T'}
123
 
        FermionNumber = 0
124
 
        VectorNumber =0
125
 
        ScalarNumber = 0
126
 
        TensorNumber = 0
 
126
        FermionNumber = 0
 
127
        VectorNumber =0
 
128
        ScalarNumber = 0
 
129
        TensorNumber = 0
127
130
        OnShell = 1 
128
131
        Counter = 0
129
132
        OffShellParticle = 999
145
148
            elif elem[0] == 'V':
146
149
                DeclareList.append('%s%d(6)' % (DeclareDict[elem[0]], index + 1))  
147
150
                VectorList.append('%s%d' % ('V', index + 1))
148
 
                VectorNumber +=1 
 
151
                VectorNumber +=1 
149
152
            elif elem[0] == 'F':
150
153
                DeclareList.append('%s%d(6)' % (DeclareDict[elem[0]], index + 1))  
151
154
                FermiList.append('%s%d' % ('F', index + 1))  
152
 
                FermionNumber +=1 
 
155
                FermionNumber +=1 
153
156
            # Define the Calllist
154
157
            if elem[1]:
155
158
                CallList.append('%s%d' % (elem[0], index + 1))
166
169
            else: 
167
170
                MomentumConserve.append('+F%d' % (index + 1))
168
171
                Counter += 1
169
 
            # Reorder calllist cyclically. 
170
 
        if not OnShell:
171
 
            PermList = []
 
172
        # Reorder calllist cyclically. 
 
173
        if not OnShell:
 
174
            PermList = []
172
175
            if OffShellParticle< FermionNumber:
173
176
                for i in range(FermionNumber):
174
177
                    PermList.append(OffShellParticle+i-FermionNumber+1) 
175
178
                FermiList = [FermiList[i] for i in PermList] 
176
 
                FermiList.pop()
 
179
                FermiList.pop()
177
180
            elif OffShellParticle< (FermionNumber+VectorNumber):
178
181
                for i in range(len(VectorList)):
179
182
                    Shift = FermionNumber+VectorNumber-1-OffShellParticle
186
189
                    PermList.append(i-Shift) 
187
190
                ScalarList = [ScalarList[i] for i in PermList] 
188
191
                ScalarList.pop()
189
 
            elif OffShellParticle< (FermiNumber+VectorNumber+ScalarNumber):
 
192
            elif OffShellParticle< (FermionNumber+VectorNumber+ScalarNumber):
190
193
                for i in range(len(VectorList)):
191
194
                    Shift = len(self.particles)-1-OffShellParticle
192
195
                    PermList.append(i-Shift)