]> jspc29.x-matter.uni-frankfurt.de Git - hadesdaq.git/commitdiff
update hmon scripts
authorHades DAQ <jan@lxhadeb07>
Thu, 24 Jan 2019 12:42:25 +0000 (13:42 +0100)
committerHades DAQ <jan@lxhadeb07>
Thu, 24 Jan 2019 12:42:25 +0000 (13:42 +0100)
16 files changed:
hmon/QA.pm
hmon/ecal_drawing.htm
hmon/hmon_dutyfactor.pl [new file with mode: 0755]
hmon/hmon_haloforward.pl [new file with mode: 0755]
hmon/hmon_rate2.pl
hmon/hmon_richrate2.pl
hmon/hmon_startrate.pl
hmon/hmon_timeout.pl
hmon/hmon_trgsource.pl
hmon/index.cgi
hmon/monitor.cgi
hmon/permanent/hmon_ecalhv.pl
hmon/permanent/hmon_mdchv.pl
hmon/permanent/hmon_open_ssh_master_channels.pl
hmon/permanent/hmon_vertexplots.pl
hmon/styles.css

index 2683339a000c5922a4de94c58d5342430912e84c..d38b37120bceac8fb9a34ddf0c3a0fe4d8a81d35 100644 (file)
@@ -76,11 +76,11 @@ our $QAServer = "hades33";
 
 our @FeeErrLimits     = (0, 5, 10);
 our @MdcOepLimits     = (372, 372-1, 372-3);
-our @MdcVoltageLimits = (50, 60, 100);
+our @MdcVoltageLimits = (50, 70, 100);
 our @MdcLockLimits    = (0, 3, 5);
 our @MdcTempLimits    = (75, 80, 85);
 our @EcalTempLimits    = (55, 60, 65);
-our @RichInnerTempLimits = (32.5,33,34);
+our @RichInnerTempLimits = (34,34.5,35);
 our @TrgErrLimits     = (100, 1000, 10000);
 our @CPULimits        = (95, 100, 100);
 our @TimeoutLimits    = (0, 0, 1);
@@ -94,14 +94,17 @@ our @EBDeltaRateLimits = (10, 15, 25);
 our $TrgCheckPolarity = 1;
 our @Eventsbroken     = (.5,5,10);
 our @MdcTokenMissLimits = (10,50,100);
-our @MdcNominalHV = (1750,1770,1850,2150);
-our @MdcHVOffsetLimits = (5,10,20);
-
+our @MdcNominalHV = (1750,1770,1900,2150);
+our @MdcHVOffsetLimits = (5,10,55);
+our @EcalHvLimits = (326,325,320);
+   
+    
+    
 our @PionLvCurrLimits = (4,5,6);
 
 our $MdcHvOff = 0;
 our $RichHvOff = 0;
-our $MagnetOff = 0;
+our $MagnetOff = 1;
 
 our $PadiwaECalNumber = 84;
 our @PadiwaEcalLimits    = (0, 0, 0);
index 3f2f08d2f767bdb1c3c06872172a6956583d6ad3..09a88ab8ab3479f0f35c6c72141f729d6d968227 100644 (file)
@@ -1764,7 +1764,7 @@ function updatedata(d) {
    resetColor();   
             
    var trbs = [
-                [ ],//["0x6051",1,0,23], ["0x6045",25,0,23], ["0x6011",49,0,23], ["0x6014",73,0,23], ["0x6042",97,0,23], ["0x6015",121,0,23], ["0x6026",145,0,18] ], //sector 0
+                [ ["0x6025",14,14,14], ["0x6025",9,15,15], ["0x6041",3,22,22], ["0x6041",7,23,23]],//["0x6051",1,0,23], ["0x6045",25,0,23], ["0x6011",49,0,23], ["0x6014",73,0,23], ["0x6042",97,0,23], ["0x6015",121,0,23], ["0x6026",145,0,18] ], //sector 0
                 
                 
                 [ ["0x6013",1,0,0], ["0x6013",2,1,1], ["0x6013",3,2,2], ["0x6013",4,3,3], ["0x6013",5,4,4],
diff --git a/hmon/hmon_dutyfactor.pl b/hmon/hmon_dutyfactor.pl
new file mode 100755 (executable)
index 0000000..14ef5aa
--- /dev/null
@@ -0,0 +1,133 @@
+#!/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 sum];
+
+
+trb_init_ports() or die trb_strerror();
+
+HPlot::PlotInit({
+    name    => "DutyFactor",
+    file    => "files/DutyFactor",
+    entries => 50,
+    type    => HPlot::TYPE_HISTORY,
+    output  => HPlot::OUT_PNG,
+    xlabel  => "Spills",
+    ylabel  => "Duty Factor",
+    sizex   => 600,
+    sizey   => 200,
+    curves  => 1,
+    buffer  => 0,
+    nokey   => 1,
+    }); 
+
+HPlot::PlotInit({
+    name    => "SpillSum",
+    file    => "files/SpillSumDuty",
+    entries => 50,
+    type    => HPlot::TYPE_HISTORY,
+    output  => HPlot::OUT_PNG,
+    xlabel  => "Spills",
+    ylabel  => "Total Sum",
+    sizex   => 600,
+    sizey   => 200,
+    curves  => 1,
+    buffer  => 0,
+    nokey   => 1,
+    });     
+    
+my $old;
+my $diff;
+my $oldtime;
+my @store;
+my $time = 0;
+my $empties = 0;
+
+my $SPS = 10; #samples per second
+my $sampletime = 1E6/$SPS;
+
+
+my @dummy = (0,0,10,20,30,10,20,20,20,20,10,30,10,20,30,10,20,20,20,20,10,30,10,20,30,10,20,20,20,20,10,30,1,2,3,0,0,0);
+my $iter = 0;
+
+while(1) {
+
+  my $o = trb_registertime_read_mem(0x5000,0xc000,0,17);
+  
+#Just the usual calculation of differences on counters & normalization based on time between reads.
+  if (defined $old) {
+    foreach my $b (keys %$o) {
+      my $tdiff = $o->{$b}{time}->[0] - ($oldtime->{$b}||0);
+         $tdiff += 2**16 if $tdiff < 0;
+         $tdiff *= 16;
+      for my $v (0..16) {
+        my $vdiff = ($o->{$b}{value}[$v]&0xfffffff) - ($old->{$b}{value}[$v]&0xfffffff);
+           $vdiff += 2**28 if $vdiff < 0;
+        $diff->{$b}[$v] = $vdiff/($tdiff||1E6)*1E6;
+        }
+      $oldtime->{$b} = $o->{$b}{time}[0];  
+      }
+
+      
+#sum strips & store    
+    my $sum = 0;
+    for my $c (1..16) {
+      $sum += $diff->{0x5000}[$c];
+      }
+      
+# $sum = $dummy[$iter++];    #You can't do that on stage
+    push(@store,$sum);
+    $empties++ if $sum < 10;
+
+#end of spill 
+    my $lastsum = 0;
+    for my $c (1..5) { $lastsum += $store[-$c]//0;}
+
+    if($lastsum < 10*5*$SPS && ($store[-6]//0) > 9*$SPS) {
+    
+      my $total   = sum(@store)/$SPS;
+      my $max     = max(@store);
+      my $samples = scalar @store;
+    
+      my $avg  = sum(@store)/$samples;
+      my $duty = $avg/$max;
+      
+      HPlot::PlotAdd("DutyFactor",$duty,0);
+      HPlot::PlotAdd("SpillSum",  $total,0);
+      HPlot::PlotDraw('DutyFactor');
+      HPlot::PlotDraw('SpillSum');
+      
+      my $length = sprintf("%0.1f s (%i samples)",time()-$time,$samples);
+      my $offtime = $empties/(1E6/$sampletime);
+      
+      my  $str  = Hmon::MakeTitle(8, 16, "DutyFactor",1);
+          $str .= qq@<img width="600" src="%ADDPNG files/StartRateXhistbar.png%" type="image/png"><br>\n@;
+          $str .= qq@<img src="%ADDPNG files/DutyFactor.png%" type="image/png"><br\>\n@;
+          $str .= qq@<img src="%ADDPNG files/SpillSumDuty.png%" type="image/png"><br\>\n@;
+          $str .= "<table style=\"margin:auto;\"><tr><td>Last Sum<td>".QA::SciNotation($total);
+          $str .= "<tr><td>Last Duty<td>".sprintf("%0.3f",$duty);
+          $str .= "<tr><td>Last Duration<td>".$length;
+          $str .= "<tr><td>Last Break<td>".$offtime." s";
+          $str .= "<tr><td>Last Max<td>".QA::SciNotation($max)." Hz (100ms)";
+          $str .= "</table>";
+          $str .= Hmon::MakeFooter();
+          Hmon::WriteFile("DutyFactor",$str);
+      
+      $empties = 0;
+      $time = time();
+      @store = ();
+      $iter = 0;
+      }
+   
+    }
+  $old = $o;    
+  usleep($sampletime);  
+  }
\ No newline at end of file
diff --git a/hmon/hmon_haloforward.pl b/hmon/hmon_haloforward.pl
new file mode 100755 (executable)
index 0000000..3f8e3eb
--- /dev/null
@@ -0,0 +1,163 @@
+#!/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);
+use List::Util qw[min max];
+
+trb_init_ports() or die trb_strerror();
+
+HPlot::PlotInit({
+    name    => "HaloFast",
+    file    => "files/ForwardHaloFast",
+    title   => "ForwardHalo Fast",
+    entries => 3,
+    curves  => 3,
+    type    => HPlot::TYPE_HEATMAP,
+    output  => HPlot::OUT_PNG,
+    cblabel => "Hitrate [Hz]",
+#     cbscale => 10,
+    sizex   => 300,
+    sizey   => 240,
+    nokey   => 1,
+    buffer  => 1,
+    xmin    => -0.5,
+    xmax    => 2.5,
+    ymin    => -0.5,
+    ymax    => 2.5,
+    cbmax   => "100<*<1E10",
+    cbmin   => 0,
+    noinit  => 1,
+#     additional => "set logscale cb;",
+    showvalues => 0,  
+    });
+
+HPlot::PlotInit({
+    name    => "HaloSlow",
+    file    => "files/ForwardHaloSlow",
+    title   => "ForwardHalo Slow",
+    entries => 3,
+    curves  => 3,
+    type    => HPlot::TYPE_HEATMAP,
+    output  => HPlot::OUT_PNG,
+    cblabel => "Hitrate [Hz]",
+#     cbscale => 10,
+    sizex   => 300,
+    sizey   => 240,
+    nokey   => 1,
+    buffer  => 1,
+    xmin    => -0.5,
+    xmax    => 2.5,
+    ymin    => -0.5,
+    ymax    => 2.5,
+    cbmax   => "100<*<1E10",
+    cbmin   => 0,
+    noinit  => 1,
+#     additional => "set logscale cb;",
+    showvalues => 0,  
+    });    
+
+HPlot::PlotInit({
+    name    => "ForwardHaloPosition",
+    file    => "files/ForwardHaloPosition",
+    entries => 100,
+    type    => HPlot::TYPE_HISTORY,
+    output  => HPlot::OUT_PNG,
+    titles  => ["X position ","Y position","Xrms","Yrms"],
+    xlabel  => "Seconds",
+    ylabel  => "Strips",
+    sizex   => 600,
+    sizey   => 250,
+    ymin    => "-1.1",
+    ymax    => "1.1",
+    curves  => 2,
+    xscale  => 1,
+    buffer  => 1,
+    });        
+    
+my $str  = Hmon::MakeTitle(8, 11, "Forward HALO (fast/slow)",0);
+$str .= qq@<img src="%ADDPNG files/ForwardHaloFast.png%" type="image/png">\n@;
+$str .= qq@<img src="%ADDPNG files/ForwardHaloSlow.png%" type="image/png"><br\>\n@;
+$str .= qq@<img src="%ADDPNG files/ForwardHaloPosition.png%" type="image/png">\n@;
+$str .= Hmon::MakeFooter();
+Hmon::WriteFile("ForwardHalo",$str);    
+    
+my $old;
+my $diff;
+my $oldtime;
+my $iter = 1;
+
+while(1) {
+
+  my $o = trb_registertime_read_mem(0xfe71,0xc000,0,49); # or die trb_strerror() or sleep 5 and next;
+  if (defined $old) {
+    foreach my $b (keys %$o) {
+      my $tdiff = $o->{$b}{time}->[0] - ($oldtime->{$b}||0);
+         $tdiff += 2**16 if $tdiff < 0;
+         $tdiff *= 16;
+      for my $v (0..48) {
+        my $vdiff = ($o->{$b}{value}[$v]&0xfffffff) - ($old->{$b}{value}[$v]&0xfffffff);
+           $vdiff += 2**28 if $vdiff < 0;
+        $diff->{$b}[$v] = $vdiff/($tdiff||1E6)*1E6;
+        }
+      $oldtime->{$b} = $o->{$b}{time}[0];  
+      }
+  
+      
+    HPlot::PlotFill("HaloFast",$diff->{0x6025}[29],1,2);
+    HPlot::PlotFill("HaloFast",$diff->{0x6041}[45],1,0);  
+    HPlot::PlotFill("HaloFast",$diff->{0x6025}[31],0,1); 
+    HPlot::PlotFill("HaloFast",$diff->{0x6041}[47],2,1);  
+
+    HPlot::PlotFill("HaloSlow",$diff->{0x6025}[30],1,2);
+    HPlot::PlotFill("HaloSlow",$diff->{0x6041}[46],1,0);  
+    HPlot::PlotFill("HaloSlow",$diff->{0x6025}[32],0,1);   
+    HPlot::PlotFill("HaloSlow",$diff->{0x6041}[48],2,1);     
+    
+    HPlot::PlotDraw('HaloFast');
+    HPlot::PlotDraw('HaloSlow');
+    
+    my $halosum = $diff->{0x6025}[29] + $diff->{0x6041}[45] + $diff->{0x6041}[47] + $diff->{0x6025}[31];
+    my $haloypos = (-$diff->{0x6041}[45] + $diff->{0x6025}[29])/($halosum||1);
+    my $haloxpos = (-$diff->{0x6041}[47] + $diff->{0x6025}[31])/($halosum||1);
+    $haloxpos = "NaN" if $halosum < 100;
+    $haloypos = "NaN" if $halosum < 100;
+    HPlot::PlotAdd("ForwardHaloPosition",$haloxpos,0);
+    HPlot::PlotAdd("ForwardHaloPosition",$haloypos,1);
+    HPlot::PlotDraw('ForwardHaloPosition');
+    
+    
+    }
+  
+  $old = $o;
+  usleep(900000);  
+  }
+    
+    
+    
+# Oben: 0x6025 TDC-Nr. 29(fast),30(slow) oder ch17
+# Rechts: 0x6025 TDC-Nr. 31(fast),32(slow) oder ch18
+# Unten: 0x6041 TDC-Nr. 45(fast),46(slow) oder ch22
+# Links: 0x6041 TDC-Nr. 47(fast),48(slow) oder ch23
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
index cf59a94e413f9e62953973f2d9b206d790c69b46..8dbfe4ece1b8fcab9cf8c0ac33caccba739671fb 100755 (executable)
@@ -25,6 +25,8 @@ sub getCorrected {
 
 sub getCorrectedValue {
   my ($val,$cor) = @_;
+  $val = 0 unless $val;
+  $cor = 0 unless $cor;
   my $value = max($val-$cor,0);
   if ($value < $cor/20) {$value = 0;}
   return $value;
@@ -128,8 +130,8 @@ while (1) {
   my $oos;
   
   #Out of spill?
-  if($store{0xa029} < 50) {
-    for my $b (0xa029, 0xa02a, 0xa02b, 0xa024, 0xa009, 0xa03c, 0xa037) {
+  if($store{0xa02c} < 50) {
+    for my $b (0xa029, 0xa02a, 0xa02b, 0xa024, 0xa009, 0xa03c, 0xa037, 0xa02c, 0xa028,0xa025) {
       $offset->{$b} = ($offset->{$b}||0) + (($store{$b}||0) - ($offset->{$b}||0))/10;
       }
 #     print Dumper $offset;  
@@ -161,10 +163,11 @@ while (1) {
        $state, 'PT1 Rate', $shorttext, $longtext); 
                 
   $state = QA::OK;
-  $shorttext = QA::SciNotation($store{0xa009})." / ".getCorrected($store{0xa009},$offset->{0xa009});
-  $longtext  = sprintf("Trigger Rate from Start: %i Hz / %i Hz after offset correction",$store{0xa009}, getCorrectedValue($store{0xa009},$offset->{0xa009}));
-  if(getCorrectedValue($store{0xa009},$offset->{0xa009}) < 100 && 
-     getCorrectedValue($store{0xa029},$offset->{0xa029}) > 10000) {
+  $shorttext = QA::SciNotation($store{0xa02c})." / ".getCorrected($store{0xa02c},$offset->{0xa02c});
+  $longtext  = sprintf("Trigger Rate from Start: %i Hz / %i Hz after offset correction",$store{0xa02c}, 
+getCorrectedValue($store{0xa009},$offset->{0xa02c}));
+  if(getCorrectedValue($store{0xa009},$offset->{0xa02c}) < 100 && 
+     getCorrectedValue($store{0xa029},$offset->{0xa029}) > 1000) {
     $starterrorcnt+=3;
     if($starterrorcnt >= 15) {
       $state = QA::ERROR;
@@ -178,10 +181,10 @@ while (1) {
        $state, 'Start Rate', $shorttext, $longtext);        
 
   $state = QA::OK;
-  $shorttext = sprintf('%.2f',getCorrectedValue($store{0xa024},$offset->{0xa024})/(getCorrectedValue($store{0xa009},$offset->{0xa009})||1));
-  $longtext  = "Trigger Rate from PT1 vs. Start: ".$shorttext;
+  $shorttext = sprintf('%.2f',getCorrectedValue($store{0xa02c},$offset->{0xa02c})/(getCorrectedValue($store{0xa025},$offset->{0xa025})||1));
+  $longtext  = "Trigger Rate from PT2 vs. Start: ".$shorttext;
   QA::WriteQALog($fqa, "trg", "pt1rate", 10,
-       $state, 'Start/PT1', $shorttext, $longtext);            
+       $state, 'Start/PT2', $shorttext, $longtext);            
        
   sleep 1;
 }
index f2abfaedb99a45c1b98ee037627e6a99259b9fb0..66e248199c145db2a5f8b73c8bef6c5ef7bef52a 100755 (executable)
@@ -32,7 +32,7 @@ xmin    => -1.5,
 xmax    => 192.5,
 ymin    => -1.5,
 ymax    => 192.5,
-cbmax   => "100<*<1E5",
+cbmax   => "100<*<1E6",
 cbmin   => 0.0,
 noinit  => 1,
 additional => "set logscale cb;set xrange [192.5:-1.5] reverse",
@@ -132,5 +132,5 @@ while(1) {
     
   $old = $o;
   $oldtime = time();
-  sleep 2;
+  sleep 1;
   }
index 0bbfc2dc1c919e16ff0de85c1cdcd9900099de40..fa2a3955b6e84816ee31379e4f43c0f95b1fb70b 100755 (executable)
@@ -20,8 +20,8 @@ HPlot::PlotInit({
     type    => HPlot::TYPE_BARGRAPH,
     output  => HPlot::OUT_PNG,
     titles  => ["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15"],
-    xlabel  => "Time / 200 ms",
-    ylabel  => "Hits",
+    xlabel  => "Time / 100 ms",
+    ylabel  => "Hitrate [Hz]",
     sizex   => 950,
     sizey   => 330,
     xmin    => 0,
@@ -42,8 +42,8 @@ HPlot::PlotInit({
     type    => HPlot::TYPE_BARGRAPH,
     output  => HPlot::OUT_PNG,
     titles  => ["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15"],
-    xlabel  => "Time / 200 ms",
-    ylabel  => "Hits",
+    xlabel  => "Time / 100 ms",
+    ylabel  => "Hitrate [Hz]",
     sizex   => 950,
     sizey   => 330,
     xmin    => 0,
@@ -64,8 +64,8 @@ HPlot::PlotInit({
     type    => HPlot::TYPE_BARGRAPH,
     output  => HPlot::OUT_PNG,
     titles  => ["0","1","2","3","4","5","6","7"],
-    xlabel  => "Time / 200 ms",
-    ylabel  => "Hits",
+    xlabel  => "Time / 100 ms",
+    ylabel  => "Hitrate [Hz]",
     sizex   => 950,
     sizey   => 330,
     xmin    => 0,
@@ -88,7 +88,7 @@ HPlot::PlotInit({
     output  => HPlot::OUT_PNG,
     titles  => ["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15"],
     xlabel  => "Seconds",
-    ylabel  => "Hits",
+    ylabel  => "Hitrate [Hz]",
     sizex   => 950,
     sizey   => 330,
     ymin    => "0",
@@ -106,7 +106,7 @@ HPlot::PlotInit({
     output  => HPlot::OUT_PNG,
     titles  => ["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15"],
     xlabel  => "Seconds",
-    ylabel  => "Hits",
+    ylabel  => "Hitrate [Hz]",
     sizex   => 950,
     sizey   => 330,
     ymin    => "0",
@@ -124,7 +124,7 @@ HPlot::PlotInit({
     output  => HPlot::OUT_PNG,
     titles  => ["0","1","2","3","4","5","6","7"],
     xlabel  => "Seconds",
-    ylabel  => "Hits",
+    ylabel  => "Hitrate [Hz]",
     sizex   => 950,
     sizey   => 330,
     ymin    => "0",
@@ -141,11 +141,11 @@ HPlot::PlotInit({
     type    => HPlot::TYPE_BARGRAPH,
     output  => HPlot::OUT_PNG,
     titles  => ["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15"],
-    ylabel  => "Hits",
+    ylabel  => "Hitrate [Hz]",
     yscale  => 10,
     nokey   => 1,
     sizex   => 340,
-    sizey   => 330,
+    sizey   => 350,
     xmin    => -0.5,
     xmax    => 15.5,
     ymin    => "0",
@@ -162,11 +162,11 @@ HPlot::PlotInit({
     type    => HPlot::TYPE_BARGRAPH,
     output  => HPlot::OUT_PNG,
     titles  => ["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15"],
-    ylabel  => "Hits",
+    ylabel  => "Hitrate [Hz]",
     yscale  => 10,
     nokey   => 1,
     sizex   => 340,
-    sizey   => 330,
+    sizey   => 350,
     xmin    => -0.5,
     xmax    => 15.5,
     ymin    => "0",
@@ -183,11 +183,11 @@ HPlot::PlotInit({
     type    => HPlot::TYPE_BARGRAPH,
     output  => HPlot::OUT_PNG,
     titles  => ["0","1","2","3","4","5","6","7"],
-    ylabel  => "Hits",
+    ylabel  => "Hitrate [Hz]",
     yscale  => 10,
     nokey   => 1,
     sizex   => 340,
-    sizey   => 330,
+    sizey   => 350,
     xmin    => -0.5,
     xmax    => 7.5,
     ymin    => "0",
@@ -206,14 +206,32 @@ HPlot::PlotInit({
     titles  => ["X position","Y position","Xrms","Yrms"],
     xlabel  => "Seconds",
     ylabel  => "Strips",
-    sizex   => 950,
-    sizey   => 330,
+    sizex   => 970,
+    sizey   => 350,
     ymin    => "-0.5",
     ymax    => "15.5",
     curves  => 4,
     xscale  => 10,
     buffer  => 1,
     });     
+
+HPlot::PlotInit({
+    name    => "HaloPosition",
+    file    => "files/HaloPosition",
+    entries => 200,
+    type    => HPlot::TYPE_HISTORY,
+    output  => HPlot::OUT_PNG,
+    titles  => ["X position ","Y position","Xrms","Yrms"],
+    xlabel  => "Seconds",
+    ylabel  => "Strips",
+    sizex   => 600,
+    sizey   => 250,
+    ymin    => "-1.1",
+    ymax    => "1.1",
+    curves  => 2,
+    xscale  => 10,
+    buffer  => 1,
+    });        
     
 HPlot::PlotInit({
     name    => "HALO",
@@ -223,8 +241,8 @@ HPlot::PlotInit({
     curves  => 3,
     type    => HPlot::TYPE_HEATMAP,
     output  => HPlot::OUT_PNG,
-    cblabel  => "Hitrate",
-    cbscale  => 10,
+    cblabel => "Hitrate [Hz]",
+    cbscale => 10,
     sizex   => 300,
     sizey   => 240,
     nokey   => 1,
@@ -248,8 +266,8 @@ HPlot::PlotInit({
     curves  => 3,
     type    => HPlot::TYPE_HEATMAP,
     output  => HPlot::OUT_PNG,
-    cblabel  => "Hitrate",
-    cbscale  => 10,
+    cblabel => "Hitrate [Hz]",
+    cbscale => 10,
     sizex   => 300,
     sizey   => 240,
     nokey   => 1,
@@ -280,22 +298,24 @@ $str .= qq@<h3>Veto</h3><img src="%ADDPNG files/VetoRatehistbar.png%" type="imag
 $str .= Hmon::MakeFooter();
 Hmon::WriteFile("StartRateBars",$str);
     
-$str  = Hmon::MakeTitle(14, 8, "Start-X / Start-Y / Veto Rate / HALO",0);
+$str  = Hmon::MakeTitle(13, 8, "Start-X / Start-Y / Veto Rate",0);
 $str .= qq@<img src="%ADDPNG files/StartXbar.png%" type="image/png">\n@;
 $str .= qq@<img src="%ADDPNG files/StartYbar.png%" type="image/png">\n@;
 $str .= qq@<img src="%ADDPNG files/Vetobar.png%" type="image/png">\n@;
 $str .= Hmon::MakeFooter();
 Hmon::WriteFile("StartBars",$str);
 
-$str  = Hmon::MakeTitle(8, 6, "Veto / HALO",0);
+$str  = Hmon::MakeTitle(8, 11, "Veto / HALO",0);
 $str .= qq@<img src="%ADDPNG files/Veto.png%" type="image/png">\n@;
-$str .= qq@<img src="%ADDPNG files/HALO.png%" type="image/png">\n@;
+$str .= qq@<img src="%ADDPNG files/HALO.png%" type="image/png"><br\>\n@;
+$str .= qq@<img src="%ADDPNG files/HaloPosition.png%" type="image/png">\n@;
 $str .= Hmon::MakeFooter();
 Hmon::WriteFile("VetoHalo",$str);
 
     
 $str  = Hmon::MakeTitle(13, 8, "Start Position",0);
 $str .= qq@<img src="%ADDPNG files/StartPosition.png%" type="image/png">\n@;
+$str .= Hmon::MakeFooter();
 Hmon::WriteFile("StartPosition",$str);
 
 my $old;
@@ -345,8 +365,8 @@ while(1) {
     $avgy /= $sumy if($sumy !=0);
 
     for my $c (1..16) {
-      $rmsx += $diff->{0x5000}[$c]*($chanx[$c]/($avgx||1E-10))**2 ;
-      $rmsy += $diff->{0x5001}[$c]*($chany[$c]/($avgy||1E-10))**2 ;
+      $rmsx += $diff->{0x5000}[$c]*($chanx[$c]-($avgx||1E-10))**2 ;
+      $rmsy += $diff->{0x5001}[$c]*($chany[$c]-($avgy||1E-10))**2 ;
       }
     $rmsx = sqrt($rmsx/($sumx||1E-10));
     $rmsy = sqrt($rmsy/($sumy||1E-10));
@@ -363,15 +383,15 @@ while(1) {
     HPlot::PlotAdd("StartPosition",$rmsy,3);
         
     for my $c (1..8) {
-      HPlot::PlotAdd("VetoRatehist",$diff->{0x5002}[$c],$chanveto[$c]);
-      HPlot::PlotAdd("VetoRatehistbar",$diff->{0x5002}[$c],$chanveto[$c]);
-      HPlot::PlotFill("Vetobar",$diff->{0x5002}[$c],$chanveto[$c],0,$iter-9);
+      HPlot::PlotAdd("VetoRatehist",$diff->{0x5002}[$c],$c-1);
+      HPlot::PlotAdd("VetoRatehistbar",$diff->{0x5002}[$c],$c-1);
+      HPlot::PlotFill("Vetobar",$diff->{0x5002}[$c],$c-1,0,$iter-9);
       }
 
     HPlot::PlotFill("HALO",$diff->{0x5002}[9], 1,2,$iter-1);  
     HPlot::PlotFill("HALO",$diff->{0x5002}[10],1,0,$iter-1);  
     HPlot::PlotFill("HALO",$diff->{0x5002}[11],0,1,$iter-1);  
-    HPlot::PlotFill("HALO",$diff->{0x5002}[12],2,1,$iter-1);  
+    HPlot::PlotFill("HALO",$diff->{0x5002}[12],2,1,$iter-1);
 
     HPlot::PlotFill("Veto",$diff->{0x5002}[8], 0,0,$iter-1);  
     HPlot::PlotFill("Veto",$diff->{0x5002}[3], 1,0,$iter-1);  
@@ -381,6 +401,16 @@ while(1) {
     HPlot::PlotFill("Veto",$diff->{0x5002}[5], 0,2,$iter-1);  
     HPlot::PlotFill("Veto",$diff->{0x5002}[1], 1,2,$iter-1);  
     HPlot::PlotFill("Veto",$diff->{0x5002}[6], 2,2,$iter-1);  
+    
+ #Halo Position     
+    my $halosum = $diff->{0x5002}[9] + $diff->{0x5002}[10] + $diff->{0x5002}[11] + $diff->{0x5002}[12];
+    my $haloxpos = (-$diff->{0x5002}[10] + $diff->{0x5002}[9])/($halosum||1);
+    my $haloypos = (-$diff->{0x5002}[11] + $diff->{0x5002}[12])/($halosum||1);
+    $haloxpos = "NaN" if $halosum < 100;
+    $haloypos = "NaN" if $halosum < 100;
+    HPlot::PlotAdd("HaloPosition",$haloxpos,0);
+    HPlot::PlotAdd("HaloPosition",$haloypos,1);
+
       
       
     HPlot::PlotDraw('StartRateXhist') if ($iter == 1);
@@ -392,7 +422,8 @@ while(1) {
     HPlot::PlotDraw('StartXbar')   if ($iter == 6); #dont change
     HPlot::PlotDraw('StartYbar')   if ($iter == 7); #dont change
     HPlot::PlotDraw('Vetobar')     if ($iter == 8); #dont change
-    HPlot::PlotDraw('StartPosition')     if ($iter == 9);
+    HPlot::PlotDraw('StartPosition')  if ($iter == 9);
+    HPlot::PlotDraw('HaloPosition')   if ($iter == 10);
     HPlot::PlotDraw('HALO')           if ($iter == 10); #dont change
     HPlot::PlotDraw('Veto')           if ($iter == 10); #dont change
     $iter = 1                         if ($iter++ == 10) #dont change
index 43ad3d3ae390e5c21bbdd0f308ef474e1e44a010..670b5504e62a1b562dcc8de82c571126a4a518c6 100755 (executable)
@@ -27,7 +27,7 @@ while (1) {
     if (($rh_hubs->{$board} & 0xffff) != 0x0000) {
       $msg .= ", " if $msg ne "";
       $msg .= sprintf("%04x-%04x (",$board,$rh_hubs->{$board} & 0xffff);
-      foreach my $i (1..8) {
+      foreach my $i (1..12) {
         if ($rh_hubs->{$board} & (1<<$i)) {
           $msg .= sprintf("0x%04x ",Hmon::TraceDBGet($board,$i));
           $boardlist1 .= sprintf("%04X, ",Hmon::TraceDBGet($board,$i));
@@ -36,10 +36,10 @@ while (1) {
       $msg .= ")";
       $cnt++;
     }
-    if ((($rh_hubs->{$board}>>16) & 0xffff) != 0x0000 && (($board > 0x1000 && $board < 0x1200  && $board%16) || ($board&0xff00 == 0x8a00) || ($board&0xff00 == 0x8200))) {
+    if ((($rh_hubs->{$board}>>16) & 0xffff) != 0x0000 && (($board > 0x1000 && $board < 0x1200  && $board%16) || (($board&0xff00) == 0x8a00) || (($board&0xff00) == 0x8200))) {
       $msg2 .= ", " if $msg2 ne "";
       $msg2 .= sprintf("%04x-%04x (",$board,$rh_hubs->{$board}>>16 & 0xffff);
-      foreach my $i (1..8) {
+      foreach my $i (1..12) {
         if ($rh_hubs->{$board} & (1<<($i+16))) {
           $msg2 .= sprintf(" %04x",Hmon::TraceDBGet($board,$i));
           $boardlist2 .= sprintf("%04X, ",Hmon::TraceDBGet($board,$i));
index e8b42c21beed356c37abe0c044b5589d67a7e9b0..884c0af095bfd2d9d901ca3fb22f718939a49a36 100755 (executable)
@@ -47,14 +47,14 @@ $plot->{type}    = HPlot::TYPE_HISTORY;
 $plot->{output}  = HPlot::OUT_PNG;
 $plot->{titles}->[0] = "";
 $plot->{xlabel}  = "Spill Number";
-$plot->{ylabel}  = "Hodoscope Counts / Mcnt";
+$plot->{ylabel}  = "Start Counts / Mcnt";
 $plot->{sizex}   = 630;
 $plot->{sizey}   = 220;
 $plot->{nokey} = 1;
 $plot->{buffer} = 1;
 $plot->{storable} = 1;
 HPlot::PlotInit($plot);
-my  $str = Hmon::MakeTitle(8,5,"Hodoscope Counts per Spill (millions)",0);
+my  $str = Hmon::MakeTitle(8,5,"Start X Counts per Spill (millions)",0);
   $str .= qq@<img src="%ADDPNG files/StartCountSpills.png%" type="image/png">@;
   $str .= Hmon::MakeFooter();
   Hmon::WriteFile("StartCountSpill",$str);
@@ -239,14 +239,14 @@ my $longmsgcheck = $longmsg;
   my $startmsg = "";
   my $startlongmsg = "";
   
-#   foreach my $i (0..7) {
-#     $startsum += $rStat->{3}->[$i+0x8] ;
-#     }
-#   $spillsum += $startsum;
-#   
-  $startsum  = $rStat->{3}->[0x29];
+  foreach my $i (0..7) {
+    $startsum += $rStat->{3}->[$i+0x8] ;
+    }
   $spillsum += $startsum;
   
+#   $startsum  = $rStat->{3}->[0x29];
+#   $spillsum += $startsum;
+  
 ######################################
 ## QA check for spill sum on Start
   if ($lastspillsum < 0 || $lastspillsum > 50000000) {
index 6521224239eb558944b76a0e0b257ddad0dd0db4..f77240f215ab33b1aecfcf1b224264e2cb44a2f3 100755 (executable)
@@ -38,6 +38,7 @@ function openwin(url) {
 <div class="linkbox" style="width:730px;"><h4>Other Ressources</h4><ul>
 <li style="width:600px;"><a href="files/qa.htm">QA Plots (updated every 5 minutes)</a></li>
 <li style="width:500px;"><a href="files/vertex.htm">Vertex Plots (updated after each file)</a></li>
+<li style="width:500px;"><a href="../spillmon/?browser=no&monitoring=1000&layout=grid4x4&items=[%22EventBuilder/Run/HLD/HLD_HitsFast%22,%22EventBuilder/Run/HLD/HLD_HitsSlow%22,%22EventBuilder/Run/HLD/HLD_TrendX%22,%22EventBuilder/Run/HLD/HLD_TrendY%22,%22EventBuilder/Run/HLD/HLD_BeamX%22,%22EventBuilder/Run/HLD/HLD_BeamY%22,%22EventBuilder/Run/HLD/HLD_VETO_Patt%22,%22EventBuilder/Run/HLD/HLD_QSlow%22,%22EventBuilder/Run/HLD/HLD_HALO_Patt%22,%22EventBuilder/Run/HLD/HLD_XHALOSlow%22,%22EventBuilder/Run/HLD/HLD_YHALOSlow%22,%22EventBuilder/Run/HLD/HLD_LastSpill_Q_factor%22]">Beam Properties</a></li>
 <li style="width:500px;"><a href="../logbook">Beamtime Logbook</a></li>
 <li style="width:500px;"><a href="http://lxhadeb06/icinga">Icinga Server Monitoring</a>
 <li style="width:500px;"><a href="../munin">Munin Server Monitoring</a></li>
@@ -88,6 +89,7 @@ function openwin(url) {
 <li><a href="monitor.cgi?1-window-VetoHalo">Rates for Veto &amp; HALO</a></li>
 <li><a href="monitor.cgi?1-window-StartPosition">Beam Position</a></li>
 <li><a href="monitor.cgi?1-window-SpillStructure">Spill Structure from Start</a></li>
+<li><a href="monitor.cgi?1-StartRateBars-StartBars-StartPosition-VetoHalo-ForwardHalo">Beam Summary</a></li>
 </ul></div>
 
 <div class="linkbox" style="float:left"><h4>ECal</h4><ul>
index 37760666cec4ff89f9654baa9e73a1bf61cdfbbc..2fc65176b81dc3c0e9b75eb909b91b334219101b 100755 (executable)
@@ -62,7 +62,7 @@ my @args = split('-',$ENV{'QUERY_STRING'});
 <body ><!--onmousedown="stoprefresh(0);" onmouseup="stoprefresh(0);" ondblclick="stoprefresh(0);"-->
 <div class="button" style="width:45px;right:-8px;" onclick="askclose();">&nbsp;close&nbsp;</div>
 <div class="button" id = "stop" style="right:35px;width:45px;" onclick="stoprefresh(1)">stop</div>
-<div class="button" id = "big" style="right:75px;width:45px;" onclick="zoom();">&nbsp;bigger&nbsp;</div>
+<!--<div class="button" id = "big" style="right:75px;width:45px;" onclick="zoom();">&nbsp;bigger&nbsp;</div>-->
 
 <div id="contentback" class="blinkon"></div>
 <div id="content" class="blinkon"></div>
@@ -83,6 +83,7 @@ function zoom() {
        if (currentzoom == 1) {
                currentzoom = 1.5;
                document.getElementById('content').style.MozTransform="scale("+currentzoom+")"; 
+    document.getElementById('contentback').style.MozTransform="scale("+currentzoom+")"; 
                window.innerWidth *= zoomstep;
                window.innerHeight*= zoomstep;
                document.getElementById("big").innerHTML = "small";
@@ -90,6 +91,7 @@ function zoom() {
        else {
                currentzoom = 1;
                document.getElementById('content').style.MozTransform="scale("+currentzoom+")"; 
+    document.getElementById('contentback').style.MozTransform="scale("+currentzoom+")"; 
                window.innerWidth /= zoomstep;
                window.innerHeight/= zoomstep;
                document.getElementById("big").innerHTML = "bigger";
@@ -100,16 +102,16 @@ function reload() {
   xmlhttp=new XMLHttpRequest();
   xmlhttp.onreadystatechange = function() {
     if(xmlhttp.readyState == 4) {
-      if(!document.getElementById("footer")) {
-        //document.getElementById("content").style.opacity="0";
+      if(!document.getElementById("footer") && !document.getElementById('logbox')) {
+        document.getElementById("content").style.opacity="0";
         document.getElementById("content").innerHTML=xmlhttp.responseText;
-        //setTimeout('document.getElementById("content").style.opacity="1"',100);
+        setTimeout('document.getElementById("content").style.opacity="1"',100);
+        setTimeout('document.getElementById("contentback").innerHTML=document.getElementById("content").innerHTML',200);
         }
       else {  
         document.getElementById("content").innerHTML=xmlhttp.responseText;
         }
         
-      //setTimeout('document.getElementById("contentback").innerHTML=document.getElementById("content").innerHTML',200);
         
       if(document.getElementById('logbox')) {
         if(saveScrollTop) {
index 46fa378e48ce6624af1c02bb241a77735e29fdf2..90a497b6fd5565008b09d27c832831a9633d443c 100755 (executable)
@@ -344,14 +344,10 @@ while(1) {
    my $value = sprintf("%i/652",$ChnlsOn);
    my $longtext = sprintf("HV channels On: %i/652",$ChnlsOn);
 
- if ($ChnlsOn < 652 and $ChnlsOn >= 642){
-    $qastate = QA::WARN_2;}
- if ($ChnlsOn < 642){
-    $qastate = QA::ERROR_2;}
- if ($ChnlsOn == 0){
+ $qastate = QA::GetQAState('above', $ChnlsOn, @QA::EcalHvLimits);   
+if ($ChnlsOn == 0){
     $qastate = QA::NOTE;}
-    
-    
  $str = "";
    if($timer%8 == 0) {
      if ($ChnlsOn>0 and $ChnlsOn<652) {
index e1fb57bf23141574b88fc4397be6d789a902b1c7..065e027d1d21a74cc7831a1b668511a2f5015c46 100755 (executable)
@@ -114,7 +114,7 @@ print "Connected.\n";
 
 while(1) {
   my $data = Perl2Epics::GetAll();
-  my $str = Hmon::MakeTitle(18, 12, "MDC HV", 1, "");
+  my $str = Hmon::MakeTitle(13, 7, "MDC HV", 1, "");
     $str .= "<table class=\"rates textbox\">"; #<div id=\"logbox\" class=\"textbox\" >
     $str .= "<tr><th><th colspan=1>Sector 1<th colspan=1>Sector 2<th colspan=1>Sector 3<th colspan=1>Sector 4<th colspan=1>Sector 5<th colspan=1>Sector 6"; 
   for(my $i = 1; $i<=4; $i++) {
@@ -139,35 +139,32 @@ while(1) {
 
     #$str .= "<tr><th colspan=7>&nbsp;\n";      
     }  
-  $str .= "</table>\n ";#</div
-  #~ $str .= Hmon::MakeFooter();
+  $str .= "</table>\n ";#</div 
 
 ####################################################################
 ## CW 20. June 2016 individual layer HV:
- my $data = Perl2Epics::GetAll();
-  #~ my $str = Hmon::MakeTitle(13, 6, "MDC indv. HV", 1, "");
-    $str .= "<br><table class=\"rates textbox\">"; #<div id=\"logbox\" class=\"textbox\" >
-    $str .= "<tr><th><th colspan=1>Layer 1<th colspan=1>Layer 2<th colspan=1>Layer 3<th colspan=1>Layer 4<th colspan=1>Layer 5<th colspan=1>Layer 6/0"; 
-   for(my $i = 1; $i<=4; $i++) {
-      $str .= "<tr><tr><th colspan=7>Chamber $i\n";      
-    for(my $v = 0; $v<=1; $v++) {
-      $str .= "<tr><td>".$layerlabel[$v]."&nbsp;";
-      for(my $s = 1; $s<=6; $s++) {
-        my $voltI = $data->{"Ind-$i-$s-$v-V"}->{val};
-        my $currI = $data->{"Ind-$i-$s-$v-I"}->{val};
-        my $tvI   = strftime("%H:%M:%S",localtime($data->{"Ind-$i-$s-$v-V"}->{tme} || 0));
-        my $tcI   = strftime("%H:%M:%S",localtime($data->{"Ind-$i-$s-$v-I"}->{tme} || 0));
-        $voltI = -1 unless defined $voltI;
-        $currI = -1 unless defined $currI;
-        my $tmpI .= sprintf(" %4i V | %3.2f uA",$voltI,$currI);
-        $str .= "<td title=\"$tvI / $tcI\">".$tmpI;
-        }
-      }
-    }  
-  $str .= "</table>\n";#</div
- $str .= Hmon::MakeFooter(); 
-####################################################################
+#     $str .= "<br><table class=\"rates textbox\">"; #<div id=\"logbox\" class=\"textbox\" >
+#     $str .= "<tr><th><th colspan=1>Layer 1<th colspan=1>Layer 2<th colspan=1>Layer 3<th colspan=1>Layer 4<th colspan=1>Layer 5<th colspan=1>Layer 6/0"; 
+#    for(my $i = 1; $i<=4; $i++) {
+#       $str .= "<tr><tr><th colspan=7>Chamber $i\n";      
+#     for(my $v = 0; $v<=1; $v++) {
+#       $str .= "<tr><td>".$layerlabel[$v]."&nbsp;";
+#       for(my $s = 1; $s<=6; $s++) {
+#         my $voltI = $data->{"Ind-$i-$s-$v-V"}->{val};
+#         my $currI = $data->{"Ind-$i-$s-$v-I"}->{val};
+#         my $tvI   = strftime("%H:%M:%S",localtime($data->{"Ind-$i-$s-$v-V"}->{tme} || 0));
+#         my $tcI   = strftime("%H:%M:%S",localtime($data->{"Ind-$i-$s-$v-I"}->{tme} || 0));
+#         $voltI = -1 unless defined $voltI;
+#         $currI = -1 unless defined $currI;
+#         my $tmpI .= sprintf(" %4i V | %3.2f uA",$voltI,$currI);
+#         $str .= "<td title=\"$tvI / $tcI\">".$tmpI;
+#         }
+#       }
+#     }  
+#   $str .= "</table>\n";#</div
 
+####################################################################
+  $str .= Hmon::MakeFooter(); 
 
   if(!($timer%1)) {
     Hmon::WriteFile("MDCHV", $str);  
index b47f88c175f4dd5ff9285a2d4d6e8c71849481b4..d9d6af2d22b74005eb0356d8f9ee0be30332f817 100755 (executable)
@@ -4,8 +4,7 @@ use strict;
 use warnings;
 use v5.10.0;
 
-my @cpus = qw |lxhadeb05 lxhadeb06 lxhadeb07 lxhadeb08 lxhadeb09 lxhadeb10 lxhadeb11 lxhadeb12 lxhadeb13 lxhaddcs03 lxhaddcs04 lxhaddcs05 lxhaddcs06 lxhadesdaq hadesdaq01 hadesdaq02 hades30 hadesp31 hades33
-lxhadeb05p lxhadeb06p lxhadeb07p lxhadeb08p lxhadeb09p lxhadeb10p lxhadeb11p lxhadeb12p lxhadeb13p lxhaddcs03p lxhaddcs04p lxhaddcs05p lxhaddcs06p lxhadesdaqp hadesdaqp01 hadesdaqp02 hadesp30 hadesp33 hadesp50 |;
+my @cpus = qw |lxhadeb05 lxhadeb06 lxhadeb07 lxhadeb08 lxhadeb09 lxhadeb10 lxhadeb11 lxhadeb12 lxhadeb13 lxhaddcs03 lxhaddcs04 lxhaddcs05 lxhaddcs06 lxhadesdaq hadesdaq01 hadesdaq02 hades30 hadesp31 hades33 lxhadeb05p lxhadeb06p lxhadeb07p lxhadeb08p lxhadeb09p lxhadeb10p lxhadeb11p lxhadeb12p lxhadeb13p lxhaddcs03p lxhaddcs04p lxhaddcs05p lxhaddcs06p lxhadesdaqp hadesdaqp01 hadesdaqp02 hadesp30 hadesp33 hadesp50 |;
 
 for my $cpu (@cpus) {
     my $c = "~/trbsoft/hadesdaq/hmon/hmon_ssh hadaq\@$cpu -N -f </dev/null &";
index 4bf00a9ac7f78fc208cf96fd46b9418b0a51d8f3..c1246e0df87a13669aec937763f786fc3099b387 100755 (executable)
@@ -49,7 +49,7 @@ while(1) {
 
   foreach my $i (0..(scalar @files2)-1) {
     next if scalar @files2 == 0;
-    $out .= "<td style='text-align:center'>";  
+    $out .= "<tr><td style='text-align:center'>";  
     my @n = split('/',$files2[$i]);
     chop $n[-1];
     my ($y1,$d1,$h1,$m1,$s1,$y2,$d2,$h2,$m2,$s2) = $n[-1] =~ /.*_(\d\d)(\d\d\d)(\d\d)(\d\d)(\d\d)-[\w-][\w-](\d\d)(\d\d\d)(\d\d)(\d\d)(\d\d).*/;
index b1fff94ab012b5a192e38320f147fc9cc07e908e..5bbbcfda1b6c34ab7c3ab5eb424decfafabb024a 100644 (file)
@@ -4,6 +4,7 @@ body {
   margin:0px;
   border:0px;
   text-align:left;
+
   }
 
 body>div>div {
@@ -22,6 +23,7 @@ body>div>div {
 
 div#content {
   background:transparent !important;
+/*      transition: opacity .5s; */
 }
   
 div.timestamp {