]> jspc29.x-matter.uni-frankfurt.de Git - hadesdaq.git/commitdiff
update hmon scripts
authorhadaq <jan@lxhadeb07>
Mon, 25 May 2020 11:59:05 +0000 (13:59 +0200)
committerhadaq <jan@lxhadeb07>
Mon, 25 May 2020 11:59:05 +0000 (13:59 +0200)
13 files changed:
hmon/doc/ecal-starthv.htt [new file with mode: 0644]
hmon/doc/misc-fwhv.htt [new file with mode: 0644]
hmon/hmon_busynew.pl
hmon/hmon_ecalrate.pl
hmon/hmon_mdc_voltage.pl
hmon/hmon_rpcrate.pl [new file with mode: 0755]
hmon/hmon_rpctof_sectorwise.pl [new file with mode: 0755]
hmon/hmon_stsrate.pl [new file with mode: 0755]
hmon/hmon_tofrate.pl [new file with mode: 0755]
hmon/index.cgi
hmon/permanent/hmon_eberrbits.pl
hmon/permanent/hmon_mdcpressure.pl
hmon/styles.css

diff --git a/hmon/doc/ecal-starthv.htt b/hmon/doc/ecal-starthv.htt
new file mode 100644 (file)
index 0000000..3563a18
--- /dev/null
@@ -0,0 +1 @@
+Just a monitor - if it's red, please inform Jurek.
diff --git a/hmon/doc/misc-fwhv.htt b/hmon/doc/misc-fwhv.htt
new file mode 100644 (file)
index 0000000..8bc6575
--- /dev/null
@@ -0,0 +1 @@
+Just a monitor - if it's red, it's in the responsibility of the FW operator, please inform them.
index d53c3a6464356911309ca90f138109265451045e..9fbc2b7a35ab5b39f546dc117fc2b5dc738051c5 100755 (executable)
@@ -25,7 +25,7 @@ $plot->{titles}->[2] = "ECal";
 $plot->{titles}->[3] = "RPC";
 $plot->{titles}->[4] = "Rich";
 $plot->{titles}->[5] = "TOF";
-$plot->{titles}->[6] = "Wall";
+$plot->{titles}->[6] = "STS";
 $plot->{titles}->[7] = "Cts";
 $plot->{titles}->[8] = "Start";
 # $plot->{titles}->[9] = "Pion";
@@ -44,7 +44,7 @@ HPlot::PlotInit($plot);
 HPlot::PlotInit({
   name     => "BusyTimeBars",
   file     => "files/BusyTimeBars",
-  curves   => 8,
+  curves   => 1,
   type     => HPlot::TYPE_BARGRAPH,
   output   => HPlot::OUT_PNG,
   ylabel   => "Deadtime (%)",
@@ -52,10 +52,10 @@ HPlot::PlotInit({
   sizex    => 520,
   sizey    => 265,
   nokey    => 1,
-  entries  => 10,
+  entries  => 9,
   ymin     => -1,
   ymax     => 101,
-  bartitle => ["M12","M34","ECa","RPC","Ric1","Ric2","TOF","FW","Cts","St"],
+  bartitle => ["M12","M34","ECa","RPC","Rich","TOF","STS","Cts","St"],
   buffer   => 1,
   storable => 0,
   bargap   => 5,
@@ -87,7 +87,7 @@ for my $p (0..8) {
 
 while (1) {
   my $o;
-  foreach my $b (0x8000,0x8012,0x8013,0x8015,0x8016,0x8017,0x8018) {
+  foreach my $b (0x8000, 0x8018){#,0x8012,0x8013,0x8015,0x8016,0x8017,0x8018) {
     my $t = trb_registertime_read_mem($b,0x4030,0,10);
     $o->{$b} = $t->{$b};
     }
@@ -104,17 +104,15 @@ while (1) {
         }
       }
       
-    my $rich1max = max($diff->{0x8017}->[0],$diff->{0x8017}->[1],$diff->{0x8017}->[2],$diff->{0x8017}->[3],$diff->{0x8017}->[4],$diff->{0x8017}->[5]);  
-    my $rich2max = max($diff->{0x8018}->[0],$diff->{0x8018}->[1],$diff->{0x8018}->[2],$diff->{0x8018}->[3],$diff->{0x8018}->[4],$diff->{0x8018}->[5]);  
-      
+     
     HPlot::PlotAdd('BusyTimes',$diff->{0x8000}->[5],0); #MDC12
     HPlot::PlotAdd('BusyTimes',$diff->{0x8000}->[6],1); #MDC34
     HPlot::PlotAdd('BusyTimes',$diff->{0x8000}->[3],2); #ECal
-    HPlot::PlotAdd('BusyTimes',max($diff->{0x8012}->[2],$diff->{0x8012}->[3]),3); #RPC
+    HPlot::PlotAdd('BusyTimes',$diff->{0x8000}->[1],3); #RPC
     HPlot::PlotAdd('BusyTimes',max($diff->{0x8000}->[7],$diff->{0x8000}->[8]),4); #Rich
-    HPlot::PlotAdd('BusyTimes',$diff->{0x8012}->[1],5); #Tof
-    HPlot::PlotAdd('BusyTimes',$diff->{0x8012}->[0],6); #Wall
-    HPlot::PlotAdd('BusyTimes',$diff->{0x8000}->[1],7); #Cts
+    HPlot::PlotAdd('BusyTimes',$diff->{0x8000}->[2],5); #Tof
+    HPlot::PlotAdd('BusyTimes',$diff->{0x8000}->[4],6); #STS
+    HPlot::PlotAdd('BusyTimes',$diff->{0x8000}->[0],7); #Cts
     HPlot::PlotAdd('BusyTimes',$diff->{0x8018}->[6],8); #Start TRB3
 #     HPlot::PlotAdd('BusyTimes',max($diff->{0x8003}->[1],$diff->{0x8003}->[2]),9); #Pion
 
@@ -122,51 +120,50 @@ while (1) {
     HPlot::PlotFill('BusyTimeBars',$diff->{0x8000}->[5],0); #MDC12
     HPlot::PlotFill('BusyTimeBars',$diff->{0x8000}->[6],1); #MDC34
     HPlot::PlotFill('BusyTimeBars',$diff->{0x8000}->[3],2); #ECal
-    HPlot::PlotFill('BusyTimeBars',max($diff->{0x8012}->[2],$diff->{0x8012}->[3]),3); #RPC
-    HPlot::PlotFill('BusyTimeBars',$rich1max,4); #Rich
-    HPlot::PlotFill('BusyTimeBars',$rich2max,5); #Rich
-    HPlot::PlotFill('BusyTimeBars',$diff->{0x8012}->[1],6); #Tof
-    HPlot::PlotFill('BusyTimeBars',$diff->{0x8012}->[0],7); #Wall
-    HPlot::PlotFill('BusyTimeBars',$diff->{0x8000}->[1],8); #Cts
-    HPlot::PlotFill('BusyTimeBars',$diff->{0x8018}->[6],9); #Start TRB3
+    HPlot::PlotFill('BusyTimeBars',$diff->{0x8000}->[1],3); #RPC
+    HPlot::PlotFill('BusyTimeBars',max($diff->{0x8000}->[7],$diff->{0x8000}->[8]),4); #Rich
+    HPlot::PlotFill('BusyTimeBars',$diff->{0x8000}->[2],5); #Tof
+    HPlot::PlotFill('BusyTimeBars',$diff->{0x8000}->[4],6); #STS
+    HPlot::PlotFill('BusyTimeBars',$diff->{0x8000}->[0],7); #Cts
+    HPlot::PlotFill('BusyTimeBars',$diff->{0x8018}->[6],8); #Start TRB3
 #     HPlot::PlotAdd('BusyTimes',max($diff->{0x8003}->[1],$diff->{0x8003}->[2]),9); #Pion
 
-#Extended view
-    HPlot::PlotFill('BusyTimeBars',$diff->{0x8015}->[0],0,6); #MDC12
-    HPlot::PlotFill('BusyTimeBars',$diff->{0x8015}->[1],0,5); #MDC12
-    HPlot::PlotFill('BusyTimeBars',$diff->{0x8015}->[2],0,4); #MDC12
-    HPlot::PlotFill('BusyTimeBars',$diff->{0x8015}->[3],0,3); #MDC12
-    HPlot::PlotFill('BusyTimeBars',$diff->{0x8015}->[4],0,2); #MDC12
-    HPlot::PlotFill('BusyTimeBars',$diff->{0x8015}->[5],0,1); #MDC12
-    HPlot::PlotFill('BusyTimeBars',$diff->{0x8016}->[0],1,6); #MDC34
-    HPlot::PlotFill('BusyTimeBars',$diff->{0x8016}->[1],1,5); #MDC34
-    HPlot::PlotFill('BusyTimeBars',$diff->{0x8016}->[2],1,4); #MDC34
-    HPlot::PlotFill('BusyTimeBars',$diff->{0x8016}->[3],1,3); #MDC34
-    HPlot::PlotFill('BusyTimeBars',$diff->{0x8016}->[4],1,2); #MDC34
-    HPlot::PlotFill('BusyTimeBars',$diff->{0x8016}->[5],1,1); #MDC34
-    HPlot::PlotFill('BusyTimeBars',$diff->{0x8013}->[0],2,6); #ECal
-    HPlot::PlotFill('BusyTimeBars',$diff->{0x8013}->[1],2,5); #ECal
-    HPlot::PlotFill('BusyTimeBars',$diff->{0x8013}->[2],2,4); #ECal
-    HPlot::PlotFill('BusyTimeBars',$diff->{0x8013}->[3],2,3); #ECal
-    HPlot::PlotFill('BusyTimeBars',$diff->{0x8013}->[4],2,2); #ECal
-    HPlot::PlotFill('BusyTimeBars',$diff->{0x8013}->[5],2,1); #ECal
-    HPlot::PlotFill('BusyTimeBars',$diff->{0x8012}->[2],3,5); #RPC
-    HPlot::PlotFill('BusyTimeBars',$diff->{0x8012}->[3],3,4); #RPC
-#     HPlot::PlotFill('BusyTimeBars',$diff->{0x8000}->[7],4,5); #Rich
-#     HPlot::PlotFill('BusyTimeBars',$diff->{0x8000}->[8],4,4); #Rich
-
-    HPlot::PlotFill('BusyTimeBars',$diff->{0x8017}->[0],4,6); #Rich
-    HPlot::PlotFill('BusyTimeBars',$diff->{0x8017}->[1],4,5); #Rich
-    HPlot::PlotFill('BusyTimeBars',$diff->{0x8017}->[2],4,4); #Rich
-    HPlot::PlotFill('BusyTimeBars',$diff->{0x8017}->[3],4,3); #Rich
-    HPlot::PlotFill('BusyTimeBars',$diff->{0x8017}->[4],4,2); #Rich
-    HPlot::PlotFill('BusyTimeBars',$diff->{0x8017}->[5],4,1); #Rich
-    HPlot::PlotFill('BusyTimeBars',$diff->{0x8018}->[0],5,6); #Rich
-    HPlot::PlotFill('BusyTimeBars',$diff->{0x8018}->[1],5,5); #Rich
-    HPlot::PlotFill('BusyTimeBars',$diff->{0x8018}->[2],5,4); #Rich
-    HPlot::PlotFill('BusyTimeBars',$diff->{0x8018}->[3],5,3); #Rich
-    HPlot::PlotFill('BusyTimeBars',$diff->{0x8018}->[4],5,2); #Rich
-    HPlot::PlotFill('BusyTimeBars',$diff->{0x8018}->[5],5,1); #Rich
+# #Extended view
+    HPlot::PlotFill('BusyTimeBars',$diff->{0x8015}->[0],0,6); #MDC12
+    HPlot::PlotFill('BusyTimeBars',$diff->{0x8015}->[1],0,5); #MDC12
+    HPlot::PlotFill('BusyTimeBars',$diff->{0x8015}->[2],0,4); #MDC12
+    HPlot::PlotFill('BusyTimeBars',$diff->{0x8015}->[3],0,3); #MDC12
+    HPlot::PlotFill('BusyTimeBars',$diff->{0x8015}->[4],0,2); #MDC12
+    HPlot::PlotFill('BusyTimeBars',$diff->{0x8015}->[5],0,1); #MDC12
+    HPlot::PlotFill('BusyTimeBars',$diff->{0x8016}->[0],1,6); #MDC34
+    HPlot::PlotFill('BusyTimeBars',$diff->{0x8016}->[1],1,5); #MDC34
+    HPlot::PlotFill('BusyTimeBars',$diff->{0x8016}->[2],1,4); #MDC34
+    HPlot::PlotFill('BusyTimeBars',$diff->{0x8016}->[3],1,3); #MDC34
+    HPlot::PlotFill('BusyTimeBars',$diff->{0x8016}->[4],1,2); #MDC34
+    HPlot::PlotFill('BusyTimeBars',$diff->{0x8016}->[5],1,1); #MDC34
+    HPlot::PlotFill('BusyTimeBars',$diff->{0x8013}->[0],2,6); #ECal
+    HPlot::PlotFill('BusyTimeBars',$diff->{0x8013}->[1],2,5); #ECal
+    HPlot::PlotFill('BusyTimeBars',$diff->{0x8013}->[2],2,4); #ECal
+    HPlot::PlotFill('BusyTimeBars',$diff->{0x8013}->[3],2,3); #ECal
+    HPlot::PlotFill('BusyTimeBars',$diff->{0x8013}->[4],2,2); #ECal
+    HPlot::PlotFill('BusyTimeBars',$diff->{0x8013}->[5],2,1); #ECal
+    HPlot::PlotFill('BusyTimeBars',$diff->{0x8012}->[2],3,5); #RPC
+    HPlot::PlotFill('BusyTimeBars',$diff->{0x8012}->[3],3,4); #RPC
+#     HPlot::PlotFill('BusyTimeBars',$diff->{0x8000}->[7],4,5); #Rich
+#     HPlot::PlotFill('BusyTimeBars',$diff->{0x8000}->[8],4,4); #Rich
+# 
+    HPlot::PlotFill('BusyTimeBars',$diff->{0x8017}->[0],4,6); #Rich
+    HPlot::PlotFill('BusyTimeBars',$diff->{0x8017}->[1],4,5); #Rich
+    HPlot::PlotFill('BusyTimeBars',$diff->{0x8017}->[2],4,4); #Rich
+    HPlot::PlotFill('BusyTimeBars',$diff->{0x8017}->[3],4,3); #Rich
+    HPlot::PlotFill('BusyTimeBars',$diff->{0x8017}->[4],4,2); #Rich
+    HPlot::PlotFill('BusyTimeBars',$diff->{0x8017}->[5],4,1); #Rich
+    HPlot::PlotFill('BusyTimeBars',$diff->{0x8018}->[0],5,6); #Rich
+    HPlot::PlotFill('BusyTimeBars',$diff->{0x8018}->[1],5,5); #Rich
+    HPlot::PlotFill('BusyTimeBars',$diff->{0x8018}->[2],5,4); #Rich
+    HPlot::PlotFill('BusyTimeBars',$diff->{0x8018}->[3],5,3); #Rich
+    HPlot::PlotFill('BusyTimeBars',$diff->{0x8018}->[4],5,2); #Rich
+    HPlot::PlotFill('BusyTimeBars',$diff->{0x8018}->[5],5,1); #Rich
     
 #     HPlot::PlotFill('BusyTimeBars',$diff->{0x8018}->[6],7,5); #Start
 #     HPlot::PlotFill('BusyTimeBars',$diff->{0x8000}->[1],9,5); #Cts
index 7a912814b0765e1b622f45bcb74f9145032e8e37..b65f1f5f83a014918779bf8fdebba1fe05435eb0 100755 (executable)
@@ -83,6 +83,29 @@ for my $i (0..5) {
   noinit  => 0,
   showvalues => 0,  });
   }  
+
+HPlot::PlotInit({
+name    => "EcalRate",
+file    => "files/EcalRate",
+title   => "ECal Rate",
+entries => 48,
+curves  => 60,
+type    => HPlot::TYPE_HEATMAP,
+output  => HPlot::OUT_PNG,
+zlabel  => "Hitrate",
+sizex   => 470,
+sizey   => 420,
+nokey   => 1,
+buffer  => 1,
+ymin    => 59.5,
+ymax    => -0.5,
+xmin    => -0.5,
+xmax    => 47.5,
+cbmax   => "100<*<1E5",
+cbmin   => 0,
+noinit  => 1,
+additional => "set logscale cb;",
+showvalues => 0,  });  
   
 my $str  = Hmon::MakeTitle(16, 20, "ECal Hit Rate",0);
 for my $i (0..5) {
@@ -95,6 +118,13 @@ $str .= Hmon::MakeFooter();
 Hmon::WriteFile("ECalRate",$str);
 
 
+my $str  = Hmon::MakeTitle(6, 9, "ECal Hit Rate",0);
+$str .= qq@<img src="%ADDPNG files/EcalRate.png%" type="image/png"><br>\n@;
+
+$str .= Hmon::MakeFooter();
+Hmon::WriteFile("EcalSimpleRate",$str);
+
+
 my $old;
 my $oldtime = time();
 my $time = time();
@@ -114,6 +144,7 @@ while(1) {
     my $tdiff = (time() - $oldtime||0) || 1;
     foreach my $b (keys %$o) {
       my $sec  = ($b>>4) & 0x7;
+      my $simpxpos =  (($b>>4)&0xF)*10 + ($b&0xF);
       for my $v (0..23) {
         my $xpos =  ($b&0xF)*3 + int($v/8);
         
@@ -137,6 +168,10 @@ while(1) {
         HPlot::PlotFill('EcalRateFast'.$sec,$diff->{$b}->[$v*2+1],$xpos,$v % 8);
         HPlot::PlotFill('EcalRateSlow'.$sec,$diff->{$b}->[$v*2+2],$xpos,$v % 8);
         HPlot::PlotFill('EcalRateDiff'.$sec,$ratio,$xpos,$v % 8);
+        
+        HPlot::PlotFill('EcalRate',$diff->{$b}->[$v*2+1],$v*2,$simpxpos);
+        HPlot::PlotFill('EcalRate',$diff->{$b}->[$v*2+2],$v*2+1,$simpxpos);
+
         }
       }
     for my $i (0..5) {    
@@ -144,6 +179,7 @@ while(1) {
       HPlot::PlotDraw('EcalRateSlow'.$i);    
       HPlot::PlotDraw('EcalRateDiff'.$i);    
       }
+    HPlot::PlotDraw('EcalRate');    
     }
   $old = $o;
   $oldtime = time();
index 93c47878b8dff0e0cf1adfb282136ebde9b63c3f..79a2181d559649d704d5f38b78164634b3de04b2 100755 (executable)
@@ -19,7 +19,7 @@ my $status = "";
 
 my @names = qw(5.8V 5V 3.8V 3.3V 1.8V 1.2V 3V -3V);
 my @minimum = (5.5, 4.75, 3.5, 3.15, 1.4, 1.15, 2.90, -3.05);
-my @maximum = (6.1, 5.1, 4.0, 3.4, 2.0, 1.25, 3.10, -2.95);
+my @maximum = (6.2, 5.1, 4.0, 3.4, 2.0, 1.25, 3.10, -2.95);
 
 
 my $fqa = QA::OpenQAFile();
diff --git a/hmon/hmon_rpcrate.pl b/hmon/hmon_rpcrate.pl
new file mode 100755 (executable)
index 0000000..357bb3f
--- /dev/null
@@ -0,0 +1,110 @@
+#!/usr/bin/perl -w
+
+use warnings;
+use strict;
+use Data::Dumper;
+use Data::TreeDumper;
+use Hmon;
+use QA;
+use HADES::TrbNet;
+use HPlot;
+use Time::HiRes qw(usleep time);
+use List::Util qw[min max];
+
+use Encode qw(encode from_to);
+use JSON::XS;
+
+
+my $plot1 = {
+name    => "RpcRate",
+file    => "files/RpcRate",
+title   => "RPC Rate",
+entries => 48,
+curves  => 60,
+type    => HPlot::TYPE_HEATMAP,
+output  => HPlot::OUT_PNG,
+zlabel  => "Hitrate",
+sizex   => 470,
+sizey   => 420,
+nokey   => 1,
+buffer  => 1,
+ymin    => 59.5,
+ymax    => -0.5,
+xmin    => -0.5,
+xmax    => 47.5,
+cbmax   => "100<*<1E5",
+cbmin   => 0,
+noinit  => 1,
+additional => "set logscale cb;",
+showvalues => 0,  };
+HPlot::PlotInit($plot1);
+
+
+my $str  = Hmon::MakeTitle(6, 9, "RPC Hit Rate",0);
+$str .= qq@<img src="%ADDPNG files/RpcRate.png%" type="image/png"><br>\n@;
+
+$str .= Hmon::MakeFooter();
+Hmon::WriteFile("RpcRate",$str);
+
+
+my $old;
+my $oldtime = time();
+my $time = time();
+my $diff;
+my $iter = 0;
+
+
+
+trb_init_ports() or die trb_strerror();
+
+
+while(1) {
+  #my $data;
+  #my $max = 0 ;
+  #my $min = 5E9;
+  
+  my $o = trb_register_read_mem(0xfe73,0xc000,0,49) or die trb_strerror() or sleep 5 and next;
+
+  if (defined $old) {
+    my $tdiff = (time() - $oldtime)|1;
+    foreach my $b (keys %$o) {
+      #my $ratesum = 0;
+      next unless ($b>=0x5800 && $b<=0x58ff);
+      my $xpos =  (($b>>4)&0xF)*10 + ($b&0xF);
+
+      for my $v (0..47) {
+        my $vdiff = ($o->{$b}->[$v+1]&0xfffffff) - ($old->{$b}->[$v+1]&0xfffffff);
+        
+        if ($vdiff < 0) { $vdiff += 2**28;}
+        $diff->{$b}->[$v+1] = $vdiff/$tdiff;
+        #$ratesum += $diff->{$b}->[$v+1];
+        HPlot::PlotFill('RpcRate',$diff->{$b}->[$v+1],$v,$xpos);
+        }
+      #my $s = sprintf("0x%04x",$b);
+      #$data->{$s}= int(100*($ratesum / 32) +0.5) /100;
+      
+      #$min = $data->{$s} if $data->{$s} < $min;
+      #$max = $data->{$s} if  $data->{$s}> $max;
+      }
+    HPlot::PlotDraw('RpcRate');    
+    
+    
+    
+   # $data->{max} = $max;
+   # $data->{min} = $min;
+   # $data->{symbol} = " Hits/s";
+   # $data->{title} = "Mean DiRICH TDC Rate";
+    
+   
+   # $data->{updatetime} = getTimeString; 
+    
+   # my $fh;
+   # open($fh, ">", Hmon::HMONDIR."/files/richMeanRateDiRICH.json");
+   # print $fh   encode_json($data);
+   # close $fh;
+   }
+    
+  $old = $o;
+  $oldtime = time();
+  sleep 2;
+  }
diff --git a/hmon/hmon_rpctof_sectorwise.pl b/hmon/hmon_rpctof_sectorwise.pl
new file mode 100755 (executable)
index 0000000..e4bcd37
--- /dev/null
@@ -0,0 +1,99 @@
+#!/usr/bin/perl -w
+
+use warnings;
+use Time::HiRes qw(usleep);
+use Data::Dumper;
+use Hmon;
+use QA;
+use HADES::TrbNet;
+use HPlot;
+
+
+HPlot::PlotInit({
+  name    => "RpcTofSectorRate",
+  file    => "files/RpcTofSectorRate",
+  entries => 6,
+  curves  => 2,
+  type    => HPlot::TYPE_BARGRAPH,
+  output  => HPlot::OUT_PNG,
+  titles  => ["TOF","RPC"],
+  xlabel  => "Sectors",
+  ylabel  => "Counts [Hz]",
+  sizex   => 370,
+  sizey   => 370,
+  xmin    => -0.3,
+  xmax    => 5.8,
+  ymax    => "500<*<1E5",
+  ymin    => 0,
+  nokey   => 0,
+  buffer  => 1,
+  bargap => 0.4,
+  curvewidth => 1,
+  storable=> 1}
+  );
+
+HPlot::PlotInit({
+  name    => "RpcTofSectorRateHist",
+  file    => "files/RpcTofSectorRateHist",
+  entries => 60,
+  curves  => 12,
+  type    => HPlot::TYPE_HISTORY,
+  output  => HPlot::OUT_PNG,
+  titles  => ["R0","R1","R2","R3","R4","R5","T0","T1","T2","T3","T4","T5"],
+  xlabel  => "Time [s]",
+  ylabel  => "Counts [Hz]",
+  sizex   => 550,
+  sizey   => 370,
+#   nokey   => 1,
+  buffer  => 1,
+  storable=> 1}
+  );
+
+my  $str = Hmon::MakeTitle(12,8,"RpcTofSectorRate",0);
+  $str .= qq@<img src="%ADDPNG files/RpcTofSectorRate.png%" type="image/png">\n@;
+  $str .= qq@<img src="%ADDPNG files/RpcTofSectorRateHist.png%" type="image/png">@;
+  $str .= Hmon::MakeFooter();
+  Hmon::WriteFile("RpcTofSectorRate",$str);
+
+# my $fqa = QA::OpenQAFile() or die "No connection to QA Logfile";
+
+trb_init_ports() or die trb_strerror();
+
+my @values;
+my $oldrpc;
+my $oldtof;
+  
+while (1) {
+  my $rpcsum = 0;
+  my $tofsum = 0;
+
+  my $o = trb_register_read(0xfe60,0xdfe6);
+  foreach my $b (keys %{$o}) {
+    next unless defined $oldrpc->{$b};
+    my $diff = $o->{$b} - $oldrpc->{$b};
+       $diff += 2**24 if $diff < 0;
+    if ($b >= 0x84c0 && $b <= 0x84c5) {
+      HPlot::PlotFill('RpcTofSectorRate',$diff,$b&0xF,1);
+      HPlot::PlotAdd( 'RpcTofSectorRateHist',$diff,$b&0xF);
+      }
+    }
+  $oldrpc = $o;
+  
+  $o = trb_register_read(0xfe60,0xdfe6);
+  foreach my $b (keys %{$o}) {
+    next unless defined $oldtof->{$b};
+    my $diff = $o->{$b} - $oldtof->{$b};
+       $diff += 2**24 if $diff < 0;
+    if ($b >= 0x86c0 && $b <= 0x86c5) {
+      HPlot::PlotFill('RpcTofSectorRate',$diff,$b&0xF,0);
+      HPlot::PlotAdd( 'RpcTofSectorRateHist',$diff,($b&0xF)+6);
+      }
+    }
+  $oldtof = $o;
+  
+  
+  HPlot::PlotDraw('RpcTofSectorRate');
+  HPlot::PlotDraw('RpcTofSectorRateHist');
+  sleep(1);
+  }
+
diff --git a/hmon/hmon_stsrate.pl b/hmon/hmon_stsrate.pl
new file mode 100755 (executable)
index 0000000..d73685e
--- /dev/null
@@ -0,0 +1,110 @@
+#!/usr/bin/perl -w
+
+use warnings;
+use strict;
+use Data::Dumper;
+use Data::TreeDumper;
+use Hmon;
+use QA;
+use HADES::TrbNet;
+use HPlot;
+use Time::HiRes qw(usleep time);
+use List::Util qw[min max];
+
+use Encode qw(encode from_to);
+use JSON::XS;
+
+
+my $plot1 = {
+name    => "StsRate",
+file    => "files/StsRate",
+title   => "STS Rate",
+entries => 48,
+curves  => 80,
+type    => HPlot::TYPE_HEATMAP,
+output  => HPlot::OUT_PNG,
+zlabel  => "Hitrate",
+sizex   => 470,
+sizey   => 420,
+nokey   => 1,
+buffer  => 1,
+ymin    => 79.5,
+ymax    => -0.5,
+xmin    => -0.5,
+xmax    => 47.5,
+cbmax   => "100<*<1E5",
+cbmin   => 0,
+noinit  => 1,
+additional => "set logscale cb;",
+showvalues => 0,  };
+HPlot::PlotInit($plot1);
+
+
+my $str  = Hmon::MakeTitle(6, 9, "STS Hit Rate",0);
+$str .= qq@<img src="%ADDPNG files/StsRate.png%" type="image/png"><br>\n@;
+
+$str .= Hmon::MakeFooter();
+Hmon::WriteFile("StsRate",$str);
+
+
+my $old;
+my $oldtime = time();
+my $time = time();
+my $diff;
+my $iter = 0;
+
+
+
+trb_init_ports() or die trb_strerror();
+
+
+while(1) {
+  #my $data;
+  #my $max = 0 ;
+  #my $min = 5E9;
+  
+  my $o = trb_register_read_mem(0xfe4c,0xc000,0,49) or die trb_strerror() or sleep 5 and next;
+
+  if (defined $old) {
+    my $tdiff = (time() - $oldtime)|1;
+    foreach my $b (keys %$o) {
+      #my $ratesum = 0;
+      next unless ($b>=0x6400 && $b<=0x64ff);
+      my $xpos =  (($b>>4)&0xF)*10 + ($b&0xF);
+
+      for my $v (0..47) {
+        my $vdiff = ($o->{$b}->[$v+1]&0xfffffff) - ($old->{$b}->[$v+1]&0xfffffff);
+        
+        if ($vdiff < 0) { $vdiff += 2**28;}
+        $diff->{$b}->[$v+1] = $vdiff/$tdiff;
+        #$ratesum += $diff->{$b}->[$v+1];
+        HPlot::PlotFill('StsRate',$diff->{$b}->[$v+1],$v,$xpos);
+        }
+      #my $s = sprintf("0x%04x",$b);
+      #$data->{$s}= int(100*($ratesum / 32) +0.5) /100;
+      
+      #$min = $data->{$s} if $data->{$s} < $min;
+      #$max = $data->{$s} if  $data->{$s}> $max;
+      }
+    HPlot::PlotDraw('StsRate');    
+    
+    
+    
+   # $data->{max} = $max;
+   # $data->{min} = $min;
+   # $data->{symbol} = " Hits/s";
+   # $data->{title} = "Mean DiRICH TDC Rate";
+    
+   
+   # $data->{updatetime} = getTimeString; 
+    
+   # my $fh;
+   # open($fh, ">", Hmon::HMONDIR."/files/richMeanRateDiRICH.json");
+   # print $fh   encode_json($data);
+   # close $fh;
+   }
+    
+  $old = $o;
+  $oldtime = time();
+  sleep 2;
+  }
diff --git a/hmon/hmon_tofrate.pl b/hmon/hmon_tofrate.pl
new file mode 100755 (executable)
index 0000000..8dbe969
--- /dev/null
@@ -0,0 +1,110 @@
+#!/usr/bin/perl -w
+
+use warnings;
+use strict;
+use Data::Dumper;
+use Data::TreeDumper;
+use Hmon;
+use QA;
+use HADES::TrbNet;
+use HPlot;
+use Time::HiRes qw(usleep time);
+use List::Util qw[min max];
+
+use Encode qw(encode from_to);
+use JSON::XS;
+
+
+my $plot1 = {
+name    => "TofRate",
+file    => "files/TofRate",
+title   => "TOF Rate",
+entries => 32,
+curves  => 70,
+type    => HPlot::TYPE_HEATMAP,
+output  => HPlot::OUT_PNG,
+zlabel  => "Hitrate",
+sizex   => 470,
+sizey   => 420,
+nokey   => 1,
+buffer  => 1,
+ymin    => 69.5,
+ymax    => -0.5,
+xmin    => -0.5,
+xmax    => 31.5,
+cbmax   => "100<*<1E5",
+cbmin   => 0,
+noinit  => 1,
+additional => "set logscale cb;",
+showvalues => 0,  };
+HPlot::PlotInit($plot1);
+
+
+my $str  = Hmon::MakeTitle(6, 9, "TOF Hit Rate",0);
+$str .= qq@<img src="%ADDPNG files/TofRate.png%" type="image/png"><br>\n@;
+
+$str .= Hmon::MakeFooter();
+Hmon::WriteFile("TofRate",$str);
+
+
+my $old;
+my $oldtime = time();
+my $time = time();
+my $diff;
+my $iter = 0;
+
+
+
+trb_init_ports() or die trb_strerror();
+
+
+while(1) {
+  #my $data;
+  #my $max = 0 ;
+  #my $min = 5E9;
+  
+  my $o = trb_register_read_mem(0xfe73,0xc000,0,33) or die trb_strerror() or sleep 5 and next;
+
+  if (defined $old) {
+    my $tdiff = (time() - $oldtime)|1;
+    foreach my $b (keys %$o) {
+      #my $ratesum = 0;
+      next unless ($b>=0x5c00 && $b<=0x5cff);
+      my $xpos =  (($b>>4)&0xF)*10 + ($b&0xF);
+
+      for my $v (0..31) {
+        my $vdiff = ($o->{$b}->[$v+1]&0xfffffff) - ($old->{$b}->[$v+1]&0xfffffff);
+        
+        if ($vdiff < 0) { $vdiff += 2**28;}
+        $diff->{$b}->[$v+1] = $vdiff/$tdiff;
+        #$ratesum += $diff->{$b}->[$v+1];
+        HPlot::PlotFill('TofRate',$diff->{$b}->[$v+1],$v,$xpos);
+        }
+      #my $s = sprintf("0x%04x",$b);
+      #$data->{$s}= int(100*($ratesum / 32) +0.5) /100;
+      
+      #$min = $data->{$s} if $data->{$s} < $min;
+      #$max = $data->{$s} if  $data->{$s}> $max;
+      }
+    HPlot::PlotDraw('TofRate');    
+    
+    
+    
+   # $data->{max} = $max;
+   # $data->{min} = $min;
+   # $data->{symbol} = " Hits/s";
+   # $data->{title} = "Mean DiRICH TDC Rate";
+    
+   
+   # $data->{updatetime} = getTimeString; 
+    
+   # my $fh;
+   # open($fh, ">", Hmon::HMONDIR."/files/richMeanRateDiRICH.json");
+   # print $fh   encode_json($data);
+   # close $fh;
+   }
+    
+  $old = $o;
+  $oldtime = time();
+  sleep 2;
+  }
index 4e9ee8b4c4fd0fe23098f462e439d4bdba087ee5..aa63c9c25f3a3d2a8621b8e64a25dada1edccdbe 100755 (executable)
@@ -56,10 +56,11 @@ function openwin(url) {
 </ul></div>
 
 <div class="linkbox" style="width:730px;"><h4>Operator Monitor - the "must-have" windows</h4><ul>
-<li style="width:600px;"><a href="monitor.cgi?1-window-QA">Main Screen 0</a>
-<li style="width:600px;"><a href="monitor.cgi?1-window9x27-busyhist-eventratelong-eventrateshort-StartBars">Main Screen 1</a>
-<li style="width:600px;"><a href="monitor.cgi?1-window8x26-busy-DutyFactor-Pt3AcceptRatio-EvtsPerSpill-StartCountSpill">Main Screen 2</a>
-<li style="width:600px;"><a href="monitor.cgi?1-window14x14-EBSummary-hldlast-CTSRates">Main Screen 3</a></li>
+<li style="width:600px;"><a href="monitor.cgi?1-window-QA">Main Screen 0</a> Tactical Overview
+<li style="width:600px;"><a href="monitor.cgi?1-window9x27-busyhist-eventratelong-eventrateshort-StartBars">Main Screen 1</a> Eventrate & Busy
+<li style="width:600px;"><a href="monitor.cgi?1-window8x26-busy-DutyFactor-Pt3AcceptRatio-EvtsPerSpill-StartCountSpill">Main Screen 2</a> Spill Info
+<li style="width:600px;"><a href="monitor.cgi?1-window14x14-EBSummary-hldlast-CTSRates">Main Screen 3</a> EBs</li>
+<li style="width:600px;"><a href="monitor.cgi?2-window13x18-TofRate-RpcRate-StsRate-EcalSimpleRate">Main Screen 4</a> Tof Rpc STS Ecal rates</li>
 </ul></div>
 
 <div class="linkbox" style="clear:both"><h4>DAQ Network</h4><ul>
index b6e7369e184211416039060e94063d5908113e8e..92accad32b3c4cb4e13d329a60fadc679a4d91d9 100755 (executable)
@@ -24,7 +24,20 @@ my $sources = {
 TRB_8800 => "CentralCTS",
 TRB_8400      =>"RPC123 ",
 TRB_8410      =>"RPC456 ",
+TRB_84C0      =>"RPCnew1",
+TRB_84C1      =>"RPCnew2",
+TRB_84C2      =>"RPCnew3",
+TRB_84C3      =>"RPCnew4",
+TRB_84C4      =>"RPCnew5", 
+TRB_84C5      =>"RPCnew6",  
 TRB_8600      =>"TOF   ",
+TRB_86C0      =>"TOFnew1",
+TRB_86C1      =>"TOFnew2",
+TRB_86C2      =>"TOFnew3",
+TRB_86C3      =>"TOFnew4",
+TRB_86C4      =>"TOFnew5",
+TRB_86C5      =>"TOFnew6",
+TRB_86C6      =>"TOFnew7",
 TRB_8700      =>"FW    ",
 TRB_8880      => "StartTRB3",
 TRB_8890      => "VetoTRB3",
@@ -42,27 +55,35 @@ TRB_1120      => "MDC34sec3",
 TRB_1130      => "MDC34sec4",
 TRB_1140      => "MDC34sec5",
 TRB_1150      => "MDC34sec6",
-TRB_8a00      => "ECal0 ",
-TRB_8a01      => "ECal1 ",
-TRB_8a02      => "ECal2 ",
-TRB_8a03      => "ECal3 ",
-TRB_8a04      => "ECal4 ",
-TRB_8a05      => "ECal5 ",
-TRB_83c0      => "RICH0 ",
-TRB_83c1      => "RICH1 ",
-TRB_83c2      => "RICH2 ",
-TRB_83c3      => "RICH3 ",
-TRB_83c4      => "RICH4 ",
-TRB_83c5      => "RICH5 ",
-TRB_83c6      => "RICH6 ",
-TRB_83c7      => "RICH7 ",
-TRB_83c8      => "RICH8 ",
-TRB_83c9      => "RICH9 ",
-TRB_83ca      => "RICHa ",
-TRB_83cb      => "RICHb "
+TRB_8A00      => "ECal0 ",
+TRB_8A01      => "ECal1 ",
+TRB_8A02      => "ECal2 ",
+TRB_8A03      => "ECal3 ",
+TRB_8A04      => "ECal4 ",
+TRB_8A05      => "ECal5 ",
+TRB_83C0      => "RICH0 ",
+TRB_83C1      => "RICH1 ",
+TRB_83C2      => "RICH2 ",
+TRB_83C3      => "RICH3 ",
+TRB_83C4      => "RICH4 ",
+TRB_83C5      => "RICH5 ",
+TRB_83C6      => "RICH6 ",
+TRB_83C7      => "RICH7 ",
+TRB_83C8      => "RICH8 ",
+TRB_83C9      => "RICH9 ",
+TRB_83CA      => "RICHa ",
+TRB_83CB      => "RICHb ",
+TRB_8B10      => "STS2-0",
+TRB_8B11      => "STS2-1",
+TRB_8B12      => "STS2-2",
+TRB_8B13      => "STS2-3",
+TRB_8B14      => "STS2-4",
+TRB_8B15      => "STS2-5"  
 };
 
 
+
+
 my @bits = qw(OK Collision WordMissing ChecksumMismatch DontUnderstand BufferMismatch AnswerMissing 7 8 9 10 11 12 13 14 15 EventNumberMismatch TriggerCodeMismatch WrongLength AnswerMissing NotFound PartiallyMissing SevereProblem BrokenEvent EthernetLinkError SubEventBufferFull EthernetError TimingTriggerError 28 29 30 31);
 
 
index 414c0ef6fe667d7a9937149cd118bde3358f00ff..e3f655bc17a0c60b40a10b771b07657dbefceb75 100755 (executable)
@@ -12,12 +12,10 @@ use Perl2Epics;
 use HPlot;
 
 
-my @names = qw( reflowPressureAthm:average reflowPressureCompr reflowInO2 reflowRatioIsob opensysFreshARGON 
-opensysFreshCO2 reflowFreshArgon reflowFreshIsob pipePressureIsoB CO2:concentration CO2:concentration2 reflowPressureLP);
-my @namesLABEL = qw( AtmosphericPressure reflowPressureCompressor reflow_O2_concentration 
-reflow_Isobutane_fraction planeI_argon_fresh planeI_CO2_frsh reflowFreshArgon reflowFreshIsobutane pipePressureIsobutane  CO2-P1 CO2-P2 LP-pressure);
-my @names2 = qw(waage_1_net waage_2_net);
-my @names2LABEL = qw(Scale_1 Scale_2);
+my @names = qw( reflowPressureAthm:average reflowPressureCompr reflowInO2  opensysFreshARGON opensysFreshCO2 reflowFreshArgon reflowFreshIsob  CO2:concentration CO2:concentration2 reflowPressureLP );
+my @namesLABEL = qw( AtmosphericPressure reflowPressureCompressor reflow_O2_concentration  planeI_argon_fresh planeI_CO2_frsh reflowFreshArgon reflowFreshCO2   CO2-P1 CO2-P2 LP-pressure );
+my @names2 = qw( MDC:P4:S1:M6:temp MDC:P4:S2:M6:temp MDC:P4:S6:M6:temp MDC:P5:S1:M1:temp MDC:cooling:water:temp MDC:cooling:air:temp);
+my @names2LABEL = qw(airTemperatureSector1 airTemperatureSector2 airTemperatureSector6 Temperature_avuum_pump coolingWaterTemp coolingAirTemp  );
 my @names3 = qw(targetVakPressure);
 
 my $presserr = 0;
@@ -84,17 +82,21 @@ HPlot::PlotInit($plot);
 my $plot2 = ();
 $plot2->{name}    = "MdcScales";
 $plot2->{file}    = "files/MdcScales";
-$plot2->{entries} = 2880;
+$plot2->{entries} = 10800;
 $plot2->{type}    = HPlot::TYPE_HISTORY;
 $plot2->{output}  = HPlot::OUT_PNG;
-$plot2->{titles}->[0] = "Scale_1";
-$plot2->{titles}->[1] = "Scale_2";
+$plot2->{titles}->[0] = "air S2";
+$plot2->{titles}->[1] = "air S6";
+$plot2->{titles}->[2] = "air S1";
+$plot2->{titles}->[3] = "cooling water";
+$plot2->{titles}->[4] = "cooling air";
 $plot2->{xlabel}  = "Minutes";
-$plot2->{ylabel}  = "kg";
+$plot2->{ylabel}  = "°C";
+#$plot2->{ymin} = 15;
 $plot2->{sizex}   = 630;
 $plot2->{sizey}   = 220;
 $plot2->{nokey} = 0;
-$plot2->{curves} = 2;
+$plot2->{curves} = 5;
 $plot2->{buffer} = 1;
 $plot2->{storable} = 1;
 HPlot::PlotInit($plot2);
@@ -250,6 +252,12 @@ foreach my $n (@names2) {
   Perl2Epics::Connect($n,"HAD:".$n);
   }
 Perl2Epics::Connect("reflowPressureAthmaverage","HAD:MDC:GAS:reflowPressureAthm:average");
+Perl2Epics::Connect("airTempS2","HAD:MDC:P4:S2:M6:temp");
+Perl2Epics::Connect("airTempS6","HAD:MDC:P4:S6:M6:temp");
+Perl2Epics::Connect("airTempS1","HAD:MDC:P4:S1:M6:temp");
+Perl2Epics::Connect("coolingAirTemp","HAD:MDC:cooling:water:temp");
+Perl2Epics::Connect("coolingWaterTemp","HAD:MDC:cooling:air:temp");
+
 Perl2Epics::Connect("p1CO2","HAD:MDC:GAS:CO2:concentration:average");
 Perl2Epics::Connect("p2CO2","HAD:MDC:GAS:CO2:concentration2:average");
 
@@ -285,7 +293,7 @@ while(1) {
   $str = Hmon::MakeTitle(8, 18, "MDC Reflow & Scales", 1, "");  
   $str .= "<h4>Atmospheric Pressure</h4>\n";
   $str .= qq@<img src="%ADDPNG files/AtmosPress.png%" type="image/png">\n@; 
-  $str .= "<h4>Isobutane scales</h4>";
+  $str .= "<h4>air Temperature</h4>";
   $str .= qq@<img src="%ADDPNG files/MdcScales.png%" type="image/png">\n@;
   
    $str .= "<h4>Gas System</h4>";
@@ -308,8 +316,11 @@ while(1) {
   Hmon::WriteFile("MDCReflow", $str);  
 
   if(!($timer%6)) {
-    HPlot::PlotAdd("MdcScales",$data->{waage_1_net}->{val},0);
-    HPlot::PlotAdd("MdcScales",$data->{waage_2_net}->{val},1);
+    HPlot::PlotAdd("MdcScales",$data->{airTempS2}->{val},0);
+    HPlot::PlotAdd("MdcScales",$data->{airTempS6}->{val},1);
+    HPlot::PlotAdd("MdcScales",$data->{airTempS1}->{val},2);
+    HPlot::PlotAdd("MdcScales",$data->{coolingAirTemp}->{val},3);
+    HPlot::PlotAdd("MdcScales",$data->{coolingWaterTemp}->{val},4);
     HPlot::PlotDraw("MdcScales");  
     }    
   
index a2d9117cc8d6568ca8c959295515c3f447818b28..d156728d1bbe25145742e59668990ba29259adec 100644 (file)
@@ -9,7 +9,7 @@ body {
 
 body>div>div {
   float:left;
-  margin: 0px 8px 0px 0;
+  margin: 0px 5px 5px 0;
   padding: 0 0 0 0 ;
   border: 1px solid #777;
   border-width:0 1px 1px 1px;