'mdc'=>"MDC",
'endp'=>"Endp",
'feeerr'=>"Fee",
- 'other'=>"Other",
+# 'other'=>"Othe",
'pion'=>"Pion",
'rich'=>'RICH',
'padiwa'=>'Padiwa',
'hv'=>'HV',
'hv2'=>'HV',
- 'misc'=>'misc'};
+ 'misc'=>'misc',
+ 'misc2'=>'misc',
+};
# Order of categories
our $entries->{'cats'} = ["main",
"feeerr",
# "pion",
"rich",
- "padiwa",
+# "padiwa",
"hv",
"hv2",
"misc",
+ "misc2",
];
$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','nothing','pt8'];
-$entries->{'server'} = ['fill', 'cpu', 'to see', 'here', 'onlineqa']; #icinga, pwrsup
+$entries->{'rate'} = ['pt1','pt2','pt3','here','pt8'];
+$entries->{'server'} = ['fill', 'cpu', 'be', 'dragons', 'onlineqa']; #icinga, pwrsup
$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','rpc','tof'];
$entries->{'rich'} = ['temp','LV','bkpl','isob','richthr'];
-$entries->{'padiwa'} = ['ecal','start','','',''];#'sts','itof','hodo'
+#$entries->{'padiwa'} = ['ecal','start','sts','itof','hodo'];
$entries->{'hv'} = ['richhv','ecalhv','rpchv','fwhv','tofhv'];
-$entries->{'hv2'} = ['mdchv','','','','valve'];#stshv,frpchv,itofhv
+#$entries->{'hv2'} = ['mdchv','stshv','frpchv','itofhv','valve'];
+$entries->{'hv2'} = ['mdchv','','','','valve'];
$entries->{'misc'} = ['seu','calib','magnet','env','sequencer'];
+$entries->{'misc2'} = ['ecal','m1','m2','m3','m4'];
$entries->{'pion'} = ['nxstatus', 'HV', 'HVcurr', 'cooling','seu'];
# Missing Boards
###############################################################################
-our @mdc_boards_removed =(0x2203, 0x2027, 0x2057); #(0x2257, 0x2029); # 2233 added 2014-08-28 , 2203 at 2014/09/03, 2029 2014/09/23
+our @mdc_boards_removed =();#(0x2203, 0x2027, 0x2057); #(0x2257, 0x2029); # 2233 added 2014-08-28 , 2203 at 2014/09/03, 2029 2014/09/23
our @mdc_chambers_removed =();
-our @rich_boards_removed =(0x71a4,0x71a5,0x71b4,0x71b5,0x72a4,0x72a5,0x72b4,0x72b5,0x73a4,0x73a5,0x73b4,0x73b5,0x826a);
+our @rich_boards_removed =();#(0x71a4,0x71a5,0x71b4,0x71b5,0x72a4,0x72a5,0x72b4,0x72b5,0x73a4,0x73a5,0x73b4,0x73b5,0x826a);
our @tof_boards_removed =();
our @rpc_boards_removed =();
our @other_boards_removed =();
<h3>MDC Endpoints</h3>
-This button shows if all MDC front-end modules are active. The button is red if too many modules are
+This button shows if all MDC boards (OEP, MDC-Hub) are active. The button is red if too many modules are
missing or two boards in the same chamber are missing or few boards are missing for a long time.<br>
<li>If this doesn't help, use "Reboot MdcHub" plus 2 DAQ restarts.
<li>If the missing boards include a hub (0x1___) and a restart doesn't help, a power cycle of MDC Hubs might be needed.
<li>If 14/16 boards show an error after a power-cycle, click "MDC LV Turn On ALL Relais". You can
-check the status of relais <a href="/mon/monitor.cgi?1-window-MDCLV">here</a>.
+check the status of relais <a href="/mon/monitor.cgi?5-window-MDCLV">here</a>.
</ul>
<br>
while(1) {
my $ret;
- my $EPICS_data = Perl2Epics::GetAll();
+# my $EPICS_data = Perl2Epics::GetAll();
+ my $EPICS_data;
# foreach my $a (@{$config{AdcTrb3sc}}) {
# $ret->[0] = measure($a,0);
while(1){
my $data = getjsonhash('eb', 'Master/BNET/get.json');
unless($data->{Inputs}{value}) {sleep 5; next;}
-
+#print Dumper $data;
my $export;
my $store;
my $num_rpc_mistake = (scalar @{$rpc_results[4]});
my @sorted_rpc_results = sort @{$rpc_results[2]};
- my $rpc_title = "ECal/STT/fRPC";
+ my $rpc_title = "ECal";
my $rpc_value = "OK ".(scalar @rpc_boards);
if ($num_rpc_missing > 0) {$rpc_value = "$num_rpc_missing / ".(scalar @rpc_boards)." miss";}
if ($num_rpc_mistake > 0) {$rpc_value = "Check Script";}
$worstQaState = QA::OK;
}
- QA::WriteQALog($fqa,"padiwa","ecal", 45, $worstQaState, "ECAL", $nofStr . " | " . $tempStr,
+ QA::WriteQALog($fqa,"misc2","ecal", 45, $worstQaState, "ECAL", $nofStr . " | " . $tempStr,
$tempStr2. "Temperature in ECAL " . $tempStr . "°C.<br>" . $nofStr2 . $nofStr . " PADIWAs<br>" . " Missing are: " . $missing_str);
sleep(10);
my ($Hist,$val,$board,$sens) = @_;
# print "$val $board $sens \n";
if ($board == 0) {
- $board=7-$sens; $sens=8-$sens;
+ #$board=7-$sens; $sens=8-$sens;
+ return; # JOF: Since Arm 0 is not working '23-11-15
} elsif ($board == 1) {
$board = 7-$sens; $sens = 4;
} elsif ($board == 2) {
--- /dev/null
+#!/usr/bin/perl
+
+use warnings;
+use POSIX qw(strftime floor ceil);
+use FileHandle;
+use lib "./code";
+use lib "../daqtools/tools";
+use HADES::TrbNet;
+use Time::HiRes qw(usleep);
+use Dmon;
+use Hmon;
+use HPlot;
+use QA;
+use getebjson;
+use getrootjson;
+use JSON::XS;
+use Data::Dumper;
+use List::Util qw(min max sum);
+use LWP::Simple qw(get);
+use Try::Tiny;
+trb_init_ports() or die trb_strerror();
+
+my $data;
+my $NUMPLOTS = 9;
+my $SERVER = 'calib'; #calib or calibtest
+
+
+ my $labels = 'set xtics (';
+
+ my $entry = 0;
+ my $regs = trb_register_read_mem(0xffff,0xc802,0,2) or die trb_strerror() or sleep 5 and next;
+ my $boards;
+ foreach my $b (sort {$a <=> $b} keys %$regs) {
+ next unless (defined $regs->{$b}[1]);
+ $boards->{$b}{enable} = $regs->{$b}[0] + ($regs->{$b}[1] << 32);
+ $labels .= sprintf("'%04x' %i,",$b,$entry++);
+ }
+ chomp $labels;
+ my $numboards = $entry;
+ $labels .= ') rotate by 90 offset 0,-1.4 font ",6";';
+
+ my @names = qw(LeadingAverage[ns] LeadingSigma[ps] IgnoredOutliers IgnoredHits ToTAverage[ns] ToTSigma[ps] IgnoredToTOutliers IgnoredToT CorrectedHits);
+
+HPlot::PlotInit({
+ name => "TdcCalMon0",
+ file => "files/TdcCalMon0",
+ cblabel => "TdcCalMon ".$names[0],
+ entries => $numboards,
+ curves => 49,
+ type => HPlot::TYPE_HEATMAP,
+ output => HPlot::OUT_PNG,
+ sizex => 10000,
+ sizey => 500,
+ nokey => 1,
+ buffer => 0,
+ xmin => -0.5,
+ xmax => $numboards-0.5,
+ ymin => -0.5,
+ ymax => 48.5,
+ cbmin => -10,
+ cbmax => 10,
+ noinit => 1,
+ palette => 'defined (-10 "red", -9 "yellow", 9 "blue", 10 "red")',
+ additional => $labels,
+ showvalues => 0, });
+
+HPlot::PlotInit({
+ name => "TdcCalMon1",
+ file => "files/TdcCalMon1",
+ cblabel => "TdcCalMon ".$names[1],
+ entries => $numboards,
+ curves => 49,
+ type => HPlot::TYPE_HEATMAP,
+ output => HPlot::OUT_PNG,
+ sizex => 10000,
+ sizey => 500,
+ nokey => 1,
+ buffer => 0,
+ xmin => -0.5,
+ xmax => $numboards-0.5,
+ ymin => -0.5,
+ ymax => 48.5,
+ cbmin => 0,
+ cbmax => 200,
+ noinit => 1,
+ palette => 'defined (0 "red", 0.1 "#008800", 10 "#00ff00", 25 "#ffff00", 35 "#ffaaaa", 50 "#ff00ff", 50.1 "#aa0000", 200 "#000000")',
+ additional => $labels,
+ showvalues => 0, });
+
+HPlot::PlotInit({
+ name => "TdcCalMon2",
+ file => "files/TdcCalMon2",
+ cblabel => "TdcCalMon ".$names[2],
+ entries => $numboards,
+ curves => 49,
+ type => HPlot::TYPE_HEATMAP,
+ output => HPlot::OUT_PNG,
+ sizex => 10000,
+ sizey => 500,
+ nokey => 1,
+ buffer => 0,
+ xmin => -0.5,
+ xmax => $numboards-0.5,
+ ymin => -0.5,
+ ymax => 48.5,
+ noinit => 1,
+# palette => 'defined (0 "red", 0.1 "#008800", 10 "#00ff00", 25 "yellow", 60 "violet", 300 "red")',
+ additional => $labels,
+ showvalues => 0, });
+
+HPlot::PlotInit({
+ name => "TdcCalMon3",
+ file => "files/TdcCalMon3",
+ cblabel => "TdcCalMon ".$names[3],
+ entries => $numboards,
+ curves => 49,
+ type => HPlot::TYPE_HEATMAP,
+ output => HPlot::OUT_PNG,
+ sizex => 10000,
+ sizey => 500,
+ nokey => 1,
+ buffer => 0,
+ xmin => -0.5,
+ xmax => $numboards-0.5,
+ ymin => -0.5,
+ ymax => 48.5,
+ noinit => 1,
+# palette => 'defined (0 "red", 0.1 "#008800", 10 "#00ff00", 25 "yellow", 60 "violet", 300 "red")',
+ additional => $labels,
+ showvalues => 0, });
+
+###################################################################################################
+
+HPlot::PlotInit({
+ name => "TdcCalMon4",
+ file => "files/TdcCalMon4",
+ cblabel => "TdcCalMon ".$names[4],
+ entries => $numboards,
+ curves => 49,
+ type => HPlot::TYPE_HEATMAP,
+ output => HPlot::OUT_PNG,
+ sizex => 10000,
+ sizey => 500,
+ nokey => 1,
+ buffer => 0,
+ xmin => -0.5,
+ xmax => $numboards-0.5,
+ ymin => -0.5,
+ ymax => 48.5,
+ cbmin => 19,
+ cbmax => 31,
+ noinit => 1,
+ palette => 'defined (19 "red", 19.8 "red", 20 "green", 20.2 "red", 29.8 "red", 30 "blue", 30.2 "red", 31 "red")',
+ additional => $labels,
+ showvalues => 0, });
+
+HPlot::PlotInit({
+ name => "TdcCalMon5",
+ file => "files/TdcCalMon5",
+ cblabel => "TdcCalMon ".$names[5],
+ entries => $numboards,
+ curves => 49,
+ type => HPlot::TYPE_HEATMAP,
+ output => HPlot::OUT_PNG,
+ sizex => 10000,
+ sizey => 500,
+ nokey => 1,
+ buffer => 0,
+ xmin => -0.5,
+ xmax => $numboards-0.5,
+ ymin => -0.5,
+ ymax => 48.5,
+ cbmin => 0,
+ cbmax => 400,
+ noinit => 1,
+ palette => 'defined (0 "red", 0.1 "#008800", 40 "#00ff00", 50 "#ffff00", 51 "orange", 100 "#ffaaaa", 120 "#ff00ff", 120.1 "#aa0000", 400 "#000000")',
+ additional => $labels,
+ showvalues => 0, });
+
+HPlot::PlotInit({
+ name => "TdcCalMon6",
+ file => "files/TdcCalMon6",
+ cblabel => "TdcCalMon ".$names[6],
+ entries => $numboards,
+ curves => 49,
+ type => HPlot::TYPE_HEATMAP,
+ output => HPlot::OUT_PNG,
+ sizex => 10000,
+ sizey => 500,
+ nokey => 1,
+ buffer => 0,
+ xmin => -0.5,
+ xmax => $numboards-0.5,
+ ymin => -0.5,
+ ymax => 48.5,
+ noinit => 1,
+# palette => 'defined (0 "red", 0.1 "#008800", 10 "#00ff00", 25 "yellow", 60 "violet", 300 "red")',
+ additional => $labels,
+ showvalues => 0, });
+
+HPlot::PlotInit({
+ name => "TdcCalMon7",
+ file => "files/TdcCalMon7",
+ cblabel => "TdcCalMon ".$names[7],
+ entries => $numboards,
+ curves => 49,
+ type => HPlot::TYPE_HEATMAP,
+ output => HPlot::OUT_PNG,
+ sizex => 10000,
+ sizey => 500,
+ nokey => 1,
+ buffer => 0,
+ xmin => -0.5,
+ xmax => $numboards-0.5,
+ ymin => -0.5,
+ ymax => 48.5,
+ noinit => 1,
+# palette => 'defined (0 "red", 0.1 "#008800", 10 "#00ff00", 25 "yellow", 60 "violet", 300 "red")',
+ additional => $labels."set logscale cb;",
+ showvalues => 0, });
+
+HPlot::PlotInit({
+ name => "TdcCalMon8",
+ file => "files/TdcCalMon8",
+ cblabel => "TdcCalMon ".$names[8],
+ entries => $numboards,
+ curves => 49,
+ type => HPlot::TYPE_HEATMAP,
+ output => HPlot::OUT_PNG,
+ sizex => 10000,
+ sizey => 500,
+ nokey => 1,
+ buffer => 0,
+ xmin => -0.5,
+ xmax => $numboards-0.5,
+ ymin => -0.5,
+ ymax => 48.5,
+ noinit => 1,
+ cbmin => 0,
+ cbmax => 0.1,
+ palette => 'defined (0 "#004400", 0.000001 "#00ff00", 0.0009 "#33ff00", 0.001 "yellow", 0.1 "red")',
+ additional => $labels,#."set logscale cb;",
+ showvalues => 0, });
+
+while(1){
+###################################################################################################
+ #loop until run is finished
+ print "Wait for end of analysis run\n";
+ my $eventhist;
+ my $oldevnum; my $evnum=0;
+ do{
+ $oldevnum = $evnum;
+ $eventhist = getroothist($SERVER,"/HADES/Run/HLD/HLD_EvType");
+ $evnum = $eventhist->{bins}[13];
+ print "run".$evnum."\n";
+ sleep 10;
+ }while($evnum == 0 || $evnum != $oldevnum);
+
+###################################################################################################
+ print "End detected. Start to work\n";
+
+ my $str = Hmon::MakeTitle(200, 110, "TDC Cal Mon",1);
+ $str .= '<p>'.QA::getTimeString().'</p>';
+ $str .= '<p> Working</p>';
+ $str .= Hmon::MakeFooter();
+ Hmon::WriteFile("TdcCalMon",$str);
+
+
+ my $datahistlist = getjsonhash($SERVER,'h.json');
+ #print Dumper $datahistlist->{'_allnames'};
+
+ $entry = -1;
+
+ foreach my $b (sort {$a <=> $b} keys %$boards) {
+ $entry++;
+ my $activechannels = $boards->{$b}{enable};
+
+ my $p = sprintf("TDC_%04X_Edges",$b);
+ $p = $datahistlist->{'_allnames'}{$p};
+ my $hits = getroothist($SERVER,$p) if($p) ;
+ next unless $hits;
+
+ $p = sprintf("TDC_%04X_CorrectedHits",$b);
+ $p = $datahistlist->{'_allnames'}{$p};
+ my $corr = getroothist($SERVER,$p) if($p) ;
+ next unless $corr;
+
+ for(my $i=1;$i<=48;$i++) {
+ next unless $activechannels & (1<<($i-1));
+ next if($b >= 0x5000 && $b < 0x5008 && !($i&1));
+
+ my $avg = ($corr->{bins}[$i]//0) / ($hits->{bins}[$i*2]||1);
+ HPlot::PlotFill("TdcCalMon8",$avg,$entry,$i);
+ }
+ }
+
+ $entry = -1;
+ foreach my $b (sort {$a <=> $b} keys %$boards) {
+ $entry++;
+ my $activechannels = $boards->{$b}{enable};
+
+ my $p = sprintf("TDC_%04X_RisingChanneslDiff",$b);
+ $p = $datahistlist->{'_allnames'}{$p};
+ if($p) {
+ my $d = getroothist($SERVER,$p);
+ next unless $d;
+
+ for(my $i=1;$i<=48;$i++) {
+ next unless $activechannels & (1<<($i-1));
+ next if($b < 0x5008 && $b >= 0x5000 && !($i&1));
+
+ my ($sum,$avg,$sigma,$outlier,$ignored) = stats($d->{bins}[$i]);
+
+ $avg = ($avg/100.-10);
+ $sigma = ($sigma*10);
+ #printf("%04x\t%i\n",$b,$sigma);
+ HPlot::PlotFill("TdcCalMon0",$avg,$entry,$i);
+ HPlot::PlotFill("TdcCalMon1",$sigma,$entry,$i);
+ HPlot::PlotFill("TdcCalMon2",$outlier,$entry,$i);
+ HPlot::PlotFill("TdcCalMon3",$ignored,$entry,$i);
+ }
+ }
+
+ $p = sprintf("TDC_%04X_TotVsChannel",$b);
+ $p = $datahistlist->{'_allnames'}{$p};
+ if($p) {
+ my $d = getroothist($SERVER,$p);
+ next unless $d;
+
+ for(my $i=1;$i<=48;$i++) {
+ next unless $activechannels & (1<<($i-1));
+ next if($b >= 0x5000 && $b < 0x5008 && !($i&1));
+
+ my ($sum,$avg,$sigma,$outlier,$ignored) = stats($d->{bins}[$i],1460,1540) if ($b < 0x7000);
+ ($sum,$avg,$sigma,$outlier,$ignored) = stats($d->{bins}[$i],960,1040) if ($b >= 0x7000);
+
+ $avg = ($avg/50);
+ $sigma = ($sigma*20);
+ #printf("%04x\t%i\n",$b,$sigma);
+ HPlot::PlotFill("TdcCalMon4",$avg,$entry,$i);
+ HPlot::PlotFill("TdcCalMon5",$sigma,$entry,$i);
+ HPlot::PlotFill("TdcCalMon6",$outlier,$entry,$i);
+ HPlot::PlotFill("TdcCalMon7",$ignored,$entry,$i);
+ }
+ }
+
+# last if $entry == 150;
+ }
+
+
+ for(my $e = 0; $e < $NUMPLOTS; $e++) {
+ HPlot::PlotDraw("TdcCalMon$e");
+ }
+
+ $str = Hmon::MakeTitle(200, 110, "TDC Cal Mon",1);
+ $str .= '<p>'.QA::getTimeString().'</p>';
+ for(my $e = 0; $e < $NUMPLOTS; $e++) {
+ $str .= qq@<img src="%ADDPNG files/TdcCalMon@.$e.qq@.png%" type="image/png"><br>\n@;
+ }
+ $str .= Hmon::MakeFooter();
+ Hmon::WriteFile("TdcCalMon",$str);
+
+
+ do{
+ $oldevnum = $evnum;
+ $eventhist = getroothist($SERVER,"/HADES/Run/HLD/HLD_EvType");
+ $evnum = $eventhist->{bins}[13];
+ print "wait".$evnum."\n";
+ sleep 5;
+ }while($evnum == $oldevnum);
+}
+
+
+
+sub stats {
+ my @arr = @{$_[0]};
+ my $minwindow = $_[1] // 0;
+ my $maxwindow = $_[2] // (scalar @arr-1);
+
+ my $weightedsum = 0;
+ my $sigma = 0;
+ my $outlier = 0;
+ my $ignored = 0;
+ my $sum = 0;
+ my $sigmasum = 0;
+
+ for my $i ($minwindow..$maxwindow){
+ $weightedsum += $arr[$i]*$i;
+ $sum += $arr[$i];
+ }
+ return (0,0,0,0,0) unless $sum;
+
+ my $avg = $weightedsum/$sum;
+
+ for my $i (0..(scalar @arr-1)){
+ if ($i > $maxwindow || $i < $minwindow) {
+ $ignored += $arr[$i];
+ }
+ elsif($arr[$i] > 0 && $arr[$i] <= 2) {
+ $outlier+= $arr[$i];
+ }
+ else {
+ $sigma += ($i-$avg)**2 * $arr[$i];
+ $sigmasum += $arr[$i];
+ }
+ }
+ $sigma = sqrt($sigma/($sigmasum||1));
+
+ return ($sum,$avg,$sigma,$outlier,$ignored);
+ }
+
type => HPlot::TYPE_HEATMAP,
output => HPlot::OUT_PNG,
zlabel => "Hitrate",
-sizex => 470,
+sizex => 310,
sizey => 310,
nokey => 1,
buffer => 1,
HPlot::PlotInit($plot1);
-my $str = Hmon::MakeTitle(6, 7, "TOF Hit Rate",0);
+my $str = Hmon::MakeTitle(4, 7, "TOF Hit Rate",0);
$str .= qq@<img src="%ADDPNG files/TofRate.png%" type="image/png"><br>\n@;
$str .= Hmon::MakeFooter();
</ul></div>
<div class="linkbox" style="float:right"><h4>Documents</h4><ul>
-<li class="outdated"><a href="https://jspc29.x-matter.uni-frankfurt.de/docu/hadesoperator.pdf" style="color:#d33">Operator manual</a>
+<li><a href="https://hessenbox-a10.rz.uni-frankfurt.de/getlink/fiFyuhGJXrwV1dPs5RebuW/HadesOperatorManual.pdf" style="color:#d33">Operator manual</a>
+<li><a href="https://hessenbox-a10.rz.uni-frankfurt.de/getlink/fiRhk3zAKorCqtPgXk7hpa/">Document Repository</a>
<li><a href="https://jspc29.x-matter.uni-frankfurt.de/docu/networkaddresses.pdf">DAQ FEE Addresses</a>
-<li><a href="https://jspc29.x-matter.uni-frankfurt.de/docu/HadesNotes.pdf">Drawings and Notes from the Logbook</a>
-<li><a href="https://hessenbox-a10.rz.uni-frankfurt.de/getlink/fiRhk3zAKorCqtPgXk7hpa/">Further Documents</a>
<li><a href="phonenumbers.jpg">Phone Numbers</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 style="width:600px;"><a href="monitor.cgi?1-window8x26-busy-DutyFactor-Pt3AcceptRatio-EvtsPerSpill-StartCountSpill">Main Screen 2</a> Spill Info
<li style="width:600px;"><a href="monitor.cgi?1-window14x8-EBSummary-hldlast">Main Screen 3</a> EBs</li>
<!--<li style="width:600px;"><a href="monitor.cgi?2-window19x16-EcalSimpleRate-RpcRate-StsRate-TofRate-ItofRate-StartRateSimple-FrpcRate">Main Screen 4</a> Tof Rpc STS Ecal iTOF fRPC Start rates</li>-->
-<li style="width:600px;"><a href="monitor.cgi?2-window26x9-EcalSimpleRate-RpcRate-TofRate-StartRateSimple-FwRateSimple">Main Screen 4</a> Tof Rpc FW Ecal Start rates</li>
+<li style="width:600px;"><a href="monitor.cgi?2-window13x16-EcalSimpleRate-RpcRate-TofRate-StartRateSimple-FwRateSimple">Main Screen 4</a> Tof Rpc FW Ecal Start rates</li>
<li style="width:600px;"><a href="monitor.cgi?2-window13x23-StartFalls-ItofRateNumbers-TriggerRatesPerSector-CTSRates">Main Screen 5</a> Positional map for Start and iTOF, Trigger Rates</li>
<li class="outdated" style="width:600px;"><a href="monitor.cgi?2-window12x21-RpcTofSectorRate_highres-StartRateX_histbar-StartRateY_histbar">Main Screen 6</a> Beam Intensities</li>
</ul></div>
<li class="outdated"><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 class="outdated"><a href="http://hades63/icingaweb2/dashboard">Icinga Server Monitoring (local access only)</a>
-<li><a href="/calib">Calibration Monitor</a>
+<!--<li class="outdated"><a href="http://hades63/icingaweb2/dashboard">Icinga Server Monitoring (local access only)</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:right"><h4>ECal</h4><ul>
<li><a href="monitor.cgi?1-window-ECalRate">Rate Summary for ECal</a></li>
<li><a href="ecal_drawing.htm#ecalrate_slow">Rate for ECal</a></li>
-<li><a href="monitor.cgi?2-EcalHVVMap">ECAL HV Voltage Map</a></li>
-<li><a href="monitor.cgi?2-EcalHVCMap">ECAL HV Current Map</a></li>
+<li><a href="monitor.cgi?2-window-EcalHVVMap">ECAL HV Voltage Map</a></li>
+<li><a href="monitor.cgi?2-window-EcalHVCMap">ECAL HV Current Map</a></li>
</ul></div>
<div class="linkbox" style="float:left"><h4>RICH</h4><ul>
<li><a href="monitor.cgi?30-window-EBDisks">Fill-level of disks</a></li>
<li><a href="monitor.cgi?10-window-EBCPU">Server CPU load</a></li>
<li><a href="monitor.cgi?10-window-hldlast">Last hld files written</a></li>
+<li><a href="/calib">Calibration Monitor </a>
+<li><a href="monitor.cgi?60-window-TdcCalMon">Calibration Test Plots</a></li>
</ul></div>
<li><a href="/daqtools/tools/beamabort.pl">Beam Abort</a></li>
</ul></div>
-<div class="linkbox" style="float:left"><h4>Beam</h4><ul>
+<div class="linkbox" style="float:left"><h4>Wall</h4><ul>
+<li><a href="monitor.cgi?2-window-FwRates">Forward Wall Rates</a></li>
+<li><a href="monitor.cgi?10-window-FwHV">Forward Wall HV</a></li>
+<li><a href="monitor.cgi?10-window-FwHVCurrent">Forward Wall HV Currents</a></li>
+</ul></div>
+
+<div class="linkbox" style="float:right"><h4>Beam</h4><ul>
<li><a href="monitor.cgi?2-window13x21-QFactor-MicroSpillStructure">QFactor & Micro Structure</a></li>
<li><a href="monitor.cgi?2-window-StarX_spill">Spill Macro Structure</a></li>
<li><a href="monitor.cgi?1-StartRateNumbers-StartPosition-ItofRateNumbers-StartPositionRMS-HodoRate-QFactor-CTSRates-MicroSpillStructure-StartSpillShapeAnalysisY_0">Beam plots collection similar to HKR</a></li>
+</ul></div>
+<div class="linkbox" style="float:left"><h4>Environment</h4><ul>
+<li><a href="monitor.cgi?2-window-CaveTemp">Cave and Cooling Temperature</a></li>
+<li><a href="monitor.cgi?2-window-Environment">Temperature, Humidity and Pressure</a></li>
</ul></div>
+
$;
my $str = <$MYF>;
close($MYF);
$str =~ /width(\d+)\sheight(\d+)/;
- $width = 80*$1+4;
- $height = 50*$2;
+ $width = 80*$1-6;
+ $height = 50*$2+2;
}
--- /dev/null
+#!/usr/bin/perl
+
+use warnings;
+use strict;
+use Time::HiRes qw( gettimeofday usleep time );
+use FileHandle;
+use Data::Dumper;
+use POSIX qw/floor ceil/;
+use List::Util qw'max min';
+use IO::Socket;
+use IO::Handle;
+use Perl2Epics;
+use Encode qw(encode from_to);
+use JSON::XS;
+use Hmon;
+use QA;
+use HPlot;
+
+my $fqa = QA::OpenQAFile();
+
+my $plotShort = {
+ name => "CaveTempHistShort",
+ file => "files/CaveTempHistShort",
+ entries => 200*60/10,#200 minutes with meas every 10 sec
+ type => HPlot::TYPE_HISTORY,
+ output => HPlot::OUT_PNG,
+ titles => ["Cooling Water","Cooling Air","Cave 4 m"],
+ xlabel => "Minutes",
+ ylabel => "Temperature / °C",
+ sizex => 950,
+ sizey => 360,
+ ymin => "15",
+ ymax => "25<*",
+ curves => 3,
+ xscale => 60/10,
+ storable=> 1,
+ buffer => 1,
+ colors => ["#333333","#00ff00","#ff0000"],
+ additional => "set offsets 0,0,1.5,1.5"
+ };
+HPlot::PlotInit($plotShort);
+
+my $plotLong = {
+ name => "CaveTempHistLong",
+ file => "files/CaveTempHistLong",
+ entries => 10*24*60,
+ type => HPlot::TYPE_HISTORY,
+ output => HPlot::OUT_PNG,
+ titles => ["Cooling Water","Cooling Air","Cave 4 m"],
+ xlabel => "Hours",
+ ylabel => "Temperature / °C",
+ sizex => 950,
+ sizey => 360,
+ ymin => "15",
+ ymax => "25<*",
+ curves => 3,
+ xscale => 60,
+ storable=> 1,
+ buffer => 1,
+ colors => ["#333333","#00ff00","#ff0000"],
+ additional => "set offsets 0,0,1.5,1.5"
+ };
+HPlot::PlotInit($plotLong);
+
+# my $plotLongLong = {
+# name => "CaveTempHistLongLong",
+# file => "files/CaveTempHistLongLong",
+# entries => 6000,
+# type => HPlot::TYPE_HISTORY,
+# output => HPlot::OUT_PNG,
+# titles => ["Cooling Water","Cooling Air","Cave 4 m"],
+# xlabel => "Hours",
+# ylabel => "Temperature / °C",
+# sizex => 950,
+# sizey => 360,
+# #ymin => "*<15",
+# #ymax => "40<*",
+# curves => 3,
+# xscale => 300,
+# storable=> 1,
+# buffer => 1,
+# colors => ["#333333","#00ff00","#ff0000"],
+# # additional => "set offsets 0,0,1.5,1.5"
+# # colors => ["#333333","#00ff00","#ff0000"]
+# };
+# HPlot::PlotInit($plotLongLong);
+
+# HAD:MDC:cooling:water:temp (funktioniert gerade nicht, wird aber repariert)
+# HAD:MDC:cooling:air:temp (MDC + RICH Gebläse )
+# HAD:CAVE:cooling:air:4mheight:temp ( Cave Raumluft )
+
+# HIer noch ein paar Lufttemperaturen in MDC Nähe, auch sehr ähnlich zur Cave Luft.
+# HAD:MDC:P4:S2:M6:temp
+# HAD:MDC:P4:S1:M6:temp
+# HAD:MDC:P4:S6:M6:temp
+Perl2Epics::Connect("CoolingWater","HAD:MDC:cooling:water:temp");
+Perl2Epics::Connect("CoolingAir","HAD:MDC:cooling:air:temp");
+Perl2Epics::Connect("Air4m","HAD:CAVE:cooling:air:4mheight:temp");
+
+my $str = Hmon::MakeTitle(12, 14, "CaveTemp",0);
+$str .= qq@<img src="%ADDPNG files/CaveTempHistShort.png%" type="image/png"><br>\n@;
+$str .= qq@<img src="%ADDPNG files/CaveTempHistLong.png%" type="image/png">@;
+$str .= Hmon::MakeFooter();
+Hmon::WriteFile("CaveTemp",$str);
+
+my $timer = 0;
+while (1) {
+ $timer++;
+ my $data = Perl2Epics::GetAll(10);
+
+ print Dumper $data;
+
+ HPlot::PlotAdd("CaveTempHistShort",$data->{"CoolingWater"}->{val},0);
+ HPlot::PlotAdd("CaveTempHistShort",$data->{"CoolingAir"}->{val},1);
+ HPlot::PlotAdd("CaveTempHistShort",$data->{"Air4m"}->{val},2);
+ HPlot::PlotDraw("CaveTempHistShort");
+
+ if($timer%6 == 0) { #60 seconds
+ HPlot::PlotAdd("CaveTempHistLong",$data->{"CoolingWater"}->{val},0);
+ HPlot::PlotAdd("CaveTempHistLong",$data->{"CoolingAir"}->{val},1);
+ HPlot::PlotAdd("CaveTempHistLong",$data->{"Air4m"}->{val},2);
+ HPlot::PlotDraw("CaveTempHistLong");
+ }
+
+ # sleep(9.8);
+}
+
my $s="";
for(my $i = 1; $i <=6; $i++) {
- if ($i>=2){
+# if ($i>=2){
for(my $j = 1; $j<=168; $j++) {
my $cnt = (($i-1)*168)+$j-1;
if($j<10) {$s = sprintf("HAD:ECAL:HV:S%i:M00%i:imon",$i,$j);}
if($j>=10 and $j<100) {$s = sprintf("HAD:ECAL:HV:S%i:M0%i:vmon",$i,$j);}
if($j>=100) {$s = sprintf("HAD:ECAL:HV:S%i:M%i:vmon",$i,$j);}
Perl2Epics::Connect("U$cnt",$s);
- }
+# }
}
}
- $str = Hmon::MakeTitle(10, 13, "ECAL HV - Voltage Map", 1, "");
+ $str = Hmon::MakeTitle(10, 11, "ECAL HV - Voltage Map", 1, "");
$str .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"files/styles.css\">";
$str .= "<div style=\"text-align:left; margin-top: 10px; width: 200px\">";
if($timer%8 == 0) {
if ($ChnlsOn>0 and $ChnlsOn<$TOTALCHANS and ($TOTALCHANS - $ChnlsOn) < 16) { #only report if a small number of channels is off
for(my $i = 1; $i <=6; $i++) {
- if ($i>=2){
+ # if ($i>=2){
for(my $j = 1; $j<=168; $j++) {
my $cnt = (($i-1)*168)+$j-1;
if($data->{"U$cnt"}->{val}<1000 and $data->{"I$cnt"}->{val}>=10){ $str .= sprintf("Low voltage on module %i, sector %i.<br>",$j,$i);}
if($data->{"U$cnt"}->{val}<10 and $data->{"I$cnt"}->{val}<10){ $str .= sprintf("Module %i, sector %i is switched off. Check!<br>",$j,$i);}
}
- }
+# }
}
# $value = sprintf("%i/$TOTALCHANS",$ChnlsOn);
$longtext = sprintf("HV channels On: %i/$TOTALCHANS<br>Check the current and voltage monitoring plots!<br>%s",$ChnlsOn,$str);
for (my $i = 0; $i <= 5;$i++){
- if($i>=1){
+# if($i>=1){
for (my $j = 0; $j<=167; $j++) {
my $cnt = ($i*168)+$j;
HPlot::PlotAdd("EcalCurr$i",$data->{"I$cnt"}->{val}||-1,);
}
- }
+# }
}
curves => 44,
type => HPlot::TYPE_HEATMAP,
output => HPlot::OUT_PNG,
- zlabel => "Hitrate",
+ zlabel => "Voltage",
sizex => 710,
sizey => 610,
nokey => 1,
showvalues => 0,
});
+HPlot::PlotInit({
+ name => "FwHVCurrent",
+ file => "files/FwHVCurrent",
+ title => "FwHVCurrent",
+ entries => 44,
+ curves => 44,
+ type => HPlot::TYPE_HEATMAP,
+ output => HPlot::OUT_PNG,
+ zlabel => "Current",
+ sizex => 710,
+ sizey => 610,
+ nokey => 1,
+ buffer => 1,
+ ymin => -0.5,
+ ymax => 43.5,
+ xmin => -0.5,
+ xmax => 43.5,
+# cbmax => 1800,
+ cbmin => -1,
+ noinit => 1,
+# additional => "set logscale cb;unset ytics;set format cb \"_{10}{\%L}\"",
+ additional => "
+ set obj 1 rect from 11.4, 11.5 to 31.5, 31.5 lw 0.2 fs empty border -1 front \n
+ set obj 2 rect from 15.4, 15.5 to 27.5, 27.5 lw 0.2 fs empty border -1 front \n
+ unset ytics \n
+ unset xtics \n
+# set palette defined ( -1 \"#000000\", -0.1 \"#0000ff\", 990 \"#00aaff\", 991 \"#00ff00\", 1400 \"#ffff00\", 1800 \"#ff0000\" ) \n
+ ",
+ showvalues => 0,
+ });
+
my $str = Hmon::MakeTitle(9, 13, "FWall HV",0);
$str .= qq@<img src="%ADDPNG files/FwHV.png%" type="image/png"><br>\n@;
$str .= Hmon::MakeFooter();
Hmon::WriteFile("FwHV",$str);
+$str = Hmon::MakeTitle(9, 13, "FWall HV Current",0);
+$str .= qq@<img src="%ADDPNG files/FwHVCurrent.png%" type="image/png"><br>\n@;
+$str .= Hmon::MakeFooter();
+Hmon::WriteFile("FwHVCurrent",$str);
+
for(my $i = 1; $i <= 144; $i++) {
next if ($i == 66 || $i == 67 || $i == 78 || $i == 79);
$s = "HAD:FWHV:S$i:vmon";
Perl2Epics::Connect("$i",$s);
+ $s = "HAD:FWHV:S$i:imon";
+ Perl2Epics::Connect("I$i",$s);
push(@channels,"$i");
$minvolt->{"$i"} = 990;
}
for(my $i = 145; $i <= 208; $i++) {
$s = "HAD:FWHV:M$i:vmon";
Perl2Epics::Connect("$i",$s);
+ $s = "HAD:FWHV:M$i:imon";
+ Perl2Epics::Connect("I$i",$s);
push(@channels,"$i");
$minvolt->{"$i"} = 1300;
}
next if ($i == 283 || $i == 293 || $i == 294 || $i == 295);
$s = "HAD:FWHV:L$i:vmon";
Perl2Epics::Connect("$i",$s);
+ $s = "HAD:FWHV:L$i:imon";
+ Perl2Epics::Connect("I$i",$s);
push(@channels,"$i");
$minvolt->{"$i"} = 1400;
}
HPlot::PlotFill('FwHV',$val,$x[$i]+2,43-$y[$i]-3);
HPlot::PlotFill('FwHV',$val,$x[$i]+3,43-$y[$i]-3);
}
+
+ $val = $data->{"I$i"}->{val};
+ $val = -1 if $time > (($data->{$i}{tme}//0)+600);
+ HPlot::PlotFill('FwHVCurrent',$val,$x[$i], 43-$y[$i]);
+ if($i>=145) {
+ HPlot::PlotFill('FwHVCurrent',$val,$x[$i]+1,43-$y[$i]);
+ HPlot::PlotFill('FwHVCurrent',$val,$x[$i], 43-$y[$i]-1);
+ HPlot::PlotFill('FwHVCurrent',$val,$x[$i]+1,43-$y[$i]-1);
+ }
+ if($i>=211) {
+ HPlot::PlotFill('FwHVCurrent',$val,$x[$i]+2,43-$y[$i]);
+ HPlot::PlotFill('FwHVCurrent',$val,$x[$i]+3,43-$y[$i]);
+ HPlot::PlotFill('FwHVCurrent',$val,$x[$i]+2,43-$y[$i]-1);
+ HPlot::PlotFill('FwHVCurrent',$val,$x[$i]+3,43-$y[$i]-1);
+ HPlot::PlotFill('FwHVCurrent',$val,$x[$i]+0,43-$y[$i]-2);
+ HPlot::PlotFill('FwHVCurrent',$val,$x[$i]+1,43-$y[$i]-2);
+ HPlot::PlotFill('FwHVCurrent',$val,$x[$i]+2,43-$y[$i]-2);
+ HPlot::PlotFill('FwHVCurrent',$val,$x[$i]+3,43-$y[$i]-2);
+ HPlot::PlotFill('FwHVCurrent',$val,$x[$i]+0,43-$y[$i]-3);
+ HPlot::PlotFill('FwHVCurrent',$val,$x[$i]+1,43-$y[$i]-3);
+ HPlot::PlotFill('FwHVCurrent',$val,$x[$i]+2,43-$y[$i]-3);
+ HPlot::PlotFill('FwHVCurrent',$val,$x[$i]+3,43-$y[$i]-3);
+ }
}
HPlot::PlotDraw('FwHV');
+ HPlot::PlotDraw('FwHVCurrent');
sleep(10);
}
--- /dev/null
+#!/usr/bin/perl
+use strict;
+use warnings;
+
+use FileHandle;
+use Data::Dumper;
+use Hmon;
+use QA;
+use List::Util qw(min max);
+use Perl2Epics;
+use lib ".";
+
+my @crates = qw(14 15 16 17 18 19 20 21 22 23 24 25 26 27);
+my $states;
+
+# 0 = undefined
+# 1 = running
+# 2 = restarted
+# 3 = stalled
+# 4 = disabled
+# 5 = wrong name
+# 6 = timeout
+#HAD:HV:hadhvp14:status:epics:service
+
+sub setstate {
+ my ($name,$state) = @_;
+ print $name." ".$state."\n";
+ $states->{$name} = $state;
+ Perl2Epics::Put($name,$state);
+ }
+
+
+
+for my $v (@crates) {
+ my $name = $v;
+ Perl2Epics::Connect($name,"HAD:HV:hadhvp".$v.":status:epics:service");
+ }
+
+while(1) {
+ Perl2Epics::GetAll();
+ for my $v (@crates) {
+ qx(ping hadhvp$v -c 1 -W 1);
+ setstate($v,"timeout") if $?;
+ next if $?;
+
+ my $check = "curl 'http://hadhvp".$v."/session_login.cgi' -s -X POST -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/115.0' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8' -H 'Accept-Language: en-US,en;q=0.5' -H 'Accept-Encoding: gzip, deflate' -H 'Content-Type: application/x-www-form-urlencoded' -H 'Origin: http://hadhvp25' -H 'Connection: keep-alive' -H 'Referer: http://hadhvp".$v."/session_login.cgi' -H 'Upgrade-Insecure-Requests: 1' -H 'Cookie: testing=1;' --data-raw 'page=%2Fcaen_epics%2F&user=admin&pass=admin' -c /dev/shm/hmon_epics_check";
+ qx($check);
+ setstate($v,"timeout") if $?;
+ next if $?;
+
+ $check = "curl 'http://hadhvp".$v."/caen_epics/' -s -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/115.0' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8' -H 'Accept-Language: en-US,en;q=0.5' -H 'Accept-Encoding: gzip, deflate' -H 'Referer: http://hadhvp".$v."/session_login.cgi' -H 'Connection: keep-alive' -b /dev/shm/hmon_epics_check -H 'Upgrade-Insecure-Requests: 1' | grep 'Please restart the EPICS service to update the Process Variables'";
+ qx($check);
+ setstate($v,"running") if $? == 256;
+
+ if ($? == 0) {
+ setstate($v,"stalled");
+ $check = "curl 'http://hadhvp".$v."/caen_epics/restart.cgi?' -s -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/115.0' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8' -H 'Accept-Language: en-US,en;q=0.5' -H 'Accept-Encoding: gzip, deflate' -H 'Connection: keep-alive' -H 'Referer: http://hadhvp".$v."/caen_epics/' -H 'Upgrade-Insecure-Requests: 1' -b /dev/shm/hmon_epics_check";
+ qx($check);
+ setstate($v,"restarted");
+ print STDERR time()." ".$v." restarted\n";
+
+ }
+ }
+# print Dumper $states;
+ Perl2Epics::Update(0.2);
+ sleep 300;
+ }
+
+