]> jspc29.x-matter.uni-frankfurt.de Git - hadesdaq.git/commitdiff
update hmon scripts
authorhadaq <jan@lxhadeb07>
Tue, 7 Dec 2021 11:03:11 +0000 (12:03 +0100)
committerhadaq <jan@lxhadeb07>
Tue, 7 Dec 2021 11:03:11 +0000 (12:03 +0100)
34 files changed:
hmon/QA.pm
hmon/doc/daq-busy.htt
hmon/doc/rich-isob.htt
hmon/hmon_busynew.pl
hmon/hmon_calibration.pl
hmon/hmon_endpoints.pl
hmon/hmon_frpcrate.pl
hmon/hmon_lvl1mismatch.pl
hmon/hmon_onlineqa.pl
hmon/hmon_padiwatemp.pl [changed mode: 0755->0644]
hmon/hmon_padiwatemp_ecal.pl [new file with mode: 0755]
hmon/hmon_padiwatemp_itof.pl [new file with mode: 0755]
hmon/hmon_padiwatemp_start.pl [new file with mode: 0755]
hmon/hmon_rate2.pl
hmon/hmon_richMagnet.pl
hmon/hmon_rich_temp_backplane.pl
hmon/hmon_rpcrate.pl
hmon/hmon_spill.pl
hmon/hmon_startratesimple.pl
hmon/hmon_stsrate_split.pl [new file with mode: 0755]
hmon/index.cgi
hmon/monitor.cgi
hmon/permanent/hmon_beamabort.pl [new file with mode: 0755]
hmon/permanent/hmon_cpu.pl
hmon/permanent/hmon_eb_run.pl
hmon/permanent/hmon_environment.pl
hmon/permanent/hmon_frpchv.pl [new file with mode: 0755]
hmon/permanent/hmon_hldlastfiles.pl
hmon/permanent/hmon_itofhv.pl [new file with mode: 0644]
hmon/permanent/hmon_richIsobutan.pl
hmon/rich_drawing_2.htm
hmon/rich_drawing_bkpl.htm
hmon/speakdaemon_mdc.pl [new file with mode: 0755]
hmon/start.sh

index 1bf00e7a74348ee43bf89c4b664284e49a214c4c..7514953eb54756e3e56f038d22ba88a72ecc3868 100644 (file)
@@ -17,7 +17,7 @@ our $cats = {'main'=>"Main",
              'other'=>"Other",
              'pion'=>"Pion",
              'rich'=>'RICH',
-             'ecal'=>'ECal',
+             'padiwa'=>'Padiwa',
              'hv'=>'HV',
              'hv2'=>'HV',
              'misc'=>'misc'};
@@ -34,7 +34,7 @@ our $entries->{'cats'} = ["main",
                           "feeerr",
 #                          "pion",
                           "rich",
-                         "ecal",
+                         "padiwa",
                           "hv",
                           "hv2",
                           "misc",
@@ -42,17 +42,17 @@ our $entries->{'cats'} = ["main",
 ];
 
 # Order of entries in each cat
-$entries->{'main'}    = ['time', 'rate','onlineqa','up','outofsync'];
-$entries->{'daq'}     = ['trbnet', 'timeouts', 'busy','readout','spillcount'];
+$entries->{'main'}    = ['time', 'rate','beamabort','up','spillcount'];
+$entries->{'daq'}     = ['trbnet', 'timeouts', 'busy','readout','outofsync'];
 $entries->{'trg'}     = ['spill', 'accepted', 'source','pt1rate',  'start']; #, 
-$entries->{'rate'}    = ['pt1','start','hodo','pion1','pion2'];
-$entries->{'server'}  = ['fill', 'cpu', 'icinga', 'etrax', 'pwrsup'];
+$entries->{'rate'}    = ['pt1','pt2','pt3','pt7','pt8'];
+$entries->{'server'}  = ['fill', 'cpu', 'icinga', 'pwrsup', 'onlineqa'];
 $entries->{'eb'}      = ['run', 'rate','bytes', 'lostevt', 'errbits'];
 $entries->{'mdc'}     = ['token', 'blocked', 'temp', 'linkqual', 'voltage'];
 $entries->{'endp'}    = ['mdc','rich', 'tof', 'rpc', 'other'];
 $entries->{'feeerr'}  = ['feeerr','trginp','trgqual','',''];
 $entries->{'rich'}    = ['temp','LV','bkpl','isob','richthr'];
-$entries->{'ecal'}    = ['temp','count','thr','',''];
+$entries->{'padiwa'}  = ['ecal','start','itof','hodo',''];
 $entries->{'hv'}      = ['richhv','ecalhv','rpchv','fwhv','tofhv'];
 $entries->{'hv2'}     = ['mdchv','stshv','frpchv','starthv','itofhv'];
 $entries->{'misc'}    = ['irq','calib','magnet','env','sequencer'];
@@ -85,6 +85,8 @@ our @MdcVoltageLimits = (50, 70, 100);
 our @MdcLockLimits    = (0, 3, 5);
 our @MdcTempLimits    = (75, 80, 85);
 our @EcalTempLimits    = (55, 60, 65);
+our @StartTempLimits    = (55, 60, 65);
+our @ItofTempLimits    = (55, 60, 65);
 our @RichInnerTempLimits = (34,34.5,35);
 our @TrgErrLimits     = (100, 1000, 10000);
 our @CPULimits        = (95, 100, 100);
@@ -107,7 +109,7 @@ our @RpcHvLimits = (12,12,12);
 our @TofHvLimits = (764,760,759);
 our @FwHvLimits = (280,250,200);
 our @FrpcHvLimits = (5.5,3.9,0); #kV 5.6 -> std. / 4 -> idle
-our @ItofHvLimits = (1000,999,0);
+our @ItofHvLimits = (29,28,0);
 
 our @TdcCalibrationInterval = (320000,450000,600000);   
 our @TdcCalibrationTemperature = (5,7,10);    
@@ -115,9 +117,15 @@ our @TdcCalibrationTemperature = (5,7,10);
 our @PionLvCurrLimits = (4,5,6);
 
 
-our $PadiwaECalNumber = 105;
+our $PadiwaEcalNumber = 105;
 our @PadiwaEcalLimits    = (5, 10, 20);
 
+our $PadiwaItofNumber = 18;
+our @PadiwaItofLimits    = (0, 0, 1);
+
+our $PadiwaStartNumber = 12;
+our @PadiwaStartLimits    = (0, 0, 1);
+
 our @LimitTriggerPerSpill = (1000, 0, 0);
 our $AcceleratorCycle = 7;
 use constant {CTSAddress => 0x0003};
@@ -137,6 +145,8 @@ our $ItofHvOff = 1;
 our $FrpcHvOff = 0;
 our $EcalHvOff = 0;
 
+our $QAServerOff = 1;
+
 ###############################################################################
 #  Missing Boards
 ###############################################################################
index 1ca1bb432925de7403fb28570ba6e8374403c9fd..fc8e672cdc5791ab96b5fa4a82042ad89268d10d 100644 (file)
@@ -7,10 +7,12 @@ During normal operation, the full message gives the busy times for all sub-syste
 
 <ul>
 <li>If there is "readout waiting" reported at the same time, the real problem is to be found there. 
+<li>If there is a "sync" error reported at the same time, the real problem is to be found there. 
 <li>Check the list of board addresses, which board is busy. 
-<li>If the address starts with '2' (from MDC), try to resync missing OEPs
-<li>If the address starts with '7' (from RICH), a 'Resync DiRich' followed by a DAQ restart should help
+<ul><li>If all addresses start with '2' (from MDC), try to resync missing OEPs
+<li>If all addresses start with '7' (from RICH), a 'Resync DiRich' should help
 <li>If not, a DAQ restart should solve the problem.
+</ul>
 <li>If the misbehaving board is from MDC and the error happens several times for the same board, 
 do a MDC power-cycle of the corresponding chamber.
 <li>If the board is from MDC, and there is a "FEE Error" at the same time, an MDC LV power-cycle is needed.
index e7e5c64a71c6fcbd9c7a1667bae883450071e997..22b67569c7b783209f28156a3431f4d00a76e946 100644 (file)
@@ -1,6 +1,12 @@
 <h3>Isobutan Gaspipe (RICH radiator)</h3>
 <p>
-This value gives you the pressure of the inlet line of the Isobutan pipe near the Gassystems in front of the HADES Cave.
+This values indicate the status of the isobutan gas system.</br>
+<b>Isobutan pressure:</b> Pressure of the inlet.</br>
+<b>O<sub>2</sub> concentration:</b> value should be below 400ppm. Oherwise a warning/error is shown.</br>
+<b>Isobutan Ratio:</b> Should be below 50. Oherwise a warning/error is shown.</br>
+<b>Scales:</b> weight of the two bottles next to of the target hall. Weight is an indication for an exchange of the bottles.</br>
+
+
 
 
 
index 9fbc2b7a35ab5b39f546dc117fc2b5dc738051c5..2b75cd901e1d61ba054ff2ec94fe879f9cfe9460 100755 (executable)
@@ -87,7 +87,7 @@ for my $p (0..8) {
 
 while (1) {
   my $o;
-  foreach my $b (0x8000, 0x8018){#,0x8012,0x8013,0x8015,0x8016,0x8017,0x8018) {
+  foreach my $b (0x8000, 0x8014){#,0x8012,0x8013,0x8015,0x8016,0x8017,0x8018) {
     my $t = trb_registertime_read_mem($b,0x4030,0,10);
     $o->{$b} = $t->{$b};
     }
@@ -113,7 +113,7 @@ while (1) {
     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',$diff->{0x8014}->[8],8); #Start TRB3
 #     HPlot::PlotAdd('BusyTimes',max($diff->{0x8003}->[1],$diff->{0x8003}->[2]),9); #Pion
 
 #Default plots    
@@ -125,7 +125,7 @@ while (1) {
     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::PlotFill('BusyTimeBars',$diff->{0x8014}->[8],8); #Start TRB3
 #     HPlot::PlotAdd('BusyTimes',max($diff->{0x8003}->[1],$diff->{0x8003}->[2]),9); #Pion
 
 # #Extended view
index c2f39ec9d903ddf46cabf3d6470fbfc447215aa0..1332990e5f374902b25da3b3ea1acde1cf72fcaf 100755 (executable)
@@ -74,7 +74,8 @@ while(1){
   $export->{quality} = $data->{LastCalibr}{'quality'};
   $export->{status}{time} = QA::GetQAState('below',$timesincecalib,@QA::TdcCalibrationInterval);
   $export->{status}{temp} = QA::GetQAState('below',max(-$min,$max),@QA::TdcCalibrationTemperature);
-  $export->{status}{quality} = ($export->{quality} < 1)?QA::ERROR:QA::OK;
+  $export->{status}{quality} = ($export->{quality} < 0.9)?QA::ERROR:QA::OK;
+  # JAM12-2021: 0.9 means error was acknowledged by operator (???) , 1.0 means all is perfect
   $export->{nocalib} = [];
   $export->{calibactive} = ($data->{RunPrefix}{value} eq 'tc')?1:0;
   
@@ -106,8 +107,8 @@ while(1){
       $longtext .= sprintf("Temperature changed in the interval of %.1f (%04x) to %.1f (%04x) degrees.<br/>",$min,$minboard,$max,$maxboard);
     my $status = max($export->{status}{time},$export->{status}{temp});
     
-    if($export->{quality} && $export->{quality} < 1) {
-      $longtext .= "Quality reported by EB is below 1";
+    if($export->{quality} && $export->{quality} < 0.9) {
+      $longtext .= "Quality reported by EB is below 0.9";
       $status = max(QA::FATAL,$status);
       }
     
index a647dae514702d8192808bf09c228dc0c9b35738..148a1fc83f04a1cfae3330c7708a46a1c31ce9e6 100755 (executable)
@@ -197,7 +197,7 @@ while(1) {
         0x6460, 0x6461, 0x6462, 0x6463, 0x6464, 0x6465,
         0x6470, 0x6471, 0x6472, 0x6473, #0x6474, 0x6475,
 #fRPC
-#      0x8c00,0x6800,0x6801,0x6802,0x6803,
+       0x8c00,0x6800,0x6801,0x6802,0x6803,
        0x8c10,0x6810,0x6811,0x6812,0x6813,
        );
 
@@ -207,13 +207,13 @@ while(1) {
        #central hub
        0x8000,0x8011,0x8012,0x8013,0x8014,0x8800, 0x8810,
        #innerTOF
-#        0x8d00,0x5d00,0x5d01,0x5d02,0x5d03,0x5d04,0x5d05,
-        0x8d00,0x5d01,0x5d04,
+        0x8d00,0x5d00,0x5d01,0x5d02,0x5d03,0x5d04,0x5d05,
+#        0x8d00,0x5d01,0x5d04,
 #      #Pion
 #      0x8900,0x3800,0x3801,
 #      0x8910,0x3810,0x3811,
        #Start TRB3sc
-       0x8880,0x5000,0x5001,0x5002,0x5003,
+       0x8880,0x5000,0x5001,0x5002,0x5003,0x5004,0x5005,0x5006,0x5007,
        #Hodo TRB3
        0x8890,0x5010,0x5011,0x5012,
        #Trigger
index ca2799643d78176fc0c7f7cc1261bce316fc1936..5bfbbf581bb20deff4c0c93fcf2c1a3b5c0ea168 100755 (executable)
@@ -63,7 +63,7 @@ while(1) {
   #my $max = 0 ;
   #my $min = 5E9;
   
-  my $o = trb_register_read_mem(0xfe47,0xc000,0,33) or die trb_strerror() or sleep 5 and next;
+  my $o = trb_register_read_mem(0xfe47,0xdfc0,0,32) or die trb_strerror() or sleep 5 and next;
 
   if (defined $old) {
     my $tdiff = (time() - $oldtime)|1;
@@ -73,12 +73,12 @@ while(1) {
       my $xpos =  ($b&0xF)*2 + ($b>>4 & 0xF)*10;
 
       for my $v (0..31) {
-        my $vdiff = ($o->{$b}->[$v+1]&0xfffffff) - ($old->{$b}->[$v+1]&0xfffffff);
+        my $vdiff = ($o->{$b}->[$v]&0xffffff) - ($old->{$b}->[$v]&0xffffff);
         
-        if ($vdiff < 0) { $vdiff += 2**28;}
-        $diff->{$b}->[$v+1] = $vdiff/$tdiff;
+        if ($vdiff < 0) { $vdiff += 2**24;}
+        $diff->{$b}->[$v] = $vdiff/$tdiff;
         #$ratesum += $diff->{$b}->[$v+1];
-        HPlot::PlotFill('FrpcRate',$diff->{$b}->[$v+1],$v%16,$xpos+$v/16);
+        HPlot::PlotFill('FrpcRate',$diff->{$b}->[$v],$v%16,$xpos+$v/16);
         }
       #my $s = sprintf("0x%04x",$b);
       #$data->{$s}= int(100*($ratesum / 32) +0.5) /100;
index 463f0047a46f496df729b86a4c988731a07ca1a7..074e68a9e2d8ef2abd15981ef91f46ec321c937d 100755 (executable)
@@ -54,6 +54,6 @@ while(1){
   $txt = "Error" if $cnt2+$cnt >= 2 ;
 #      
      
-  QA::WriteQALog($fqa,"main","outofsync",20,$status,'Sync',$txt,$msg);
+  QA::WriteQALog($fqa,"daq","outofsync",20,$status,'Sync',$txt,$msg);
   sleep 2;  
   }
index 788063deee25e3e43211455eb880162a5ceba384..b57a306c48e2a7dea8f1aafe143a0cbdd62d4f2a 100755 (executable)
@@ -35,7 +35,12 @@ while (1) {
     $longmsg = "The online QA server process could not be found.";
     }
 
-  QA::WriteQALog($fqa, "main", "onlineqa", 40, $qastate, $title, $msg, $longmsg);
+  if($QA::QAServerOff) {
+    $qastate = QA::NOTE;
+    $msg = "OFF";
+    }
+
+  QA::WriteQALog($fqa, "server", "onlineqa", 40, $qastate, $title, $msg, $longmsg);
 
 
   if ($qastate > 60 && !($timecnt++ % 20)) {
old mode 100755 (executable)
new mode 100644 (file)
diff --git a/hmon/hmon_padiwatemp_ecal.pl b/hmon/hmon_padiwatemp_ecal.pl
new file mode 100755 (executable)
index 0000000..13c10f5
--- /dev/null
@@ -0,0 +1,80 @@
+#!/usr/bin/perl -w
+
+use warnings;
+use strict;
+use Data::Dumper;
+# use Data::TreeDumper;
+use Hmon;
+use QA;
+use HADES::TrbNet;
+use HPlot;
+use Dmon;
+use Time::HiRes qw(usleep);
+use List::Util qw[min max];
+
+trb_init_ports() or die trb_strerror();
+my $flog = Hmon::OpenLogfile();
+my $fqa  = QA::OpenQAFile();
+
+while(1) {
+  my @r;
+  $r[0] = Dmon::PadiwaSendCmd(0x14 << 24,0xfe71,0) or sleep 1 and next;
+  $r[1] = Dmon::PadiwaSendCmd(0x14 << 24,0xfe71,1) or sleep 1 and next;
+  $r[2] = Dmon::PadiwaSendCmd(0x14 << 24,0xfe71,2) or sleep 1 and next;
+  
+  my $min = 1000;
+  my $max = 0;
+  my $count = 0;
+  my @missing = ();
+  my $c = -1;
+  if (!defined $r[0] || $r[0] == -1 || scalar %{$r[0]} < 1) {sleep 10; next;}
+  foreach my $r (@r) {
+    $c++;
+    foreach my $b (keys %{$r}) {
+      last if $r->{$b} =~ /SPI/;
+      my $t = ($r->{$b} & 0xfff)/16;
+      $count++ unless $t > 90;
+      push @missing, sprintf("%04x-%i ",$b,$c) if $t > 90;
+      # $missing .= sprintf("%04x-%i ",$b,$c) if $t > 90;
+      next if $t < 10 || $t > 90;
+      $min = $t if $t < $min;
+      $max = $t if $t > $max;
+    }
+  }
+  
+  @missing = sort @missing;
+  my $missing_str = "";
+  my $ctr = 1;
+  foreach (@missing) {
+    $missing_str .= "<br>" if $ctr % 5 == 0;
+    $missing_str .= $_;
+    $ctr++;
+  }
+
+  my $qastateTemp = QA::GetQAState('below', $max, @QA::EcalTempLimits);
+  my $qastateNof  = QA::GetQAState('below', $QA::PadiwaEcalNumber-$count, @QA::PadiwaEcalLimits);
+  my $tempStr = sprintf("%i-%i", $min, $max);
+  my $tempStr2;
+  if ($qastateTemp == QA::OK) {
+    $tempStr2 = sprintf("<b>Temperature OK</b><br>");
+  }
+  else {
+    $tempStr2 = sprintf("<b>Temperature Bad</b><br>");
+  }
+
+  my $nofStr = sprintf("%i/%i",$count,$QA::PadiwaEcalNumber);
+  my $nofStr2;
+  if ($count == $QA::PadiwaEcalNumber) {
+    $nofStr2 = sprintf("<b>Number of PADIWA OK</b><br>All ") ;
+  }
+  else {
+    $nofStr2 = sprintf("<b>Number of PADIWA");
+    $nofStr2 .= $qastateNof == QA::OK ? sprintf(" Suboptimal</b><br>Only ") : sprintf(" Bad</b><br>Only ");
+  }
+
+  my $worstQaState = ( $qastateTemp != QA::OK ? $qastateTemp : $qastateNof);
+  QA::WriteQALog($fqa,"padiwa","ecal", 45, $worstQaState, "ECAL", $nofStr . " | " . $tempStr, 
+    $tempStr2. "Temperature in ECAL " . $tempStr . "°C.<br>" . $nofStr2 . $nofStr . " PADIWAs<br>" . " Missing are: " . $missing_str);
+
+  sleep(10);
+}
diff --git a/hmon/hmon_padiwatemp_itof.pl b/hmon/hmon_padiwatemp_itof.pl
new file mode 100755 (executable)
index 0000000..7a5c62f
--- /dev/null
@@ -0,0 +1,81 @@
+#!/usr/bin/perl -w
+
+use warnings;
+use strict;
+use Data::Dumper;
+# use Data::TreeDumper;
+use Hmon;
+use QA;
+use HADES::TrbNet;
+use HPlot;
+use Dmon;
+use Time::HiRes qw(usleep);
+use List::Util qw[min max];
+
+trb_init_ports() or die trb_strerror();
+my $flog = Hmon::OpenLogfile();
+my $fqa  = QA::OpenQAFile();
+
+while(1) {
+  my @r;
+  $r[0] = Dmon::PadiwaSendCmd(0x1004 << 16,0xfe74,0) or sleep 1 and next;
+  $r[1] = Dmon::PadiwaSendCmd(0x1004 << 16,0xfe74,1) or sleep 1 and next;
+  $r[2] = Dmon::PadiwaSendCmd(0x1004 << 16,0xfe74,2) or sleep 1 and next;
+
+  my $min = 1000;
+  my $max = 0;
+  my $count = 0;
+  my @missing = ();
+  my $c = -1;
+  if (!defined $r[0] || $r[0] == -1 || scalar %{$r[0]} < 1) {sleep 10; next;}
+  foreach my $r (@r) {
+    $c++;
+    foreach my $b (keys %{$r}) {
+      last if $r->{$b} =~ /SPI/;
+      next if ($b < 0x5d00 || $b > 0x5d05);
+      my $t = ($r->{$b} & 0xfff)/16;
+      $count++ unless $t > 90;
+      push @missing, sprintf("%04x-%i ",$b,$c) if $t > 80;
+      # $missing .= sprintf("%04x-%i ",$b,$c) if $t > 90;
+      next if $t < 10 || $t > 80;
+      $min = $t if $t < $min;
+      $max = $t if $t > $max;
+    }
+  }
+  
+  @missing = sort @missing;
+  my $missing_str = "";
+  my $ctr = 1;
+  foreach (@missing) {
+    $missing_str .= "<br>" if $ctr % 5 == 0;
+    $missing_str .= $_;
+    $ctr++;
+  }
+
+  my $qastateTemp = QA::GetQAState('below', $max, @QA::ItofTempLimits);
+  my $qastateNof  = QA::GetQAState('below', $QA::PadiwaItofNumber-$count, @QA::PadiwaItofLimits);
+  my $tempStr = sprintf("%i-%i", $min, $max);
+  my $tempStr2;
+  if ($qastateTemp == QA::OK) {
+    $tempStr2 = sprintf("<b>Temperature OK</b><br>");
+  }
+  else {
+    $tempStr2 = sprintf("<b>Temperature Bad</b><br>");
+  }
+
+  my $nofStr = sprintf("%i/%i",$count,$QA::PadiwaItofNumber);
+  my $nofStr2;
+  if ($count == $QA::PadiwaItofNumber) {
+    $nofStr2 = sprintf("<b>Number of PADIWA OK</b><br>All ") ;
+  }
+  else {
+    $nofStr2 = sprintf("<b>Number of PADIWA");
+    $nofStr2 .= $qastateNof == QA::OK ? sprintf(" Suboptimal</b><br>Only ") : sprintf(" Bad</b><br>Only ");
+  }
+
+  my $worstQaState = ( $qastateTemp != QA::OK ? $qastateTemp : $qastateNof);
+  QA::WriteQALog($fqa,"padiwa","itof", 45, $worstQaState, "iTOF", $nofStr . " | " . $tempStr, 
+    $tempStr2. "Temperature in iTOF " . $tempStr . "°C.<br>" . $nofStr2 . $nofStr . " PADIWAs<br>" . " Missing are: " . $missing_str);
+
+  sleep(10);
+}
diff --git a/hmon/hmon_padiwatemp_start.pl b/hmon/hmon_padiwatemp_start.pl
new file mode 100755 (executable)
index 0000000..b4bc265
--- /dev/null
@@ -0,0 +1,81 @@
+#!/usr/bin/perl -w
+
+use warnings;
+use strict;
+use Data::Dumper;
+# use Data::TreeDumper;
+use Hmon;
+use QA;
+use HADES::TrbNet;
+use HPlot;
+use Dmon;
+use Time::HiRes qw(usleep);
+use List::Util qw[min max];
+
+trb_init_ports() or die trb_strerror();
+my $flog = Hmon::OpenLogfile();
+my $fqa  = QA::OpenQAFile();
+
+while(1) {
+  my @r;
+  $r[0] = Dmon::PadiwaSendCmd(0x1004 << 16,0xfe74,0) or sleep 1 and next;
+  $r[1] = Dmon::PadiwaSendCmd(0x1004 << 16,0xfe74,1) or sleep 1 and next;
+  $r[2] = Dmon::PadiwaSendCmd(0x1004 << 16,0xfe74,2) or sleep 1 and next;
+
+  my $min = 1000;
+  my $max = 0;
+  my $count = 0;
+  my @missing = ();
+  my $c = -1;
+  if (!defined $r[0] || $r[0] == -1 || scalar %{$r[0]} < 1) {sleep 10; next;}
+  foreach my $r (@r) {
+    $c++;
+    foreach my $b (keys %{$r}) {
+      last if $r->{$b} =~ /SPI/;
+      next if ($b < 0x5000 || $b > 0x5003);
+      my $t = ($r->{$b} & 0xfff)/16;
+      $count++ unless $t > 90;
+      push @missing, sprintf("%04x-%i ",$b,$c) if $t > 90;
+      # $missing .= sprintf("%04x-%i ",$b,$c) if $t > 90;
+      next if $t < 10 || $t > 90;
+      $min = $t if $t < $min;
+      $max = $t if $t > $max;
+    }
+  }
+  
+  @missing = sort @missing;
+  my $missing_str = "";
+  my $ctr = 1;
+  foreach (@missing) {
+    $missing_str .= "<br>" if $ctr % 5 == 0;
+    $missing_str .= $_;
+    $ctr++;
+  }
+
+  my $qastateTemp = QA::GetQAState('below', $max, @QA::StartTempLimits);
+  my $qastateNof  = QA::GetQAState('below', $QA::PadiwaStartNumber-$count, @QA::PadiwaStartLimits);
+  my $tempStr = sprintf("%i-%i", $min, $max);
+  my $tempStr2;
+  if ($qastateTemp == QA::OK) {
+    $tempStr2 = sprintf("<b>Temperature OK</b><br>");
+  }
+  else {
+    $tempStr2 = sprintf("<b>Temperature Bad</b><br>");
+  }
+
+  my $nofStr = sprintf("%i/%i",$count,$QA::PadiwaStartNumber);
+  my $nofStr2;
+  if ($count == $QA::PadiwaStartNumber) {
+    $nofStr2 = sprintf("<b>Number of PADIWA OK</b><br>All ") ;
+  }
+  else {
+    $nofStr2 = sprintf("<b>Number of PADIWA");
+    $nofStr2 .= $qastateNof == QA::OK ? sprintf(" Suboptimal</b><br>Only ") : sprintf(" Bad</b><br>Only ");
+  }
+
+  my $worstQaState = ( $qastateTemp != QA::OK ? $qastateTemp : $qastateNof);
+  QA::WriteQALog($fqa,"padiwa","start", 45, $worstQaState, "Start", $nofStr . " | " . $tempStr, 
+    $tempStr2. "Temperature in Start " . $tempStr . "°C.<br>" . $nofStr2 . $nofStr . " PADIWAs<br>" . " Missing are: " . $missing_str);
+
+  sleep(10);
+}
index b0948feab2317a3b039b71f612f3cb4ff41b947f..a2a9ffd5dc2f0774d6f97ac811a1612dc9f91d88 100755 (executable)
@@ -143,19 +143,25 @@ while (1) {
   $state = QA::OK;
   $shorttext = QA::SciNotation($store{0xa026})." / ".getCorrected($store{0xa026},$offset->{0xa026});
   $longtext  = sprintf("Trigger Rate from PT3 %i Hz / %i Hz after offset correction",$store{0xa026}, getCorrectedValue($store{0xa026},$offset->{0xa026}) );
-  QA::WriteQALog($fqa, "rate", "hodo", 10,
+  QA::WriteQALog($fqa, "rate", "pt3", 10,
        $state, 'PT3 Rate', $shorttext, $longtext); 
 
+  $state = QA::OK;
+  $shorttext = QA::SciNotation($store{0xa025})." / ".getCorrected($store{0xa025},$offset->{0xa025});
+  $longtext  = sprintf("Trigger Rate from PT2 %i Hz / %i Hz after offset correction",$store{0xa025}, getCorrectedValue($store{0xa025},$offset->{0xa025}) );
+  QA::WriteQALog($fqa, "rate", "pt2", 10,
+       $state, 'PT2 Rate', $shorttext, $longtext); 
+
   $state = QA::OK;
   $shorttext = QA::SciNotation($store{0xa02a})." / ".getCorrected($store{0xa02a},$offset->{0xa02a});
   $longtext  = sprintf("Trigger Rate from PT7: %i Hz / %i Hz after offset correction",$store{0xa02a}, getCorrectedValue($store{0xa02a},$offset->{0xa02a}) );
-  QA::WriteQALog($fqa, "rate", "pion1", 10,
+  QA::WriteQALog($fqa, "rate", "pt7", 10,
        $state, 'PT7 Rate', $shorttext, $longtext); 
        
   $state = QA::OK;
   $shorttext = QA::SciNotation($store{0xa02b})." / ".getCorrected($store{0xa02b},$offset->{0xa02b});
   $longtext  = sprintf("Trigger Rate from PT8: %i Hz / %i Hz after offset correction",$store{0xa02b}, getCorrectedValue($store{0xa02b},$offset->{0xa02b}) );
-  QA::WriteQALog($fqa, "rate", "pion2", 10,
+  QA::WriteQALog($fqa, "rate", "pt8", 10,
        $state, 'PT8 Rate', $shorttext, $longtext); 
 
   $state = QA::OK;
index e3812bf33356289015ff62e632aa366aa7fe3824..a895d7ac642cd101886962e9c304dbb51391c2a1 100755 (executable)
@@ -170,7 +170,7 @@ while(1){
           $maxtemp = $t if $t > $maxtemp;
           my $reg = 4*$boardT+$sensT;
           if ($cnt > 7) {$cnt =0;} else {$cnt++;}
-          HPlot::PlotAdd('RichInnerTempHist',$t,$reg);
+          if ($t != 0) {HPlot::PlotAdd('RichInnerTempHist',$t,$reg);}
           $TempLong[$reg]+=$t;
           $TempLongCnt[$reg]++;
           $str_log .= sprintf("%3.2f\t",$t);    
@@ -230,7 +230,7 @@ while(1){
      #long Range Hist
      for (my $i=0;$i<24;$i++){
        $TempLong[$i] /= $TempLongCnt[$i]||1;
-       HPlot::PlotAdd('RichInnerTempHistLong',$TempLong[$i],$i);
+       if ($TempLong[$i] != 0) {HPlot::PlotAdd('RichInnerTempHistLong',$TempLong[$i],$i);}
        #print $TempLong[$i]."\n";
        $TempLong[$i]    = 0;
        $TempLongCnt[$i] = 0;
index bcfff23974294d710dde04d32d7544d7311099d7..ae560e4b33ab46067c3d7e8e080e5bc95fd30e76 100755 (executable)
@@ -28,7 +28,7 @@ my $raw = {};
 my $val;
 my $mailerrstatecnt = 0;
 my ($max,$min,$avg,$sum,$count);
-my $interlockTemperature = 36.0; #Interlock value !!!
+my $interlockTemperature = 39.0; #Interlock value !!!
 #my $interlockTemperature = 95.0; #Interlock value !!!
 
 
index 371e6e0232aef8ea325c0c33d3d72d1c2660b21c..50d30f57ab78af0e0f5dac3a5748012ff70c0f1b 100755 (executable)
@@ -63,7 +63,7 @@ while(1) {
   #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;
+  my $o = trb_register_read_mem(0xfe73,0xdfc0,0,48) or die trb_strerror() or sleep 5 and next;
 
   if (defined $old) {
     my $tdiff = (time() - $oldtime)|1;
@@ -73,12 +73,12 @@ while(1) {
       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);
+        my $vdiff = ($o->{$b}->[$v]&0xffffff) - ($old->{$b}->[$v]&0xffffff);
         
-        if ($vdiff < 0) { $vdiff += 2**28;}
-        $diff->{$b}->[$v+1] = $vdiff/$tdiff;
+        if ($vdiff < 0) { $vdiff += 2**24;}
+        $diff->{$b}->[$v] = $vdiff/$tdiff;
         #$ratesum += $diff->{$b}->[$v+1];
-        HPlot::PlotFill('RpcRate',$diff->{$b}->[$v+1],$v,$xpos);
+        HPlot::PlotFill('RpcRate',$diff->{$b}->[$v],$v,$xpos);
         }
       #my $s = sprintf("0x%04x",$b);
       #$data->{$s}= int(100*($ratesum / 32) +0.5) /100;
index 52f37c0c4e42ff313805b748965bcfbdfbf1446c..374ad840306711dc4bcf91962771cda8b7c6c0a5 100755 (executable)
@@ -187,7 +187,7 @@ if ($iter%2) {
 #             Hmon::Speak('nobeam', "No beam") unless $opt_debug>0;
 #             }
           }
-        QA::WriteQALog($fqa, "daq", "spillcount", 5, $spillcountstate, "Spill Count",
+        QA::WriteQALog($fqa, "main", "spillcount", 5, $spillcountstate, "Spill Count",
                        $spillcount,"Number of spills: $spillcount" ) unless $opt_debug>0;
         if($lastspillcount == $spillcount) {
           $countnochange++;
index 963c5a141fd6b7cf7e53c4e52fca786311bac456..b42239586b66c6c6a75cc44241dfb9a0778c29a4 100755 (executable)
@@ -26,7 +26,7 @@ my $plot1 = {
              file       => "files/StartRateSimple",
              title      => "Start Rate",
              entries    => 16,
-             curves     => 16,
+             curves     => 32,
              type       => HPlot::TYPE_HEATMAP,
              output     => HPlot::OUT_PNG,
              zlabel     => "Hitrate",
@@ -34,7 +34,7 @@ my $plot1 = {
              sizey      => 310,
              nokey      => 1,
              buffer     => 1,
-             ymin       => 15.5,
+             ymin       => 31.5,
              ymax       => -0.5,
              xmin       => -0.5,
              xmax       => 15.5,
@@ -102,7 +102,7 @@ while (1) {
     foreach my $endpoint (sort keys %$current) {
     #foreach my $endpoint (0x5000, 0x5001, 0x5002, 0x5003, 0x5004) {
       #my $ratesum = 0;
-      next unless ($endpoint>=0x5000 && $endpoint<=0x5003);
+      next unless ($endpoint>=0x5000 && $endpoint<=0x5007);
       my $fpga =  ($endpoint&0xF);
 
       for my $channel_nr (0..47) {
diff --git a/hmon/hmon_stsrate_split.pl b/hmon/hmon_stsrate_split.pl
new file mode 100755 (executable)
index 0000000..f54c05c
--- /dev/null
@@ -0,0 +1,112 @@
+#!/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 $plot_sts1 = {
+name    => "Sts1Rate",
+file    => "files/Sts1Rate",
+title   => "STS1 Rate",
+entries => 48,
+curves  => 41,
+type    => HPlot::TYPE_HEATMAP,
+output  => HPlot::OUT_PNG,
+zlabel  => "Hitrate",
+sizex   => 470,
+sizey   => 420,
+nokey   => 1,
+buffer  => 1,
+ymin    => 40.5,
+ymax    => -0.5,
+xmin    => -0.5,
+xmax    => 47.5,
+cbmax   => "100<*<1E5",
+cbmin   => 0,
+noinit  => 1,
+additional => "set logscale cb;set format cb \"_{10}{\%L}\";set xtics ('0' -0.5, '8' 7.5, '16' 15.5, '24' 23.5, '32' 31.5, '40' 39.5); set grid xtics front;",
+showvalues => 0,  };
+HPlot::PlotInit($plot_sts1);
+
+my $plot_sts2 = {
+name    => "Sts2Rate",
+file    => "files/Sts2Rate",
+title   => "STS2 Rate",
+entries => 48,
+curves  => 40,
+type    => HPlot::TYPE_HEATMAP,
+output  => HPlot::OUT_PNG,
+zlabel  => "Hitrate",
+sizex   => 470,
+sizey   => 420,
+nokey   => 1,
+buffer  => 1,
+ymin    => 39.5,
+ymax    => -0.5,
+xmin    => -0.5,
+xmax    => 47.5,
+cbmax   => "100<*<1E5",
+cbmin   => 0,
+noinit  => 1,
+additional => "set logscale cb;set format cb \"_{10}{\%L}\";set xtics ('0' -0.5, '8' 7.5, '16' 15.5, '24' 23.5, '32' 31.5, '40' 39.5); set grid xtics front;",
+showvalues => 0,  };
+HPlot::PlotInit($plot_sts2);
+
+my $str  = Hmon::MakeTitle(7, 20, "STS Hit Rate",0);
+   $str .= qq@<h3>Sts 1</h3><img src="%ADDPNG files/Sts1Rate.png%" type="image/png"><br>\n@;
+   $str .= qq@<h3>Sts 2</h3><img src="%ADDPNG files/Sts2Rate.png%" type="image/png"><br>\n@;
+   $str .= Hmon::MakeFooter();
+Hmon::WriteFile("StsRateSplit",$str);
+
+trb_init_ports() or die trb_strerror();
+
+# for my $x (0..48) {
+#   for my $y (0..42) {
+#     HPlot::PlotFill('Sts1Rate',0,$x,$y);
+#     HPlot::PlotFill('Sts2Rate',0,$x,$y);
+#   }
+# }
+
+
+my $old;
+while(1) {
+  my $o = trb_registertime_read_mem(0xfe4c,0xc000,0,49) or sleep 5 and next;
+  print $o;
+  if (defined $old) {
+    foreach my $b (keys %$o) {
+      next unless ($b>=0x6400 && $b<=0x6473);
+      my $this_t = $o->{$b}{time}->[0];
+      my $old_t = $old->{$b}{time}->[0];
+      my $t_diff = ($this_t - $old_t) || 1;
+        $t_diff += 2**16 if $t_diff < 0;
+        $t_diff *= 16/1E6;
+      my $xpos;
+      $xpos = (($b>>4)&0xF)*10 + ($b&0xF)      if $b <  0x6440;
+      $xpos = (($b>>4)&0xF)*10 + ($b&0xF) - 40 if $b >= 0x6440;
+      for my $v (0..47) {
+        last if $v == 32 && ($b&0xF)==3 && $b < 0x6440;
+        last if $v == 32 && ($b == 0x6464 || $b == 0x6465);
+        my $v_diff = ($o->{$b}{value}->[$v+1]&0xfffffff) - ($old->{$b}{value}->[$v+1]&0xfffffff);
+          $v_diff += 2**28 if $v_diff < 0;
+
+        HPlot::PlotFill('Sts1Rate',$v_diff/$t_diff,$v,$xpos) if $b <  0x6440;
+        HPlot::PlotFill('Sts2Rate',$v_diff/$t_diff,$v,$xpos) if $b >= 0x6440;
+      }
+    }
+    HPlot::PlotDraw('Sts1Rate');
+    HPlot::PlotDraw('Sts2Rate');
+  }
+  $old = $o;
+  sleep 2;
+}
index 29ee8c39fe245adc11b4b24a52dfece4b9ba43e7..c580ccdce5698c6024fa3314ae112e04c5223439 100755 (executable)
@@ -39,11 +39,12 @@ function openwin(url) {
 
 <div class="linkbox" style="float:right"><h4>Documents</h4><ul>
 <li><a href="phonenumbers.jpg">Phone Numbers</a>
-<li><a href="https://jspc29.x-matter.uni-frankfurt.de/docu/qadocu.pdf">QA manual</a>
-<li><a href="https://jspc29.x-matter.uni-frankfurt.de/docu/hadesoperator.pdf">Operator manual</a>
+<li><a href="https://jspc29.x-matter.uni-frankfurt.de/docu/networkaddresses.pdf">DAQ FEE Addresses</a>
+<li class="outdated"><a href="https://jspc29.x-matter.uni-frankfurt.de/docu/qadocu.pdf">QA manual</a>
+<li class="outdated"><a href="https://jspc29.x-matter.uni-frankfurt.de/docu/hadesoperator.pdf">Operator manual</a>
 <li><a href="https://hades-db.gsi.de/pls/hades_webdbs/hades_oper.hlogbook2.form_selection">Beamtime Logbook</a></li>
 <li><a href="https://hades-db.gsi.de/pls/hades_webdbs/hades_oper.hshiftcrews2.form_select">Shift Crew</a></li>
-<li><a href="/mon/daqoperatornotes.pdf">DAQ Operator Notes</a>
+<li class="outdated"><a href="/mon/daqoperatornotes.pdf">DAQ Operator Notes</a>
 </div>
 
 <div class="linkbox" style="clear:both;width:730px;"><h4>Other Ressources</h4><ul>
@@ -52,6 +53,7 @@ function openwin(url) {
 <li><a href="files/vertex.htm">Vertex Plots (updated after each file)</a></li>
 <li class="outdated"><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 class="outdated"><a href="http://lxhadeb06/icinga">Icinga Server Monitoring (local access only)</a>
+<li><a href="/calib">Calibration Monitor</a>
 <li><a href="../munin">Munin Server Monitoring</a></li>
 <li style="width:600px;"><a href="archive/?C=M;O=D">Archive of Hmon Windows (updated every 10 minutes)</a></li>
 </ul></div>
@@ -122,15 +124,16 @@ function openwin(url) {
 <div class="linkbox" style="float:left"><h4>RICH</h4><ul>
 <li><a target="_blank" href="rich_drawing_2.htm#richTemperature">Temperature</a></li>
 <li><a target="_blank" href="rich_drawing_bkpl.htm#richTemperatureBackplane">Temperature Backplane</a></li>
+<li><a target="_blank" href="monitor.cgi?10-window-RichTempHistoDiRICH">Temperature Backplane Histo</a></li>
 <li><a target="_blank" href="rich_drawing_2.htm#rich1V">DiRich 1.1V</a></li>
 <li><a target="_blank" href="rich_drawing_2.htm#rich2V5">DiRich 2.5V</a></li>
-<li><a href="monitor.cgi?10-richvolt">Voltage & Current</a></li>
-<li><a href="monitor.cgi?2-window-RichHV">High Voltage</a></li>
-<li><a href="monitor.cgi?2-RichRatev2">Rates on all channels</a></li>
+<li><a target="_blank" href="monitor.cgi?10-richvolt">Voltage & Current</a></li>
+<li><a target="_blank" href="monitor.cgi?2-window-RichHV">High Voltage</a></li>
+<li><a target="_blank" href="monitor.cgi?2-RichRatev2">Rates on all channels</a></li>
 <li><a target="_blank" href="rich_drawing_2.htm#custom-0xfe51-0xc001-0-30-0.03125-ratesum32">Mean rate per DiRICH</a></li>
-<li><a href="monitor.cgi?10-window-RichMagnet">Rich Inner Magnet fields</a></li>
-<li><a href="monitor.cgi?10-window-RichInnerTemp">Rich Inner Temperatures</a></li>
-<li><a href="monitor.cgi?10-window-RichGas">Rich Gas Information</a></li>
+<li><a target="_blank" href="monitor.cgi?10-window-RichMagnet">Rich Inner Magnet fields</a></li>
+<li><a target="_blank" href="monitor.cgi?10-window-RichInnerTemp">Rich Inner Temperatures</a></li>
+<li><a target="_blank" href="monitor.cgi?10-window-RichGas">Rich Gas Information</a></li>
 </ul></div>
 
 <div class="linkbox" style="float:right"><h4>MDC</h4><ul>
@@ -159,6 +162,12 @@ function openwin(url) {
 </ul></div>
 
 
+<div class="linkbox" style="float:right"><h4>Trigger</h4><ul>
+<li><a href="/daqtools/network/triggerbox.pl">Triggerbox</a></li>
+<li><a href="/daqtools/tools/beamabort.pl">Beam Abort</a></li>
+</ul></div>
+
+
 $;
 
 
index 1ec867e13318314fc6cbcfc67c0abbf6baac2ab3..174430b45a31af88eeebb0a0a29e7fa0176029b0 100755 (executable)
@@ -33,8 +33,8 @@ my @args = split('-',$ENV{'QUERY_STRING'});
       my $str = <$MYF>;
       close($MYF);
       $str =~ /width(\d+)\sheight(\d+)/;
-      $width = 80*$1-8;
-      $height = 50*$2-8;
+      $width = 80*$1-4;
+      $height = 50*$2-4;
       }
 
   
diff --git a/hmon/permanent/hmon_beamabort.pl b/hmon/permanent/hmon_beamabort.pl
new file mode 100755 (executable)
index 0000000..7e59f42
--- /dev/null
@@ -0,0 +1,61 @@
+#!/usr/bin/perl -w
+use warnings;
+use strict;
+
+use Time::HiRes qw( gettimeofday usleep time );
+use FileHandle;
+use Data::Dumper;
+use POSIX qw/floor ceil/;
+use Hmon;
+use QA;
+
+my $fqa = QA::OpenQAFile();
+
+my @res;
+my $cmd = 'ssh hadaq@hadeswrp02 "~/bin/readreg.sh"';
+my $longtext;
+my $value = "";
+my $qastate;
+
+while (1) {
+
+  @res = qx($cmd);
+
+
+  if(!defined $res[0] || !defined $res[1] || !defined $res[2]) {
+    $qastate  = QA::WARN_2;
+    $value    = "read failed";
+    $longtext = "reading status from adapter board failed";
+    }
+  else {
+  $qastate = QA::OK;
+  $longtext = "";
+  $value    = "";
+  $longtext .= "Inputs: <br>";
+  $longtext .= "FPGA: ";
+  $longtext .= "active"   if (substr($res[0],5,2) eq "01" || substr($res[0],5,2) eq "10");
+  $longtext .= "inactive" if (substr($res[0],5,2) eq "11");
+  $longtext .= "ABORT"    if (substr($res[0],5,2) eq "00");
+
+  $longtext .= "<br>";
+  $longtext .= "Soft Override: ";
+  $longtext .= "none"     if (substr($res[2],7,2) eq "00");
+  $longtext .= "inactive" if (substr($res[2],7,2) eq "10");
+  $longtext .= "ABORT"    if (substr($res[2],8,1) eq "1");
+
+  $longtext .= "<br>";
+  $longtext .= "Hard Override: ";
+  $longtext .= "none"     if (substr($res[0],7,2) eq "00");
+  $longtext .= "inactive" if (substr($res[0],7,2) eq "10");
+  $longtext .= "ABORT"    if (substr($res[0],8,1) eq "1");
+
+  $value = "inactive"  if $longtext =~ /inactive/;
+  $value = "ABORT"     if $longtext =~ /ABORT/;
+  $qastate = QA::WARN  if $longtext =~ /inactive/;
+  $qastate = QA::FATAL if $longtext =~ /ABORT/;
+  }
+
+  QA::WriteQALog($fqa,"main","beamabort",30,$qastate,'Beam Abort',$value,$longtext);
+
+  sleep 5;
+  }
index fb5dcb9018ce319c2de1708d96672076f8f8a263..adee51601e6fedec36abbd8a209ce384887e2874 100755 (executable)
@@ -46,8 +46,8 @@ while(1) {
   $laststore = clone($store);
   $store = {};
   for(my $n=0;$n< scalar @srv;$n++) {
-    my @out = Hmon::qxtimeout("ssh $srv[$n] \"cat /proc/stat \" </dev/null",10);
     print "$srv[$n]\n";
+    my @out = Hmon::qxtimeout("ssh $srv[$n] \"cat /proc/stat \" </dev/null",10);
     foreach my $a (@out)  {
       if($a =~ /cpu(\d+)/) {
         my @s = split(/\s/,$a);
@@ -72,7 +72,7 @@ while(1) {
   my $maxstr = "";
   my $busystr = "";
   if (defined $laststore->{0}->{0}->{'idle'}) {
-    $str = Hmon::MakeTitle(9,12,"Server CPU Usage");
+    $str = Hmon::MakeTitle(9,13,"Server CPU Usage");
     $str .= $template;
     for(my $s = 0; $s < scalar @srv; $s++) {
       $str .= "\n<tr><th class=\"title\">$srv[$s]";
@@ -135,7 +135,7 @@ while(1) {
       $qastate = QA::OK;
     }
     QA::WriteQALog($fqa,"server","cpu",40,$qastate,"Max. CPU",$maxstr,$busystr);
-    sleep 10;
+    sleep 5;
     }
   else {
     sleep 1;
index cb3a33446eb7e19907e0b1c82839a3bc7d8fc4e8..e6cb748bd34424077e487ccc1fee87ec6de7383d 100755 (executable)
@@ -420,8 +420,8 @@ while (1) {
     $speak_counter++;
     if($speak_counter>20)
     {
-     $speak_counter=0;
-     Hmon::Speak('ebfiles', "Warning: event builders do not write files to disk. Please check.") unless $opt_debug>0 ||($masterstate =~ /NoNodes/);
+     $speak_counter=-20;
+     Hmon::Speak('ebfiles', "event builders do not write files to disk.") unless $opt_debug>0 ||($masterstate =~ /NoNodes/);
      print "No files are written by eventbuilders.\n" unless $opt_debug<1;
     }
   }
index 2983a4b226c58f325876cd382a077e932288e9c0..80c9c3652234c9628b83b9e15d82a43c9cbef103 100755 (executable)
@@ -20,28 +20,71 @@ my $fqa  = QA::OpenQAFile();
 
 
 my $plot = ();
-$plot->{name}    = "Env";
-$plot->{file}    = "files/Environment";
-$plot->{entries} = 1200;
+$plot->{name}    = "Envtemp";
+$plot->{file}    = "files/Environment_temp";
+$plot->{entries} = 2400;
 $plot->{type}    = HPlot::TYPE_HISTORY;
 $plot->{output}  = HPlot::OUT_PNG;
 $plot->{titles}->[0] = "Temperature";
-$plot->{titles}->[1] = "rel. humidity";
 $plot->{xlabel}  = "Minutes";
-$plot->{ylabel}  = "°C/%";
+$plot->{ylabel}  = "°C";
 $plot->{sizex}   = 630;
 $plot->{sizey}   = 220;
-$plot->{ymin} = 5;
-$plot->{ymax} = 80;
+$plot->{ymin} = 12;
+$plot->{ymax} = 26;
 $plot->{xscale} = 10;
 $plot->{nokey} = 1;
 $plot->{buffer} = 1;
 $plot->{storable} = 1;
-$plot->{curves} = 2;
+$plot->{curves} = 1;
+
+my $plot2 = ();
+$plot2->{name}    = "Envhum";
+$plot2->{file}    = "files/Environment_hum";
+$plot2->{entries} = 2400;
+$plot2->{type}    = HPlot::TYPE_HISTORY;
+$plot2->{output}  = HPlot::OUT_PNG;
+$plot2->{titles}->[0] = "Temperature";
+$plot2->{titles}->[1] = "rel. humidity";
+$plot2->{xlabel}  = "Minutes";
+$plot2->{ylabel}  = "%";
+$plot2->{sizex}   = 630;
+$plot2->{sizey}   = 220;
+$plot2->{ymin} = 10;
+$plot2->{ymax} = 60;
+$plot2->{xscale} = 10;
+$plot2->{nokey} = 1;
+$plot2->{buffer} = 1;
+$plot2->{storable} = 1;
+$plot2->{curves} = 1;
 
 HPlot::PlotInit($plot);
-my  $str = Hmon::MakeTitle(8,5,"Environment",0);
-$str .= qq@<img src="%ADDPNG files/Environment.png%" type="image/png">@;
+HPlot::PlotInit($plot2);
+
+HPlot::PlotInit({
+    name    => "Envpres",
+    file    => "files/Environment_pres",
+    entries => 2400,
+    type    => HPlot::TYPE_HISTORY,
+    output  => HPlot::OUT_PNG,
+    titles  => ["Pressure"],
+    xlabel  => "Minutes",
+    ylabel  => "Pressure [mbar]",
+    sizex   => 630,
+    sizey   => 220,
+    ymin    => "970",
+    ymax    => "1030",
+    curves  => 1,
+    xscale  => 10,
+    buffer  => 1,
+    storable=> 1,
+    nokey   => 1,
+    });
+
+my  $str = Hmon::MakeTitle(8,15,"Environment",0);
+$str .= qq@<img src="%ADDPNG files/Environment_temp.png%" type="image/png"><br>\n@;
+$str .= qq@<img src="%ADDPNG files/Environment_hum.png%" type="image/png"><br>\n@;
+$str .= qq@<img src="%ADDPNG files/Environment_pres.png%" type="image/png">@;
 $str .= Hmon::MakeFooter();
 Hmon::WriteFile("Environment",$str);
 
@@ -75,9 +118,12 @@ while (1) {{
 
     QA::WriteQALog($fqa,"misc","env",30,QA::OK,$value0,$value,$longtext);
 
-    HPlot::PlotAdd("Env",$t,0);
-    HPlot::PlotAdd("Env",$h,1);
-    HPlot::PlotDraw("Env");
+    HPlot::PlotAdd("Envtemp",$t,0);
+    HPlot::PlotAdd("Envhum",$h,0);
+    HPlot::PlotAdd("Envpres",$p,0);
+    HPlot::PlotDraw("Envtemp");
+    HPlot::PlotDraw("Envhum");
+    HPlot::PlotDraw("Envpres");
   $port->close();
   
   sleep 9;
diff --git a/hmon/permanent/hmon_frpchv.pl b/hmon/permanent/hmon_frpchv.pl
new file mode 100755 (executable)
index 0000000..f6e2b9b
--- /dev/null
@@ -0,0 +1,70 @@
+#!/usr/bin/perl -w
+use strict;
+use warnings;
+use Time::HiRes qw( gettimeofday usleep time );
+use POSIX qw(strftime);
+use FileHandle;
+use Data::Dumper;
+use POSIX qw/floor ceil/;
+use List::Util qw/min max/;
+use Hmon;
+use QA;
+use Perl2Epics;
+use HADES::TrbNet;
+use HPlot;
+
+my $flog = QA::OpenQAFile();
+
+my $EPICS_HEAD = "HAD:fRPC:HV:";
+
+Perl2Epics::Connect("fRPC1_V" ,$EPICS_HEAD."S1:vmon");
+Perl2Epics::Connect("fRPC2_V" ,$EPICS_HEAD."S2:vmon");
+Perl2Epics::Connect("fRPC3_V" ,$EPICS_HEAD."S3:vmon");
+Perl2Epics::Connect("fRPC4_V" ,$EPICS_HEAD."S4:vmon");
+
+Perl2Epics::Connect("fRPC1_I" ,$EPICS_HEAD."S1:imon");
+Perl2Epics::Connect("fRPC2_I" ,$EPICS_HEAD."S2:imon");
+Perl2Epics::Connect("fRPC3_I" ,$EPICS_HEAD."S3:imon");
+Perl2Epics::Connect("fRPC4_I" ,$EPICS_HEAD."S4:imon");
+
+print "Connected.\n";
+
+while(1) {
+
+  my $data = Perl2Epics::GetAll();
+  my @V = (
+      $data->{"fRPC1_V"}->{val}/1000 || 0
+    , $data->{"fRPC2_V"}->{val}/1000 || 0
+    , $data->{"fRPC3_V"}->{val}/1000 || 0
+    , $data->{"fRPC4_V"}->{val}/1000 || 0
+  );
+    
+  my $max_V = max(@V);
+  my $min_V = min(@V);
+    
+#   my $value = QA::SciNotation($min_V)." - ".QA::SciNotation($max_V);
+
+  my $value  = QA::SciNotation($data->{"fRPC1_V"}->{val}/1000)."/";
+     $value .= QA::SciNotation($data->{"fRPC2_V"}->{val}/1000)."/";
+     $value .= QA::SciNotation($data->{"fRPC3_V"}->{val}/1000)."/";
+     $value .= QA::SciNotation($data->{"fRPC4_V"}->{val}/1000)."/";
+
+  my $qastate = QA::GetQAState('above', $min_V, @QA::FrpcHvLimits);
+     $qastate = QA::NOTE if $QA::FrpcHvOff == 1;
+  
+  $value = "HV is OFF"                   if $min_V < $QA::FrpcHvLimits[2] || $QA::FrpcHvOff == 1;
+  $value = "HV is ON, but should be off" if $min_V > $QA::FrpcHvLimits[2] && $QA::FrpcHvOff == 1;
+
+  my $longtext  = " fRPC-S1: ".QA::SciNotation($data->{"fRPC1_V"}->{val}/1000)."kV / ";
+     $longtext .= QA::SciNotation($data->{"fRPC1_I"}->{val})."A <br>";
+     $longtext .= " fRPC-S2: ".QA::SciNotation($data->{"fRPC2_V"}->{val}/1000)."kV / ";
+     $longtext .= QA::SciNotation($data->{"fRPC2_I"}->{val})."A <br>";
+     $longtext .= " fRPC-S3: ".QA::SciNotation($data->{"fRPC3_V"}->{val}/1000)."kV / ";
+     $longtext .= QA::SciNotation($data->{"fRPC3_I"}->{val})."A <br>";
+     $longtext .= " fRPC-S4: ".QA::SciNotation($data->{"fRPC4_V"}->{val}/1000)."kV / ";
+     $longtext .= QA::SciNotation($data->{"fRPC4_I"}->{val})."A <br>";
+  
+  QA::WriteQALog($flog,"hv2","frpchv",30,$qastate,"fRPC HV",$value,$longtext);
+  
+  sleep(10);
+  }
index 585d88bd9d23d9225b5e5e5390d043a74f5d0f01..2aa5a01673bfc5c88ed2990370821e1588c82a07 100755 (executable)
@@ -11,7 +11,7 @@ use QA;
 
 
 while(1) {
-  my $out  = Hmon::MakeTitle(6,10,"Last *.hld files"); 
+  my $out  = Hmon::MakeTitle(4,11,"Last *.hld files"); 
   $out .= "<pre style='text-align:left;font-size:12px;'> ";
   foreach my $i (8,9,14,15,16) {
     my $server = sprintf("lxhadeb%02i",$i);
diff --git a/hmon/permanent/hmon_itofhv.pl b/hmon/permanent/hmon_itofhv.pl
new file mode 100644 (file)
index 0000000..341c505
--- /dev/null
@@ -0,0 +1,70 @@
+#!/usr/bin/perl -w
+use strict;
+use warnings;
+use Time::HiRes qw( gettimeofday usleep time );
+use POSIX qw(strftime);
+use FileHandle;
+use Data::Dumper;
+use POSIX qw/floor ceil/;
+use List::Util qw/min max/;
+use Hmon;
+use QA;
+use Perl2Epics;
+use HADES::TrbNet;
+use HPlot;
+
+my $flog = QA::OpenQAFile();
+
+my $EPICS_HEAD = "HAD:iTOF:HV:";
+
+Perl2Epics::Connect("iTOF1_V" ,$EPICS_HEAD."S1:vmon");
+Perl2Epics::Connect("iTOF2_V" ,$EPICS_HEAD."S2:vmon");
+Perl2Epics::Connect("iTOF3_V" ,$EPICS_HEAD."S3:vmon");
+Perl2Epics::Connect("iTOF4_V" ,$EPICS_HEAD."S4:vmon");
+
+Perl2Epics::Connect("iTOF1_I" ,$EPICS_HEAD."S1:imon");
+Perl2Epics::Connect("iTOF2_I" ,$EPICS_HEAD."S2:imon");
+Perl2Epics::Connect("iTOF3_I" ,$EPICS_HEAD."S3:imon");
+Perl2Epics::Connect("iTOF4_I" ,$EPICS_HEAD."S4:imon");
+
+print "Connected.\n";
+
+while(1) {
+
+  my $data = Perl2Epics::GetAll();
+  my @V = (
+      $data->{"iTOF1_V"}->{val} || 0
+    , $data->{"iTOF2_V"}->{val} || 0
+    , $data->{"iTOF3_V"}->{val} || 0
+    , $data->{"iTOF4_V"}->{val} || 0
+  );
+    
+  my $max_V = max(@V);
+  my $min_V = min(@V);
+    
+#   my $value = QA::SciNotation($min_V)." - ".QA::SciNotation($max_V);
+
+  my $value  = QA::SciNotation($data->{"iTOF1_V"}->{val})."/";
+     $value .= QA::SciNotation($data->{"iTOF2_V"}->{val})."/";
+     $value .= QA::SciNotation($data->{"iTOF3_V"}->{val})."/";
+     $value .= QA::SciNotation($data->{"iTOF4_V"}->{val})."/";
+
+  my $qastate = QA::GetQAState('above', $min_V, @QA::ItofHvLimits);
+     $qastate = QA::NOTE if $QA::ItofHvOff == 1;
+  
+  $value = "HV is OFF"                   if $min_V < $QA::ItofHvLimits[2] || $QA::ItofHvOff == 1;
+  $value = "HV is ON, but should be off" if $min_V > $QA::ItofHvLimits[2] && $QA::ItofHvOff == 1;
+
+  my $longtext  = " iTOF-1: ".QA::SciNotation($data->{"iTOF1_V"}->{val})."V / ";
+     $longtext .= QA::SciNotation($data->{"iTOF1_I"}->{val})."A <br>";
+     $longtext .= " iTOF-2: ".QA::SciNotation($data->{"iTOF2_V"}->{val})."V / ";
+     $longtext .= QA::SciNotation($data->{"iTOF2_I"}->{val})."A <br>";
+     $longtext .= " iTOF-3: ".QA::SciNotation($data->{"iTOF3_V"}->{val})."V / ";
+     $longtext .= QA::SciNotation($data->{"iTOF3_I"}->{val})."A <br>";
+     $longtext .= " iTOF-4: ".QA::SciNotation($data->{"iTOF4_V"}->{val})."V / ";
+     $longtext .= QA::SciNotation($data->{"iTOF4_I"}->{val})."A <br>";
+  
+  QA::WriteQALog($flog,"hv2","itofhv",30,$qastate,"iTOF HV",$value,$longtext);
+  
+  sleep(10);
+  }
index 99902dc85268e84cf0b6b5d8bce7776e9d2d985d..d309d90b39292097305c2ad7bcb94496a2b3fa38 100755 (executable)
@@ -117,7 +117,7 @@ while(1) {
   my $IsobPress = $data->{"IsoPress"}->{val};
   my $IsobPressStr = sprintf("Isobutan pressure: %.2f bar",$IsobPress);
 
-  my $IsobO2 = $data->{"IsoO2Concentr"}->{val};
+  my $IsobO2 = ($data->{"IsoO2Concentr"}->{val}/10);
   my $IsobO2Str = sprintf("O2 concentration: %.1f dppm",$IsobO2);
 
   my $IsobRefR = $data->{"IsoRefRatio"}->{val};
@@ -165,8 +165,8 @@ while(1) {
   my $longtext = "";
 
   $qastate = QA::OK      if ($IsobPress <= 2.0 && $IsobPress >= 0.9);    
-  $qastate = QA::WARN_2  if (($IsobPress < 0.9) || ($IsobO2 >3000.0) || ($IsobRefR < 70.0));
-  $qastate = QA::ERROR_2 if (($IsobPress > 2.0) || ($IsobPress < 0.7) || ($IsobO2 > 8000.0) || ($IsobRefR < 50.0));
+  $qastate = QA::WARN_2  if (($IsobPress < 0.9) || ($IsobO2 >300.0) || ($IsobRefR < 70.0));
+  $qastate = QA::ERROR_2 if (($IsobPress > 2.0) || ($IsobPress < 0.7) || ($IsobO2 > 800.0) || ($IsobRefR < 50.0));
   $qastate = min(QA::WARN_2,$qastate) if $QA::RichHvOff;
 
   if( $timer % 4 == 0) {
index 5632fd1bea879667268086c734887c3989b95278..0e6eaeaa3ba2e6b5adb997f0e4419ccdce913a6c 100644 (file)
@@ -1836,12 +1836,19 @@ function color(id,value) {
   var val = map(value,min,max);
   var x = 240.0 - val;
   if(!document.getElementById(id)) {return;}
-  if (val == -1) {
+//  if (val == -1) {
+  if (value > max) {
     if (document.getElementById("invertBox").value == 2) {
       document.getElementById(id).style.backgroundColor = "#FFF200";
     } else {
       document.getElementById(id).style.backgroundColor = "#FF00FF";
     }
+  } else if (value < min) {
+    if (document.getElementById("invertBox").value == 2) {
+      document.getElementById(id).style.backgroundColor = "#000000";
+    } else {
+      document.getElementById(id).style.backgroundColor = "#000000";
+    }
   } else {
       if (document.getElementById("invertBox").value == 1) {
         document.getElementById(id).style.backgroundColor = "hsl("+(val)+", 100%, 55%)";
index 42a8367b1a3612d3f5ffeff1765cb056a5d3c868..04fe3af6e22a4769188afbb5e33c99b112cf7203 100644 (file)
@@ -1779,8 +1779,11 @@ function color(id,value) {
   var val = map(value,min,max);
   var x = 240.0 - val;
   if(!document.getElementById(id)) {return;}
-  if (val == -1) {
+//  if (val == -1) {
+  if (value > max) {
       document.getElementById(id).style.backgroundColor = "#FF00FF";
+  } else if (value < min) {
+      document.getElementById(id).style.backgroundColor = "#FFFFFF";
   } else {
       document.getElementById(id).style.backgroundColor = "hsl("+x+", 100%, 55%)";
   }
diff --git a/hmon/speakdaemon_mdc.pl b/hmon/speakdaemon_mdc.pl
new file mode 100755 (executable)
index 0000000..3baf551
--- /dev/null
@@ -0,0 +1,49 @@
+#!/usr/bin/perl -w
+use strict;
+use warnings;
+
+use HTML::Entities;
+use Hmon;
+use QA;
+
+my $inhibit = 0;
+$SIG{USR1}  = sub { $inhibit = 1; };
+$SIG{USR2}  = sub { $inhibit = 0; system("killall espeak");}; #system("espeak -ven-male2 -s 130 -g 1 \"Speech daemon is online\" 2>/dev/null");
+
+# my $fq = QA::OpenQAFile();
+my $cmd = "ssh hades33 /home/hadaq/trbsoft/daq/hmon/hmon_tail -n 0 -F /home/hadaq/trbsoft/hadesdaq/hmon/files/speaklog_mdc";
+
+# my $fq = "remote";
+# my $cmd = "./hmon_ssh -T $QA::QAServer \"tail -n 0 -F /home/hadaq/trbsoft/daq/tools/hmon/files/speaklog\" </dev/null";
+
+my $f = fork();
+
+
+if($f) {
+  while(1) {
+    open(FTRB, "$cmd|");
+    while(my $a = <FTRB>) {
+      if ($inhibit == 0) {
+#         system("espeak -vus-mbrola-1 -s125  \"$a\" 2>/dev/null #-ven+m2 -s 130 -g 1 ");  -ven-us+f2 -p50 -s120
+#        system("espeak -ven-us+f2 -p60 -s150 -g 1 \"$a\" 2>/dev/null");
+        system("espeak-ng -ven-german -s140 -p 90 \"$a\" 2>/dev/null");
+#        system("espeak  -s120 -p 90 \"$a\" 2>/dev/null");
+        }
+      }
+    }
+  }
+else {
+  while(1) {
+    if($inhibit == 0) {
+#       QA::WriteQALog($fq, "main", "speech", 120, QA::OK,
+#                     "Speech Output", "running", "The speech daemon is running.");
+      }
+    else {
+#       QA::WriteQALog($fq, "main", "speech", 120, QA::WARN,
+#                     "Speech Output", "muted", "The speech daemon is muted.");
+      }
+    sleep 60;
+    }
+  }
+
index dae9414016207b75a469b7ede7a608825af0e871..88ea5cfa03ce35904327ae4008637c22df735d5a 100755 (executable)
@@ -45,8 +45,7 @@ mkdir `pwd`/pion
 
 # sshfs -o allow_other hadaq@lxhadeb06p:/data01/tmp/ `pwd`/pion
 
-sshfs -o allow_other hadaq@hadesp63:~/local/tdcmon/dabc/cal `pwd`/calibration
-
+sshfs -o allow_other hadaq@hadesp63:/home/hadaq/local/tdcmon/dabc/cal `pwd`/calibration
 
 
 echo "  <Hmon>     Linking files to server..."