Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
showplots.php
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file showplots.php
1 
2 <?php
3 
4 // http://logbook.phenix.bnl.gov/OnlMon/mon.cgi?runnumber=327126&runtype=calibdata
5 // https://www.phenix.bnl.gov/WWW/run/10/online_monitoring/200GeV/mon.cgi?runnumber=310026&runtype=eventdata
6 
9 $scale = "160";
10 
11 $topdir = $_POST[runrange] . $_POST[histos];
12 
13 $dirs = explode("/", $topdir); // split directory
14 $sub = explode(".", $dirs[sizeof($dirs)-1]); // last item of directory string
15 $subsystem = $sub[0]; // eliminate .png
16 
17 // on logbook.phenix.bnl.gov I need to change the directory listing where I find the plots
18 // into the correct URL
19 //
20 // http://logbook.phenix.bnl.gov/common/s6/backup/OnlMon/html/pedestaldata/run_0000327000_0000328000/327814/MUTRGMON_0_327814.png
21 // into
22 // http://logbook.phenix.bnl.gov/OnlMon/pedestaldata/run_0000327000_0000328000/327814/MUTRGMON_0_327814.png
23 
24 $cmd = "ls -r ".$topdir;
25 
26 exec($cmd, $all_files);
27 foreach ( $dirs as $subdir){
28  if( stristr($subdir, "data")) break;
29 }
30 
31 //$runnumber = 123456;
32 //$url = "https://www.phenix.bnl.gov/WWW/run/10/online_monitoring/200GeV/mon.cgi?runnumber=".$runnumber."&runtype=".$subdir;
33 //$url = "http://logbook.phenix.bnl.gov/OnlMon/mon.cgi?runnumber=".$runnumber."&runtype=".$subdir;
34 //print "handling $topdir , $subdir, $subsystem, $url \n";
35 
37 
38 echo("<html>\n<head>\n</head>\n<body>\n");
39 echo("<center>\n");
40 echo("<h1> OnlMon Summary for $subsystem </h1>\n");
41 echo("<center> Selection was: $topdir </center>\n");
42 echo("<table cellpadding=2 border=1>\n");
43 
44 foreach ( $all_files as $file ){
45  $dirs = explode("/", $file); // split filename
46  $runnumber = $dirs[sizeof($dirs)-2]; // second but last item of directory string
47  $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
48 
49  if( $runnumber != $old_runnumber){
50 // $url = "https://www.phenix.bnl.gov/WWW/run/10/online_monitoring/200GeV/mon.cgi?runnumber=".$runnumber."&runtype=".$subdir;
51 // $url = "http://logbook.phenix.bnl.gov/OnlMon/mon.cgi?runnumber=".$runnumber."&runtype=".$subdir;
52  $url = "/OnlMon/mon.cgi?runnumber=".$runnumber."&runtype=".$subdir;
53  echo("<tr>\n<th colspan=\"$ncolumns\" bgcolor=\"lightgrey\"> <center> <a href=\"$url\" target=\"_blank\"> Run : $runnumber </a> </center></th>\n</tr>\n<tr>\n");
54  $at_column = 0;
55  $old_runnumber = $runnumber;
56  }
57  echo("<td><a href=\"$file_1008\" target=\"_blank\"><img src=\"$file_1008\" width=\"$scale\" alt=\"$file_1008\"></a></td>");
58  $at_column = $at_column + 1;
59  if($at_column == $ncolumns){
60  echo("</tr>\n<tr>\n");
61  $at_column = 0;
62  }
63 
64 }
65 
66 echo("</tr>\n");
67 echo("</table>\n");
68 echo("</html>\n");
69 
70 ?>
71 
72