Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:20:19

0001 
0002 <?php
0003 
0004 // http://logbook.phenix.bnl.gov/OnlMon/mon.cgi?runnumber=327126&runtype=calibdata
0005 // https://www.phenix.bnl.gov/WWW/run/10/online_monitoring/200GeV/mon.cgi?runnumber=310026&runtype=eventdata
0006 
0007 $ncolumns  = 8;
0008 $at_column = 0;
0009 $scale   = "160";
0010 
0011 $topdir     = $_POST[runrange] . $_POST[histos];
0012 
0013 $dirs = explode("/", $topdir);                // split directory 
0014 $sub  = explode(".", $dirs[sizeof($dirs)-1]); // last item of directory string
0015 $subsystem = $sub[0];                         // eliminate .png
0016 
0017 // on logbook.phenix.bnl.gov I need to change the directory listing where I find the plots
0018 // into the correct URL
0019 //
0020 // http://logbook.phenix.bnl.gov/common/s6/backup/OnlMon/html/pedestaldata/run_0000327000_0000328000/327814/MUTRGMON_0_327814.png
0021 // into 
0022 // http://logbook.phenix.bnl.gov/OnlMon/pedestaldata/run_0000327000_0000328000/327814/MUTRGMON_0_327814.png
0023 
0024 $cmd = "ls -r ".$topdir;
0025 
0026 exec($cmd, $all_files);
0027 foreach ( $dirs as $subdir){
0028   if( stristr($subdir, "data")) break;
0029 }
0030 
0031 //$runnumber = 123456;
0032 //$url = "https://www.phenix.bnl.gov/WWW/run/10/online_monitoring/200GeV/mon.cgi?runnumber=".$runnumber."&runtype=".$subdir;
0033 //$url = "http://logbook.phenix.bnl.gov/OnlMon/mon.cgi?runnumber=".$runnumber."&runtype=".$subdir;
0034 //print "handling $topdir , $subdir, $subsystem, $url \n";
0035 
0036 $old_runnumber = 0;
0037 
0038 echo("<html>\n<head>\n</head>\n<body>\n");
0039 echo("<center>\n");
0040 echo("<h1> OnlMon Summary for $subsystem </h1>\n");
0041 echo("<center> Selection was:  $topdir </center>\n");
0042 echo("<table cellpadding=2 border=1>\n");
0043 
0044 foreach ( $all_files as $file ){
0045   $dirs      = explode("/", $file);     // split filename 
0046   $runnumber = $dirs[sizeof($dirs)-2];  // second but last item of directory string
0047   $file_1008 = "http://logbook.phenix.bnl.gov/OnlMon/".$dirs[6]."/".$dirs[7]."/".$dirs[8]."/".$dirs[9]; // the URL for the file is different from disk location
0048 
0049   if( $runnumber != $old_runnumber){
0050 //     $url = "https://www.phenix.bnl.gov/WWW/run/10/online_monitoring/200GeV/mon.cgi?runnumber=".$runnumber."&runtype=".$subdir;
0051 //     $url = "http://logbook.phenix.bnl.gov/OnlMon/mon.cgi?runnumber=".$runnumber."&runtype=".$subdir;
0052      $url = "/OnlMon/mon.cgi?runnumber=".$runnumber."&runtype=".$subdir;
0053      echo("<tr>\n<th colspan=\"$ncolumns\" bgcolor=\"lightgrey\"> <center> <a href=\"$url\" target=\"_blank\"> Run : $runnumber </a> </center></th>\n</tr>\n<tr>\n");
0054      $at_column = 0;
0055      $old_runnumber = $runnumber;
0056   }
0057   echo("<td><a href=\"$file_1008\" target=\"_blank\"><img src=\"$file_1008\" width=\"$scale\" alt=\"$file_1008\"></a></td>");
0058     $at_column = $at_column + 1;
0059     if($at_column == $ncolumns){
0060         echo("</tr>\n<tr>\n");
0061         $at_column = 0;
0062     }
0063 
0064 }
0065 
0066 echo("</tr>\n");
0067 echo("</table>\n");
0068 echo("</html>\n");
0069 
0070 ?>
0071 
0072