Page MenuHomeHEPForge

process.pl_save
No OneTemporary

process.pl_save

#!/usr/bin/perl
require "subs.pl";
if($ARGV[0] eq "" || $ARGV[0] eq "homepage") {
#############################################################################
####FIRST PRODUCE THE HOME PAGE
# open INPUT,'<all.sorted';
open INPUT,'<new.sorted';
$dummy=<INPUT>;
$nlabs=0;
while ($line=<INPUT>){
chomp $line;
@line = split /\t+/,$line;
($lab,$rest) = split /-/,$line[0],2;
$have=0;
if($nlabs>0){
foreach $n (1...$nlabs){
if($lab eq "$lab[$n]") { $have=1; $havelab=$n; }
}
}
if($have==0){
$nlabs++;
$havelab=$nlabs;
$nexps[$nlabs]=1;
$lab[$nlabs]=$lab;
$exp[$nlabs][$nexps[$nlabs]]=$line[0];
} else {
$haveexp=0;
foreach $m (1...$nexps[$havelab]){
if($line[0] eq "$exp[$havelab][$m]") { $haveexp=1;}
}
if($haveexp==0){
$nexps[$havelab]++;
$exp[$havelab][$nexps[$havelab]]=$line[0];
}
}
}
#print "$nlabs\n";
$maxexp=0;
foreach $n (1...$nlabs){
if($nexps[$n]>$maxexp) {$maxexp=$nexps[$n];}
# print "$lab[$n] $nexps[$n]\n";
foreach $m (1...$nexps[$n]){
print " $exp[$n][$m]\n";
#
}
}
open NAVIG,'>navig.shtml';
open HOME,'>home.shtml';
print HOME "
<center>
<b><font color=blue size=+1> An up-to-date archive of PP and PbarP data<br>
elastic and inelastic cross sections</font></b></center>
<p>
<center>
<table align=center border=3 cellpadding=5>
<tr>
<td align=center colspan=$nlabs ><font color=red size=-1><b>data from a specific experiment</b></font></td>
</tr>
<tr>
";
print NAVIG "
<table bgcolor=#ffffdd align=top>
<tr>
<th colspan=3><font size = '-1' color='red'>Measurements</font></tr>
<td colspan=1><b><i><font size='-1' >p p &rarr; \X</i></b>
&nbsp;<td align='center'> <A HREF=/review/ppcross/PPXSIG.shtml><b><font size=-1>&nbsp;&sigma;&nbsp;</font></b></A>&nbsp;<br> </td>
<td> <A HREF=/review/ppcross/PPXDSIGDT.shtml><b><font size=-1>&nbsp;d&sigma;/dt&nbsp;</font></b></A> &nbsp;<br></td></tr>
<td colspan=1><b><i><font size='-1'><font style='text-decoration:overline'> p</font> p &rarr; X</i></b>
<td align='center'> <A HREF=/review/ppcross/PBARPXSIG.shtml><b><font size=-1>&nbsp;&nbsp;&sigma;&nbsp;&nbsp;</font></b><br></A> </td>
<td> <A HREF=/review/ppcross/PBARPXDSIGDT.shtml><b><font size=-1>&nbsp;&nbsp;d&sigma;/dt&nbsp;&nbsp;</font></b><br></A> </td></tr>
<td colspan=1><b><i><font size='-1'>P P &rarr; P P</i></b>
<td align='center'> <A HREF=/review/ppcross/PPPPSIG.shtml><b><font size=-1>&nbsp;&nbsp;&sigma;&nbsp;&nbsp;</font></b><br></A> </td>
<td> <A HREF=/review/ppcross/PPPPDSIGDT.shtml><b><font size=-1>&nbsp;&nbsp;d&sigma;/dt&nbsp;&nbsp;</font></b><br></A> </td></tr>
<td colspan=1><b><i><font size='-1'><font style='text-decoration:overline'>P</font> P &rarr; <font style='text-decoration:overline'>P</font> P</i></b>
<td align='center'> <A HREF=/review/ppcross/PBARPPBARPSIG.shtml><b><font size=-1>&nbsp;&nbsp;&sigma;&nbsp;&nbsp;</font></b><br></A> </td>
<td> <A HREF=/review/ppcross/PBARPPBARPDSIGDT.shtml><b><font size=-1>&nbsp;&nbsp;d&sigma;/dt&nbsp;&nbsp;</font></b><br></A> </td></tr>
</table.
";
print NAVIG "
<table bgcolor=#ffffdd align=top>
<tr>
<th colspan=2><font size = '-1' color='red'>Experiments</font>
";
foreach $n (1...$nlabs){
print HOME "<th align=center><b><font size=-1>$lab[$n]</font></b></th>
";
}
foreach $m (1...$maxexp){
print HOME "<tr>\n";
foreach $n (1...$nlabs){
print HOME "<td> <A HREF=/review/ppcross/$exp[$n][$m].shtml><b><font size=-2>$exp[$n][$m]</font></b><br></A> </td>\n";
}
print HOME "</tr>\n";
}
print HOME "</table>\n";
foreach $n (1...$nlabs){
print NAVIG "<tr>
<th colspan=2><b><font size='-1' color='#000000'>$lab[$n]</b></tr>
";
$nex = $nexps[$n];
use integer;
$rows = $nex/2;
if(2*$rows != $nex) { $rows++; }
no integer;
foreach $m (1...$rows){
print NAVIG "<tr>\n";
$m1 = 2*$m-1;
$m2 = 2*$m;
print NAVIG "<td> <A HREF=/review/ppcross/$exp[$n][$m1].shtml><b><font size=-2>$exp[$n][$m1]</font></b><br></A> </td>\n";
print NAVIG "<td> <A HREF=/review/ppcross/$exp[$n][$m2].shtml><b><font size=-2>$exp[$n][$m2]</font></b><br></A> </td>\n";
print NAVIG "</tr>\n";
}
}
print NAVIG "</table>\n";
close INPUT;
}
#############################################################################
####NEXT PRODUCE THE INDIVIDUAL EXPERIMENT PAGES
if($ARGV[0] eq "" || $ARGV[0] eq "experiments") {
# open INPUT,'<all.sorted';
open INPUT,'<new.sorted';
# $dummy=<INPUT>;
$oirn=0;
$address="http://hepdata.cedar.ac.uk";
$old_exp = "FIRST";
while ($line=<INPUT>){
chomp $line;
@line = split /\t/,$line;
$exp = $line[0];
if($exp ne $old_exp) {
if($old_exp ne "FIRST"){
print OUTPUT " </ul>
</ul>
</td>
</tr>
</table>
</body>
</html>
";
}
close OUTPUT;
open OUTPUT,">$exp.shtml";
print OUTPUT "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01//EN' 'http://www.w3.org/TR/html4/strict.dtd'>";
print OUTPUT"<html>
<head>
<style TYPE='text/css'>
A:link {color:blue;
text-decoration:underline;
font-family: arial, verdana, helvetica, sans-serif;
font-size: 10pt;
font-weight:bold;}
A:visited {color:blue;
text-decoration:underline;
font-size: 10pt;
font-family: arial, verdana, helvetica, sans-serif;
font-weight:bold;}
A:hover {color:red;
text-decoration:underline;
font-size: 10pt;
font-family: arial, verdana, helvetica, sans-serif;
font-weight:bold;}
TH {background-color:#bbbbbb}
TD {background-color:#eeeeee}
</STYLE>
<link rel='stylesheet' href='/review/pp/hepdata.css' type='text/css'>
</head>
<body>
<table border=1 cellpadding=15pt>
<tr>
<td bgcolor='#DDDDDD' valign='top'>
<!--#include virtual='/review/ppcross/cont.shtml'-->
</td>
<td bgcolor='#EEEEEE' valign='top'>
<!--#include virtual='/review/ppcross/top.shtml'-->
</td>
</tr>
<tr>
<td valign='top'>
<!--#include virtual='/review/ppcross/navig.shtml'-->
</td>
<td bgcolor='#FFFFca' valign='top'>
<title>$exp PP/PBARP data </title>
<body bgcolor='#ffffff'>
<table width='100%'>
<td>
<b><font size=+3 color='#000080'>Data from the $exp Collaboration</font></b>
<td align=right>
<a href=index.shtml>
<img alt='BACK' src='../../../icons/back.gif'</a>
</table>
<hr>
<font size=-1>The individual links display the specific datasets.</font><br>
<font size=-1>The publication reference link displays the SPIRES hep database entry.</font><br>
<font size=-1>The [R] link displays the complete entry for that paper from the HepData Reaction database.</font>
<hr>
";
$first=0;
}
$old_exp=$exp;
$restring = "re.DsReactions like '$line[1]'";
$sqrts = '????';
$obs = $line[2];
$irn = $line[3];
$auth = $line[4];
$ref = $line[5];
# print "$exp\t$restring\t$sqrts\t$obs\t$irn\t$auth\t$ref\n";
if($irn ne $oirn){
print OUTPUT " </ul>\n";
if($first == 0) { print OUTPUT "<ul>\n"; $first=1;}
print OUTPUT " <br><li><b>$auth et al. <a href='http://durpdg.dur.ac.uk/cgi-bin/spiface/find/hep/www?rawcmd=irn+";
print OUTPUT $irn;
print OUTPUT "' target='_blank'>$ref</a>\n";
$result = `echo "select count(*) from Papers where SpiresId=$irn" | mysql hepdata5test`;
@result = split /\n/,$result;
if($result[1]>0){ print OUTPUT " <a href = '$address/View/$irn' target='_blank'>[R]</a>";}
print OUTPUT "<font size=-1> - $irn </font>";
print OUTPUT "</b><br>\n";
$result = `echo "select Title from Papers where SpiresId=$irn" | mysql hepdata5test`;
@result = split /\n/,$result;
$title = $result[1];
if($title eq '') {$title = `ssh h1 'spires/getTitleFromIRN $irn'`;}
print OUTPUT "<i><font size=-1>$title</font></i><br>\n";
print OUTPUT " <ul>\n";
$oirn = $irn;
}
print OUTPUT " <li>$line[9] - ";
print OUTPUT "<font size=-1>$line[1] - $obs </font>";
$dslocal = &getDsLocalDsId($obs,$restring);
# $dsplabs = &getDsPlabs($obs,$restring);
# print "dsslocal:$dslocal dsplabs:$dsplabs\n";
@dslocal = split /\n/,$dslocal;
if($#dslocal>0){
foreach $n (1...$#dslocal){
print OUTPUT "<br/> <font size=-1> $obs </font>\n";
($localid,$dsid) = split /\s+/,$dslocal[$n];
$header = `echo "select Header,AXIS_ID from XAxes where _dataset_DATASET_ID=$dsid and LocalId=1" | mysql hepdata5test`;
@head = split /\n/,$header;
@head1 = split /\s+/,$head[1];
$axid = $head1[$#head1];
@header = split /\s+IN\s+/,$head1[0];
$bins = `echo "select Max(LocalId) from Bins where _xAxis_AXIS_ID=$axid" | mysql hepdata5test`;
@bins = split /\n/,$bins;
print OUTPUT "<font size=-1> <i>v</i> $header[0]</font>";
#print " <a href = '$address/ViewTable/$irn/d$localid'>[$localid]</a>";
print OUTPUT " <a href = '/review-cgi/ppcross/$irn/d$localid'>[$localid]</a>";
if($bins[1] == 1) {
print OUTPUT "<font size=-1> ($bins[1] point)</font>";
} else{
print OUTPUT "<font size=-1> ($bins[1] points)</font>";
}
}
}
if($line[11] ne '' ){ print OUTPUT " $line[11]"; }
}
print OUTPUT " </ul>
</ul>
</td>
</tr>
</table>
</body>
</html>
";
close INPUT;
}
#############################################################################
####NEXT PRODUCE THE Pages for the observables
if($ARGV[0] eq "" || $ARGV[0] eq "observables") {
foreach $REAC ("P P --> P P","PBAR P --> PBAR P","P P --> X","PBAR P --> X"){
foreach $OBS ("SIG","DSIG/DT"){
# $REAC = "PBAR P --> PBAR P";
# $OBS = "SIG";
# open INPUT,'<all.sorted';
open INPUT,'<new.sorted';
$dummy=<INPUT>;
$outputfile = "$REAC"."$OBS";
$outputfile =~ s/-//g;
$outputfile =~ s/>//g;
$outputfile =~ s/\s+//g;
$outputfile =~ s/\///g;
$REAC2 = "<i>$REAC</i>";
$REAC2 =~ s/PBAR/<font style='text-decoration:overline'>P<\/font>/g;
$REAC2 = "\L$REAC2";
$REAC2 =~ s/x/X/;
$REAC2 =~ s/-->/&rarr;/;
$OBS2 = $OBS;
$OBS2 =~ s/SIG/&sigma;/;
$OBS2 = "\L$OBS2";
open OUTPUTOBS,">$outputfile.shtml";
print OUTPUTOBS "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01//EN' 'http://www.w3.org/TR/html4/strict.dtd'>";
print OUTPUTOBS "<html>
<head>
<style TYPE='text/css'>
A:link {color:blue;
text-decoration:underline;
font-family: arial, verdana, helvetica, sans-serif;
font-size: 10pt;
font-weight:bold;}
A:visited {color:blue;
text-decoration:underline;
font-size: 10pt;
font-family: arial, verdana, helvetica, sans-serif;
font-weight:bold;}
A:hover {color:red;
text-decoration:underline;
font-size: 10pt;
font-family: arial, verdana, helvetica, sans-serif;
font-weight:bold;}
TH {background-color:#bbbbbb}
TD {background-color:#eeeeee}
</STYLE>
<link rel='stylesheet' href='/review/pp/hepdata.css' type='text/css'>
</head>
<body>
<table border=1 cellpadding=15pt>
<tr>
<td bgcolor='#DDDDDD' valign='top'>
<!--#include virtual='/review/ppcross/cont.shtml'-->
</td>
<td bgcolor='#EEEEEE' valign='top'>
<!--#include virtual='/review/ppcross/top.shtml'-->
</td>
</tr>
<tr>
<td valign='top'>
<!--#include virtual='/review/ppcross/navig.shtml'-->
</td>
<td bgcolor='#FFFFca' valign='top'>
<title> PP/PBARP data </title>
<body bgcolor='#ffffff'>
<table width='100%'>
<td>
<b><font size=+3 color='#000080'>Data on <font color='red'>$OBS2</font> for <font color='red'>$REAC2</font></font></b>
<td align=right>
<a href=index.shtml>
<img alt='BACK' src='../../../icons/back.gif'</a>
</table>
<hr>
<font size=-1>The individual links display the specific datasets.</font><br>
<font size=-1>The publication reference link displays the SPIRES hep database entry.</font><br>
<font size=-1>The [R] link displays the complete entry for that paper from the HepData Reaction database.</font>
<hr>
";
$oirn=1;
$address="http://hepdata.cedar.ac.uk";
$first=0;
$old_exp = "";
while ($line=<INPUT>){
chomp $line;
@line = split /\t/,$line;
$exp = $line[0];
$reac = $line[1];
$sqrts = '????';
$obs = $line[2];
$irn = $line[3];
$auth = $line[4];
$ref = $line[5];
# "$exp\t$restring\t$sqrts\t$obs\t$irn\t$auth\t$ref\n";
if( ($reac eq "$REAC" && $obs eq "$OBS") || ( ($OBS eq 'DSIG/DT') && ($reac eq "$REAC" && $obs eq 'SLOPE') ) ){
# print OUTPUTOBS "$line<br>\n";
$exp=$line[0];
if($exp ne $oexp){
if($oirn != 1) { print OUTPUTOBS "</ul></ul>" }
print OUTPUTOBS "<font color='red'><b><a name='$exp' href='#$exp'></a>$exp</font></b>";
print OUTPUTOBS "<ul><ul>";
$oexp = $exp;
}
if($irn ne $oirn){
print OUTPUTOBS "</ul>\n";
$first=1;
print OUTPUTOBS "<li><b>$auth et al. <a href= 'http://durpdg.dur.ac.uk/cgi-bin/spiface/find/hep/www?rawcmd=irn+";
print OUTPUTOBS $irn;
print OUTPUTOBS "'>$ref</a>\n";
$result = `echo "select count(*) from Papers where SpiresId=$irn" | mysql hepdata5test`;
@result = split /\s+/,$result;
if($result[1]>0){ print OUTPUTOBS " <a href = '$address/View/$irn'>[R]</a>";}
print OUTPUTOBS "<font size=-1> - $irn </font></b> <br>\n";
$result = `echo "select Title from Papers where SpiresId=$irn" | mysql hepdata5test`;
@result = split /\n/,$result;
$title = $result[1];
if($title eq '') {$title = `ssh h1 'spires/getTitleFromIRN $irn'`;}
print OUTPUTOBS "<i><font size=-1>$title</font></i><br>\n";
print OUTPUTOBS " <ul>\n";
$oirn = $irn;
}
print OUTPUTOBS " <li>$line[10] - ";
print OUTPUTOBS "<b><font size=-1>$reac $obs</font></b>";
$restring = "re.DsReactions like '$reac'";
$dslocalOBS = &getDsLocalDsId($obs,$restring);
@dslocalOBS = split /\n/,$dslocalOBS;
$dslocalXH = &getDsLocalDsIdXH($obs,$restring);
@dslocalXH = split /\n/,$dslocalXH;
if($#dslocalOBS<0 && $#dslocalXH>0){
@dslocal=@dslocalXH;
}
elsif ($#dslocalOBS>0 && $#dslocalXH<0) {
@dslocal=@dslocalOBS;
}
elsif ($#dslocalOBS>0 && $#dslocalXH>0) {
shift(@dslocalXH);
@dslocal = (@dslocalOBS, @dslocalXH);
}
else {
@dslocal = @dslocalOBS;
}
if($#dslocal>0){
foreach $n (1...$#dslocal){
print OUTPUTOBS "<table>\n";
($localid,$dsid) = split /\s+/,$dslocal[$n];
$dscomment = `echo "select Comments from DatasetComments where DATASET_ID=$dsid" | mysql hepdata5test`;
@dscomment = split /\n/,$dscomment;
$header = `echo "select Header,AXIS_ID from XAxes where _dataset_DATASET_ID=$dsid and LocalId=1" | mysql hepdata5test`;
@head = split /\n/,$header;
@head1 = split /\s+/,$head[1];
$axid = $head1[$#head1];
@header = split /\s+IN\s+/,$head1[0];
$header[0] =~ s/^\(//;
$header[0] =~ s/\($//;
if($header[0] =~ m/^MEAN/){
$header[0] =~ s/N=//;
} elsif($header[0] =~ m/^ABS/){
$header[0] =~ s/ABS\(//;$header[0] =~ s/\)$//; @header = split /\(/,$header[0];
} else {
@header = split /\(/,$header[0];
}
if( $header[0] eq 'SQRT') { $header[0]='Ecm'; }
$ecm = `echo "select bp.Focus,bp.LowValue,bp.HighValue from YAxes ya,AxisProperties ap,BaseProperties bp where bp.Name like 'sqrts' and bp.PROPERTY_ID=ap.PROPERTY_ID and ap._yAxis_AXIS_ID=ya.AXIS_ID and ya._dataset_DATASET_ID=$dsid" | mysql hepdata5test`;
@ecm = split /\n/,$ecm;
@ecms = split /\s+/,$ecm[1];
# print "select bp.Focus,bp.LowValue,bp.HighValue from YAxes ya,AxisProperties ap,BaseProperties bp where bp.Name like 'sqrts' and bp.PROPERTY_ID=ap.PROPERTY_ID and ap._yAxis_AXIS_ID=ya.AXIS_ID and ya._dataset_DATASET_ID=$dsid\n";
# $bins = `echo "select Max(LocalId) from Bins where _xAxis_AXIS_ID=$axid" | mysql hepdata5test`;
# @bins = split /\n/,$bins;
print OUTPUTOBS "<tr><td>";
&filter($dscomment[1]);
print OUTPUTOBS "<a href = '/review-cgi/ppcross/$irn/d$localid' title='$dscomment[1]'><font size=-2> $obs <i>v</i> $header[0]</font></a>";
print OUTPUTOBS "<font size=-1> ($localid)</font>";
print OUTPUTOBS "</td>";
print OUTPUTOBS "<td></td><td>";
$shortcomment = substr($dscomment[1],0,80);
if($ecms[2] != $ecms[1]) { $ecm="$ecms[1]-$ecms[2]";} else { $ecm="$ecms[1]";}
print OUTPUTOBS "<font size=-2>(&radic;<font style='text-decoration:overline'>s</font>=$ecm GeV - $shortcomment... $nucleus)</font>";
print OUTPUTOBS "</td></tr>";
print OUTPUTOBS "</table>\n";
}
}
if($line[12] ne '' ){ print OUTPUTOBS " $line[12]"; }
}
}
print OUTPUTOBS " </ul>
</ul>
</td>
</tr>
</table>
</body>
</html>
";
}
}
}
sub filter{
$_[0] =~ s/>/&gt\;/g;
$_[0] =~ s/</&lt\;/g;
$_[0] =~ s/>=/&ge\;/g;
$_[0] =~ s/<=/&le\;/g;
$_[0] =~ s/</&lt\;/g;
$_[0] =~ s/</&lt\;/g;
}
exit();

File Metadata

Mime Type
text/html
Expires
Mon, Jan 20, 8:20 PM (11 h, 56 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4242205
Default Alt Text
process.pl_save (18 KB)

Event Timeline