4
#---------------------------------------------------------------------
5
# Run GS to create jpeg files defined as $gs
6
#---------------------------------------------------------------------
7
system("/bin/bash -c \"rm -f matrix*.jpg\" ");
8
system "/bin/bash -c \"nice gs \-sDEVICE\=jpeg \-sOutputFile\=matrix\%00d.jpg \-q \-dNOPAUSE \-dBATCH matrix.ps\" ";
10
#--------------------------------------------------------------------------------
11
# not sure how many jpegs produced so we need to loop
12
# file still in cgi directory at this point
13
#--------------------------------------------------------------------------------
16
while(-e "matrix$i.jpg" && $i < $max_jpg){
23
open(PAGE,"> diagrams.html") || die "Error creating diagrams.html";
24
print PAGE "\<HTML\> \n";
25
print PAGE "\<HEAD\> \n";
26
print PAGE "\<TITLE\>Feynman Diagrams \<\/TITLE\> \n";
27
print PAGE "\<\/HEAD\> \n";
28
print PAGE "\<BODY\> \n";
29
# print PAGE "\<H1 id=\"TOP\" \>MadGraph ll\<\/H1\> \n";
31
# print PAGE "<P>\<A HREF\=\"results.html\"\> Results \<\/A\> \<BR\> \n";
32
print PAGE "<P>\<A HREF\=\"matrix.ps\"\> Postscript Diagrams \<\/A\> \<BR\> \n";
33
# print PAGE "\<H2\>Diagrams: \<\/H2/> \n";
34
for($j=1;$j<$pages+1;$j++){
35
# print PAGE "\<P>\<A NAME=\"matrix$j\" \> \<B\>Page $j of $pages \<\/B\> \<BR\> \n";
36
# print PAGE "\<A HREF=\"\#TOP\" onMouseOver=\"window\.status=\'Back to top of page\'\; return true\" onMouseOut=\"window.status=\' \'\; return true\" \>back to top of page<\/A\> \<BR\> \n";
37
print PAGE "\<IMG SRC=\"matrix$j.jpg\" ALT=\"Page $j of $pages \" \> \<BR\> \n";
40
# In case I didn't include all of the diagrams as jpeg, warn user
42
if (-e "matrix$max_jpg.jpg" ) {
43
print PAGE "<P> <H3> To save bandwidth not all diagrams were converted to jpeg.";
44
print PAGE "<P> To view all diagrams click on ";
45
print PAGE "\<A HREF\=\"matrix.ps\"\> postscript. \<\/A\> \<BR\> \n";
46
print PAGE "\<\/H3\> \n";
48
# Delete files which aren't included in diagrams.html
51
while(-e "matrix$i.jpg"){
52
# print "Deleting matrix$i.jpg";
53
system ("/bin/bash -c \"rm -f matrix$i.jpg\" ");
59
print PAGE "\<\/BODY\> \n";
60
print PAGE "\<\/HTML\> \n";
63
# Now create jpeg file for card
65
system ("/bin/bash -c \"head -339 matrix.ps >& junk.ps\" ");
66
open(PAGE,">> junk.ps") || die "Error opening junk.ps";
68
print PAGE "-20 -390 translate \n";
69
print PAGE "0.7 0.7 scale \n";
72
system ("/bin/bash -c \"cat matrix.ps | sed 1,339d >> junk.ps\" ");
74
system "/bin/bash -c \"nice gs \-sDEVICE\=jpeg \-sOutputFile\=card.jpg \-q \-dNOPAUSE \-dBATCH \-g180x150 junk.ps; rm -f junk.ps; cp -p card.jpg ../../card.jpg\" ";