From: Hades DAQ Date: Thu, 24 Jan 2019 12:42:25 +0000 (+0100) Subject: update hmon scripts X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=54bbb1e500f35da362ebb9a0d98a419751dfb580;p=hadesdaq.git update hmon scripts --- diff --git a/hmon/QA.pm b/hmon/QA.pm index 2683339..d38b371 100644 --- a/hmon/QA.pm +++ b/hmon/QA.pm @@ -76,11 +76,11 @@ our $QAServer = "hades33"; our @FeeErrLimits = (0, 5, 10); our @MdcOepLimits = (372, 372-1, 372-3); -our @MdcVoltageLimits = (50, 60, 100); +our @MdcVoltageLimits = (50, 70, 100); our @MdcLockLimits = (0, 3, 5); our @MdcTempLimits = (75, 80, 85); our @EcalTempLimits = (55, 60, 65); -our @RichInnerTempLimits = (32.5,33,34); +our @RichInnerTempLimits = (34,34.5,35); our @TrgErrLimits = (100, 1000, 10000); our @CPULimits = (95, 100, 100); our @TimeoutLimits = (0, 0, 1); @@ -94,14 +94,17 @@ our @EBDeltaRateLimits = (10, 15, 25); our $TrgCheckPolarity = 1; our @Eventsbroken = (.5,5,10); our @MdcTokenMissLimits = (10,50,100); -our @MdcNominalHV = (1750,1770,1850,2150); -our @MdcHVOffsetLimits = (5,10,20); - +our @MdcNominalHV = (1750,1770,1900,2150); +our @MdcHVOffsetLimits = (5,10,55); +our @EcalHvLimits = (326,325,320); + + + our @PionLvCurrLimits = (4,5,6); our $MdcHvOff = 0; our $RichHvOff = 0; -our $MagnetOff = 0; +our $MagnetOff = 1; our $PadiwaECalNumber = 84; our @PadiwaEcalLimits = (0, 0, 0); diff --git a/hmon/ecal_drawing.htm b/hmon/ecal_drawing.htm index 3f2f08d..09a88ab 100644 --- a/hmon/ecal_drawing.htm +++ b/hmon/ecal_drawing.htm @@ -1764,7 +1764,7 @@ function updatedata(d) { resetColor(); var trbs = [ - [ ],//["0x6051",1,0,23], ["0x6045",25,0,23], ["0x6011",49,0,23], ["0x6014",73,0,23], ["0x6042",97,0,23], ["0x6015",121,0,23], ["0x6026",145,0,18] ], //sector 0 + [ ["0x6025",14,14,14], ["0x6025",9,15,15], ["0x6041",3,22,22], ["0x6041",7,23,23]],//["0x6051",1,0,23], ["0x6045",25,0,23], ["0x6011",49,0,23], ["0x6014",73,0,23], ["0x6042",97,0,23], ["0x6015",121,0,23], ["0x6026",145,0,18] ], //sector 0 [ ["0x6013",1,0,0], ["0x6013",2,1,1], ["0x6013",3,2,2], ["0x6013",4,3,3], ["0x6013",5,4,4], diff --git a/hmon/hmon_dutyfactor.pl b/hmon/hmon_dutyfactor.pl new file mode 100755 index 0000000..14ef5aa --- /dev/null +++ b/hmon/hmon_dutyfactor.pl @@ -0,0 +1,133 @@ +#!/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 sum]; + + +trb_init_ports() or die trb_strerror(); + +HPlot::PlotInit({ + name => "DutyFactor", + file => "files/DutyFactor", + entries => 50, + type => HPlot::TYPE_HISTORY, + output => HPlot::OUT_PNG, + xlabel => "Spills", + ylabel => "Duty Factor", + sizex => 600, + sizey => 200, + curves => 1, + buffer => 0, + nokey => 1, + }); + +HPlot::PlotInit({ + name => "SpillSum", + file => "files/SpillSumDuty", + entries => 50, + type => HPlot::TYPE_HISTORY, + output => HPlot::OUT_PNG, + xlabel => "Spills", + ylabel => "Total Sum", + sizex => 600, + sizey => 200, + curves => 1, + buffer => 0, + nokey => 1, + }); + +my $old; +my $diff; +my $oldtime; +my @store; +my $time = 0; +my $empties = 0; + +my $SPS = 10; #samples per second +my $sampletime = 1E6/$SPS; + + +my @dummy = (0,0,10,20,30,10,20,20,20,20,10,30,10,20,30,10,20,20,20,20,10,30,10,20,30,10,20,20,20,20,10,30,1,2,3,0,0,0); +my $iter = 0; + +while(1) { + + my $o = trb_registertime_read_mem(0x5000,0xc000,0,17); + +#Just the usual calculation of differences on counters & normalization based on time between reads. + if (defined $old) { + foreach my $b (keys %$o) { + my $tdiff = $o->{$b}{time}->[0] - ($oldtime->{$b}||0); + $tdiff += 2**16 if $tdiff < 0; + $tdiff *= 16; + for my $v (0..16) { + my $vdiff = ($o->{$b}{value}[$v]&0xfffffff) - ($old->{$b}{value}[$v]&0xfffffff); + $vdiff += 2**28 if $vdiff < 0; + $diff->{$b}[$v] = $vdiff/($tdiff||1E6)*1E6; + } + $oldtime->{$b} = $o->{$b}{time}[0]; + } + + +#sum strips & store + my $sum = 0; + for my $c (1..16) { + $sum += $diff->{0x5000}[$c]; + } + +# $sum = $dummy[$iter++]; #You can't do that on stage + push(@store,$sum); + $empties++ if $sum < 10; + +#end of spill + my $lastsum = 0; + for my $c (1..5) { $lastsum += $store[-$c]//0;} + + if($lastsum < 10*5*$SPS && ($store[-6]//0) > 9*$SPS) { + + my $total = sum(@store)/$SPS; + my $max = max(@store); + my $samples = scalar @store; + + my $avg = sum(@store)/$samples; + my $duty = $avg/$max; + + HPlot::PlotAdd("DutyFactor",$duty,0); + HPlot::PlotAdd("SpillSum", $total,0); + HPlot::PlotDraw('DutyFactor'); + HPlot::PlotDraw('SpillSum'); + + my $length = sprintf("%0.1f s (%i samples)",time()-$time,$samples); + my $offtime = $empties/(1E6/$sampletime); + + my $str = Hmon::MakeTitle(8, 16, "DutyFactor",1); + $str .= qq@
\n@; + $str .= qq@\n@; + $str .= qq@\n@; + $str .= "
Last Sum".QA::SciNotation($total); + $str .= "
Last Duty".sprintf("%0.3f",$duty); + $str .= "
Last Duration".$length; + $str .= "
Last Break".$offtime." s"; + $str .= "
Last Max".QA::SciNotation($max)." Hz (100ms)"; + $str .= "
"; + $str .= Hmon::MakeFooter(); + Hmon::WriteFile("DutyFactor",$str); + + $empties = 0; + $time = time(); + @store = (); + $iter = 0; + } + + } + $old = $o; + usleep($sampletime); + } \ No newline at end of file diff --git a/hmon/hmon_haloforward.pl b/hmon/hmon_haloforward.pl new file mode 100755 index 0000000..3f8e3eb --- /dev/null +++ b/hmon/hmon_haloforward.pl @@ -0,0 +1,163 @@ +#!/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); +use List::Util qw[min max]; + +trb_init_ports() or die trb_strerror(); + +HPlot::PlotInit({ + name => "HaloFast", + file => "files/ForwardHaloFast", + title => "ForwardHalo Fast", + entries => 3, + curves => 3, + type => HPlot::TYPE_HEATMAP, + output => HPlot::OUT_PNG, + cblabel => "Hitrate [Hz]", +# cbscale => 10, + sizex => 300, + sizey => 240, + nokey => 1, + buffer => 1, + xmin => -0.5, + xmax => 2.5, + ymin => -0.5, + ymax => 2.5, + cbmax => "100<*<1E10", + cbmin => 0, + noinit => 1, +# additional => "set logscale cb;", + showvalues => 0, + }); + +HPlot::PlotInit({ + name => "HaloSlow", + file => "files/ForwardHaloSlow", + title => "ForwardHalo Slow", + entries => 3, + curves => 3, + type => HPlot::TYPE_HEATMAP, + output => HPlot::OUT_PNG, + cblabel => "Hitrate [Hz]", +# cbscale => 10, + sizex => 300, + sizey => 240, + nokey => 1, + buffer => 1, + xmin => -0.5, + xmax => 2.5, + ymin => -0.5, + ymax => 2.5, + cbmax => "100<*<1E10", + cbmin => 0, + noinit => 1, +# additional => "set logscale cb;", + showvalues => 0, + }); + +HPlot::PlotInit({ + name => "ForwardHaloPosition", + file => "files/ForwardHaloPosition", + entries => 100, + type => HPlot::TYPE_HISTORY, + output => HPlot::OUT_PNG, + titles => ["X position ","Y position","Xrms","Yrms"], + xlabel => "Seconds", + ylabel => "Strips", + sizex => 600, + sizey => 250, + ymin => "-1.1", + ymax => "1.1", + curves => 2, + xscale => 1, + buffer => 1, + }); + +my $str = Hmon::MakeTitle(8, 11, "Forward HALO (fast/slow)",0); +$str .= qq@\n@; +$str .= qq@\n@; +$str .= qq@\n@; +$str .= Hmon::MakeFooter(); +Hmon::WriteFile("ForwardHalo",$str); + +my $old; +my $diff; +my $oldtime; +my $iter = 1; + +while(1) { + + my $o = trb_registertime_read_mem(0xfe71,0xc000,0,49); # or die trb_strerror() or sleep 5 and next; + if (defined $old) { + foreach my $b (keys %$o) { + my $tdiff = $o->{$b}{time}->[0] - ($oldtime->{$b}||0); + $tdiff += 2**16 if $tdiff < 0; + $tdiff *= 16; + for my $v (0..48) { + my $vdiff = ($o->{$b}{value}[$v]&0xfffffff) - ($old->{$b}{value}[$v]&0xfffffff); + $vdiff += 2**28 if $vdiff < 0; + $diff->{$b}[$v] = $vdiff/($tdiff||1E6)*1E6; + } + $oldtime->{$b} = $o->{$b}{time}[0]; + } + + + HPlot::PlotFill("HaloFast",$diff->{0x6025}[29],1,2); + HPlot::PlotFill("HaloFast",$diff->{0x6041}[45],1,0); + HPlot::PlotFill("HaloFast",$diff->{0x6025}[31],0,1); + HPlot::PlotFill("HaloFast",$diff->{0x6041}[47],2,1); + + HPlot::PlotFill("HaloSlow",$diff->{0x6025}[30],1,2); + HPlot::PlotFill("HaloSlow",$diff->{0x6041}[46],1,0); + HPlot::PlotFill("HaloSlow",$diff->{0x6025}[32],0,1); + HPlot::PlotFill("HaloSlow",$diff->{0x6041}[48],2,1); + + HPlot::PlotDraw('HaloFast'); + HPlot::PlotDraw('HaloSlow'); + + my $halosum = $diff->{0x6025}[29] + $diff->{0x6041}[45] + $diff->{0x6041}[47] + $diff->{0x6025}[31]; + my $haloypos = (-$diff->{0x6041}[45] + $diff->{0x6025}[29])/($halosum||1); + my $haloxpos = (-$diff->{0x6041}[47] + $diff->{0x6025}[31])/($halosum||1); + $haloxpos = "NaN" if $halosum < 100; + $haloypos = "NaN" if $halosum < 100; + HPlot::PlotAdd("ForwardHaloPosition",$haloxpos,0); + HPlot::PlotAdd("ForwardHaloPosition",$haloypos,1); + HPlot::PlotDraw('ForwardHaloPosition'); + + + } + + $old = $o; + usleep(900000); + } + + + +# Oben: 0x6025 TDC-Nr. 29(fast),30(slow) oder ch17 +# Rechts: 0x6025 TDC-Nr. 31(fast),32(slow) oder ch18 +# Unten: 0x6041 TDC-Nr. 45(fast),46(slow) oder ch22 +# Links: 0x6041 TDC-Nr. 47(fast),48(slow) oder ch23 + + + + + + + + + + + + + + + + diff --git a/hmon/hmon_rate2.pl b/hmon/hmon_rate2.pl index cf59a94..8dbfe4e 100755 --- a/hmon/hmon_rate2.pl +++ b/hmon/hmon_rate2.pl @@ -25,6 +25,8 @@ sub getCorrected { sub getCorrectedValue { my ($val,$cor) = @_; + $val = 0 unless $val; + $cor = 0 unless $cor; my $value = max($val-$cor,0); if ($value < $cor/20) {$value = 0;} return $value; @@ -128,8 +130,8 @@ while (1) { my $oos; #Out of spill? - if($store{0xa029} < 50) { - for my $b (0xa029, 0xa02a, 0xa02b, 0xa024, 0xa009, 0xa03c, 0xa037) { + if($store{0xa02c} < 50) { + for my $b (0xa029, 0xa02a, 0xa02b, 0xa024, 0xa009, 0xa03c, 0xa037, 0xa02c, 0xa028,0xa025) { $offset->{$b} = ($offset->{$b}||0) + (($store{$b}||0) - ($offset->{$b}||0))/10; } # print Dumper $offset; @@ -161,10 +163,11 @@ while (1) { $state, 'PT1 Rate', $shorttext, $longtext); $state = QA::OK; - $shorttext = QA::SciNotation($store{0xa009})." / ".getCorrected($store{0xa009},$offset->{0xa009}); - $longtext = sprintf("Trigger Rate from Start: %i Hz / %i Hz after offset correction",$store{0xa009}, getCorrectedValue($store{0xa009},$offset->{0xa009})); - if(getCorrectedValue($store{0xa009},$offset->{0xa009}) < 100 && - getCorrectedValue($store{0xa029},$offset->{0xa029}) > 10000) { + $shorttext = QA::SciNotation($store{0xa02c})." / ".getCorrected($store{0xa02c},$offset->{0xa02c}); + $longtext = sprintf("Trigger Rate from Start: %i Hz / %i Hz after offset correction",$store{0xa02c}, +getCorrectedValue($store{0xa009},$offset->{0xa02c})); + if(getCorrectedValue($store{0xa009},$offset->{0xa02c}) < 100 && + getCorrectedValue($store{0xa029},$offset->{0xa029}) > 1000) { $starterrorcnt+=3; if($starterrorcnt >= 15) { $state = QA::ERROR; @@ -178,10 +181,10 @@ while (1) { $state, 'Start Rate', $shorttext, $longtext); $state = QA::OK; - $shorttext = sprintf('%.2f',getCorrectedValue($store{0xa024},$offset->{0xa024})/(getCorrectedValue($store{0xa009},$offset->{0xa009})||1)); - $longtext = "Trigger Rate from PT1 vs. Start: ".$shorttext; + $shorttext = sprintf('%.2f',getCorrectedValue($store{0xa02c},$offset->{0xa02c})/(getCorrectedValue($store{0xa025},$offset->{0xa025})||1)); + $longtext = "Trigger Rate from PT2 vs. Start: ".$shorttext; QA::WriteQALog($fqa, "trg", "pt1rate", 10, - $state, 'Start/PT1', $shorttext, $longtext); + $state, 'Start/PT2', $shorttext, $longtext); sleep 1; } diff --git a/hmon/hmon_richrate2.pl b/hmon/hmon_richrate2.pl index f2abfae..66e2481 100755 --- a/hmon/hmon_richrate2.pl +++ b/hmon/hmon_richrate2.pl @@ -32,7 +32,7 @@ xmin => -1.5, xmax => 192.5, ymin => -1.5, ymax => 192.5, -cbmax => "100<*<1E5", +cbmax => "100<*<1E6", cbmin => 0.0, noinit => 1, additional => "set logscale cb;set xrange [192.5:-1.5] reverse", @@ -132,5 +132,5 @@ while(1) { $old = $o; $oldtime = time(); - sleep 2; + sleep 1; } diff --git a/hmon/hmon_startrate.pl b/hmon/hmon_startrate.pl index 0bbfc2d..fa2a395 100755 --- a/hmon/hmon_startrate.pl +++ b/hmon/hmon_startrate.pl @@ -20,8 +20,8 @@ HPlot::PlotInit({ type => HPlot::TYPE_BARGRAPH, output => HPlot::OUT_PNG, titles => ["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15"], - xlabel => "Time / 200 ms", - ylabel => "Hits", + xlabel => "Time / 100 ms", + ylabel => "Hitrate [Hz]", sizex => 950, sizey => 330, xmin => 0, @@ -42,8 +42,8 @@ HPlot::PlotInit({ type => HPlot::TYPE_BARGRAPH, output => HPlot::OUT_PNG, titles => ["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15"], - xlabel => "Time / 200 ms", - ylabel => "Hits", + xlabel => "Time / 100 ms", + ylabel => "Hitrate [Hz]", sizex => 950, sizey => 330, xmin => 0, @@ -64,8 +64,8 @@ HPlot::PlotInit({ type => HPlot::TYPE_BARGRAPH, output => HPlot::OUT_PNG, titles => ["0","1","2","3","4","5","6","7"], - xlabel => "Time / 200 ms", - ylabel => "Hits", + xlabel => "Time / 100 ms", + ylabel => "Hitrate [Hz]", sizex => 950, sizey => 330, xmin => 0, @@ -88,7 +88,7 @@ HPlot::PlotInit({ output => HPlot::OUT_PNG, titles => ["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15"], xlabel => "Seconds", - ylabel => "Hits", + ylabel => "Hitrate [Hz]", sizex => 950, sizey => 330, ymin => "0", @@ -106,7 +106,7 @@ HPlot::PlotInit({ output => HPlot::OUT_PNG, titles => ["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15"], xlabel => "Seconds", - ylabel => "Hits", + ylabel => "Hitrate [Hz]", sizex => 950, sizey => 330, ymin => "0", @@ -124,7 +124,7 @@ HPlot::PlotInit({ output => HPlot::OUT_PNG, titles => ["0","1","2","3","4","5","6","7"], xlabel => "Seconds", - ylabel => "Hits", + ylabel => "Hitrate [Hz]", sizex => 950, sizey => 330, ymin => "0", @@ -141,11 +141,11 @@ HPlot::PlotInit({ type => HPlot::TYPE_BARGRAPH, output => HPlot::OUT_PNG, titles => ["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15"], - ylabel => "Hits", + ylabel => "Hitrate [Hz]", yscale => 10, nokey => 1, sizex => 340, - sizey => 330, + sizey => 350, xmin => -0.5, xmax => 15.5, ymin => "0", @@ -162,11 +162,11 @@ HPlot::PlotInit({ type => HPlot::TYPE_BARGRAPH, output => HPlot::OUT_PNG, titles => ["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15"], - ylabel => "Hits", + ylabel => "Hitrate [Hz]", yscale => 10, nokey => 1, sizex => 340, - sizey => 330, + sizey => 350, xmin => -0.5, xmax => 15.5, ymin => "0", @@ -183,11 +183,11 @@ HPlot::PlotInit({ type => HPlot::TYPE_BARGRAPH, output => HPlot::OUT_PNG, titles => ["0","1","2","3","4","5","6","7"], - ylabel => "Hits", + ylabel => "Hitrate [Hz]", yscale => 10, nokey => 1, sizex => 340, - sizey => 330, + sizey => 350, xmin => -0.5, xmax => 7.5, ymin => "0", @@ -206,14 +206,32 @@ HPlot::PlotInit({ titles => ["X position","Y position","Xrms","Yrms"], xlabel => "Seconds", ylabel => "Strips", - sizex => 950, - sizey => 330, + sizex => 970, + sizey => 350, ymin => "-0.5", ymax => "15.5", curves => 4, xscale => 10, buffer => 1, }); + +HPlot::PlotInit({ + name => "HaloPosition", + file => "files/HaloPosition", + entries => 200, + type => HPlot::TYPE_HISTORY, + output => HPlot::OUT_PNG, + titles => ["X position ","Y position","Xrms","Yrms"], + xlabel => "Seconds", + ylabel => "Strips", + sizex => 600, + sizey => 250, + ymin => "-1.1", + ymax => "1.1", + curves => 2, + xscale => 10, + buffer => 1, + }); HPlot::PlotInit({ name => "HALO", @@ -223,8 +241,8 @@ HPlot::PlotInit({ curves => 3, type => HPlot::TYPE_HEATMAP, output => HPlot::OUT_PNG, - cblabel => "Hitrate", - cbscale => 10, + cblabel => "Hitrate [Hz]", + cbscale => 10, sizex => 300, sizey => 240, nokey => 1, @@ -248,8 +266,8 @@ HPlot::PlotInit({ curves => 3, type => HPlot::TYPE_HEATMAP, output => HPlot::OUT_PNG, - cblabel => "Hitrate", - cbscale => 10, + cblabel => "Hitrate [Hz]", + cbscale => 10, sizex => 300, sizey => 240, nokey => 1, @@ -280,22 +298,24 @@ $str .= qq@

Veto

\n@; $str .= qq@\n@; $str .= qq@\n@; $str .= Hmon::MakeFooter(); Hmon::WriteFile("StartBars",$str); -$str = Hmon::MakeTitle(8, 6, "Veto / HALO",0); +$str = Hmon::MakeTitle(8, 11, "Veto / HALO",0); $str .= qq@\n@; -$str .= qq@\n@; +$str .= qq@\n@; +$str .= qq@\n@; $str .= Hmon::MakeFooter(); Hmon::WriteFile("VetoHalo",$str); $str = Hmon::MakeTitle(13, 8, "Start Position",0); $str .= qq@\n@; +$str .= Hmon::MakeFooter(); Hmon::WriteFile("StartPosition",$str); my $old; @@ -345,8 +365,8 @@ while(1) { $avgy /= $sumy if($sumy !=0); for my $c (1..16) { - $rmsx += $diff->{0x5000}[$c]*($chanx[$c]/($avgx||1E-10))**2 ; - $rmsy += $diff->{0x5001}[$c]*($chany[$c]/($avgy||1E-10))**2 ; + $rmsx += $diff->{0x5000}[$c]*($chanx[$c]-($avgx||1E-10))**2 ; + $rmsy += $diff->{0x5001}[$c]*($chany[$c]-($avgy||1E-10))**2 ; } $rmsx = sqrt($rmsx/($sumx||1E-10)); $rmsy = sqrt($rmsy/($sumy||1E-10)); @@ -363,15 +383,15 @@ while(1) { HPlot::PlotAdd("StartPosition",$rmsy,3); for my $c (1..8) { - HPlot::PlotAdd("VetoRatehist",$diff->{0x5002}[$c],$chanveto[$c]); - HPlot::PlotAdd("VetoRatehistbar",$diff->{0x5002}[$c],$chanveto[$c]); - HPlot::PlotFill("Vetobar",$diff->{0x5002}[$c],$chanveto[$c],0,$iter-9); + HPlot::PlotAdd("VetoRatehist",$diff->{0x5002}[$c],$c-1); + HPlot::PlotAdd("VetoRatehistbar",$diff->{0x5002}[$c],$c-1); + HPlot::PlotFill("Vetobar",$diff->{0x5002}[$c],$c-1,0,$iter-9); } HPlot::PlotFill("HALO",$diff->{0x5002}[9], 1,2,$iter-1); HPlot::PlotFill("HALO",$diff->{0x5002}[10],1,0,$iter-1); HPlot::PlotFill("HALO",$diff->{0x5002}[11],0,1,$iter-1); - HPlot::PlotFill("HALO",$diff->{0x5002}[12],2,1,$iter-1); + HPlot::PlotFill("HALO",$diff->{0x5002}[12],2,1,$iter-1); HPlot::PlotFill("Veto",$diff->{0x5002}[8], 0,0,$iter-1); HPlot::PlotFill("Veto",$diff->{0x5002}[3], 1,0,$iter-1); @@ -381,6 +401,16 @@ while(1) { HPlot::PlotFill("Veto",$diff->{0x5002}[5], 0,2,$iter-1); HPlot::PlotFill("Veto",$diff->{0x5002}[1], 1,2,$iter-1); HPlot::PlotFill("Veto",$diff->{0x5002}[6], 2,2,$iter-1); + + #Halo Position + my $halosum = $diff->{0x5002}[9] + $diff->{0x5002}[10] + $diff->{0x5002}[11] + $diff->{0x5002}[12]; + my $haloxpos = (-$diff->{0x5002}[10] + $diff->{0x5002}[9])/($halosum||1); + my $haloypos = (-$diff->{0x5002}[11] + $diff->{0x5002}[12])/($halosum||1); + $haloxpos = "NaN" if $halosum < 100; + $haloypos = "NaN" if $halosum < 100; + HPlot::PlotAdd("HaloPosition",$haloxpos,0); + HPlot::PlotAdd("HaloPosition",$haloypos,1); + HPlot::PlotDraw('StartRateXhist') if ($iter == 1); @@ -392,7 +422,8 @@ while(1) { HPlot::PlotDraw('StartXbar') if ($iter == 6); #dont change HPlot::PlotDraw('StartYbar') if ($iter == 7); #dont change HPlot::PlotDraw('Vetobar') if ($iter == 8); #dont change - HPlot::PlotDraw('StartPosition') if ($iter == 9); + HPlot::PlotDraw('StartPosition') if ($iter == 9); + HPlot::PlotDraw('HaloPosition') if ($iter == 10); HPlot::PlotDraw('HALO') if ($iter == 10); #dont change HPlot::PlotDraw('Veto') if ($iter == 10); #dont change $iter = 1 if ($iter++ == 10) #dont change diff --git a/hmon/hmon_timeout.pl b/hmon/hmon_timeout.pl index 43ad3d3..670b550 100755 --- a/hmon/hmon_timeout.pl +++ b/hmon/hmon_timeout.pl @@ -27,7 +27,7 @@ while (1) { if (($rh_hubs->{$board} & 0xffff) != 0x0000) { $msg .= ", " if $msg ne ""; $msg .= sprintf("%04x-%04x (",$board,$rh_hubs->{$board} & 0xffff); - foreach my $i (1..8) { + foreach my $i (1..12) { if ($rh_hubs->{$board} & (1<<$i)) { $msg .= sprintf("0x%04x ",Hmon::TraceDBGet($board,$i)); $boardlist1 .= sprintf("%04X, ",Hmon::TraceDBGet($board,$i)); @@ -36,10 +36,10 @@ while (1) { $msg .= ")"; $cnt++; } - if ((($rh_hubs->{$board}>>16) & 0xffff) != 0x0000 && (($board > 0x1000 && $board < 0x1200 && $board%16) || ($board&0xff00 == 0x8a00) || ($board&0xff00 == 0x8200))) { + if ((($rh_hubs->{$board}>>16) & 0xffff) != 0x0000 && (($board > 0x1000 && $board < 0x1200 && $board%16) || (($board&0xff00) == 0x8a00) || (($board&0xff00) == 0x8200))) { $msg2 .= ", " if $msg2 ne ""; $msg2 .= sprintf("%04x-%04x (",$board,$rh_hubs->{$board}>>16 & 0xffff); - foreach my $i (1..8) { + foreach my $i (1..12) { if ($rh_hubs->{$board} & (1<<($i+16))) { $msg2 .= sprintf(" %04x",Hmon::TraceDBGet($board,$i)); $boardlist2 .= sprintf("%04X, ",Hmon::TraceDBGet($board,$i)); diff --git a/hmon/hmon_trgsource.pl b/hmon/hmon_trgsource.pl index e8b42c2..884c0af 100755 --- a/hmon/hmon_trgsource.pl +++ b/hmon/hmon_trgsource.pl @@ -47,14 +47,14 @@ $plot->{type} = HPlot::TYPE_HISTORY; $plot->{output} = HPlot::OUT_PNG; $plot->{titles}->[0] = ""; $plot->{xlabel} = "Spill Number"; -$plot->{ylabel} = "Hodoscope Counts / Mcnt"; +$plot->{ylabel} = "Start Counts / Mcnt"; $plot->{sizex} = 630; $plot->{sizey} = 220; $plot->{nokey} = 1; $plot->{buffer} = 1; $plot->{storable} = 1; HPlot::PlotInit($plot); -my $str = Hmon::MakeTitle(8,5,"Hodoscope Counts per Spill (millions)",0); +my $str = Hmon::MakeTitle(8,5,"Start X Counts per Spill (millions)",0); $str .= qq@@; $str .= Hmon::MakeFooter(); Hmon::WriteFile("StartCountSpill",$str); @@ -239,14 +239,14 @@ my $longmsgcheck = $longmsg; my $startmsg = ""; my $startlongmsg = ""; -# foreach my $i (0..7) { -# $startsum += $rStat->{3}->[$i+0x8] ; -# } -# $spillsum += $startsum; -# - $startsum = $rStat->{3}->[0x29]; + foreach my $i (0..7) { + $startsum += $rStat->{3}->[$i+0x8] ; + } $spillsum += $startsum; +# $startsum = $rStat->{3}->[0x29]; +# $spillsum += $startsum; + ###################################### ## QA check for spill sum on Start if ($lastspillsum < 0 || $lastspillsum > 50000000) { diff --git a/hmon/index.cgi b/hmon/index.cgi index 6521224..f77240f 100755 --- a/hmon/index.cgi +++ b/hmon/index.cgi @@ -38,6 +38,7 @@ function openwin(url) { "; #
- $str .= "Layer 1Layer 2Layer 3Layer 4Layer 5Layer 6/0"; - for(my $i = 1; $i<=4; $i++) { - $str .= "Chamber $i\n"; - for(my $v = 0; $v<=1; $v++) { - $str .= "".$layerlabel[$v]." "; - for(my $s = 1; $s<=6; $s++) { - my $voltI = $data->{"Ind-$i-$s-$v-V"}->{val}; - my $currI = $data->{"Ind-$i-$s-$v-I"}->{val}; - my $tvI = strftime("%H:%M:%S",localtime($data->{"Ind-$i-$s-$v-V"}->{tme} || 0)); - my $tcI = strftime("%H:%M:%S",localtime($data->{"Ind-$i-$s-$v-I"}->{tme} || 0)); - $voltI = -1 unless defined $voltI; - $currI = -1 unless defined $currI; - my $tmpI .= sprintf(" %4i V | %3.2f uA",$voltI,$currI); - $str .= "".$tmpI; - } - } - } - $str .= "\n";#
"; #
+# $str .= "Layer 1Layer 2Layer 3Layer 4Layer 5Layer 6/0"; +# for(my $i = 1; $i<=4; $i++) { +# $str .= "Chamber $i\n"; +# for(my $v = 0; $v<=1; $v++) { +# $str .= "".$layerlabel[$v]." "; +# for(my $s = 1; $s<=6; $s++) { +# my $voltI = $data->{"Ind-$i-$s-$v-V"}->{val}; +# my $currI = $data->{"Ind-$i-$s-$v-I"}->{val}; +# my $tvI = strftime("%H:%M:%S",localtime($data->{"Ind-$i-$s-$v-V"}->{tme} || 0)); +# my $tcI = strftime("%H:%M:%S",localtime($data->{"Ind-$i-$s-$v-I"}->{tme} || 0)); +# $voltI = -1 unless defined $voltI; +# $currI = -1 unless defined $currI; +# my $tmpI .= sprintf(" %4i V | %3.2f uA",$voltI,$currI); +# $str .= "".$tmpI; +# } +# } +# } +# $str .= "\n";#
div>div { @@ -22,6 +23,7 @@ body>div>div { div#content { background:transparent !important; +/* transition: opacity .5s; */ } div.timestamp {