'other'=>"Other",
'pion'=>"Pion",
'rich'=>'RICH',
- 'ecal'=>'ECal',
+ 'padiwa'=>'Padiwa',
'hv'=>'HV',
'hv2'=>'HV',
'misc'=>'misc'};
"feeerr",
# "pion",
"rich",
- "ecal",
+ "padiwa",
"hv",
"hv2",
"misc",
];
# 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'];
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);
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);
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};
our $FrpcHvOff = 0;
our $EcalHvOff = 0;
+our $QAServerOff = 1;
+
###############################################################################
# Missing Boards
###############################################################################
<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.
<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>
+
+
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};
}
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
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
$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;
$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);
}
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,
);
#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
#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;
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;
$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;
}
$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)) {
--- /dev/null
+#!/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);
+}
--- /dev/null
+#!/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);
+}
--- /dev/null
+#!/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);
+}
$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;
$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);
#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;
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 !!!
#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;
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;
# 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++;
file => "files/StartRateSimple",
title => "Start Rate",
entries => 16,
- curves => 16,
+ curves => 32,
type => HPlot::TYPE_HEATMAP,
output => HPlot::OUT_PNG,
zlabel => "Hitrate",
sizey => 310,
nokey => 1,
buffer => 1,
- ymin => 15.5,
+ ymin => 31.5,
ymax => -0.5,
xmin => -0.5,
xmax => 15.5,
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) {
--- /dev/null
+#!/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;
+}
<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>
<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>
<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>
</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>
+
+
$;
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;
}
--- /dev/null
+#!/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;
+ }
$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);
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]";
$qastate = QA::OK;
}
QA::WriteQALog($fqa,"server","cpu",40,$qastate,"Max. CPU",$maxstr,$busystr);
- sleep 10;
+ sleep 5;
}
else {
sleep 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;
}
}
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);
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;
--- /dev/null
+#!/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);
+ }
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);
--- /dev/null
+#!/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);
+ }
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};
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) {
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%)";
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%)";
}
--- /dev/null
+#!/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;
+ }
+ }
+
+
# 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..."