|
[HepData-svn] r1404 - pdf-cgiblackhole at projects.hepforge.org blackhole at projects.hepforge.orgWed Sep 22 16:17:11 BST 2010
Author: whalley Date: Wed Sep 22 16:17:11 2010 New Revision: 1404 Log: initial import Added: pdf-cgi/ pdf-cgi/pdfplot2qq.pl (contents, props changed) pdf-cgi/pdfplot_hessian.pl (contents, props changed) pdf-cgi/pdfplotall (contents, props changed) pdf-cgi/pdfplotallE (contents, props changed) Added: pdf-cgi/pdfplot2qq.pl ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ pdf-cgi/pdfplot2qq.pl Wed Sep 22 16:17:11 2010 (r1404) @@ -0,0 +1,217 @@ +#!/usr/bin/perl +use CGI qw(param header p); +print header('text/html'); +#print "<body bgcolor='#FFFFBB'>"; +print "<body>"; +print " <p/>"; + at types = qw(all up down upbar downbar strange charm bottom gluon); +$first = 1; +$xq = param("xq"); +if($xq == 1) { + $xmin = param("xmin"); + $xmax = param("xmax"); + $xinc= param("xinc"); + $scale= param("scale"); + $p2=$xmin; + $p3=$xmax; + $p4=$xinc; + $p5=$scale; +} +else{ + $q2min = param("q2min"); + $q2max = param("q2max"); + $q2inc = param("q2inc"); + $x= param("x"); + $p2=$q2min; + $p3=$q2max; + $p4=$q2inc; + $p5=$x; +} +$xbinning= param("xbinning"); +$ybinning= param("ybinning"); +$ymin = param("ymin"); +$ymax = param("ymax"); +$numplot = param("numplot"); +$lwidth = param("lwidth"); +foreach $num (1...4){ + $plot[$num] = param("plot$num"); + $typ[$num] = param("typ$num"); + $which[$num] = param("Which$num"); + if($which[$num] =~ m/\//){ ($which[$num],$member[$num]) = split /\//,$which[$num],2;} + else{ $member[$num] = 0; } + $sf[$num] = param("sf$num"); +} + +$ENV{'LD_LIBRARY_PATH'} = "/home/whalley/local/lib"; +$ENV{'LHAPATH'} = "/home/whalley/pdfsets"; + +foreach $times (1...4){ + if($plot[$times] eq on){ + foreach $i (0...8){ + if($typ[$times] eq $types[$i]) {$iqtype = $i;} + } + if($numplot eq num){ + print "<h2> Parton Distributions, xf(x), from $which[$times] </h2>"; + print "<xmp>"; + if($iqtype == 0){ + print " X Q**2 up down upbar downbar strange charm bottom gluon"; + } else{ + print " X Q**2 $typ[$times]"; + } + if($which[$times] =~ m/^MRS99/) { + chdir "/home/whalley/pdflib/mrs/mrs99"; + $temp = `echo "$which[$times] $member[$times] $p2 $p3 $p4 $p5 $xbinning $iqtype $xq" | ./mrs99.out`; + } + else{ + chdir "/home/whalley/pdflib/lhapdf"; + $temp = `echo "$which[$times] $member[$times] $p2 $p3 $p4 $p5 $xbinning $iqtype $xq" | ./pdf | ./noheader`; + } + print $temp; + print "</xmp>"; + } + else{ + if($iqtype == 0){ + system("/home/whalley/pdf-cgi/pdfplotall","$which[$times]","$p2","$p3","$p4","$p5","$xbinning","$ybinning","$ymin","$ymax","$numplot","$xq","$lwidth"); + exit(); + } + if($first == 1) { + $first = 0; + $tempdir = `/home/whalley/bin/mktmp`; + chomp $tempdir; + system("mkdir $tempdir"); + open KUMAC,">$tempdir/temp.kumac"; + print KUMAC "opt zfl1\n"; + print KUMAC "opt nbox\n"; + print KUMAC "opt ndat\n"; + print KUMAC "opt ngri\n"; + if($ybinning == 1){ print KUMAC "opt liny\n";} else { print KUMAC "opt logy\n";} + if($xbinning == 1){ + print KUMAC "opt linx\n"; + if($xq == 1){print KUMAC "null 0 1.0 $ymin $ymax\n";} + else {print KUMAC "null $q2min $q2max $ymin $ymax\n";} + } else { + print KUMAC "opt logx\n"; + if($xq == 1){print KUMAC "null $xmin $xmax $ymin $ymax\n";} + else{ print KUMAC "null $q2min $q2max $ymin $ymax\n";} + } + print KUMAC "set asize 0.4\n"; + if($xq == 1){ + print KUMAC "atitle 'x' 'xf(x,Q2)'\n"; + $npoint = `echo $xbinning $xmin $xmax $xinc | /home/whalley/bin/findbin`; + } else { + print KUMAC "atitle 'Q**2 (GeV**2)' 'xf(x,Q2)'\n"; + $npoint = `echo $xbinning $xmin $xmax $xinc | /home/whalley/bin/findbinq`; + } + $npoint++; + } + if($which[$times] =~ m/^MRS99/){ + chdir "/home/whalley/pdflib/mrs/mrs99"; + $temp = `echo "$which[$times] $member[$times] $p2 $p3 $p4 $p5 $xbinning $iqtype $xq" | ./mrs99.out >> $tempdir/temp.dat$times`; + } + else{ + chdir "/home/whalley/pdflib/lhapdf"; + $temp = `echo "$which[$times] $member[$times] $p2 $p3 $p4 $p5 $xbinning $iqtype $xq" | ./pdf | ./noheader >> $tempdir/temp.dat$times`; + } + + system("echo ' ' >> $tempdir/temp.dat$times"); + system("echo ' ' >> $tempdir/temp.dat$times"); + system("mv $tempdir/temp.dat$times $tempdir/temp.dat$times_temp"); + system("cat $tempdir/temp.dat$times_temp | grep -v WARNING > $tempdir/temp.dat$times"); + system("rm $tempdir/temp.dat$times_temp"); + print KUMAC "ve/cr q($npoint)\n"; + chdir $tempdir; + $times_temp = `echo $times | /home/whalley/bin/pdfmod`; + print KUMAC "$times_temp\n"; + if($xq == 1){ print KUMAC "ve/co v(1,1:$npoint) x\n";} + else { print KUMAC "ve/co v(2,1:$npoint) x\n";} + print KUMAC "ve/co v(3,1:$npoint) y\n"; + print KUMAC "sigma y=y*$sf[$times]\n"; + print KUMAC "igset plci $times\n"; + print KUMAC "igset lwid $lwidth\n"; + print KUMAC "igset ltyp $times\n"; + print KUMAC "graph $npoint x y c\n"; + print KUMAC "opt linx\n"; + print KUMAC "opt liny\n"; + print KUMAC "null 0 1 0 1 as\n"; + if($times == 1){ + print KUMAC "igset lwid 3\n"; + print KUMAC "fbox 0.04 0.15 0.92 0.97 0.035 0.155 0.915 0.975\n"; + print KUMAC "text 0.055 0.95 'HEPDATA' 0.2\n"; + print KUMAC "text 0.05 0.93 'Databases' 0.2\n"; + $ypos = 0.85; + if($xq == 1){ + print KUMAC "text 0.5 0.9 'Q\*\*2=' 0.3\n"; + print KUMAC "text 0.62 0.9 $scale 0.3\n"; + print KUMAC "text 0.75 0.9 'GeV\*\*2' 0.3\n"; + } + else { + print KUMAC "text 0.5 0.9 'x=' 0.3\n"; + print KUMAC "text 0.55 0.9 $x 0.3\n"; + } + } + if($times == 2) { $ypos = 0.80; } + if($times == 3) { $ypos = 0.75; } + if($times == 4) { $ypos = 0.70; } + print KUMAC "igset lwid $lwidth\n"; + print KUMAC "line 0.5 $ypos 0.55 $ypos\n"; + print KUMAC "text 0.57 $ypos $typ[$times] 0.3\n"; + $temp = $which[$times]; + $temp =~ s/_/-/g; + print KUMAC "text 0.7 $ypos $temp/$member[$times] 0.3\n"; + if($sf[$times] ne '1.0'){ + $mult = 'x'; + print KUMAC "text 0.92 $ypos $mult 0.3\n"; + print KUMAC "text 0.95 $ypos $sf[$times] 0.3\n"; + } + if($ybinning == 1){ print KUMAC "opt liny\n"; } + else { print KUMAC "opt logy\n"; } + if($xbinning == 1){ + print KUMAC "opt linx\n"; + if($xq == 1){ print KUMAC "null 0 1.0 $ymin $ymax as\n";} + else { print KUMAC "null $q2min $q2max $ymin $ymax as\n";} + } + else { + print KUMAC "opt logx\n"; + if($xq == 1){ print KUMAC "null $xmin $xmax $ymin $ymax as\n";} + else { print KUMAC "null $q2min $q2max $ymin $ymax as\n";} + } + print KUMAC "ve/de *\n"; + } + } +} +close KUMAC; +if($numplot eq 'plot'){ + $pid=`/home/whalley/bin/getpid`; + chomp $pid; + system("mkdir /var/www/plots/$pid"); + open KUMAC2,">$tempdir/temp2.kumac"; + print KUMAC2 "Macro plot_file\n"; + print KUMAC2 "For/File 1 $tempdir/plotpaw.ps\n"; + print KUMAC2 "Metafile -1 -111\n"; + close KUMAC2; + system("cat $tempdir/temp.kumac >> $tempdir/temp2.kumac"); + open KUMAC2,">>$tempdir/temp2.kumac"; + print KUMAC2 "close 1\n"; + print KUMAC2 "exit\n"; + close KUMAC2; + system ("cat $tempdir/temp2.kumac | sed 's/</{L#/g' | sed 's/>/{G#/g' | tr '\173' '\042' > $tempdir/plot_file.kumac"); + system("/usr/bin/paw -b $tempdir/temp2 > /dev/null"); + system("cp $tempdir/plotpaw.ps /var/www/plots/$pid/"); + system("/usr/bin/convert $tempdir/plotpaw.ps -shave 15x125 /var/www/plots/$pid/plotpaw.png > /dev/null"); + print "<a href=/pdf-plots/$pid/plotpaw.ps><img src=/pdf-plots/$pid/plotpaw.png border=0></a>"; + print "<p><a href=/pdf-plots/$pid/plotpaw.ps>postscript version</a>"; +} +if($numplot eq 'kumac'){ + print "<XMP>\n"; + system ("cat $tempdir/temp.kumac"); + foreach $times (1...4){ + if($plot[$times] eq 'on'){ + print "**************************************************************\n"; + print "Next follows the file temp.dat$times\n"; + print "**************************************************************\n"; + system ("cat $tempdir/temp.dat$times\n"); + } + } +} + +exit; Added: pdf-cgi/pdfplot_hessian.pl ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ pdf-cgi/pdfplot_hessian.pl Wed Sep 22 16:17:11 2010 (r1404) @@ -0,0 +1,288 @@ +#!/usr/bin/perl +use CGI qw(param header p); +print header('text/html'); +print "<head>"; +print "<style type='text/css'>"; +print " .table, .table TD, .table TH, body"; +print " {"; +print " font-family:Helvetica;"; +print " font-size:10pt;"; +print " background-color:which;"; +print " margin-left:20pt;"; +print " }"; +print " #mysubmit { background-color: #cfc; font-size: 100%; padding: 0px; font-weight: bold; }"; +print " #myparton { background-color: #cfc; font-size: 100%; padding: 0px; font-weight: bold; }"; +print "</style>"; +print "</head> "; +print "<body>"; + at types = qw(all up down upbar downbar strange charm bottom gluon); +$ENV{'LD_LIBRARY_PATH'} = "/home/whalley/local/lib"; +$ENV{'LHAPATH'} = "/home/whalley/pdfsets"; +$first = 1; +$xmin = param("xmin"); +$xmax = param("xmax"); +if ($xmax eq '1') { $xmax = 0.999; } +if ($xmax eq '1.') { $xmax = 0.999; } +if ($xmax eq '1.0') { $xmax = 0.999; } +if ($xmax eq '1.00') { $xmax = 0.999; } +if ($xmax eq '1.000') { $xmax = 0.999; } +$xinc = param("xinc"); +$qscale = param("scale"); +$xbinning = param("binning"); +$ymax = param("ymax"); +$numplot = param("numplot"); +foreach $n (1,2){ + $plot[$n] = param("plot$n"); + $typ[$n] = param("typ$n"); + $which[$n] = param("Which$n"); + $sf[$n] = param("sf$n"); +} +print "<h2><font color='blue'> $which[1] PDF Error Limits\n"; +if ($plot[2] eq 'on') { + print "<br>and comparison with $which[2] PDF"; +} +print "</font></h2>"; + +$tempdir = `/home/whalley/bin/mktmp`; +chomp $tempdir; +foreach $n (1...2){ + if($plot[$n] eq 'on'){ + foreach $i(0...8){ + if($typ[$n] eq $types[$i]) {$iqtype = $i;} + } + if($iqtype == 0){ + system("/home/whalley/pdf-cgi/pdfplotallE $which[$n] $xmin $xmax $xinc $qscale $xbinning $ymax $numplot $sf[1]"); + exit(); + } +# +# next section first time through only +# + if ($first == 1){ + $first = 0; + system("mkdir $tempdir"); + open KUMAC,">$tempdir/temp.kumac"; + print KUMAC "opt zfl1\n"; + print KUMAC "opt nbox\n"; + print KUMAC "opt ndat\n"; + print KUMAC "opt ngri\n"; + print KUMAC "opt liny\n"; + print KUMAC "opt linx\n"; + print KUMAC "size 20 30\n"; + print KUMAC "zone 1 2 1\n"; + if ($xbinning == 1){ + print KUMAC "opt linx\n"; + print KUMAC "null 0 1.0 0.0 $ymax\n"; + } + else { + print KUMAC "opt logx\n"; + print KUMAC "null $xmin $xmax 0.0 $ymax\n"; + } + print KUMAC "ticks\n"; + print KUMAC "set asiz 0.4\n"; + print KUMAC "atitle x xf(x,Q2)\n"; + $npoint = `echo $xbinning $xmin $xmax $xinc | /home/whalley/bin/findbin`; + $npoint++; + } + else { + print KUMAX "zone 1 2 1 s\n"; + if( $xbinning == 1) { + print KUMAC "opt linx\n"; + print KUMAC "null 0 1.0 0.0 $ymax\n"; + } + else { + print KUMAC "opt logx\n"; + print KUMAC "null $xmin $xmax 0.0 $ymax\n"; + } + } +# +# end of first time through +# +# get output files from pdf programmes +# +# first the error and the normal ones programmes +# + chdir "/home/whalley/pdflib/lhapdf"; + if ($n == 1) { + $temp = `echo "$which[$n] $xmin $xmax $xinc $qscale $xbinning $iqtype" | ./pdfE | ./noheader `; + $temp = `echo "$which[$n] $xmin $xmax $xinc $qscale $xbinning $iqtype" | ./pdfE | ./noheader >> $tempdir/temp.dat$n`; + } + else { + $temp = `echo "$which[$n] 0 $xmin $xmax $xinc $qscale $xbinning $iqtype 1" | ./pdf | ./noheader >> $tempdir/temp.dat$n`; + } +# +#end of getting pdf files +# + system("echo ' ' >> $tempdir/temp.dat$n"); + system("echo ' ' >> $tempdir/temp.dat$n"); + system("mv $tempdir/temp.dat$n $tempdir/temp.dat$n_temp"); + system("cat $tempdir/temp.dat$n_temp | grep -v WARNING > $tempdir/temp.dat$n"); + system("rm $tempdir/temp.dat$n_temp"); +# + print KUMAC "ve/cr q($npoint)\n"; +#read in the data file + chdir $tempdir; + if ($n == 1) { + $times_temp = `echo $n | /home/whalley/bin/pdfmodE`; + } + else { + $times_temp = `echo $n | /home/whalley/bin/pdfmod`; + } + print KUMAC "$times_temp\n"; +# + print KUMAC "ve/co v(1,1:$npoint) x\n"; + print KUMAC "ve/co v(3,1:$npoint) y\n"; + if ($n == 1) { + print KUMAC "ve/co v(4,1:$npoint) ey\n"; + } + print KUMAC "igset plci $n\n"; + print KUMAC "igset lwid 3\n"; + print KUMAC "igset ltyp $n\n"; +# + if ($n == 1) { + print KUMAC "sigma ysave = y\n"; + print KUMAC "sigma ytemp = y + ey\n"; + print KUMAC "graph $npoint x ytemp c\n"; + print KUMAC "sigma ytemp = y - ey\n"; + print KUMAC "graph $npoint x ytemp c\n"; + } + else { + print KUMAC "graph $npoint x y c\n"; + } + print KUMAC "opt linx\n"; + print KUMAC "null 0 1 0 1 as\n"; + if ($n == 1) { + print KUMAC "fbox 0.04 0.15 0.92 0.97 0.035 0.155 0.915 0.975\n"; + print KUMAC "text 0.055 0.95 HEPDATA 0.2\n"; + print KUMAC "text 0.05 0.93 Databases 0.2\n"; + $ypos = 0.85; + print KUMAC "text 0.5 0.9 Q**2= 0.3\n"; + print KUMAC "text 0.62 0.9 $qscale 0.3\n"; + print KUMAC "text 0.75 0.9 GeV**2 0.3\n"; + } + if ($n == 2) {$ypos = 0.8;} + print KUMAC "line 0.5 $ypos 0.55 $ypos\n"; + print KUMAC "text 0.57 $ypos $typ[1] 0.3\n"; + print KUMAC "text 0.7 $ypos $which[$n] 0.3\n"; + print KUMAC "zone 1 2 2 s\n"; + print KUMAC "igset plci $n\n"; + print KUMAC "igset lwid 3.0\n"; + print KUMAC "igset ltyp $n\n"; + if ($n == 1) { + if ($xbinning == 1) { + print KUMAC "opt linx\n"; + print KUMAC "null 0 1.0 -sf[1] $sf[1]\n"; + } + else { + print KUMAC "opt logx\n"; + print KUMAC "null $xmin $xmax -$sf[1] $sf[1]\n"; + } + print KUMAC "atitle 'x' 'percentage.error'\n"; + print KUMAC "ticks\n"; + print KUMAC "igset ltype 1\n"; + print KUMAC "sigma pct = 100*ey/y\n"; + print KUMAC "graph $npoint x pct c\n"; + print KUMAC "sigma pct = -100*ey/y\n"; + print KUMAC "graph $npoint x pct c\n"; + print KUMAC "opt linx\n"; + print KUMAC "null 0 1 0 1 as\n"; + print KUMAC "ve/de v q y ey ytemp x\n"; + print KUMAC 'text 0.225 0.85 "A# 0.3',"\n"; + if($which[$n] =~ m/^a02m/) { + } + else { + print KUMAC "text 0.25 0.875 1 0.3\n"; + print KUMAC "text 0.25 0.85 - 0.3\n"; + print KUMAC "text 0.25 0.825 2 0.3\n"; + } + print KUMAC 'text 0.28 0.85 "R# 0.55',"\n"; + print KUMAC "text 0.325 0.85 [S] 0.55\n"; + if($which[$n] =~ m/^a02m/) { + print KUMAC "text 0.35 0.86 ([s](i))^2! 0.35\n"; + } + else{ + print KUMAC "text 0.35 0.86 ([s](2i-1)-[s](2i))^2! 0.35\n"; + } + print KUMAC "text 0.325 0.815 i=1 0.25\n"; +# print KUMAC "text 0.325 0.915 20 0.25\n"; + + if($which[$n] =~ m/^MRST/) { + print KUMAC "text 0.325 0.915 15 0.25\n"; + } elsif ($which[$n] =~ m/^MSTW/) { + print KUMAC "text 0.325 0.915 20 0.25\n"; + } elsif ($which[$n] =~ m/^ZEUS/) { + print KUMAC "text 0.325 0.915 11 0.25\n"; + } elsif ($which[$n] =~ m/^H12000/) { + print KUMAC "text 0.325 0.915 10 0.25\n"; + } elsif ($which[$n] =~ m/^a02m/) { + print KUMAC "text 0.325 0.915 17 0.25\n"; + } else { + print KUMAC "text 0.325 0.915 20 0.25\n"; + } + } + else { + if ($xbinning == 1) { + print KUMAC "opt linx\n"; + print KUMAC "null 0 1.0 -$sf[1] $sf[1]\n"; + } + else { + print KUMAC "opt logx\n"; + print KUMAC "null $xmin $xmax -$sf[1] $sf[1]\n"; + print KUMAC "sigma pct = 100*(y-ysave)/ysave\n"; + print KUMAC "graph $npoint x pct c\n"; + } + } + } +} +close KUMAC; +if ($numplot eq plot) { + + open KUMAC2,">$tempdir/temp2.kumac"; + print KUMAC2 "Macro plot_file\n"; + print KUMAC2 "For/File 1 $tempdir/plotpaw.ps\n"; + print KUMAC2 "Metafile -1 -111\n"; + close KUMAC2; + system("cat $tempdir/temp.kumac >> $tempdir/temp2.kumac"); + open KUMAC2,">>$tempdir/temp2.kumac"; + print KUMAC2 "close 1\n"; + print KUMAC2 "exit\n"; + close KUMAC2; + print "<body>\n"; + print "<table class='table'>\n"; + print "<td>\n" ; + system("cat $tempdir/temp2.kumac | sed 's/</{L#/g' | sed 's/>/{G#/g' | tr '\173' '\042' > $tempdir/plot_file.kumac"); + system("/usr/bin/paw -n -b $tempdir/temp2 > /dev/null"); + system("cp $tempdir/plotpaw.ps /var/www/plots/"); + system("/usr/bin/convert $tempdir/plotpaw.ps /var/www/plots/plotpaw.png > /dev/null"); + print "<a href=/pdf-plots/plotpaw.ps><font face=helvetia,sans-serif color='blue'> (postscript version)</font></a>"; + print "<a href=/pdf-plots/plotpaw.ps><img src=/pdf-plots/plotpaw.png></a>"; + print "<tr><td><font face=helvetia,sans-serif><b> "; + print "The percentage errors are calculated from the error analyses as decribed in the respective"; + print "papers hep-ph/0201195(CTEQ), hep-ph/0211080(MRST), hep-ex/0208023(ZEUS) and hep-ph/0503274 (ZEUS Jet fit)."; + print "by summing over the pdfs given in the"; + print " 40 (CTEQ,MSTW), 30 (MRST) or 22 (ZEUS) eigenvector grids, in the following way:<br><br>"; + if($which[1] =~ m/^a02m/) { + print "<b>sigma(central) +- sqrt[sum_i=1,17 {sigma(i)}^2</b> ]"; + } + else{ + print "<b>sigma(central) +- 1/2 sqrt[sum_i=1,20(15)(11) {sigma(2i-1) - sigma(2i)}^2</b> ]"; + } + print "<br><br> For the comparison with the second PDF the percentage difference from the"; + print "CTEQ6 or MRST central value is plotted."; + print "</font>"; + print "</td> </table>"; +} +if ($numplot eq kumac) { + print '<xmp>'; + system("cat $tempdir/temp.kumac"); + foreach $n (1,2){ + if($plot[$n] eq 'on'){ + print "**********************************************************\n"; + print "Next follows the file temp.dat$n\n"; + print "**********************************************************\n"; + system("cat temp.dat$n\n"); + } + } + print '</xmp>'; +} + +exit; Added: pdf-cgi/pdfplotall ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ pdf-cgi/pdfplotall Wed Sep 22 16:17:11 2010 (r1404) @@ -0,0 +1,199 @@ +#!/bin/csh +#echo 'Content-Type: text/html' +#echo '' +#echo 'Sorry ... cannot plot ALL pdfs on one page at the moment' +#echo "<br> $argv[1] $argv[2] $argv[3] $argv[4] $argv[5] $argv[6] $argv[7] $argv[8]" +#exit +setenv LD_LIBRARY_PATH /home/whalley/local/lib +setenv LHAPATH /home/whalley/pdfsets +set p2 = $argv[1] +set xmin = $argv[2] +set xmax = $argv[3] +set xinc = $argv[4] +set qscale = $argv[5] +set linlog = $argv[6] +set ylinlog = $argv[7] +set ymin = $argv[8] +set ymax = $argv[9] +set plotnum = $argv[10] +set xq = $argv[11] +set lwidth = $argv[12] +set p3 = `echo '1'` +set first = `echo '1'` +set count = `echo '11'` +set times = `echo '0'` +set tempdir = `/home/whalley/bin/mktmp` +again: +@ times++ +set iqtyp = `echo $times` +set p1 = `echo $times` +set nplots = `echo $times` +if ($first == 1) then + set first = `echo '0'` + mkdir $tempdir + echo 'opt zfl1' >> $tempdir/temp.kumac + echo 'opt nbox' >> $tempdir/temp.kumac + echo 'opt ndat' >> $tempdir/temp.kumac + echo 'opt ngri' >> $tempdir/temp.kumac + echo 'opt liny' >> $tempdir/temp.kumac + echo 'opt linx' >> $tempdir/temp.kumac + if ($ylinlog == '1') then + echo 'opt liny' >> $tempdir/temp.kumac + else + echo 'opt logy' >> $tempdir/temp.kumac + endif + if ($linlog == '1') then + echo 'opt linx' >> $tempdir/temp.kumac + echo 'null 0 1.0' $ymin $ymax >> $tempdir/temp.kumac + else + echo 'opt logx' >> $tempdir/temp.kumac + echo 'null' $xmin $xmax $ymin $ymax >> $tempdir/temp.kumac + endif + echo 'set asiz 0.4' >> $tempdir/temp.kumac + if($xq == 1) then + echo "atitle 'x' 'xf(x,Q2)'" >> $tempdir/temp.kumac + set npoint = `echo $linlog $xmin $xmax $xinc | /home/whalley/bin/findbin` + else + echo "atitle 'Q**2 (GeV**2)' 'xf(x,Q2)'" >> $tempdir/temp.kumac + set npoint = `echo $linlog $xmin $xmax $xinc | /home/whalley/bin/findbinq` + endif +@ npoint++ +endif +#################################### +cd /home/whalley/pdflib/lhapdf +echo "$p2 0 $xmin $xmax $xinc $qscale $linlog $iqtyp $xq" | ./pdf | ./noheader > $tempdir'/temp.dat'$times +#################################### +cd $tempdir +echo ' ' >> $tempdir'/temp.dat'$times + +echo ' ' >> $tempdir'/temp.dat'$times +mv $tempdir'/temp.dat'$times $tempdir'/temp.dat'$times'_temp' +cat $tempdir'/temp.dat'$times'_temp' | grep -v 'WARNING' > $tempdir'/temp.dat'$times +rm $tempdir'/temp.dat'$times'_temp' +echo 've/cr q('$npoint')' >> $tempdir/temp.kumac +echo $times | /home/whalley/bin/pdfmod >> $tempdir/temp.kumac +if($xq == 1) then + echo 've/co v(1,1:'$npoint') x' >> $tempdir/temp.kumac +else + echo 've/co v(2,1:'$npoint') x' >> $tempdir/temp.kumac +endif +echo 've/co v(3,1:'$npoint') y' >> $tempdir/temp.kumac +#echo 'sigma y=y*'$p3 >> $tempdir/temp.kumac +set lltyp = $times +echo 'igset lwid' $lwidth >> $tempdir/temp.kumac +echo 'igset plci' $times >> $tempdir/temp.kumac +if($times == 8 ) then + echo 'igset plci 2' >> $tempdir/temp.kumac +else + echo 'igset plci' $times >> $tempdir/temp.kumac +endif +if($times > 4) then +@ lltyp = $lltyp - 4 +echo 'igset lwid' $lwidth >> $tempdir/temp.kumac +endif +echo 'igset ltyp' $lltyp >> $tempdir/temp.kumac +echo 'graph '$npoint' x y c' >> $tempdir/temp.kumac +echo 'opt linx' >> $tempdir/temp.kumac +echo 'opt liny' >> $tempdir/temp.kumac +echo 'null 0 1 0 1 as' >> $tempdir/temp.kumac +if ($times == 1) then + echo 'igset lwid 3' >> $tempdir/temp.kumac + echo fbox 0.04 0.15 0.92 0.97 0.035 0.155 0.915 0.975>> $tempdir/temp.kumac + echo text 0.055 0.95 'HEPDATA' 0.2 >> $tempdir/temp.kumac + echo text 0.05 0.93 'Databases' 0.2 >> $tempdir/temp.kumac + set ypos = `echo '0.85'` + if($xq == 1) then + echo text 0.5 0.9 "Q**2=" 0.3 >> $tempdir/temp.kumac + echo text 0.62 0.9 $qscale 0.3 >> $tempdir/temp.kumac + echo text 0.75 0.9 'GeV**2' 0.3 >> $tempdir/temp.kumac + else + echo text 0.5 0.9 "x" 0.3 >> $tempdir/temp.kumac + echo text 0.55 0.9 $qscale 0.3 >> $tempdir/temp.kumac + endif +endif +if ($times == 2) set ypos = `echo '0.820'` +if ($times == 3) set ypos = `echo '0.790'` +if ($times == 4) set ypos = `echo '0.760'` +if ($times == 5) set ypos = `echo '0.730'` +if ($times == 6) set ypos = `echo '0.700'` +if ($times == 7) set ypos = `echo '0.670'` +if ($times == 8) set ypos = `echo '0.640'` +echo 'line 0.5' $ypos '0.55' $ypos >> $tempdir/temp.kumac +if($times == 1) echo 'text 0.57' $ypos 'up 0.3' >> $tempdir/temp.kumac +if($times == 2) echo 'text 0.57' $ypos 'down 0.3' >> $tempdir/temp.kumac +if($times == 3) echo 'text 0.57' $ypos 'upbar 0.3' >> $tempdir/temp.kumac +if($times == 4) echo 'text 0.57' $ypos 'downbar 0.3' >> $tempdir/temp.kumac +if($times == 5) echo 'text 0.57' $ypos 'strange 0.3' >> $tempdir/temp.kumac +if($times == 6) echo 'text 0.57' $ypos 'charm 0.3' >> $tempdir/temp.kumac +if($times == 7) echo 'text 0.57' $ypos 'bottom 0.3' >> $tempdir/temp.kumac +if($times == 8) echo 'text 0.57' $ypos 'gluon 0.3' >> $tempdir/temp.kumac +if ($times == 1) echo 'text 0.7' $ypos $p2 '0.3' >> $tempdir/temp.kumac +#if ($p3 != '1.0') then +# set mult = `echo 'x'` +# echo 'text 0.92' $ypos $mult '0.3' >> $tempdir/temp.kumac +# echo 'text 0.95' $ypos $p3 '0.3' >> $tempdir/temp.kumac +#endif +if ($ylinlog == '1') then + echo 'opt liny' >> $tempdir/temp.kumac +else + echo 'opt logy' >> $tempdir/temp.kumac +endif +if ($linlog == '1') then + echo 'opt linx' >> $tempdir/temp.kumac + if($xq == 1) then + echo 'null 0 1.0' $ymin $ymax 'as' >> $tempdir/temp.kumac + else + echo 'null' $xmin $xmax $ymin $ymax 'as' >> $tempdir/temp.kumac + endif +else + echo 'opt logx' >> $tempdir/temp.kumac + echo 'null' $xmin $xmax $ymin $ymax 'as' >> $tempdir/temp.kumac + endif +endif +echo 've/de *' >> $tempdir/temp.kumac +#echo '<br>' $times +if ($times != 8) goto again +if ($plotnum == plot) then + chmod 777 $tempdir + cd $tempdir + echo 'Macro plot_file' > temp2.kumac + echo 'For/File 1 '$tempdir'/plotpaw.ps' >> temp2.kumac + echo 'Metafile -1 -111' >> temp2.kumac + cat temp.kumac >> temp2.kumac + echo 'close 1' >> temp2.kumac + echo "exit" >>temp2.kumac + cat temp2.kumac | sed "s/</{L#/g" | sed "s/>/{G#/g" | tr '\173' '\042' > plot_file.kumac + /usr/bin/paw -b $tempdir/temp2 > /dev/null + cp $tempdir/plotpaw.ps /var/www/plots/ + /usr/bin/convert $tempdir/plotpaw.ps -shave 15x125 /var/www/plots/plotpaw.png> /dev/null + echo "</td><td valign=top>" + echo "<a href=/pdf-plots/plotpaw.ps><img src=/pdf-plots/plotpaw.png border=0></a>" + echo "<br> click on above plot for postscript version" + echo "</td></table>" +else +# echo 'Content-Type: text/html' +# echo '' + cd $tempdir + echo '<pre>' + cat temp.kumac + set count = `echo '0'` +repeat: +@ count++ + echo '**********************************************************' + echo 'Next follows the file temp.dat'$count + echo '**********************************************************' + cat temp.dat$count + if ($count != 8) goto repeat + echo '</pre>' +endif +#cd .. +#sleep 5 +#rm -r $tempdir +exit + +#echo "<p><img src=/icons/hepdata/rain_line.gif>" +#echo 'Location: http://h2.phyip3.dur.ac.uk'$tempdir'/plotpaw.ps' +#echo '' + + +exit Added: pdf-cgi/pdfplotallE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ pdf-cgi/pdfplotallE Wed Sep 22 16:17:11 2010 (r1404) @@ -0,0 +1,219 @@ +#!/bin/csh +#echo 'Content-Type: text/html' +#echo '' +#echo 'Sorry ... cannot plot ALL pdfs on one page at the moment' +#echo '<br>' $argv[1] $argv[2] $argv[3] $argv[4] $argv[5] $argv[6] $argv[7] +setenv LD_LIBRARY_PATH /home/whalley/local/lib +setenv LHAPATH /home/whalley/pdfsets +set p2 = $argv[1] +set xmin = $argv[2] +set xmax = $argv[3] +set xinc = $argv[4] +set qscale = $argv[5] +set linlog = $argv[6] +set ymax = $argv[7] +set plotnum = $argv[8] +set p3 = $argv[9] +set first = `echo '1'` +set count = `echo '8'` +set tempdir = `/home/whalley/bin/mktmp` +mkdir $tempdir +cd $tempdir +echo "$p2 $xmin $xmax $xinc $qscale $linlog 0" | /home/whalley/pdflib/lhapdf/pdfE > /dev/null +mv fort.11 temp.dat1 +mv fort.12 temp.dat2 +mv fort.13 temp.dat3 +mv fort.14 temp.dat4 +mv fort.15 temp.dat5 +mv fort.16 temp.dat6 +mv fort.17 temp.dat7 +mv fort.18 temp.dat8 + +# +set times = `echo '0'` +again: +@ times++ +if ($first == 1) then + set first = `echo '0'` + echo 'opt zfl1' >> $tempdir/temp.kumac + echo 'opt nbox' >> $tempdir/temp.kumac + echo 'opt ndat' >> $tempdir/temp.kumac + echo 'opt ngri' >> $tempdir/temp.kumac + echo 'opt liny' >> $tempdir/temp.kumac + echo 'opt linx' >> $tempdir/temp.kumac + echo 'size 20 30' >> $tempdir/temp.kumac + echo 'zone 1 2 1' >> $tempdir/temp.kumac + if ($linlog == '1') then + echo 'opt linx' >> $tempdir/temp.kumac + echo 'null 0 1.0 0.0' $ymax >> $tempdir/temp.kumac + else + echo 'opt logx' >> $tempdir/temp.kumac + echo 'null' $xmin $xmax '0.0' $ymax >> $tempdir/temp.kumac + endif + echo 'ticks' >> $tempdir/temp.kumac +cat << ===CAT_END=== >> $tempdir/temp.kumac + set asiz 0.4 + atitle 'x' 'xf(x,Q2)' +===CAT_END=== +set npoint = `echo $linlog $xmin $xmax $xinc | /home/whalley/bin/findbin` +@ npoint++ +else + echo 'zone 1 2 1 s' >> $tempdir/temp.kumac + if ($linlog == '1') then + echo 'opt linx' >> $tempdir/temp.kumac + echo 'null 0 1.0 0.0' $ymax >> $tempdir/temp.kumac + else + echo 'opt logx' >> $tempdir/temp.kumac + echo 'null' $xmin $xmax '0.0' $ymax >> $tempdir/temp.kumac + endif +endif +# end of first time through +cd $tempdir +echo ' ' >> $tempdir'/temp.dat'$times +echo ' ' >> $tempdir'/temp.dat'$times +mv $tempdir'/temp.dat'$times $tempdir'/temp.dat'$times'_temp' +cat $tempdir'/temp.dat'$times'_temp' | grep -v 'WARNING' > $tempdir'/temp.dat'$times +rm $tempdir'/temp.dat'$times'_temp' +echo 've/cr q('$npoint')' >> $tempdir/temp.kumac +echo $times | /home/whalley/bin/pdfmodE >> $tempdir/temp.kumac +echo 've/co v(1,1:'$npoint') x' >> $tempdir/temp.kumac +echo 've/co v(3,1:'$npoint') y' >> $tempdir/temp.kumac +echo 've/co v(4,1:'$npoint') ey' >> $tempdir/temp.kumac +set lltyp = $times +echo 'igset lwid 5.0' >> $tempdir/temp.kumac +echo 'igset plci' $times >> $tempdir/temp.kumac +if($times == 8 ) then + echo 'igset plci 2' >> $tempdir/temp.kumac +else + echo 'igset plci' $times >> $tempdir/temp.kumac +endif +if($times > 4) then +@ lltyp = $lltyp - 4 +echo 'igset lwid 1.0' >> $tempdir/temp.kumac +endif +echo 'igset ltyp' $lltyp >> $tempdir/temp.kumac +echo 'graph '$npoint' x y c' >> $tempdir/temp.kumac +echo 'sigma ytemp = y + ey' >> $tempdir/temp.kumac +echo 'graph '$npoint' x ytemp c' >> $tempdir/temp.kumac +echo 'sigma ytemp = y - ey' >> $tempdir/temp.kumac +echo 'graph '$npoint' x ytemp c' >> $tempdir/temp.kumac +echo 'opt linx' >> $tempdir/temp.kumac +echo 'null 0 1 0 1 as' >> $tempdir/temp.kumac +if ($times == 1) then + echo fbox 0.04 0.15 0.92 0.97 0.035 0.155 0.915 0.975>> $tempdir/temp.kumac + echo text 0.055 0.95 'HEPDATA' 0.2 >> $tempdir/temp.kumac + echo text 0.05 0.93 'Databases' 0.2 >> $tempdir/temp.kumac + set ypos = `echo '0.85'` + echo text 0.5 0.9 "Q**2=" 0.3 >> $tempdir/temp.kumac + echo text 0.62 0.9 $qscale 0.3 >> $tempdir/temp.kumac + echo text 0.75 0.9 'GeV**2' 0.3 >> $tempdir/temp.kumac +endif +if ($times == 2) set ypos = `echo '0.820'` +if ($times == 3) set ypos = `echo '0.790'` +if ($times == 4) set ypos = `echo '0.760'` +if ($times == 5) set ypos = `echo '0.730'` +if ($times == 6) set ypos = `echo '0.700'` +if ($times == 7) set ypos = `echo '0.670'` +if ($times == 8) set ypos = `echo '0.640'` +echo 'line 0.5' $ypos '0.55' $ypos >> $tempdir/temp.kumac +if($times == 1) echo 'text 0.57' $ypos 'up 0.3' >> $tempdir/temp.kumac +if($times == 2) echo 'text 0.57' $ypos 'down 0.3' >> $tempdir/temp.kumac +if($times == 3) echo 'text 0.57' $ypos 'upbar 0.3' >> $tempdir/temp.kumac +if($times == 4) echo 'text 0.57' $ypos 'downbar 0.3' >> $tempdir/temp.kumac +if($times == 5) echo 'text 0.57' $ypos 'strange 0.3' >> $tempdir/temp.kumac +if($times == 6) echo 'text 0.57' $ypos 'charm 0.3' >> $tempdir/temp.kumac +if($times == 7) echo 'text 0.57' $ypos 'bottom 0.3' >> $tempdir/temp.kumac +if($times == 8) echo 'text 0.57' $ypos 'gluon 0.3' >> $tempdir/temp.kumac +if ($times == 1) echo 'text 0.7' $ypos $p2 '0.3' >> $tempdir/temp.kumac + +echo 'zone 1 2 2 s' >> $tempdir/temp.kumac +#echo $p3 + + +if ($linlog == '1') then + echo 'opt linx' >> $tempdir/temp.kumac + echo 'null 0 1.0 -'$p3 $p3 >> $tempdir/temp.kumac +else + echo 'opt logx' >> $tempdir/temp.kumac + echo 'null' $xmin $xmax '-'$p3 $p3 >> $tempdir/temp.kumac + echo 'line -10 0 0 0' >> $tempdir/temp.kumac +endif +echo 'atitle' '''x''' '''percentage.error''' >> $tempdir/temp.kumac +echo 'ticks' >> $tempdir/temp.kumac +set lltyp = $times +if($times > 4) then +@ lltyp = $lltyp - 4 +echo 'igset lwid 1.0' >> $tempdir/temp.kumac +endif +echo 'igset ltyp' $lltyp >> $tempdir/temp.kumac +#echo 'igset ltype 2' >> $tempdir/temp.kumac +echo 'sigma pct = 100*ey/y' >> $tempdir/temp.kumac +echo 'graph '$npoint' x pct c' >> $tempdir/temp.kumac +echo 'sigma pct = -100*ey/y' >> $tempdir/temp.kumac +echo 'graph '$npoint' x pct c' >> $tempdir/temp.kumac +echo 've/de *' >> $tempdir/temp.kumac +echo 'opt linx' >> $tempdir/temp.kumac +echo 'null 0 1 0 1 as' >> $tempdir/temp.kumac +echo 'text 0.225 0.85 "A# 0.3' >> $tempdir/temp.kumac +if($p2 =~ "a02*") then +else + echo 'text 0.25 0.875 1 0.3' >> $tempdir/temp.kumac + echo 'text 0.25 0.85 - 0.3' >> $tempdir/temp.kumac + echo 'text 0.25 0.825 2 0.3' >> $tempdir/temp.kumac +endif +echo 'text 0.28 0.85 "R# 0.55' >> $tempdir/temp.kumac +echo 'text 0.325 0.85 [S] 0.55' >> $tempdir/temp.kumac +if($p2 =~ "a02*") then + echo 'text 0.35 0.86 ([s](i)^2! 0.35' >> $tempdir/temp.kumac +else + echo 'text 0.35 0.86 ([s](2i-1)-[s](2i))^2! 0.35' >> $tempdir/temp.kumac +endif +echo 'text 0.325 0.815 i=1 0.25' >> $tempdir/temp.kumac +if($p2 =~ "a02m*") then + echo 'text 0.325 0.915 17 0.25' >> $tempdir/temp.kumac +else if($p2 =~ "MRST*" || $p2 =~ "a02*") then + echo 'text 0.325 0.915 15 0.25' >> $tempdir/temp.kumac +else if ($p2 =~ "ZEUS*") then + echo 'text 0.325 0.915 11 0.25' >> $tempdir/temp.kumac +else if ($p2 =~ "H12000*") then + echo 'text 0.325 0.915 10 0.25' >> $tempdir/temp.kumac +else + echo 'text 0.325 0.915 20 0.25' >> $tempdir/temp.kumac +endif + +if ($times != 8) goto again +if ($plotnum == plot) then + chmod 777 $tempdir + cd $tempdir + echo 'Macro plot_file' > temp2.kumac + echo 'For/File 1 '$tempdir'/plotpaw.ps' >> temp2.kumac + echo 'Metafile -1 -111' >> temp2.kumac + cat temp.kumac >> temp2.kumac + echo 'close 1' >> temp2.kumac + echo "exit" >>temp2.kumac + cat temp2.kumac | sed "s/</{L#/g" | sed "s/>/{G#/g" | tr '\173' '\042' > plot_file.kumac + /usr/bin/paw -b $tempdir/temp2 > /dev/null + cp $tempdir/plotpaw.ps /var/www/plots/ + /usr/bin/convert $tempdir/plotpaw.ps /var/www/plots/plotpaw.jpg > /dev/null + echo "</td><td valign=top>" + echo "<a href=/pdf-plots/plotpaw.ps><img src=/pdf-plots/plotpaw.jpg></a>" + echo "<br> click on above plot for postscript version" + echo "</td></table>" + echo "<p><img src=/icons/hepdata/rain_line.gif>" +else + cd $tempdir + echo '<pre>' + cat temp.kumac + set count = `echo '0'` +repeat: +@ count++ + echo '**********************************************************' + echo 'Next follows the file temp.dat'$count + echo '**********************************************************' + cat temp.dat$count + if ($count != 8) goto repeat + echo '</pre>' +endif +cd .. +exit +
More information about the HepData-svn mailing list |