From: hadaq Date: Wed, 16 Apr 2025 12:34:15 +0000 (+0200) Subject: update hmon scripts X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=570efe91f9a93ef589aa0a2953342381c5e261b8;p=hadesdaq.git update hmon scripts --- diff --git a/hmon/QA.pm b/hmon/QA.pm index a4257c6..5c0547b 100644 --- a/hmon/QA.pm +++ b/hmon/QA.pm @@ -52,7 +52,7 @@ $entries->{'rate'} = ['pt1','pt2','pt3','pt8','veto']; $entries->{'server'} = ['fill', 'cpu', '', 'ebinputs', 'onlineqa']; #icinga, pwrsup $entries->{'eb'} = ['run', 'rate','bytes', 'lostevt', 'errbits']; $entries->{'mdc'} = ['token', 'blocked', 'temp', 'linkqual', 'voltage']; -$entries->{'endp'} = ['mdc','mdc12','rich', 'tof', 'other']; #'rpc', +$entries->{'endp'} = ['mdc12','mdc','rich', 'tof', 'other']; #'rpc', $entries->{'feeerr'} = ['feeerr','trginp','trgqual','rpc','tof']; $entries->{'rich'} = ['temp','LV','bkpl','isob','richthr']; #$entries->{'padiwa'} = ['ecal','start','sts','itof','hodo']; @@ -169,7 +169,7 @@ our $QAServerOff = 0; ############################################################################### our @mdc_boards_removed =(0x2257); # 2333 added 2024-03-01 #(0x2203, 0x2027, 0x2057); #(0x2257, 0x2029); # 2233 added 2014-08-28 , 2203 at 2014/09/03, 2029 2014/09/23 -our @mdc_new_boards_removed =(0x8e95,0xa950,0xa951); +our @mdc_new_boards_removed =(); #(0x8e95,0xa950,0xa951); our @mdc_chambers_removed =(); our @rich_boards_removed =();#(0x71a4,0x71a5,0x71b4,0x71b5,0x72a4,0x72a5,0x72b4,0x72b5,0x73a4,0x73a5,0x73b4,0x73b5,0x826a); diff --git a/hmon/hmon_checkrebooted.pl b/hmon/hmon_checkrebooted.pl index d07249a..359d53e 100755 --- a/hmon/hmon_checkrebooted.pl +++ b/hmon/hmon_checkrebooted.pl @@ -30,19 +30,22 @@ while(1) { my $wrongtimeboards=""; my $boards = trb_register_read(0xffff,0x40); - foreach my $board ( keys %$boards ) { + foreach my $board (sort keys %$boards ) { next if $board == 0xfc00; if ($board >= 0xf000) { $noaddrboards .= sprintf("%04x (%s), ",$board,Hmon::getsystem($board)); } - if ($board >= 0xa000 && $board <= 0xbfff && $boards->{$board} < 0x65000000) { + if ($board >= 0xa000 && $board <= 0xbfff && $boards->{$board} < 0x67d00000) { + $wrongtimeboards .= sprintf("%04x (%s), ",$board,Hmon::getsystem($board)); + } + if ($board >= 0x8e00 && $board <= 0x8fff && $boards->{$board} < 0x67a80000) { $wrongtimeboards .= sprintf("%04x (%s), ",$board,Hmon::getsystem($board)); } } my $qastate = QA::OK; my $status = ""; - my $longmsg = "No wrong compile times or addresses found"; + my $longmsg = ""; if ($noaddrboards ne "" || $wrongtimeboards ne "") { chop $noaddrboards; chop $noaddrboards; chop $wrongtimeboards; chop $wrongtimeboards; @@ -51,6 +54,8 @@ while(1) { $longmsg .= "Boards without valid addresses: $noaddrboards
" if $noaddrboards ne ""; $longmsg .= "Boards with wrong compile time: $wrongtimeboards" if $wrongtimeboards ne ""; } + $longmsg = "No wrong compile times or addresses found" if $longmsg eq ""; + QA::WriteQALog($fqa, "misc2", "boards", 30, $qastate,"Boards", $status,$longmsg); system("logger -p local1.info -t DAQ Boards \\ $longmsg") if $qastate != QA::OK && $timer == 0; diff --git a/hmon/hmon_eberrbits_withreset.pl b/hmon/hmon_eberrbits_withreset.pl index 4e709e1..42ceaa4 100755 --- a/hmon/hmon_eberrbits_withreset.pl +++ b/hmon/hmon_eberrbits_withreset.pl @@ -209,13 +209,16 @@ print Dumper $store if $opt_verbose; # JAM2018 - same as before with epics: foreach my $k (sort keys %$store) { - next if $k eq "TRB_83C2"; #################################################################because of trigger input error + #next if $k eq "TRB_83C2"; #################################################################because of trigger input error if ($k ne "all") { foreach my $b (sort keys %{$store->{$k}}) { if(($b != 0)) { my $perc = $store->{$k}->{$b}/($store->{$k}->{0} || $store->{$k}->{$b} || 1)*100; - $maxperc = $perc if $perc > $maxperc; - $sumperc += $perc; + if(!($k =~ "TRB_85")) { + $maxperc = $perc if $perc > $maxperc; + $sumperc += $perc; + $brokenevents += $store->{$k}->{$b}; + }; my $ts = sprintf("%s has %i events (%.2f%%) with %s - ", $sources->{$k}, # substr ($sources->{$k}, 1, -1), @@ -223,7 +226,6 @@ foreach my $k (sort keys %$store) { $perc, $bits[$b]); $longstring .= $ts."
"; - $brokenevents += $store->{$k}->{$b}; } } } diff --git a/hmon/hmon_endpoints.pl b/hmon/hmon_endpoints.pl index 70304c6..b0f1d1a 100755 --- a/hmon/hmon_endpoints.pl +++ b/hmon/hmon_endpoints.pl @@ -244,8 +244,8 @@ while(1) { # 0x8900,0x3800,0x3801, # 0x8910,0x3810,0x3811, #Start TRB3sc -# 0x8880, -# 0x5000,0x5001,0x5002,0x5003,0x5004, #0x5005,0x5006,0x5007, + 0x8880, + 0x5000,0x5001,0x5002,0x5003,0x5004, #0x5005,0x5006,0x5007, #Hodo TRB3 # 0x8890,0x5010,0x5011, #0x5012, #Trigger diff --git a/hmon/hmon_mdcnew_temp_1wire.pl b/hmon/hmon_mdcnew_temp_1wire.pl index 92533a3..dacc1b3 100755 --- a/hmon/hmon_mdcnew_temp_1wire.pl +++ b/hmon/hmon_mdcnew_temp_1wire.pl @@ -11,12 +11,24 @@ use lib '.'; use MDC; use Time::HiRes qw(usleep time); use List::Util qw[min max]; +use Perl2Epics; use HADES::TrbNet; #$ENV{DAQOPSERVER} = 'localhost:40'; trb_init_ports() or die trb_strerror(); +foreach my $p (0..3) { + foreach my $s (0..5) { + foreach my $t (0..4) { + Perl2Epics::Connect("Temp-P$p-S$s-M$t","HAD:MDC:P".($p+1).":S".($s+1).":M".($t+1).":temp"); + } + } + } +my $data = Perl2Epics::GetAll(); + +print "Connected\n"; + HPlot::PlotInit({ name => "MDCNew1wire", @@ -38,7 +50,7 @@ HPlot::PlotInit({ #cbmax => "100<*<1E7", #cbmin => 0, noinit => 1, - additional => "set format y \"%02o\";set ytics (0,5,8,13,16,21,24,29);set xtics('IS' 0,'OS' 1, 'IL' 2,'OL' 3,'IC' 4);", + additional => "set format y \"%02o\";set ytics (0,5,8,13,16,21,24,29);set xtics('InShort' 0,'InLong' 1, 'OutShort' 2,'OutLong' 3,'InCent' 4);", showvalues => 1, } ); @@ -80,13 +92,16 @@ while (1) { if($store->{$sensors->[$p][$s][$t]}) { my $v = $store->{$sensors->[$p][$s][$t]}; HPlot::PlotFill('MDCNew1wire',$v,$t,$p*8+$s); + + Perl2Epics::Put("Temp-P$p-S$s-M$t",$v) + } } } } HPlot::PlotDraw('MDCNew1wire'); - + Perl2Epics::Update(1); # print Dumper $store; # last; sleep 31; diff --git a/hmon/hmon_sfp.pl b/hmon/hmon_sfp.pl old mode 100644 new mode 100755 diff --git a/hmon/permanent/hmon_fwhv.pl b/hmon/permanent/hmon_fwhv.pl index 2b3ef2b..b10845e 100755 --- a/hmon/permanent/hmon_fwhv.pl +++ b/hmon/permanent/hmon_fwhv.pl @@ -39,7 +39,7 @@ HPlot::PlotInit({ sizex => 710, sizey => 610, nokey => 1, - buffer => 1, + buffer => 0, ymin => -0.5, ymax => 43.5, xmin => -0.5, @@ -70,7 +70,7 @@ HPlot::PlotInit({ sizex => 710, sizey => 610, nokey => 1, - buffer => 1, + buffer => 0, ymin => -0.5, ymax => 43.5, xmin => -0.5, diff --git a/hmon/permanent/hmon_mdcpressure.pl b/hmon/permanent/hmon_mdcpressure.pl index 31f9e58..4a04f41 100755 --- a/hmon/permanent/hmon_mdcpressure.pl +++ b/hmon/permanent/hmon_mdcpressure.pl @@ -406,14 +406,14 @@ while(1) { my $qastat = QA::OK; my $msg = ""; my $longmsg = ""; - if($vallow < 20 || $vallow > 110){ + if($vallow > 110){ #$vallow < 20 || $qastat = QA::ERROR; $msg .= "VacLow LOLO
" if $vallow < 30; $msg .= "VacLow HIHI
" if $vallow > 110; $longmsg .= "VacLow LOLO
" if $vallow < 30; $longmsg .= "VacLow HIHI
" if $vallow > 110; } - if($qastat != QA::ERROR && ($vallow < 25 || $vallow > 80)){ + if($qastat != QA::ERROR && ($vallow > 80)){ #$vallow < 30 || $qastat = QA::WARN; $msg .= "VacLow LO
" if $vallow < 50; $msg .= "VacLow HI
" if $vallow > 90; @@ -433,7 +433,7 @@ while(1) { if($qastat == QA::OK) { $msg = sprintf("%s / %s",QA::SciNotation($vallow),QA::SciNotation2($valhigh)); } - $longmsg .= sprintf("low vacuum: 20 mbar << 25 mbar < %s mbar < 80 mbar << 110 mbar
",QA::SciNotation($vallow)); + $longmsg .= sprintf("low vacuum: %s mbar < 80 mbar << 110 mbar
",QA::SciNotation($vallow)); $longmsg .= sprintf("high vacuum: %s mbar < 60×10-6 mbar << 150×10-6 mbar
",QA::SciNotation2($valhigh)); if($H2_run) { diff --git a/hmon/permanent/hmon_trbnet.pl b/hmon/permanent/hmon_trbnet.pl index beba103..c278102 100755 --- a/hmon/permanent/hmon_trbnet.pl +++ b/hmon/permanent/hmon_trbnet.pl @@ -27,7 +27,7 @@ while(1) { foreach my $s (@out) { chomp $s; -# print $s."\n"; + print $s."\n"; if ($s =~ /0x(\w{4})\s+0x(\w{8})/ && $status eq "N/A") { $status = "OK"; $qastate = QA::OK; @@ -58,7 +58,7 @@ while(1) { } Hmon::Speak('trbnet',"TRB Network Error") if $qastate > 60; QA::WriteQALog($fqa,"daq","trbnet",3,$qastate,"TrbNet",$status,$msg); -# print $status; + print $status; if($lastqastate != $qastate) { $msg =~ s/'//g; system("logger -p local1.info -t DAQ 'Trbnet \ $msg '") if $qastate == QA::FATAL;