~maddevelopers/mg5amcnlo/3.0.2-alpha0

« back to all changes in this revision

Viewing changes to Template/bin/gen_infohtml-pl

Added Template and HELAS into bzr

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/perl -w
 
2
&writeHtmlProcessPage;
 
3
 
 
4
 
 
5
sub writeHtmlProcessPage {
 
6
  my($interaction, $qcdOrder, $qedOrder);
 
7
  #
 
8
  #    Make sure we are in the main directory, not bin
 
9
  #
 
10
  if (-d "bin") {
 
11
    #      print "We are in main directory \n";
 
12
  } else {
 
13
    #      print "Not in correct directory \n";
 
14
    chdir("../");
 
15
    if (-d "bin") {
 
16
      #   print "We are in main directory \n";
 
17
    } else {
 
18
      print "Error gen_infohtml-pl must be run from main or bin directory \n";
 
19
      exit;
 
20
    }     
 
21
  }  
 
22
  #
 
23
  #     Writes out html page index.html with links to results
 
24
  #     and code.
 
25
  #
 
26
  my $totdiag=0;
 
27
  $htfile =  "HTML/info" . "\.html"; #name the file
 
28
  open(PAGE,"> $htfile");
 
29
  print PAGE "\<HTML\> \n";
 
30
  print PAGE "\<HEAD\> \n";
 
31
  print PAGE "\<TITLE\>  \<\/TITLE\> \n";
 
32
  if (! -e "SubProcesses/done") {
 
33
    print PAGE "<META HTTP-EQUIV=\"REFRESH\" CONTENT=\"30\" > \n";
 
34
  }
 
35
  print PAGE "<META HTTP-EQUIV=\"EXPIRES\" CONTENT=\"20\" >";
 
36
  print PAGE "\<\/HEAD\> \n";
 
37
  print PAGE "\<BODY\> \n";
 
38
  if (-e "SubProcesses/subproc.mg") {
 
39
    chdir("./SubProcesses");
 
40
 
 
41
      print PAGE "<P> <H2 ALIGN=CENTER> SubProcesses and Feynman diagrams <\/H2>";
 
42
    print PAGE "<TABLE BORDER=2 ALIGN=CENTER> \n";      
 
43
    print PAGE "<TR>";  
 
44
    print PAGE "<TH>Directory</TH> <TH NOWRAP># Diagrams </TH><TH NOWRAP># Subprocesses </TH> \n";
 
45
    print PAGE "<TH COLSPAN=2>FEYNMAN DIAGRAMS</TH> <TH COLSPAN=4> SUBPROCESS </TH></TR> \n";
 
46
    print PAGE "</TR>"; 
 
47
    my($line);
 
48
    my($proc);
 
49
    my($after);
 
50
    my($before);
 
51
    $line= "Failed";
 
52
    if (open FILE, "subproc.mg") {
 
53
      while ($line = <FILE>) {
 
54
        chomp $line;
 
55
        print PAGE "<TR> <TD> $line </TD> \n";
 
56
        if (open FILE2, "$line/matrix.f") {
 
57
          @lines = <FILE2>;
 
58
          @tlines = grep /NGRAPHS=/, @lines;
 
59
          foreach $one (@tlines) {
 
60
            ($before,$after) = split /=/,$one;
 
61
            ($before,$one) = split /,/,$after;
 
62
            print PAGE "<TD> $before </TD> \n";
 
63
            $totdiag+=$before;
 
64
            close(FILE2);
 
65
          }
 
66
                      
 
67
          if (open FILE2, "$line/auto_dsig.f") {
 
68
            @lines = <FILE2>;
 
69
            $nlines = grep /IPROC=IPROC/, @lines;
 
70
            print PAGE "<TD> $nlines </TD> \n";
 
71
          }
 
72
                      
 
73
                      
 
74
          print PAGE "<TD> \<A HREF=\"../SubProcesses/$line/diagrams.html\" \> html \<\/A\> </TD> \n";
 
75
          print PAGE "<TD> \<A HREF=\"../SubProcesses/$line/matrix.ps\" \> postscript \<\/A\> </TD> \n";
 
76
                      
 
77
          if (open FILE2, "$line/auto_dsig.f") {
 
78
            @lines = <FILE2>;
 
79
            @tlines = grep /IPROC=IPROC/, @lines;              
 
80
            foreach $one (@tlines) {
 
81
              ($before,$after) = split /!/,$one;
 
82
              #            print "$after \n ";
 
83
              print PAGE "<TD NOWRAP> $after </TD> \n ";
 
84
            }
 
85
            print PAGE "</TR>";
 
86
            close(FILE2);
 
87
          }
 
88
        }
 
89
      }
 
90
      print PAGE "</TABLE>";
 
91
      close FILE;
 
92
      #       close(IDENT);      
 
93
    }
 
94
    print PAGE "\<BR\> \n";
 
95
    chdir("../"); 
 
96
  } else {
 
97
    print PAGE "<H2> No diagrams were generated <\/H2> <BR> \n";
 
98
    print PAGE "Check process text and number of couplings. Also look at the log file";
 
99
    print PAGE "<BR> \n";
 
100
  }
 
101
  
 
102
  print PAGE "<CENTER> $totdiag diagrams have been generated.</CENTER>";
 
103
  open(NUMDIAG,"> ./numdiag");
 
104
  print NUMDIAG $totdiag;
 
105
  close(NUMDIAG);
 
106
 
 
107
  print PAGE "<TABLE ALIGN=CENTER>";
 
108
  
 
109
  print PAGE "<TR> <TD ALIGN=CENTER> <A HREF\=\"../proc_log.txt\"\>proc_log.txt<\/A\> <TD> Log file from MadGraph code generation. ";  
 
110
  if (-e "SubProcesses/procdef_mg5.dat") {
 
111
    print PAGE "<TR> <TD ALIGN=CENTER> <A HREF\=\"../Cards/proc_card_mg5.dat\"\>proc_card_mg5.dat\<\/A\> <TD> Input file used for code generation.";
 
112
  } else {
 
113
    print PAGE "<TR> <TD ALIGN=CENTER> <A HREF\=\"../Cards/proc_card.dat\"\>proc_card.dat\<\/A\> <TD> Input file used for code generation.";
 
114
  }
 
115
  print PAGE "<TR> <TD ALIGN=CENTER> <A HREF\=\"../Source/MODEL/particles.dat\"\>particles.dat\<\/A\> <TD> Particles file used for code generation.";
 
116
  print PAGE "<TR> <TD ALIGN=CENTER> <A HREF\=\"../Source/MODEL/interactions.dat\"\>interactions.dat\<\/A\> <TD> Interactions file used for code generation.";
 
117
  print PAGE "</TABLE>";
 
118
  print PAGE "\<P><H3 align=center>\<A HREF\=\"../index.html\"\> Main Page \<\/A\>";
 
119
  print PAGE "\<\/BODY\> \n";
 
120
  print PAGE "\<\/HTML\> \n";
 
121
  close(PAGE);
 
122
}                               #end sub writeHtmlProcessPage