~madteam/mg5amcnlo/series2.0

« back to all changes in this revision

Viewing changes to madgraph/iolibs/export_v4.py

  • Committer: olivier-mattelaer
  • Date: 2019-09-26 11:09:58 UTC
  • mfrom: (282.1.19 2.6.7)
  • mto: (283.1.18 2.7.0)
  • mto: This revision was merged to the branch mainline in revision 284.
  • Revision ID: olivier-mattelaer-20190926110958-38wrjh8hemq9zibw
merge with 2.6.7 + change L meaning for spin1 

Show diffs side-by-side

added added

removed removed

Lines of Context:
3840
3840
        # indicate that the output type is not grouped
3841
3841
        if  not isinstance(self, ProcessExporterFortranMEGroup):
3842
3842
            self.proc_characteristic['grouped_matrix'] = False
 
3843
        
3843
3844
        self.proc_characteristic['complex_mass_scheme'] = mg5options['complex_mass_scheme']
 
3845
 
 
3846
        # set limitation linked to the model
 
3847
    
 
3848
        
3844
3849
        # indicate the PDG of all initial particle
3845
3850
        try:
3846
3851
            pdgs1 = [p.get_initial_pdg(1) for me in matrix_elements for m in me.get('matrix_elements') for p in m.get('processes') if p.get_initial_pdg(1)]
3971
3976
            # Set lowercase/uppercase Fortran code
3972
3977
            writers.FortranWriter.downcase = False
3973
3978
 
 
3979
        # check if MLM/.../ is supported for this matrix-element and update associate flag
 
3980
        if self.model and 'MLM' in self.model["limitations"]:
 
3981
            if 'MLM' not in self.proc_characteristic["limitations"]:
 
3982
                used_couplings = matrix_element.get_used_couplings(output="set") 
 
3983
                for vertex in self.model.get('interactions'):
 
3984
                    particles = [p for p in vertex.get('particles')]
 
3985
                    if 21 in [p.get('pdg_code') for p in particles]:
 
3986
                        colors = [par.get('color') for par in particles]
 
3987
                        if 1 in colors:
 
3988
                            continue
 
3989
                        elif 'QCD' not in vertex.get('orders'):
 
3990
                            for bad_coup in vertex.get('couplings').values():
 
3991
                                if bad_coup in used_couplings:
 
3992
                                    self.proc_characteristic["limitations"].append('MLM')
 
3993
                                    break
 
3994
 
3974
3995
        # The proc prefix is not used for MadEvent output so it can safely be set
3975
3996
        # to an empty string.
3976
3997
        replace_dict = {'proc_prefix':''}
4103
4124
        replace_dict['ampsplitorders']='\n'.join(amp_so)
4104
4125
        replace_dict['sqsplitorders']='\n'.join(sqamp_so)
4105
4126
        
4106
 
        
 
4127
 
4107
4128
        # Extract JAMP lines
4108
4129
        # If no split_orders then artificiall add one entry called 'ALL_ORDERS'
4109
4130
        jamp_lines = self.get_JAMP_lines_split_order(\
5125
5146
 
5126
5147
        filename = 'symfact_orig.dat'
5127
5148
        self.write_symfact_file(open(filename, 'w'), symmetry)
 
5149
        
 
5150
        # check consistency
 
5151
        for i, sym_fact in enumerate(symmetry):
 
5152
            if sym_fact > 0:
 
5153
                continue
 
5154
            if nqcd_list[i] != nqcd_list[abs(sym_fact)-1]:
 
5155
                misc.sprint(i, sym_fact, nqcd_list[i], nqcd_list[abs(sym_fact)])
 
5156
                raise Exception, "identical diagram with different QCD powwer" 
 
5157
                                      
 
5158
        
5128
5159
 
5129
5160
        filename = 'symperms.inc'
5130
5161
        self.write_symperms_file(writers.FortranWriter(filename),