From 0864f4e7c4235895159c9832f8de54dc91e936fe Mon Sep 17 00:00:00 2001 From: "hadaq@countinghouse" Date: Sat, 26 Apr 2014 23:36:41 +0200 Subject: [PATCH] Beamtime Preparation... --- .gitignore | 2 + control/gui/daq/10_Start_DAQ | 2 +- control/gui/daq/50_Reboot_TRB3 | 10 +++ control/gui/expert/RICH_Powercycle | 0 control/gui/monitor/28_Epics | 2 +- control/gui/monitor/30_Epics_EB | 4 +- control/gui/monitor/80_Daq_VNC | 2 +- evtbuild/eb.conf | 2 +- hmon/QA.pm | 22 +++--- hmon/hmon_diamond.pl | 1 - hmon/hmon_endpoints.pl | 23 ++++--- hmon/hmon_hodo.pl | 36 ++++++++-- hmon/hmon_hodo_hist.pl | 84 ++++++++++++++++++++++ hmon/hmon_nxyter_status.pl | 50 ++++++++++++++ hmon/hmon_pionadc.pl | 29 ++++++++ hmon/hmon_pionrate.pl | 84 +++++++++++++++++----- hmon/hmon_rate2.pl | 34 +++++++++ hmon/hmon_shower.pl | 0 hmon/hmon_starthist.pl | 0 hmon/hmon_trgsource.pl | 4 +- hmon/index.cgi | 20 +++--- hmon/permanent/hmon_archiver.pl | 18 ++--- hmon/permanent/hmon_ebdiskfill.pl | 4 +- hmon/permanent/hmon_pionlv.pl | 103 +++++++++++++++++++++++++++ hmon/permanent/hmon_pionsupply.pl | 107 +++++++++++++++++++++++++++++ hmon/permanent/hmon_qa.pl | 32 ++++----- hmon/start.sh | 3 + hub/configure_ports.script | 19 ++--- start/ThreshNinoStart.db | 10 +-- start/ThreshPadiwaVeto.db | 30 ++++---- start/startup.script | 8 +-- utils/allmonoff | 2 +- 32 files changed, 626 insertions(+), 121 deletions(-) create mode 100755 control/gui/daq/50_Reboot_TRB3 mode change 100644 => 100755 control/gui/expert/RICH_Powercycle mode change 100755 => 100644 hmon/hmon_diamond.pl create mode 100755 hmon/hmon_hodo_hist.pl create mode 100755 hmon/hmon_nxyter_status.pl create mode 100755 hmon/hmon_pionadc.pl mode change 100755 => 100644 hmon/hmon_shower.pl mode change 100755 => 100644 hmon/hmon_starthist.pl mode change 100644 => 100755 hmon/permanent/hmon_archiver.pl create mode 100644 hmon/permanent/hmon_pionlv.pl create mode 100755 hmon/permanent/hmon_pionsupply.pl diff --git a/.gitignore b/.gitignore index dc267f6..e78feb7 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,5 @@ bitfiles nohup.out delme *.back +archive +tables diff --git a/control/gui/daq/10_Start_DAQ b/control/gui/daq/10_Start_DAQ index 363c611..fed9db9 100755 --- a/control/gui/daq/10_Start_DAQ +++ b/control/gui/daq/10_Start_DAQ @@ -7,7 +7,7 @@ if [ $myvar == "256" ]; then exit; fi xterm -geometry 80x24 -bg orange -fg black -e bash --login -c ' - ssh -X hadaq@lxhadesdaq " + ssh hadaq@lxhadesdaq " source /home/hadaq/.bash_profile echo \" Connected to lxhadesdaq...\" echo \" Starting DAQ with default settings...\" diff --git a/control/gui/daq/50_Reboot_TRB3 b/control/gui/daq/50_Reboot_TRB3 new file mode 100755 index 0000000..88d671e --- /dev/null +++ b/control/gui/daq/50_Reboot_TRB3 @@ -0,0 +1,10 @@ +#!/usr/bin/perl +use warnings; +use HADES::TrbNet; +$ENV{'DAQOPSERVER'} = "hades31"; +trb_init_ports() or die "could not reach trbnet-daemon.", trb_strerror(); +system("trbcmd reload 0x8880"); +system("trbcmd reload 0x8890"); +system("trbcmd reload 0x8900"); +system("trbcmd reload 0x8910"); + \ No newline at end of file diff --git a/control/gui/expert/RICH_Powercycle b/control/gui/expert/RICH_Powercycle old mode 100644 new mode 100755 diff --git a/control/gui/monitor/28_Epics b/control/gui/monitor/28_Epics index b5dbd93..a3a15ea 100755 --- a/control/gui/monitor/28_Epics +++ b/control/gui/monitor/28_Epics @@ -1,4 +1,4 @@ #!/bin/bash #ssh -X -l scs lxhadeb06 '. /home/scs/.profile; medm -x hades.adl' -export EPICS_CA_ADDR_LIST="192.168.103.255 hadsc1 e7had2"; export EPICS_CA_AUTO_ADDR_LIST=NO; /home/epics/EPICS/EPICS-3.14.12.4/extensions/bin/linux-x86_64/medm -x /home/scs/operator/hades.adl & +ssh -X scs@lxhadeb06 'export EPICS_CA_ADDR_LIST="192.168.103.255 hadsc1 e7had2"; export EPICS_CA_AUTO_ADDR_LIST=NO; /home/epics/EPICS/EPICS-3.14.12.4/extensions/bin/linux-x86_64/medm -x /home/scs/operator/hades.adl &' diff --git a/control/gui/monitor/30_Epics_EB b/control/gui/monitor/30_Epics_EB index ed9b9b7..4cf305c 100755 --- a/control/gui/monitor/30_Epics_EB +++ b/control/gui/monitor/30_Epics_EB @@ -1,3 +1,3 @@ #!/bin/bash -#ssh -X scs@lxhadeb06 'export EPICS_CA_ADDR_LIST=192.168.103.255; export EPICS_CA_AUTO_ADDR_LIST=NO; /home/epics/EPICS/EPICS-3.14.12.4/extensions/bin/linux-x86_64/medm -x -macro "SUBSYSNUM=24" ~/operator/ebmainctrl.adl' -export EPICS_CA_ADDR_LIST=192.168.103.255; export EPICS_CA_AUTO_ADDR_LIST=NO; /home/epics/EPICS/EPICS-3.14.12.4/extensions/bin/linux-x86_64/medm -x -macro "SUBSYSNUM=24" /home/scs/operator/ebmainctrl.adl & +ssh -X scs@lxhadeb06 'export EPICS_CA_ADDR_LIST=192.168.103.255; export EPICS_CA_AUTO_ADDR_LIST=NO; /home/epics/EPICS/EPICS-3.14.12.4/extensions/bin/linux-x86_64/medm -x -macro "SUBSYSNUM=24" ~/operator/ebmainctrl.adl' +#export EPICS_CA_ADDR_LIST=192.168.103.255; export EPICS_CA_AUTO_ADDR_LIST=NO; /home/epics/EPICS/EPICS-3.14.12.4/extensions/bin/linux-x86_64/medm -x -macro "SUBSYSNUM=24" /home/scs/operator/ebmainctrl.adl & diff --git a/control/gui/monitor/80_Daq_VNC b/control/gui/monitor/80_Daq_VNC index 7066e8c..36e882e 100755 --- a/control/gui/monitor/80_Daq_VNC +++ b/control/gui/monitor/80_Daq_VNC @@ -1,3 +1,3 @@ #!/bin/bash -vncviewer -passwd ~/.vnc/daqvncpasswd lxhadesdaq:1 & +vncviewer -passwd ~/.vnc/daqvncpasswd hadesdaq01:1 & diff --git a/evtbuild/eb.conf b/evtbuild/eb.conf index d3d7e02..ed04817 120000 --- a/evtbuild/eb.conf +++ b/evtbuild/eb.conf @@ -1 +1 @@ -eb.conf.mai14_withRFIO \ No newline at end of file +eb.conf.mai14_noRFIO_noDABC \ No newline at end of file diff --git a/hmon/QA.pm b/hmon/QA.pm index 38df908..c6ad492 100644 --- a/hmon/QA.pm +++ b/hmon/QA.pm @@ -8,9 +8,10 @@ use Hmon; our $cats = {'main'=>"Main", 'daq'=>"DAQ", 'trg'=>"Trig", + 'rate'=>"Rate", 'server'=>"Srv", 'eb'=>"EB", - 'mdc'=>"MDC", +# 'mdc'=>"MDC", 'endp'=>"Endp", 'feeerr'=>"Fee", 'other'=>"Other", @@ -20,25 +21,28 @@ our $cats = {'main'=>"Main", our $entries->{'cats'} = ["main", "daq", "trg", + "rate", "server", "eb", - "mdc", +# "mdc", "endp", "feeerr", + "pion", "other", - "pion"]; +]; # Order of entries in each cat $entries->{'main'} = ['time', 'rate','onlineqa','up']; $entries->{'daq'} = ['trbnet', 'timeouts', 'busy','readout']; -$entries->{'trg'} = ['spill', 'source', 'accepted', 'ptrate', 'start']; +$entries->{'trg'} = ['spill', 'source']; #, 'accepted', 'ptrate', 'start' +$entries->{'rate'} = ['pt1','start','hodo','pion1','pion2']; $entries->{'server'} = ['fill', 'cpu', 'icinga', 'etrax', 'pwrsup']; $entries->{'eb'} = ['run', 'rate','bytes', 'lostevt', 'errbits']; -$entries->{'mdc'} = ['token', 'blocked', 'temp', 'linkqual', 'voltage']; -$entries->{'endp'} = ['mdc', 'rich', 'tof', 'rpc', 'other']; +#$entries->{'mdc'} = ['token', 'blocked', 'temp', 'linkqual', 'voltage']; +$entries->{'endp'} = ['rich', 'tof', 'rpc', 'other']; #'mdc' $entries->{'feeerr'} = ['rich', 'trb', 'feeerr','trginp','trgqual']; -$entries->{'other'} = ['magnet','speech','shower','rich','mdcinvalid']; -$entries->{'pion'} = ['nxstatus', 'LV', 'HV', 'cooling', 'rate']; +$entries->{'other'} = ['speech','rich']; #'magnet','mdcinvalid','shower' +$entries->{'pion'} = ['nxstatus', 'HV', 'cooling']; our $QAServer = "hades33"; @@ -147,7 +151,7 @@ sub WriteQALog { my $tmp = time()."\t$category\t$entry\t$ttl\t$status\t$title\t$value\t$longtext\n"; if ($fh eq "remote") { - system("ssh $QAServer \"echo '$tmp' >> /home/hadaq/trbsoft/daq/tools/hmon/files/qalog\""); + system("ssh $QAServer \"echo '$tmp' >> /home/hadaq/trbsoft/daq/hmon/files/qalog\""); return; } diff --git a/hmon/hmon_diamond.pl b/hmon/hmon_diamond.pl old mode 100755 new mode 100644 index 43d052a..bb06b48 --- a/hmon/hmon_diamond.pl +++ b/hmon/hmon_diamond.pl @@ -15,7 +15,6 @@ use List::Util qw[min max]; my $plot2 = (); $plot2->{name} = "DiamondRate"; $plot2->{file} = "files/DiamondRate"; -$plot2->{curves} = 1; $plot2->{entries} = 7; $plot2->{curves} = 7; $plot2->{type} = HPlot::TYPE_HEATMAP; diff --git a/hmon/hmon_endpoints.pl b/hmon/hmon_endpoints.pl index 418ea61..0f97d9f 100755 --- a/hmon/hmon_endpoints.pl +++ b/hmon/hmon_endpoints.pl @@ -93,8 +93,8 @@ while(1) { my @other_boards =( #shower - 0x3200,0x3201,0x3202,0x3210,0x3211,0x3212,0x3220,0x3221,0x3222,0x3230,0x3231,0x3232,0x3240,0x3241,0x3242, - 0x3250,0x3251,0x3252, +# 0x3200,0x3201,0x3202,0x3210,0x3211,0x3212,0x3220,0x3221,0x3222,0x3230,0x3231,0x3232,0x3240,0x3241,0x3242, +# 0x3250,0x3251,0x3252, #shower-hub # 0x8500,0x8501, #cts @@ -106,11 +106,12 @@ while(1) { #start/veto hub 0x8800,0x8801, #fw - 0x4400,0x4410,0x4420, +# 0x4400,0x4410,0x4420, #fw hub - 0x8700,0x8701, +# 0x8700,0x8701, #Pion 0x8900,0x3800,0x3801, + 0x8910,0x3810,0x3811, #Start TRB3 0x8880,0x5000,0x5002,0x5003, #Hodo TRB3 @@ -146,13 +147,13 @@ while(1) { if ($num_mdc_mistake > 0) {$longtext .= " Endp @{$mdc_results[4]} not known";} - my $qastate = QA::GetQAState('below',$num_mdc_missing,@QA::MdcEndpMissingLimits); - Hmon::Speak('mdcmiss',"$num_mdc_missing MDC Frontends missing") if($qastate > 60); - QA::WriteQALog($flog,"endp","mdc",$waittime,$qastate,$title,$value,$longtext); - if($qastate > 60) { - system("logger -p local1.info -t DAQ Endp \\ $longtext") unless (($timecnt->{mdc}++)%$loggerperiod); - } - else {$timecnt->{mdc} = 0;} + my $qastate = QA::GetQAState('below',$num_mdc_missing,@QA::MdcEndpMissingLimits); +# Hmon::Speak('mdcmiss',"$num_mdc_missing MDC Frontends missing") if($qastate > 60); +# QA::WriteQALog($flog,"endp","mdc",$waittime,$qastate,$title,$value,$longtext); +# if($qastate > 60) { +# system("logger -p local1.info -t DAQ Endp \\ $longtext") unless (($timecnt->{mdc}++)%$loggerperiod); +# } +# else {$timecnt->{mdc} = 0;} ###rich my(%rich_mask, @rich_results); diff --git a/hmon/hmon_hodo.pl b/hmon/hmon_hodo.pl index 67799ed..6172559 100755 --- a/hmon/hmon_hodo.pl +++ b/hmon/hmon_hodo.pl @@ -15,7 +15,6 @@ use List::Util qw[min max]; my $plot2 = (); $plot2->{name} = "HodoRate"; $plot2->{file} = "files/HodoRate"; -$plot2->{curves} = 1; $plot2->{entries} = 2; $plot2->{curves} = 16; $plot2->{type} = HPlot::TYPE_HEATMAP; @@ -30,15 +29,37 @@ $plot2->{xmax} = 1.5; $plot2->{ymin} = 15.5; $plot2->{ymax} = -0.5; $plot2->{showvalues} = 1; - HPlot::PlotInit($plot2); +my $plot = (); +$plot->{name} = "HodoRatePlot"; +$plot->{file} = "files/HodoRatePlot"; +$plot->{entries} = 16; +$plot->{curves} = 2; +$plot->{type} = HPlot::TYPE_HISTORY; +$plot->{output} = HPlot::OUT_PNG; +$plot->{xlabel} = "Bar"; +$plot->{ylabel} = "Hitrate"; +$plot->{sizex} = 580; +$plot->{sizey} = 365; +$plot->{nokey} = 1; +$plot->{xscale} = -1; +$plot->{xmin} = -0.5; +$plot->{xmax} = 16.5; +$plot->{ymin} = 0; +$plot->{buffer} = 1; +HPlot::PlotInit($plot); + my $str = Hmon::MakeTitle(9, 10, "Hodoscope Hit Rate"); $str .= qq@
\n@; $str .= Hmon::MakeFooter(); Hmon::WriteFile("HodoRate",$str); +$str = Hmon::MakeTitle(9, 8, "Hodoscope Hit Rate"); +$str .= qq@
\n@; +$str .= Hmon::MakeFooter(); +Hmon::WriteFile("HodoRatePlot",$str); my $old; my $oldtime = time(); @@ -65,16 +86,17 @@ while (1) { $diff->{$b}->[$v] = $vdiff/($tdiff|1); } } - for my $bar (0..7) { for my $x (0..1) { - HPlot::PlotFill('HodoRate',$diff->{0x5010}->[$bar*2+1+$x*16],$x,$bar); - HPlot::PlotFill('HodoRate',$diff->{0x5013}->[$bar*2+1+$x*16],$x,$bar+8); + HPlot::PlotFill('HodoRate',$diff->{0x5010}->[$bar*2+1+$x*16],$x,$bar+8); + HPlot::PlotFill('HodoRate',$diff->{0x5013}->[$bar*2+1+$x*16],$x,$bar); + HPlot::PlotFill('HodoRatePlot',$diff->{0x5010}->[$bar*2+1+$x*16],$bar+8,$x); + HPlot::PlotFill('HodoRatePlot',$diff->{0x5013}->[$bar*2+1+$x*16],$bar,$x); } } - HPlot::PlotDraw('HodoRate'); + HPlot::PlotDraw('HodoRate'); + HPlot::PlotDraw('HodoRatePlot'); } - $old = $o; $oldtime = time(); sleep(1); diff --git a/hmon/hmon_hodo_hist.pl b/hmon/hmon_hodo_hist.pl new file mode 100755 index 0000000..a9f4417 --- /dev/null +++ b/hmon/hmon_hodo_hist.pl @@ -0,0 +1,84 @@ +#!/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]; + + +my $plot = (); +$plot->{name} = "HodoHist"; +$plot->{file} = "files/HodoHist"; +$plot->{curves} = 8; +$plot->{entries} = 200; +$plot->{type} = HPlot::TYPE_HISTORY; +$plot->{output} = HPlot::OUT_PNG; +$plot->{zlabel} = "Hitrate"; +$plot->{sizex} = 880; +$plot->{sizey} = 465; +$plot->{nokey} = 0; +$plot->{buffer} = 1; +$plot->{xscale} = 10; +$plot->{xlabel} = "Time [s]"; +$plot->{ylabel} = "Hits [1/s]"; +HPlot::PlotInit($plot); + + +my $str = Hmon::MakeTitle(12, 10, "Hodoscope Hit History"); +$str .= qq@
\n@; +$str .= Hmon::MakeFooter(); +Hmon::WriteFile("HodoHist",$str); + +my $timer = 0; +my $old; +my $oldtime = 0; +my $time = 0; +my $diff; +my $iter = 0; + +trb_init_ports() or die trb_strerror(); + + +while (1) { + my $o; + foreach my $b (0x5010,0x5013) { + my $t = trb_registertime_read_mem($b,0xc000,0,33); + $o->{$b} = $t->{$b}; + } + + if (defined $old) { + foreach my $b (keys %$o) { + for my $v (0..32) { + my $tdiff = $o->{0x5010}->{time}->[0] - $oldtime; + my $vdiff = ($o->{$b}->{value}->[$v]&0xffffff) - ($old->{$b}->{value}->[$v]&0xffffff); + if ($vdiff < 0) { $vdiff += 2**24;} + if ($tdiff < 0) { $tdiff += 2**16;} + $tdiff *= 16; + $diff->{$b}->[$v] = $vdiff/($tdiff||1E6)*1E6; + } + } + my @sum = qw(0 0 0 0 0 0 0 0); + for my $bar (0..7) { + for my $x (0..1) { + $sum[$bar/2+4] += $diff->{0x5010}->[$bar*2+1+$x*16]; + $sum[$bar/2] += $diff->{0x5013}->[$bar*2+1+$x*16]; + } + } + for my $i (0..7) { + HPlot::PlotAdd("HodoHist",$sum[$i]/2,$i); + } + unless($timer++ % 10) { + HPlot::PlotDraw('HodoHist'); + } + } + + $old = $o; + $oldtime = $o->{0x5010}->{time}->[0]; + usleep(100000); + } diff --git a/hmon/hmon_nxyter_status.pl b/hmon/hmon_nxyter_status.pl new file mode 100755 index 0000000..45c4184 --- /dev/null +++ b/hmon/hmon_nxyter_status.pl @@ -0,0 +1,50 @@ +#!/usr/bin/perl -w + +use warnings; +use strict; +use QA; +use Data::Dumper; +use HADES::TrbNet; + +my $SLEEP_TIME = 1; +my $flog = QA::OpenQAFile(); + +trb_init_ports() or die trb_strerror(); + +while (1) { + + # Default Output Values + my $title = "NX Status"; + my $shorttext = ""; + my $longtext = "Status of all Nxyter FEBs"; + my $status = QA::OK; + + # Read Status Register of all Nxyter + my $rh_status = trb_register_read(0xfe49, 0x810c) + or sleep $SLEEP_TIME and next; + + my $error_ctr = 0; + my $error_msg = ""; + + foreach my $board (sort {$a <=> $b} keys %$rh_status) { + if ($rh_status->{$board} > 0) { + $error_msg = $error_msg . + sprintf " - 0x%04x: 0x%02x", $board, $rh_status->{$board}; + $error_ctr++; + } + } + + # Create Output Messages + if (($error_ctr > 0)) { + $shorttext = "Errors: ${error_ctr}"; + + $longtext = "Errors on: "; + $longtext = $longtext . $error_msg; + $status = QA::WARN; + } + + QA::WriteQALog($flog, "pion", "nxstatus", $SLEEP_TIME * 2, + $status, $title, $shorttext, $longtext); + + sleep $SLEEP_TIME; +} diff --git a/hmon/hmon_pionadc.pl b/hmon/hmon_pionadc.pl new file mode 100755 index 0000000..e5712f9 --- /dev/null +++ b/hmon/hmon_pionadc.pl @@ -0,0 +1,29 @@ +#!/usr/bin/perl -w + +use warnings; +use strict; +use Hmon; + +my $str = ""; + + +$str = Hmon::MakeTitle(9,12,"Pion 1 ADC Values", 0); +$str .= "
\n"; +$str .= "\n"; +$str .= Hmon::MakeFooter(); +Hmon::WriteFile("pion1adc",$str); + +$str = Hmon::MakeTitle(9,12,"Pion 2 ADC Values", 0); +$str .= "
\n"; +$str .= "\n"; +$str .= Hmon::MakeFooter(); +Hmon::WriteFile("pion2adc",$str); + + + + qx(./hmon_hadplot.sh -d 2000 -a 0x3800 -r 0x8b00 -m 128 -w 32 -p 0 -t "Y Channel" -xtitle "Y Channels" -key -xtitle "DOWN (5cm) UP (5cm)" -key -curvestyle steps -xmin -1 -xmax 128 -ymin 0 -ymax 4100 -output "PNG.files/PionADC1X.700.265" reg >/dev/null & + ./hmon_hadplot.sh -d 2000 -a 0x3801 -r 0x8b00 -m 128 -w 32 -p 0 -t "X Channel" -xtitle "X Channels" -key -xtitle "RIGHT (-5cm) LEFT (5cm)" -key -curvestyle steps -xmin -1 -xmax 128 -ymin 0 -ymax 4100 -output "PNG.files/PionADC1Y.700.265" reg >/dev/null & + ./hmon_hadplot.sh -d 2000 -a 0x3810 -r 0x8b00 -m 128 -w 32 -p 0 -t "Y Channel" -xtitle "Y Channels" -key -xtitle "DOWN (5cm) UP (5cm)" -key -curvestyle steps -xmin -1 -xmax 128 -ymin 0 -ymax 4100 -output "PNG.files/PionADC2X.700.265" reg >/dev/null & + ./hmon_hadplot.sh -d 2000 -a 0x3811 -r 0x8b00 -m 128 -w 32 -p 0 -t "X Channel" -xtitle "X Channels" -key -xtitle "RIGHT (-5cm) LEFT (5cm)" -key -curvestyle steps -xmin -1 -xmax 128 -ymin 0 -ymax 4100 -output "PNG.files/PionADC2Y.700.265" reg >/dev/null &); + + diff --git a/hmon/hmon_pionrate.pl b/hmon/hmon_pionrate.pl index 1b6e3d5..3a57ab7 100755 --- a/hmon/hmon_pionrate.pl +++ b/hmon/hmon_pionrate.pl @@ -3,29 +3,81 @@ use warnings; use strict; use Hmon; +use HADES::TrbNet; +use Data::Dumper; + +trb_init_ports() or die trb_strerror(); my $str = ""; +my $plots = fork(); + + +if($plots) { + while(1) { + my $filter; -$str = Hmon::MakeTitle(9,12,"Pion 1 Rates",0); -#$str .= "\n#ADDFILE files/eventratehist.svg\n"; -$str .= "
\n"; -$str .= "\n"; -$str .= Hmon::MakeFooter(); -Hmon::WriteFile("pion1rate",$str); + $str = Hmon::MakeTitle(9,12,"Pion 1 Rates",0); + # + # Get Histogram Filter Status + # + $filter = trb_register_read(0x3800, 0x8400); + print Dumper $filter; + if (($filter->{0x3800} & 0x80000000) > 0) { + $str .= "All Data"; + } else { + $str .= "Event Buffer Data"; + } + $str .= "\n"; + + # Get Histogram Filter Status + # + $filter = trb_register_read(0x3801, 0x8400); + if (($filter->{0x3801} & 0x80000000) > 0) { + $str .= "All Data"; + } else { + $str .= "Event Buffer Data"; + } + $str .= "\n"; -$str = Hmon::MakeTitle(9,12,"Pion 2 Rates",0); -#$str .= "\n#ADDFILE files/eventratehist.svg\n"; -$str .= "
\n"; -$str .= "\n"; -$str .= Hmon::MakeFooter(); -Hmon::WriteFile("pion2rate",$str); + $str .= Hmon::MakeFooter(); + Hmon::WriteFile("pion1rate",$str); + # --------------------------------------------------------------------------------------------------------- + # + $str = Hmon::MakeTitle(9,12,"Pion 2 Rates",0); + # + # Get Histogram Filter Status + # + $filter = trb_register_read(0x3810, 0x8400); + if (($filter->{0x3810} & 0x80000000) > 0) { + $str .= "All Data"; + } else { + $str .= "Event Buffer Data"; + } + $str .= "
\n"; + # + # Get Histogram Filter Status + # + $filter = trb_register_read(0x3811, 0x8400); + if (($filter->{0x3811} & 0x80000000) > 0) { + $str .= "All Data"; + } else { + $str .= "Event Buffer Data"; + } + $str .= "\n"; - qx(./hmon_hadplot.sh -d 1000 -a 0x3800 -r 0x8800 -m 128 -w 32 -p 0 -output "PNG.files/Pion1X.700.265" regdiff >/dev/null & - ./hmon_hadplot.sh -d 1000 -a 0x3801 -r 0x8800 -m 128 -w 32 -p 0 -output "PNG.files/Pion1Y.700.265" regdiff >/dev/null & - ./hmon_hadplot.sh -d 1000 -a 0x3810 -r 0x8800 -m 128 -w 32 -p 0 -output "PNG.files/Pion2X.700.265" regdiff >/dev/null & - ./hmon_hadplot.sh -d 1000 -a 0x3811 -r 0x8800 -m 128 -w 32 -p 0 -output "PNG.files/Pion2Y.700.265" regdiff >/dev/null &); + $str .= Hmon::MakeFooter(); + Hmon::WriteFile("pion2rate",$str); + sleep(5); + } + } +else{ + qx(./hmon_hadplot.sh -d 1000 -a 0x3800 -r 0x8800 -m 128 -w 32 -p 0 -t "Y Channels" -key -xtitle "DOWN (5cm) UP (5cm)" -output "PNG.files/Pion1X.700.265" regdiff >/dev/null & + ./hmon_hadplot.sh -d 1000 -a 0x3801 -r 0x8800 -m 128 -w 32 -p 0 -t "X Channels" -key -xtitle "RIGHT (-5cm) LEFT (5cm)" -output "PNG.files/Pion1Y.700.265" regdiff >/dev/null & + ./hmon_hadplot.sh -d 1000 -a 0x3810 -r 0x8800 -m 128 -w 32 -p 0 -t "Y Channels" -key -xtitle "DOWN (5cm) UP (5cm)" -output "PNG.files/Pion2X.700.265" regdiff >/dev/null & + ./hmon_hadplot.sh -d 1000 -a 0x3811 -r 0x8800 -m 128 -w 32 -p 0 -t "X Channels" -key -xtitle "RIGHT (-5cm) LEFT (5cm)" -output "PNG.files/Pion2Y.700.265" regdiff >/dev/null &); + } diff --git a/hmon/hmon_rate2.pl b/hmon/hmon_rate2.pl index fb07e15..6c9488f 100755 --- a/hmon/hmon_rate2.pl +++ b/hmon/hmon_rate2.pl @@ -4,10 +4,12 @@ use warnings; use strict; use Hmon; use HADES::TrbNet; +use QA; trb_init_ports() or die trb_strerror(); my $flog = Hmon::OpenLogfile(); +my $fqa = QA::OpenQAFile(); while (1) { my $rh_rate; @@ -100,7 +102,39 @@ while (1) { Hmon::WriteFile("CTSRates", $str); + + my $shorttext; my $longtext; my $state; + + $state = QA::OK; + $shorttext = QA::SciNotation($store{0xa029})."Hz"; + $longtext = sprintf("Trigger Rate from Hodoscope %i Hz",$store{0xa029}); + QA::WriteQALog($fqa, "rate", "hodo", 10, + $state, 'Hodo Rate', $shorttext, $longtext); + $state = QA::OK; + $shorttext = QA::SciNotation($store{0xa02a})."Hz"; + $longtext = sprintf("Trigger Rate from Pion 1: %i Hz",$store{0xa02a}); + QA::WriteQALog($fqa, "rate", "pion1", 10, + $state, 'Pion1 Rate', $shorttext, $longtext); + + $state = QA::OK; + $shorttext = QA::SciNotation($store{0xa02b})."Hz"; + $longtext = sprintf("Trigger Rate from Pion 2: %i Hz",$store{0xa02b}); + QA::WriteQALog($fqa, "rate", "pion2", 10, + $state, 'Pion2 Rate', $shorttext, $longtext); + + $state = QA::OK; + $shorttext = QA::SciNotation($store{0xa024})."Hz"; + $longtext = sprintf("Trigger Rate from PT1: %i Hz",$store{0xa024}); + QA::WriteQALog($fqa, "rate", "pt1", 10, + $state, 'PT1 Rate', $shorttext, $longtext); + + $state = QA::OK; + $shorttext = QA::SciNotation($store{0xa009})."Hz"; + $longtext = sprintf("Trigger Rate from Start: %i Hz",$store{0xa009}); + QA::WriteQALog($fqa, "rate", "start", 10, + $state, 'Start Rate', $shorttext, $longtext); + sleep 1; } diff --git a/hmon/hmon_shower.pl b/hmon/hmon_shower.pl old mode 100755 new mode 100644 diff --git a/hmon/hmon_starthist.pl b/hmon/hmon_starthist.pl old mode 100755 new mode 100644 diff --git a/hmon/hmon_trgsource.pl b/hmon/hmon_trgsource.pl index 5cc8ccc..1d2bee5 100755 --- a/hmon/hmon_trgsource.pl +++ b/hmon/hmon_trgsource.pl @@ -24,8 +24,8 @@ my @lnames= qw(SectorwiseMult1 SectorwiseMult2 SectorwiseMult3 SectorwiseMult4 SectorwiseMult5 SectorwiseMult6 SectorwiseMult2NoNeighbour SectorwiseMult3NoNeighbour SectorwiseMult2Opposite); -my @ptnames= qw(M2 M5 M20 PT4 PT5 FW PT7 PT8); -my @ptlnames= qw(PT1/M2 PT2/M5 PT3/M20 PT4 PT5 PT6/ForwardWall PT7 PT8); +my @ptnames= qw(M2 M5 M16 PT4 PT5 Hod Pi1 Pi0); +my @ptlnames= qw(PT1/M2 PT2/M5 PT3/M16 PT4 PT5 PT6/Hodoscope PT7/Pion1 PT8/Pion0); my $lastlongmsg = ""; my $spillsum = 0; diff --git a/hmon/index.cgi b/hmon/index.cgi index 6b7255d..cb68eff 100755 --- a/hmon/index.cgi +++ b/hmon/index.cgi @@ -52,11 +52,15 @@ function openwin(url) {
  • Rate on Start Diamond
  • Rate on Pion 1
  • Rate on Pion 2
  • -
  • Rate on Hodoscope
  • +
  • ADC values on Pion 1
  • +
  • ADC values on Pion 2
  • +
  • Pion Power & Cooling
  • +
  • Rate on Hodoscope (heatmap)
  • +
  • Rate on Hodoscope (curve)
  • -