From: hadaq Date: Tue, 8 Feb 2022 19:02:36 +0000 (+0100) Subject: update hmon scripts X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=1b43174ed0a477c3688e15b0da99a99227edd1df;p=hadesdaq.git update hmon scripts --- diff --git a/beamabort/beamabort.trbcmd b/beamabort/beamabort.trbcmd new file mode 120000 index 0000000..403146a --- /dev/null +++ b/beamabort/beamabort.trbcmd @@ -0,0 +1 @@ +beam_abort_init_beamCond.trbcmd \ No newline at end of file diff --git a/hmon/Hmon.pm b/hmon/Hmon.pm index fe9cfac..1de94a6 100644 --- a/hmon/Hmon.pm +++ b/hmon/Hmon.pm @@ -365,5 +365,43 @@ sub qxtimeout { return @out; } + +sub getsystem { + my $b = $_[0]; + if($b >= 0x0000 && $b < 0x0010) { return "CTS";} + if($b >= 0x0010 && $b < 0x0200) { return "Trg / Aux";} + + if($b >= 0x1000 && $b < 0x1200) { return "MDC Hub";} + if($b >= 0x2000 && $b < 0x2400) { return "MDC OEP";} + if($b >= 0x5000 && $b < 0x5010) { return "Start";} + if($b >= 0x5010 && $b < 0x5020) { return "Hodo";} + if($b >= 0x5800 && $b < 0x58ff) { return "RPC";} + if($b >= 0x5c00 && $b < 0x5cff) { return "TOF";} + if($b >= 0x5d00 && $b < 0x5dff) { return "iTOF";} + if($b >= 0x6000 && $b < 0x60ff) { return "ECal";} + if($b >= 0x6400 && $b < 0x6440) { return "STS-1";} + if($b >= 0x6440 && $b < 0x6480) { return "STS-2";} + if($b >= 0x6700 && $b < 0x67ff) { return "FWall";} + if($b >= 0x6800 && $b < 0x68ff) { return "fRPC";} + if($b >= 0x7000 && $b < 0x7fff) { return "DiRICH";} + if($b >= 0x8000 && $b < 0x80ff) { return "Central Hubs";} + if($b >= 0x8100 && $b < 0x81ff) { return "MDC Hubs";} + if($b >= 0x8200 && $b < 0x82ff) { return "RICH Comb.";} + if($b >= 0x83c0 && $b < 0x83cf) { return "RICH Hubs";} + if($b >= 0x84c0 && $b < 0x84cf) { return "RPC Hubs";} + if($b >= 0x86c0 && $b < 0x86cf) { return "TOF Hubs";} + if($b >= 0x8700 && $b < 0x870f) { return "Wall Hubs";} + if($b >= 0x8800 && $b < 0x887f) { return "Central Hubs";} + if($b >= 0x8880 && $b < 0x888f) { return "Start Hubs";} + if($b >= 0x8890 && $b < 0x889f) { return "Hodo Hubs";} + if($b >= 0x8a00 && $b < 0x8aff) { return "ECal Hubs";} + if($b >= 0x8b00 && $b < 0x8bff) { return "STS Hubs";} + if($b >= 0x8c00 && $b < 0x8cff) { return "fRPC Hubs";} + if($b >= 0x8d00 && $b < 0x8dff) { return "iTOF Hubs";} + + + + return "Other"; + } 1; __END__ diff --git a/hmon/QA.pm b/hmon/QA.pm index 425f89c..358b47d 100644 --- a/hmon/QA.pm +++ b/hmon/QA.pm @@ -45,8 +45,8 @@ our $entries->{'cats'} = ["main", $entries->{'main'} = ['time', 'rate','beamabort','up','spillcount']; $entries->{'daq'} = ['trbnet', 'timeouts', 'busy','readout','outofsync']; $entries->{'trg'} = ['spill', 'accepted', 'source','pt1rate', 'start']; -$entries->{'rate'} = ['pt1','pt2','pt3','pt7','pt8']; -$entries->{'server'} = ['fill', 'cpu', '', '', 'onlineqa']; #icinga, pwrsup +$entries->{'rate'} = ['pt1','pt2','pt3','nothing','pt8']; +$entries->{'server'} = ['fill', 'cpu', 'to see', 'here', 'onlineqa']; #icinga, pwrsup $entries->{'eb'} = ['run', 'rate','bytes', 'lostevt', 'errbits']; $entries->{'mdc'} = ['token', 'blocked', 'temp', 'linkqual', 'voltage']; $entries->{'endp'} = ['mdc','rich', 'tof', 'rpc', 'other']; @@ -54,7 +54,7 @@ $entries->{'feeerr'} = ['feeerr','trginp','trgqual','rpc','tof']; $entries->{'rich'} = ['temp','LV','bkpl','isob','richthr']; $entries->{'padiwa'} = ['ecal','start','itof','hodo','sts']; $entries->{'hv'} = ['richhv','ecalhv','rpchv','fwhv','tofhv']; -$entries->{'hv2'} = ['mdchv','stshv','frpchv','starthv','itofhv']; +$entries->{'hv2'} = ['mdchv','stshv','frpchv','itofhv','valve']; $entries->{'misc'} = ['seu','calib','magnet','env','sequencer']; @@ -105,7 +105,9 @@ our @MdcTokenMissLimits = (10,50,100); ##single HV each plane #our @MdcNominalHV = (1750,1770,1900,2150); #individual HV each chamber -our $MdcNominalHV = [[1750,1750,1750,1750,1750,1750],[1770,1790,1770,1770,1770,1770],[1900,1900,1900,1900,1900,1900],[2150,2150,2150,2150,2150,2150]]; +#Original our $MdcNominalHV = [[1750,1750,1750,1750,1750,1750],[1770,1790,1750,1770,1770,1770],[1900,1900,1900,1900,1900,1900],[2150,2150,2150,2150,2150,2150]]; +# Modification of 8.Feb2022 P2S3 supplied by different HV channels, so taken out here: +our $MdcNominalHV = [[1750,1750,1750,1750,1750,1750],[1770,1790,0,1770,1770,1770],[1900,1900,1900,1900,1900,1900],[2150,2150,2150,2150,2150,2150]]; our $MdcHVOffsetLimits = [[5,10,255],[5,30,255],[5,10,255],[10,110,325]]; our @EcalHvLimits = (493,325,320); our @RpcHvLimits = (12,12,12); @@ -114,7 +116,7 @@ our @FwHvLimits = (280,250,200); our @FrpcHvLimits = (5.39,3.9,0); #kV 5.6 -> std. / 4 -> idle our @ItofHvLimits = (29,28,0); -our @TdcCalibrationInterval = (320000,450000,600000); +our @TdcCalibrationInterval = (3200000,4500000,6000000); our @TdcCalibrationTemperature = (5,7,10); our @PionLvCurrLimits = (4,5,6); @@ -133,7 +135,7 @@ our $PadiwaHodoNumber = 2; our @PadiwaHodoLimits = (0, 0, 0); our @LimitTriggerPerSpill = (1000, 0, 0); -our $AcceleratorCycle = 2; +our $AcceleratorCycle = 9; use constant {CTSAddress => 0x0003}; ############################################################################### @@ -145,7 +147,7 @@ our $RichGasOff = 0; our $TofHvOff = 0; our $RpcHvOff = 0; our $FwHvOff = 1; -our $MagnetOff = 1; +our $MagnetOff = 0; our $StsHvOff = 0; our $StartHvOff = 1; our $ItofHvOff = 0; diff --git a/hmon/doc/daq-busy.htt b/hmon/doc/daq-busy.htt index 7998e60..a499620 100644 --- a/hmon/doc/daq-busy.htt +++ b/hmon/doc/daq-busy.htt @@ -8,9 +8,13 @@ During normal operation, the full message gives the busy times for all sub-syste diff --git a/hmon/doc/eb-errbits.htt b/hmon/doc/eb-errbits.htt index 598e4e6..c89f1dc 100644 --- a/hmon/doc/eb-errbits.htt +++ b/hmon/doc/eb-errbits.htt @@ -5,7 +5,7 @@ The number of accepted events (written to disk) with errors reported by the fron Check the long error message for the subsystems that cause the most errors, then try to solve these.
Partially Missing errors usually refer to a detector with a lot of noise, try to reload thresholds for the corresponding detector. A few errors of this type are perfectly normal. -
TriggerNumberMismatch TriggerCodeMismatch errors are usually a problem in the hubs - if a DAQ restart doesn't help, try a reboot of the corresponding hubs (in RICH: combiners, or hubs). +
EventNumberMismatch TriggerCodeMismatch errors are usually a problem in the hubs - if a DAQ restart doesn't help, try a reboot of the corresponding hubs (in RICH: combiners, or hubs).
TimingTriggerError A board has problems receiving the reference time for the event. Check the "Trigger" box for more details.
If the reason is unclear, try to do a DAQ restart
In some cases a reload or power-cycle of the corresponding system / chamber is necessary. diff --git a/hmon/doc/main-beamabort.htt b/hmon/doc/main-beamabort.htt index 8ba4d28..600dd0c 100644 --- a/hmon/doc/main-beamabort.htt +++ b/hmon/doc/main-beamabort.htt @@ -2,8 +2,9 @@ The beam abort is used to shut down the accelerator in emergency cases. The long message contains the current status of all possible sources of the beam abort.

Error Handling

Errors have to be handled by the shift leader and the accelerator control room. +
To reset the error display use "Reset Beamabort Error". diff --git a/hmon/hmon_adcvolt.pl b/hmon/hmon_adcvolt.pl index 793a47a..79cad32 100755 --- a/hmon/hmon_adcvolt.pl +++ b/hmon/hmon_adcvolt.pl @@ -326,8 +326,8 @@ while(1) { my $value = ''; my $status = QA::OK; - if($min[0]<3290 || $min[1]<2260 || $min[2]<1260 || $min[3]<1160) {$status = QA::WARN} - if($min[10]<3360 || $min[11]<2260 || $min[12]<1260 || $min[13]<1160) {$status = QA::WARN} + if($min[0]<3270 || $min[1]<2260 || $min[2]<1260 || $min[3]<1160) {$status = QA::WARN} + if($min[10]<3330 || $min[11]<2260 || $min[12]<1260 || $min[13]<1160) {$status = QA::WARN} # QA::WriteQALog($fqa,"rich","volt",30,$status,'Voltages',$value,$longtext); diff --git a/hmon/hmon_beamabortbox.pl b/hmon/hmon_beamabortbox.pl new file mode 100755 index 0000000..b1f1839 --- /dev/null +++ b/hmon/hmon_beamabortbox.pl @@ -0,0 +1,71 @@ +#!/usr/bin/perl + +use warnings; +use strict; +use Data::Dumper; +use Data::TreeDumper; +use Hmon; +use QA; +use HADES::TrbNet; +use HPlot; +use Time::HiRes qw(usleep time); +use List::Util qw[min max sum]; + + +HPlot::PlotInit({ + name => "BeamAbortFlags", + file => "files/BeamAbortFlags", + entries => 1000, + type => HPlot::TYPE_HISTORY, + output => HPlot::OUT_PNG, + xlabel => "Time", + ylabel => "Channel", + colors => ['purple','purple','purple','purple','purple','purple','gray','gray','orange','orange','orange','orange','gray','orange','orange','gray','blue','blue','blue','blue','blue','blue','blue','blue','red','green'], + sizex => 950, + sizey => 330, + ymin => -0.5, + ymax => 25.5, + xscale => 5, + curves => 26, + buffer => 1, + nokey => 1, + dots => 1, +# storable => 1, + }); + + + +my $str = Hmon::MakeTitle(12, 7, "Beam Abort Flags",0); + $str .= qq@
\n@; + $str .= Hmon::MakeFooter(); +Hmon::WriteFile("BeamAbortFlags",$str); + +#Reset error flag +system("ssh hadeswrp02 /home/hadaq/bin/reset_beamabort_error.sh"); + +trb_init_ports() or die trb_strerror(); + +my $iter = 0; +while(1) { + my $ba_flags = trb_register_read(0x130,0xe500); + my $ba_global = trb_register_read(0x130,0xe700); + + $ba_flags->{0x130} //= 0; + $ba_global->{0x130} //= 0; + + for(my $i=0;$i<24;$i++) { + my $v = -1; + $v = $i if($ba_flags->{0x130} & (1<<$i)); + HPlot::PlotAdd("BeamAbortFlags",$v,$i); + } + HPlot::PlotAdd("BeamAbortFlags",$ba_global->{0x130}?24:-1,24); + HPlot::PlotAdd("BeamAbortFlags",$ba_global->{0x130}?-1:25,25); + + Hmon::Speak('beamabort',"High radiation levels. Beam abort.") if($ba_global->{0x130}); + + HPlot::PlotDrawFork("BeamAbortFlags") if $iter == 10; + HPlot::PlotJsonDump("BeamAbortFlags",Hmon::HMONDIR."/files/BeamAbortFlags.json") if $iter == 9; + $iter++; + $iter = 0 if $iter == 11; + usleep(95000); + } diff --git a/hmon/hmon_boxmon.pl b/hmon/hmon_boxmon.pl index 6b08ee7..aa3f046 100755 --- a/hmon/hmon_boxmon.pl +++ b/hmon/hmon_boxmon.pl @@ -11,6 +11,32 @@ use HPlot; use Time::HiRes qw(usleep time); use List::Util qw[min max sum]; +HPlot::PlotInit({ + name => "TriggerRatesPerSector", + file => "files/TriggerRatesPerSector", + entries => 5, + curves => 6, + type => HPlot::TYPE_HEATMAP, + output => HPlot::OUT_PNG, + zlabel => "Hitrate", + sizex => 450, + sizey => 360, + nokey => 1, + buffer => 1, + xmin => -0.5, + xmax => 4.5, + ymin => 5.5, + ymax => -0.5, + cbmin => "0", + cbmax => "1000<*", + showvalues => 1, + additional => "set xtics ('TOF' 0, 'RPC' 1, 'Meta' 2, 'iTOF' 3, 'Coin' 4);set x2tics ('TOF' 0, 'RPC' 1, 'Meta' 2, 'iTOF' 3, 'Coin' 4);", +}); + +my $str = Hmon::MakeTitle(6, 8, "Trigger Rates per Sector"); + $str .= qq@
\n@; + $str .= Hmon::MakeFooter(); + Hmon::WriteFile("TriggerRatesPerSector",$str); my $oldtb; my $diff; @@ -88,8 +114,25 @@ while (1) { $str .= Hmon::MakeFooter(); Hmon::WriteFile("Triggerbox",$str); + +###Trigger Rate Plot + for(my $i=0; $i<6;$i++) { + HPlot::PlotFill("TriggerRatesPerSector",$diff->{0x10}[$regs->[0][$i]]*$inspill,0,$i); + HPlot::PlotFill("TriggerRatesPerSector",$diff->{0x10}[$regs->[1][$i]]*$inspill,1,$i); + HPlot::PlotFill("TriggerRatesPerSector",($diff->{0x10}[$regs->[0][$i]]+$diff->{0x10}[$regs->[1][$i]])*$inspill,2,$i); + HPlot::PlotFill("TriggerRatesPerSector",$diff->{0x10}[$regs->[3][$i]]*$inspill,3,$i); + HPlot::PlotFill("TriggerRatesPerSector",$diff->{0x10}[$regs->[4][$i]]*$inspill,4,$i); + } + + HPlot::PlotDrawFork("TriggerRatesPerSector"); + + } - $oldtb = $tb; + $oldtb = $tb; + + + + usleep(500000); } diff --git a/hmon/hmon_busynew.pl b/hmon/hmon_busynew.pl index 285b7a2..3f53115 100755 --- a/hmon/hmon_busynew.pl +++ b/hmon/hmon_busynew.pl @@ -181,8 +181,8 @@ while (1) { my $maxpercent = max(@{$diff->{0x8000}}); my $msgstr = sprintf("%3.1f%%",$maxpercent); my $qastate = QA::OK; - $qastate = QA::WARN if ($maxpercent > 70); - $qastate = QA::WARN_2 if ($maxpercent > 80); + $qastate = QA::WARN if ($maxpercent > 65); + $qastate = QA::WARN_2 if ($maxpercent > 70); $qastate = QA::ERROR if ($maxpercent > 99); QA::WriteQALog($fqa,"daq","busy",5,$qastate,"Busy",$msgstr,"") unless ($maxpercent >= 99); } diff --git a/hmon/hmon_lvl1mismatch.pl b/hmon/hmon_lvl1mismatch.pl index f3fee8d..7563ebf 100755 --- a/hmon/hmon_lvl1mismatch.pl +++ b/hmon/hmon_lvl1mismatch.pl @@ -26,7 +26,7 @@ while(1){ foreach my $b (keys %{$temp}) { if ($temp->{$b} & 0x10) { $cnt++; - $msg .= sprintf("%04x ",$b); + $msg .= sprintf("%04x (%s)",$b,Hmon::getsystem($b)); } } diff --git a/hmon/hmon_rate2.pl b/hmon/hmon_rate2.pl index 88e80ed..0c06c0a 100755 --- a/hmon/hmon_rate2.pl +++ b/hmon/hmon_rate2.pl @@ -149,32 +149,32 @@ while (1) { $state = QA::OK; - $shorttext = QA::SciNotation($store{0xa026})." / ".getCorrected($store{0xa026},$offset->{0xa026}); + $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", "pt3", 10, $state, 'PT3 Rate', $shorttext, $longtext); $state = QA::OK; # $state = QA::WARN_2 if $offset->{0xa025} > 100; - $shorttext = QA::SciNotation($store{0xa025})." / ".getCorrected($store{0xa025},$offset->{0xa025}); + $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", "pt7", 10, - $state, 'PT7 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", "pt7", 10, +# $state, 'PT7 Rate', $shorttext, $longtext); $state = QA::OK; - $shorttext = QA::SciNotation($store{0xa02b})." / ".getCorrected($store{0xa02b},$offset->{0xa02b}); + $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", "pt8", 10, $state, 'PT8 Rate', $shorttext, $longtext); $state = QA::OK; - $shorttext = QA::SciNotation($store{0xa024})." / ".getCorrected($store{0xa024},$offset->{0xa024}); + $shorttext = QA::SciNotation($store{0xa024});#." / ".getCorrected($store{0xa024},$offset->{0xa024}); $longtext = sprintf("Trigger Rate from PT1: %i Hz / %i Hz after offset correction",$store{0xa024}, getCorrectedValue($store{0xa024},$offset->{0xa024})); QA::WriteQALog($fqa, "rate", "pt1", 10, $state, 'PT1 Rate', $shorttext, $longtext); diff --git a/hmon/hmon_rpcrate.pl b/hmon/hmon_rpcrate.pl index 286d7b9..6564092 100755 --- a/hmon/hmon_rpcrate.pl +++ b/hmon/hmon_rpcrate.pl @@ -105,7 +105,7 @@ while(1) { $qastate = QA::OK; $text = "OK"; - $shorttext = "OK"; + $shorttext = ""; for my $i (0..5) { if ($highrate[$i] > $highratecount) { diff --git a/hmon/hmon_rpctof_sectorwise.pl b/hmon/hmon_rpctof_sectorwise.pl index a8fb1bc..5d0a266 100755 --- a/hmon/hmon_rpctof_sectorwise.pl +++ b/hmon/hmon_rpctof_sectorwise.pl @@ -92,8 +92,8 @@ while (1) { $oldtof = $o; - HPlot::PlotDraw('RpcTofSectorRate'); - HPlot::PlotDraw('RpcTofSectorRateHist'); + HPlot::PlotDrawFork('RpcTofSectorRate'); + HPlot::PlotDrawFork('RpcTofSectorRateHist'); sleep(1); } diff --git a/hmon/hmon_rpctof_sectorwise_highres.pl b/hmon/hmon_rpctof_sectorwise_highres.pl new file mode 100755 index 0000000..7587a66 --- /dev/null +++ b/hmon/hmon_rpctof_sectorwise_highres.pl @@ -0,0 +1,88 @@ +#!/usr/bin/perl + +use warnings; +use Time::HiRes qw(usleep); +use Data::Dumper; +use Hmon; +use QA; +use HADES::TrbNet; +use HPlot; + + +HPlot::PlotInit({ + name => "RpcTofSectorRateHist", + file => "files/RpcTofSectorRateHist_highres", + entries => 2000, + curves => 12, + type => HPlot::TYPE_BARGRAPH, + output => HPlot::OUT_PNG, + titles => ["R0","R1","R2","R3","R4","R5","T0","T1","T2","T3","T4","T5"], + xlabel => "Time [100ms] ", + stacked => 1, + ylabel => "Counts [Hz]", + sizex => 950, + sizey => 330, + xmin => 0, + curvewidth => .9, + xmax => 2000, +# nokey => 1, + buffer => 1, +# storable=> 1 + } + ); + +my $str = Hmon::MakeTitle(12,7,"RpcTofSectorRate_highres",0); + $str .= qq@@; + $str .= Hmon::MakeFooter(); + Hmon::WriteFile("RpcTofSectorRate_highres",$str); + + +# my $fqa = QA::OpenQAFile() or die "No connection to QA Logfile"; + +trb_init_ports() or die trb_strerror(); + + +my $oldrpc; +my $oldtof; +my $iter = 0; +my $diff; + +while (1) { + $iter++; + + my $rpc = trb_registertime_read(0xfe61,0xdfe6); + my $tof = trb_registertime_read(0xfe40,0xdfd3); + + if (defined $oldrpc) { + foreach my $b (keys %$rpc) { + my $tdiff = $rpc->{$b}{time}[0] - ($oldrpc->{$b}{time}[0]||0); + $tdiff += 2**16 if ($tdiff <= 0); + $tdiff = ($tdiff * 16 / 1E6) || 1; + $vdiff = (($rpc->{$b}{value}[0]||0)&0xffffff) - (($oldrpc->{$b}{value}[0]||0)&0xffffff); + $vdiff += 2**24 if ($vdiff < 0); + $diff->{$b} = $vdiff/$tdiff; + if ($b >= 0x84c0 && $b <= 0x84c5) { + HPlot::PlotAdd( 'RpcTofSectorRateHist',$diff->{$b},$b&0xF); + } + } + foreach my $b (keys %$tof) { + my $tdiff = $tof->{$b}{time}[0] - ($oldtof->{$b}{time}[0]||0); + $tdiff += 2**16 if ($tdiff <= 0); + $tdiff = ($tdiff * 16 / 1E6) || 1; + $vdiff = (($tof->{$b}{value}[0]||0)&0xffffff) - (($oldtof->{$b}{value}[0]||0)&0xffffff); + $vdiff += 2**24 if ($vdiff < 0); + $diff->{$b} = $vdiff/$tdiff; + if ($b >= 0x86c0 && $b <= 0x86c5) { + HPlot::PlotAdd( 'RpcTofSectorRateHist',$diff->{$b},($b&0xF)+6); + } + } + } + + $oldrpc = $rpc; + $oldtof = $tof; + + HPlot::PlotDrawFork('RpcTofSectorRateHist') if $iter == 10; + $iter = 0 if $iter == 10; + usleep(100000); + } + diff --git a/hmon/hmon_seu.pl b/hmon/hmon_seu.pl index 884cc16..2099f61 100755 --- a/hmon/hmon_seu.pl +++ b/hmon/hmon_seu.pl @@ -50,9 +50,13 @@ while(1) { push(@boards,$b); } $longtext = "$seuboards out of $totalboards monitored report some radiation issues
"; - $longtext .= sprintf("%04x ",$_) for sort @boards; + $longtext .= sprintf("%04x (%s)
",$_,Hmon::getsystem($_)) for sort @boards; + + if($seuboards >= 8) { + $longtext .= "
Quite many boards seem to be affected by radiation. Better do some reboots soon."; + $qastate = QA::WARN_2; + } $value = "$seuboards/$totalboards"; QA::WriteQALog($fqa,"misc","seu",30,$qastate,'SEU',$value,$longtext); - print $value." ".$longtext."\n"; sleep 10; } diff --git a/hmon/hmon_startrate.pl b/hmon/hmon_startrate.pl index b41e2b5..ac9da0a 100755 --- a/hmon/hmon_startrate.pl +++ b/hmon/hmon_startrate.pl @@ -777,10 +777,10 @@ while(1) { my @hitRatesStartY_1 = calculate_rates($channels_y_1, $old, $current_readout); for my $i(1..48 ){ - HPlot::PlotFill('StartRateNumbers',$hitRatesStartX_0[$i]*$inspill,0, $i); - HPlot::PlotFill('StartRateNumbers',$hitRatesStartX_1[$i]*$inspill,1, $i); - HPlot::PlotFill('StartRateNumbers',$hitRatesStartY_0[$i]*$inspill,2, $i); - HPlot::PlotFill('StartRateNumbers',$hitRatesStartY_1[$i]*$inspill,3, $i); + HPlot::PlotFill('StartRateNumbers',$hitRatesStartX_0[$i],0, $i); #*$inspill + HPlot::PlotFill('StartRateNumbers',$hitRatesStartX_1[$i],1, $i); #*$inspill + HPlot::PlotFill('StartRateNumbers',$hitRatesStartY_0[$i],2, $i); #*$inspill + HPlot::PlotFill('StartRateNumbers',$hitRatesStartY_1[$i],3, $i); #*$inspill } @@ -997,6 +997,8 @@ while(1) { HPlot::PlotDrawFork('StartSpillSumY_0'); HPlot::PlotDrawFork('StartSpillPeakY_0'); HPlot::PlotDrawFork('StartDutyFactorY_0'); + + HPlot::PlotJsonDump("StartRateY_histbar_short",Hmon::HMONDIR."/files/StartRateY_histbar_short.json"); } if($inspill) { diff --git a/hmon/hmon_tofrate.pl b/hmon/hmon_tofrate.pl index 1e2ffe9..6e11afb 100755 --- a/hmon/hmon_tofrate.pl +++ b/hmon/hmon_tofrate.pl @@ -55,10 +55,10 @@ my $time = time(); my $diff; my $iter = 0; -my $lowratelimit = 200; -my $highratelimit = 30000; +my $lowratelimit = 500; +my $highratelimit = 20000; my $lowratecount = 400; -my $highratecount = 10; +my $highratecount = 7; my $qastate = QA::OK; my $text = "OK"; @@ -100,7 +100,7 @@ while(1) { $qastate = QA::OK; $text = "OK"; - $shorttext = "OK"; + $shorttext = ""; if ($highrate > $highratecount) { $qastate = QA::ERROR; diff --git a/hmon/hmon_trgerr.pl b/hmon/hmon_trgerr.pl index 019d25c..d43f9f0 100755 --- a/hmon/hmon_trgerr.pl +++ b/hmon/hmon_trgerr.pl @@ -6,6 +6,7 @@ use Data::Dumper; use Hmon; use QA; use HADES::TrbNet; +use List::Util qw(min max); my %laststore2; @@ -122,7 +123,7 @@ while (1) { $totalsum += $boards->{$c}; if ( $diff != 0 || $diff_10sec !=0 ) { - $boardstring .= sprintf("0x%04x, ",$c); + $boardstring .= sprintf("0x%04x (%s), ",$c,Hmon::getsystem($c)); } } #print "\n"; @@ -134,10 +135,14 @@ while (1) { $qash = sprintf("%u Errors", $sum) if $sum; my $qalg = sprintf("%u errors in last second - %u errors in total", $sum, $totalsum); + + $qastate = min($qastate,QA::NOTE) if $boardstring eq "0x70a7 (DiRICH)"; #Misbehaving board.... + QA::WriteQALog($fqa, "feeerr", "trgqual", 20, $qastate, "Trigger", $qash, $qalg." - Boards (in last 10 seconds): ".$boardstring); } - + + Hmon::WriteFile("MDCTriggerError", $str[0][4]."

".$str[1][0].$str[1][1]."

". $str[1][2]."

".$str[1][3].$str[2][0]); diff --git a/hmon/hmon_triggerratio.pl b/hmon/hmon_triggerratio.pl index b6f76bd..b9b885e 100755 --- a/hmon/hmon_triggerratio.pl +++ b/hmon/hmon_triggerratio.pl @@ -95,6 +95,9 @@ HPlot::PlotInit({ storable => 1, }); + + + my $str = Hmon::MakeTitle(8,5,"Start X Counts per Spill (millions)",0); $str .= qq@@; $str .= Hmon::MakeFooter(); @@ -115,7 +118,8 @@ my $str = Hmon::MakeTitle(8,5,"Start X Counts per Spill (millions)",0); $str .= qq@
\n@; $str .= Hmon::MakeFooter(); Hmon::WriteFile("M2Rate",$str); - + + trb_init_ports() or die trb_strerror(); my $fqa = QA::OpenQAFile(); @@ -176,18 +180,18 @@ while (1) { ###Ratio PT3 over Start - $ratio = $pt3/($startdirect||1); + my $pt3ratio = $pt3/($startdirect||1); if ($startdirect <= $STARTRATELIMIT || !$inspill) { HPlot::PlotAdd("Pt3StartRatio",0,1); HPlot::PlotAdd("Pt3StartRatio","NaN",0) } - elsif ($ratio >= $UPPERLIMIT_PT3) { + elsif ($pt3ratio >= $UPPERLIMIT_PT3) { HPlot::PlotAdd("Pt3StartRatio",$UPPERLIMIT_PT3,1); HPlot::PlotAdd("Pt3StartRatio","NaN",0) } else { HPlot::PlotAdd("Pt3StartRatio","NaN",1); - HPlot::PlotAdd("Pt3StartRatio",$ratio,0) + HPlot::PlotAdd("Pt3StartRatio",$pt3ratio,0) } ###M2 Rate @@ -215,19 +219,38 @@ while (1) { HPlot::PlotDrawFork("StartCountSpills"); } if($inspill) { - $spillsumstart += $start; + $spillsumstart += $startdirect; } if($iter==5) { +###Spillsum QA my $qastatstart = QA::OK; my $startmsg = ""; my $startlongmsg = ""; if ($lastspillsumstart < 10000 || $lastspillsumstart > 20E8) { $qastatstart = QA::WARN; } - $startmsg = sprintf("%s / %s",QA::SciNotation($start),QA::SciNotation($lastspillsumstart)); - $startlongmsg = sprintf("counts per second %s/s - counts per spill %s",QA::SciNotation($start),QA::SciNotation($lastspillsumstart)); + $startmsg = sprintf("%s / %s",QA::SciNotation($startdirect),QA::SciNotation($lastspillsumstart)); + $startlongmsg = sprintf("counts per second %s/s - counts per spill %s",QA::SciNotation($startdirect),QA::SciNotation($lastspillsumstart)); QA::WriteQALog($fqa, "trg", "start", 10, $qastatstart, "Start Count", $startmsg, $startlongmsg); + +###Trigger Ratio QA + my $qastatratio = QA::OK; + my $ratiomsg = ""; + my $ratiolongmsg = sprintf("M2/Start: %1.2f%%
PT3/Start: %1.2f‰",$ratio*100,$pt3ratio*1000);; + + $ratiomsg = sprintf("%1.2f%% / %1.2f‰",$ratio*100,$pt3ratio*1000); + if ($startdirect < 100000 || !$inspill) { + $ratiomsg = "--"; + } + if ($startdirect > 100000 && $inspill && ($ratio > 0.03 || $pt3ratio > 0.005)) { + $qastatratio = QA::WARN; + } + + $ratiolongmsg = sprintf("counts per second %s/s - counts per spill %s",QA::SciNotation($start),QA::SciNotation($lastspillsumstart)); + QA::WriteQALog($fqa, "trg", "pt1rate", 10, $qastatratio, "Trg Ratios", $ratiomsg, $ratiolongmsg); + + } diff --git a/hmon/index.cgi b/hmon/index.cgi index c1f0d79..f9f2aa2 100755 --- a/hmon/index.cgi +++ b/hmon/index.cgi @@ -49,11 +49,11 @@ function openwin(url) {