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);
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);
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],
--- /dev/null
+#!/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@<img width="600" src="%ADDPNG files/StartRateXhistbar.png%" type="image/png"><br>\n@;
+ $str .= qq@<img src="%ADDPNG files/DutyFactor.png%" type="image/png"><br\>\n@;
+ $str .= qq@<img src="%ADDPNG files/SpillSumDuty.png%" type="image/png"><br\>\n@;
+ $str .= "<table style=\"margin:auto;\"><tr><td>Last Sum<td>".QA::SciNotation($total);
+ $str .= "<tr><td>Last Duty<td>".sprintf("%0.3f",$duty);
+ $str .= "<tr><td>Last Duration<td>".$length;
+ $str .= "<tr><td>Last Break<td>".$offtime." s";
+ $str .= "<tr><td>Last Max<td>".QA::SciNotation($max)." Hz (100ms)";
+ $str .= "</table>";
+ $str .= Hmon::MakeFooter();
+ Hmon::WriteFile("DutyFactor",$str);
+
+ $empties = 0;
+ $time = time();
+ @store = ();
+ $iter = 0;
+ }
+
+ }
+ $old = $o;
+ usleep($sampletime);
+ }
\ No newline at end of file
--- /dev/null
+#!/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@<img src="%ADDPNG files/ForwardHaloFast.png%" type="image/png">\n@;
+$str .= qq@<img src="%ADDPNG files/ForwardHaloSlow.png%" type="image/png"><br\>\n@;
+$str .= qq@<img src="%ADDPNG files/ForwardHaloPosition.png%" type="image/png">\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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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;
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;
$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;
$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;
}
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",
$old = $o;
$oldtime = time();
- sleep 2;
+ sleep 1;
}
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,
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,
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,
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",
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",
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",
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",
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",
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",
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",
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,
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,
$str .= Hmon::MakeFooter();
Hmon::WriteFile("StartRateBars",$str);
-$str = Hmon::MakeTitle(14, 8, "Start-X / Start-Y / Veto Rate / HALO",0);
+$str = Hmon::MakeTitle(13, 8, "Start-X / Start-Y / Veto Rate",0);
$str .= qq@<img src="%ADDPNG files/StartXbar.png%" type="image/png">\n@;
$str .= qq@<img src="%ADDPNG files/StartYbar.png%" type="image/png">\n@;
$str .= qq@<img src="%ADDPNG files/Vetobar.png%" type="image/png">\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@<img src="%ADDPNG files/Veto.png%" type="image/png">\n@;
-$str .= qq@<img src="%ADDPNG files/HALO.png%" type="image/png">\n@;
+$str .= qq@<img src="%ADDPNG files/HALO.png%" type="image/png"><br\>\n@;
+$str .= qq@<img src="%ADDPNG files/HaloPosition.png%" type="image/png">\n@;
$str .= Hmon::MakeFooter();
Hmon::WriteFile("VetoHalo",$str);
$str = Hmon::MakeTitle(13, 8, "Start Position",0);
$str .= qq@<img src="%ADDPNG files/StartPosition.png%" type="image/png">\n@;
+$str .= Hmon::MakeFooter();
Hmon::WriteFile("StartPosition",$str);
my $old;
$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));
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);
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);
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
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));
$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));
$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@<img src="%ADDPNG files/StartCountSpills.png%" type="image/png">@;
$str .= Hmon::MakeFooter();
Hmon::WriteFile("StartCountSpill",$str);
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) {
<div class="linkbox" style="width:730px;"><h4>Other Ressources</h4><ul>
<li style="width:600px;"><a href="files/qa.htm">QA Plots (updated every 5 minutes)</a></li>
<li style="width:500px;"><a href="files/vertex.htm">Vertex Plots (updated after each file)</a></li>
+<li style="width:500px;"><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 style="width:500px;"><a href="../logbook">Beamtime Logbook</a></li>
<li style="width:500px;"><a href="http://lxhadeb06/icinga">Icinga Server Monitoring</a>
<li style="width:500px;"><a href="../munin">Munin Server Monitoring</a></li>
<li><a href="monitor.cgi?1-window-VetoHalo">Rates for Veto & HALO</a></li>
<li><a href="monitor.cgi?1-window-StartPosition">Beam Position</a></li>
<li><a href="monitor.cgi?1-window-SpillStructure">Spill Structure from Start</a></li>
+<li><a href="monitor.cgi?1-StartRateBars-StartBars-StartPosition-VetoHalo-ForwardHalo">Beam Summary</a></li>
</ul></div>
<div class="linkbox" style="float:left"><h4>ECal</h4><ul>
<body ><!--onmousedown="stoprefresh(0);" onmouseup="stoprefresh(0);" ondblclick="stoprefresh(0);"-->
<div class="button" style="width:45px;right:-8px;" onclick="askclose();"> close </div>
<div class="button" id = "stop" style="right:35px;width:45px;" onclick="stoprefresh(1)">stop</div>
-<div class="button" id = "big" style="right:75px;width:45px;" onclick="zoom();"> bigger </div>
+<!--<div class="button" id = "big" style="right:75px;width:45px;" onclick="zoom();"> bigger </div>-->
<div id="contentback" class="blinkon"></div>
<div id="content" class="blinkon"></div>
if (currentzoom == 1) {
currentzoom = 1.5;
document.getElementById('content').style.MozTransform="scale("+currentzoom+")";
+ document.getElementById('contentback').style.MozTransform="scale("+currentzoom+")";
window.innerWidth *= zoomstep;
window.innerHeight*= zoomstep;
document.getElementById("big").innerHTML = "small";
else {
currentzoom = 1;
document.getElementById('content').style.MozTransform="scale("+currentzoom+")";
+ document.getElementById('contentback').style.MozTransform="scale("+currentzoom+")";
window.innerWidth /= zoomstep;
window.innerHeight/= zoomstep;
document.getElementById("big").innerHTML = "bigger";
xmlhttp=new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if(xmlhttp.readyState == 4) {
- if(!document.getElementById("footer")) {
- //document.getElementById("content").style.opacity="0";
+ if(!document.getElementById("footer") && !document.getElementById('logbox')) {
+ document.getElementById("content").style.opacity="0";
document.getElementById("content").innerHTML=xmlhttp.responseText;
- //setTimeout('document.getElementById("content").style.opacity="1"',100);
+ setTimeout('document.getElementById("content").style.opacity="1"',100);
+ setTimeout('document.getElementById("contentback").innerHTML=document.getElementById("content").innerHTML',200);
}
else {
document.getElementById("content").innerHTML=xmlhttp.responseText;
}
- //setTimeout('document.getElementById("contentback").innerHTML=document.getElementById("content").innerHTML',200);
if(document.getElementById('logbox')) {
if(saveScrollTop) {
my $value = sprintf("%i/652",$ChnlsOn);
my $longtext = sprintf("HV channels On: %i/652",$ChnlsOn);
- if ($ChnlsOn < 652 and $ChnlsOn >= 642){
- $qastate = QA::WARN_2;}
- if ($ChnlsOn < 642){
- $qastate = QA::ERROR_2;}
- if ($ChnlsOn == 0){
+ $qastate = QA::GetQAState('above', $ChnlsOn, @QA::EcalHvLimits);
+if ($ChnlsOn == 0){
$qastate = QA::NOTE;}
-
-
+
$str = "";
if($timer%8 == 0) {
if ($ChnlsOn>0 and $ChnlsOn<652) {
while(1) {
my $data = Perl2Epics::GetAll();
- my $str = Hmon::MakeTitle(18, 12, "MDC HV", 1, "");
+ my $str = Hmon::MakeTitle(13, 7, "MDC HV", 1, "");
$str .= "<table class=\"rates textbox\">"; #<div id=\"logbox\" class=\"textbox\" >
$str .= "<tr><th><th colspan=1>Sector 1<th colspan=1>Sector 2<th colspan=1>Sector 3<th colspan=1>Sector 4<th colspan=1>Sector 5<th colspan=1>Sector 6";
for(my $i = 1; $i<=4; $i++) {
#$str .= "<tr><th colspan=7> \n";
}
- $str .= "</table>\n ";#</div
- #~ $str .= Hmon::MakeFooter();
+ $str .= "</table>\n ";#</div
####################################################################
## CW 20. June 2016 individual layer HV:
- my $data = Perl2Epics::GetAll();
- #~ my $str = Hmon::MakeTitle(13, 6, "MDC indv. HV", 1, "");
- $str .= "<br><table class=\"rates textbox\">"; #<div id=\"logbox\" class=\"textbox\" >
- $str .= "<tr><th><th colspan=1>Layer 1<th colspan=1>Layer 2<th colspan=1>Layer 3<th colspan=1>Layer 4<th colspan=1>Layer 5<th colspan=1>Layer 6/0";
- for(my $i = 1; $i<=4; $i++) {
- $str .= "<tr><tr><th colspan=7>Chamber $i\n";
- for(my $v = 0; $v<=1; $v++) {
- $str .= "<tr><td>".$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 .= "<td title=\"$tvI / $tcI\">".$tmpI;
- }
- }
- }
- $str .= "</table>\n";#</div
- $str .= Hmon::MakeFooter();
-####################################################################
+# $str .= "<br><table class=\"rates textbox\">"; #<div id=\"logbox\" class=\"textbox\" >
+# $str .= "<tr><th><th colspan=1>Layer 1<th colspan=1>Layer 2<th colspan=1>Layer 3<th colspan=1>Layer 4<th colspan=1>Layer 5<th colspan=1>Layer 6/0";
+# for(my $i = 1; $i<=4; $i++) {
+# $str .= "<tr><tr><th colspan=7>Chamber $i\n";
+# for(my $v = 0; $v<=1; $v++) {
+# $str .= "<tr><td>".$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 .= "<td title=\"$tvI / $tcI\">".$tmpI;
+# }
+# }
+# }
+# $str .= "</table>\n";#</div
+####################################################################
+ $str .= Hmon::MakeFooter();
if(!($timer%1)) {
Hmon::WriteFile("MDCHV", $str);
use warnings;
use v5.10.0;
-my @cpus = qw |lxhadeb05 lxhadeb06 lxhadeb07 lxhadeb08 lxhadeb09 lxhadeb10 lxhadeb11 lxhadeb12 lxhadeb13 lxhaddcs03 lxhaddcs04 lxhaddcs05 lxhaddcs06 lxhadesdaq hadesdaq01 hadesdaq02 hades30 hadesp31 hades33
-lxhadeb05p lxhadeb06p lxhadeb07p lxhadeb08p lxhadeb09p lxhadeb10p lxhadeb11p lxhadeb12p lxhadeb13p lxhaddcs03p lxhaddcs04p lxhaddcs05p lxhaddcs06p lxhadesdaqp hadesdaqp01 hadesdaqp02 hadesp30 hadesp33 hadesp50 |;
+my @cpus = qw |lxhadeb05 lxhadeb06 lxhadeb07 lxhadeb08 lxhadeb09 lxhadeb10 lxhadeb11 lxhadeb12 lxhadeb13 lxhaddcs03 lxhaddcs04 lxhaddcs05 lxhaddcs06 lxhadesdaq hadesdaq01 hadesdaq02 hades30 hadesp31 hades33 lxhadeb05p lxhadeb06p lxhadeb07p lxhadeb08p lxhadeb09p lxhadeb10p lxhadeb11p lxhadeb12p lxhadeb13p lxhaddcs03p lxhaddcs04p lxhaddcs05p lxhaddcs06p lxhadesdaqp hadesdaqp01 hadesdaqp02 hadesp30 hadesp33 hadesp50 |;
for my $cpu (@cpus) {
my $c = "~/trbsoft/hadesdaq/hmon/hmon_ssh hadaq\@$cpu -N -f </dev/null &";
foreach my $i (0..(scalar @files2)-1) {
next if scalar @files2 == 0;
- $out .= "<td style='text-align:center'>";
+ $out .= "<tr><td style='text-align:center'>";
my @n = split('/',$files2[$i]);
chop $n[-1];
my ($y1,$d1,$h1,$m1,$s1,$y2,$d2,$h2,$m2,$s2) = $n[-1] =~ /.*_(\d\d)(\d\d\d)(\d\d)(\d\d)(\d\d)-[\w-][\w-](\d\d)(\d\d\d)(\d\d)(\d\d)(\d\d).*/;
margin:0px;
border:0px;
text-align:left;
+
}
body>div>div {
div#content {
background:transparent !important;
+/* transition: opacity .5s; */
}
div.timestamp {