~maddevelopers/mg5amcnlo/APPLGRID_PS

« back to all changes in this revision

Viewing changes to madgraph/loop/loop_exporters.py

  • Committer: Rikkert Frederix
  • Date: 2015-07-14 17:26:37 UTC
  • mfrom: (253.2.171 2.3.1)
  • Revision ID: frederix@physik.uzh.ch-20150714172637-wkm4ij19rnlv7yv8
merge with latest public version

Show diffs side-by-side

added added

removed removed

Lines of Context:
1250
1250
              'HELPICKED_BU=HELPICKED','HELPICKED=H','MP_DONE=.FALSE.',
1251
1251
              'IF(SKIPLOOPEVAL) THEN','GOTO 1227','ENDIF'])
1252
1252
            replace_dict['loop_induced_finalize'] = \
1253
 
            ("""HELPICKED=HELPICKED_BU
1254
 
               DO I=NCTAMPS+1,NLOOPAMPS
 
1253
            ("""DO I=NCTAMPS+1,NLOOPAMPS
1255
1254
               IF((CTMODERUN.NE.-1).AND..NOT.CHECKPHASE.AND.(.NOT.S(I))) THEN
1256
1255
                 WRITE(*,*) '##W03 WARNING Contribution ',I
1257
1256
                 WRITE(*,*) ' is unstable for helicity ',H
1263
1262
C                  WRITE(*,*) 'double pole contribution    = ',AMPL(3,I)
1264
1263
C                ENDIF
1265
1264
               ENDDO
1266
 
               1227 CONTINUE""")%replace_dict
 
1265
               1227 CONTINUE
 
1266
               HELPICKED=HELPICKED_BU""")%replace_dict
1267
1267
            replace_dict['loop_helas_calls']=""
1268
1268
            replace_dict['nctamps_or_nloopamps']='nloopamps'
1269
1269
            replace_dict['nbornamps_or_nloopamps']='nloopamps'
2634
2634
            raise writers.FortranWriter.FortranWriterError(\
2635
2635
                "writer not FortranWriter")
2636
2636
        
 
2637
        # We must refresh the general replacement dictionary since this function
 
2638
        # write_matrix_element is called from within the function
 
2639
        # export_v4.ProcessExporterFortranMEGroup.generate_subprocess_directory_v4
 
2640
        # which of course does not take care of refreshing this replacement
 
2641
        # dictionary for each new matrix_element in the group currently being
 
2642
        # exported
 
2643
        self.general_replace_dict = self.generate_general_replace_dict(
 
2644
               matrix_element, group_number = subproc_number, proc_id = proc_id)
 
2645
        if matrix_element.get('loop_color_basis'):
 
2646
            self.general_replace_dict['nLoopFlows'] = len(matrix_element.get(
 
2647
                                                            'loop_color_basis'))
 
2648
        else:
 
2649
            raise MadGraph5Error('The loop-induced function '+\
 
2650
              'write_matrix_element_v4 must be called *after* the color algebra'+\
 
2651
              ' for this matrix element has been performed, i.e. typically in'+\
 
2652
              ' function write_loop_matrix_element_v4 called by the function'+\
 
2653
              ' generate_loop_subprocess.')
 
2654
            
2637
2655
        replace_dict = copy.copy(self.general_replace_dict)
2638
2656
        
2639
2657
        # Extract version number and date from VERSION file
2693
2711
        
2694
2712
        n_tot_diags = len(matrix_element.get_loop_diagrams())
2695
2713
        replace_dict['n_tot_diags'] = n_tot_diags
2696
 
        
 
2714
 
2697
2715
        file = open(pjoin(_file_path, \
2698
2716
                          'iolibs/template_files/%s' % self.matrix_file)).read()
2699
2717
        file = file % replace_dict
2765
2783
        including the necessary matrix_N.f files, configs.inc and various
2766
2784
        other helper files"""
2767
2785
            
2768
 
        # Then generate the MadLoop files
 
2786
        # Generate the MadLoop files
2769
2787
        calls = 0
2770
2788
        matrix_elements = subproc_group.get('matrix_elements')
2771
2789
        for ime, matrix_element in enumerate(matrix_elements):
2774
2792
#          group_number = str(subproc_group.get('number')), proc_id = str(ime+1),
2775
2793
          config_map = subproc_group.get('diagram_maps')[ime])
2776
2794
        
2777
 
        # First generate the MadEvent files
 
2795
        # Then generate the MadEvent files
2778
2796
        export_v4.ProcessExporterFortranMEGroup.generate_subprocess_directory_v4(
2779
2797
                                 self, subproc_group,fortran_model,group_number)
2780
2798