]> jspc29.x-matter.uni-frankfurt.de Git - hadesdaq.git/commitdiff
update Hmon rate monitors
authorhadaq <jan@lxhadeb07>
Thu, 7 Jan 2021 11:40:57 +0000 (12:40 +0100)
committerhadaq <jan@lxhadeb07>
Thu, 7 Jan 2021 11:40:57 +0000 (12:40 +0100)
hmon/hmon_ecalrate.pl
hmon/hmon_frpcrate.pl [new file with mode: 0755]
hmon/hmon_itofrate.pl [new file with mode: 0755]
hmon/hmon_rpcrate.pl
hmon/hmon_startratesimple.pl [new file with mode: 0755]
hmon/hmon_tofrate.pl
hmon/permanent/hmon_qa.pl
hub/startup.script

index b5f34e24467bfd98042a3820209739d1326af6a4..9c3b3fc3b4689e741c31b2a750c140576c85ff19 100755 (executable)
@@ -104,7 +104,7 @@ xmax    => 47.5,
 cbmax   => "100<*<1E5",
 cbmin   => 0,
 noinit  => 1,
-additional => "set logscale cb;set format cb \"_{10}{\%L}\"",
+additional => "set logscale cb;unset ytics;set format cb \"_{10}{\%L}\"",
 showvalues => 0,  });  
   
 my $str  = Hmon::MakeTitle(16, 20, "ECal Hit Rate",0);
diff --git a/hmon/hmon_frpcrate.pl b/hmon/hmon_frpcrate.pl
new file mode 100755 (executable)
index 0000000..ca27996
--- /dev/null
@@ -0,0 +1,110 @@
+#!/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];
+
+use Encode qw(encode from_to);
+use JSON::XS;
+
+
+my $plot1 = {
+name    => "FrpcRate",
+file    => "files/FrpcRate",
+title   => "fRPC Rate",
+entries => 16,
+curves  => 20,
+type    => HPlot::TYPE_HEATMAP,
+output  => HPlot::OUT_PNG,
+zlabel  => "Hitrate",
+sizex   => 310,
+sizey   => 310,
+nokey   => 1,
+buffer  => 1,
+ymin    => 19.5,
+ymax    => -0.5,
+xmin    => -0.5,
+xmax    => 15.5,
+cbmax   => "100<*<1E5",
+cbmin   => 0,
+noinit  => 1,
+additional => "set logscale cb;unset ytics;set format cb \"_{10}{\%L}\"",
+showvalues => 0,  };
+HPlot::PlotInit($plot1);
+
+
+my $str  = Hmon::MakeTitle(4, 7, "fRPC Hit Rate",0);
+$str .= qq@<img src="%ADDPNG files/FrpcRate.png%" type="image/png"><br>\n@;
+
+$str .= Hmon::MakeFooter();
+Hmon::WriteFile("FrpcRate",$str);
+
+
+my $old;
+my $oldtime = time();
+my $time = time();
+my $diff;
+my $iter = 0;
+
+
+
+trb_init_ports() or die trb_strerror();
+
+
+while(1) {
+  #my $data;
+  #my $max = 0 ;
+  #my $min = 5E9;
+  
+  my $o = trb_register_read_mem(0xfe47,0xc000,0,33) or die trb_strerror() or sleep 5 and next;
+
+  if (defined $old) {
+    my $tdiff = (time() - $oldtime)|1;
+    foreach my $b (keys %$o) {
+      #my $ratesum = 0;
+      next unless ($b>=0x6800 && $b<=0x68ff);
+      my $xpos =  ($b&0xF)*2 + ($b>>4 & 0xF)*10;
+
+      for my $v (0..31) {
+        my $vdiff = ($o->{$b}->[$v+1]&0xfffffff) - ($old->{$b}->[$v+1]&0xfffffff);
+        
+        if ($vdiff < 0) { $vdiff += 2**28;}
+        $diff->{$b}->[$v+1] = $vdiff/$tdiff;
+        #$ratesum += $diff->{$b}->[$v+1];
+        HPlot::PlotFill('FrpcRate',$diff->{$b}->[$v+1],$v%16,$xpos+$v/16);
+        }
+      #my $s = sprintf("0x%04x",$b);
+      #$data->{$s}= int(100*($ratesum / 32) +0.5) /100;
+      
+      #$min = $data->{$s} if $data->{$s} < $min;
+      #$max = $data->{$s} if  $data->{$s}> $max;
+      }
+    HPlot::PlotDraw('FrpcRate');    
+    
+    
+    
+   # $data->{max} = $max;
+   # $data->{min} = $min;
+   # $data->{symbol} = " Hits/s";
+   # $data->{title} = "Mean DiRICH TDC Rate";
+    
+   
+   # $data->{updatetime} = getTimeString; 
+    
+   # my $fh;
+   # open($fh, ">", Hmon::HMONDIR."/files/richMeanRateDiRICH.json");
+   # print $fh   encode_json($data);
+   # close $fh;
+   }
+    
+  $old = $o;
+  $oldtime = time();
+  sleep 1;
+  }
diff --git a/hmon/hmon_itofrate.pl b/hmon/hmon_itofrate.pl
new file mode 100755 (executable)
index 0000000..24db645
--- /dev/null
@@ -0,0 +1,110 @@
+#!/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];
+
+use Encode qw(encode from_to);
+use JSON::XS;
+
+
+my $plot1 = {
+name    => "ItofRate",
+file    => "files/ItofRate",
+title   => "iTOF Rate",
+entries => 16,
+curves  => 24,
+type    => HPlot::TYPE_HEATMAP,
+output  => HPlot::OUT_PNG,
+zlabel  => "Hitrate",
+sizex   => 310,
+sizey   => 310,
+nokey   => 1,
+buffer  => 1,
+ymin    => 23.5,
+ymax    => -0.5,
+xmin    => -0.5,
+xmax    => 15.5,
+cbmax   => "100<*<1E5",
+cbmin   => 0,
+noinit  => 1,
+additional => "set logscale cb;unset ytics;set format cb \"_{10}{\%L}\"",
+showvalues => 0,  };
+HPlot::PlotInit($plot1);
+
+
+my $str  = Hmon::MakeTitle(4, 7, "iTOF Hit Rate",0);
+$str .= qq@<img src="%ADDPNG files/ItofRate.png%" type="image/png"><br>\n@;
+
+$str .= Hmon::MakeFooter();
+Hmon::WriteFile("ItofRate",$str);
+
+
+my $old;
+my $oldtime = time();
+my $time = time();
+my $diff;
+my $iter = 0;
+
+
+
+trb_init_ports() or die trb_strerror();
+
+
+while(1) {
+  #my $data;
+  #my $max = 0 ;
+  #my $min = 5E9;
+  
+  my $o = trb_register_read_mem(0xfe74,0xc000,0,49) or die trb_strerror() or sleep 5 and next;
+
+  if (defined $old) {
+    my $tdiff = (time() - $oldtime)|1;
+    foreach my $b (keys %$o) {
+      #my $ratesum = 0;
+      next unless ($b>=0x5d00 && $b<=0x5dff);
+      my $xpos =  ($b&0xF)*4;
+
+      for my $v (0..47) {
+        my $vdiff = ($o->{$b}->[$v+1]&0xfffffff) - ($old->{$b}->[$v+1]&0xfffffff);
+        
+        if ($vdiff < 0) { $vdiff += 2**28;}
+        $diff->{$b}->[$v+1] = $vdiff/$tdiff;
+        #$ratesum += $diff->{$b}->[$v+1];
+        HPlot::PlotFill('ItofRate',$diff->{$b}->[$v+1],$v%16,$xpos+$v/16);
+        }
+      #my $s = sprintf("0x%04x",$b);
+      #$data->{$s}= int(100*($ratesum / 32) +0.5) /100;
+      
+      #$min = $data->{$s} if $data->{$s} < $min;
+      #$max = $data->{$s} if  $data->{$s}> $max;
+      }
+    HPlot::PlotDraw('ItofRate');    
+    
+    
+    
+   # $data->{max} = $max;
+   # $data->{min} = $min;
+   # $data->{symbol} = " Hits/s";
+   # $data->{title} = "Mean DiRICH TDC Rate";
+    
+   
+   # $data->{updatetime} = getTimeString; 
+    
+   # my $fh;
+   # open($fh, ">", Hmon::HMONDIR."/files/richMeanRateDiRICH.json");
+   # print $fh   encode_json($data);
+   # close $fh;
+   }
+    
+  $old = $o;
+  $oldtime = time();
+  sleep 1;
+  }
index a201324e8a33828682ec5f426fe81c22641854e7..b1ab32c21bea106afe555c91504f4c07ed399482 100755 (executable)
@@ -35,7 +35,7 @@ xmax    => 47.5,
 cbmax   => "100<*<1E5",
 cbmin   => 0,
 noinit  => 1,
-additional => "set logscale cb;set format cb \"_{10}{\%L}\"",
+additional => "set logscale cb;unset ytics;set format cb \"_{10}{\%L}\"",
 showvalues => 0,  };
 HPlot::PlotInit($plot1);
 
diff --git a/hmon/hmon_startratesimple.pl b/hmon/hmon_startratesimple.pl
new file mode 100755 (executable)
index 0000000..0a6acb9
--- /dev/null
@@ -0,0 +1,110 @@
+#!/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];
+
+use Encode qw(encode from_to);
+use JSON::XS;
+
+
+my $plot1 = {
+name    => "StartRateSimple",
+file    => "files/StartRateSimple",
+title   => "Start Rate",
+entries => 16,
+curves  => 16,
+type    => HPlot::TYPE_HEATMAP,
+output  => HPlot::OUT_PNG,
+zlabel  => "Hitrate",
+sizex   => 310,
+sizey   => 310,
+nokey   => 1,
+buffer  => 1,
+ymin    => 15.5,
+ymax    => -0.5,
+xmin    => -0.5,
+xmax    => 15.5,
+cbmax   => "100<*<1E5",
+cbmin   => 0,
+noinit  => 1,
+additional => "set logscale cb;unset ytics;set format cb \"_{10}{\%L}\"",
+showvalues => 0,  };
+HPlot::PlotInit($plot1);
+
+
+my $str  = Hmon::MakeTitle(4, 7, "Start Hit Rate",0);
+$str .= qq@<img src="%ADDPNG files/StartRateSimple.png%" type="image/png"><br>\n@;
+
+$str .= Hmon::MakeFooter();
+Hmon::WriteFile("StartRateSimple",$str);
+
+
+my $old;
+my $oldtime = time();
+my $time = time();
+my $diff;
+my $iter = 0;
+
+
+
+trb_init_ports() or die trb_strerror();
+
+
+while(1) {
+  #my $data;
+  #my $max = 0 ;
+  #my $min = 5E9;
+  
+  my $o = trb_register_read_mem(0xfe74,0xc000,0,49) or die trb_strerror() or sleep 5 and next;
+
+  if (defined $old) {
+    my $tdiff = (time() - $oldtime)|1;
+    foreach my $b (keys %$o) {
+      #my $ratesum = 0;
+      next unless ($b>=0x5000 && $b<=0x500f);
+      my $xpos =  ($b&0xF)*4;
+
+      for my $v (0..47) {
+        my $vdiff = ($o->{$b}->[$v+1]&0xfffffff) - ($old->{$b}->[$v+1]&0xfffffff);
+        
+        if ($vdiff < 0) { $vdiff += 2**28;}
+        $diff->{$b}->[$v+1] = $vdiff/$tdiff;
+        #$ratesum += $diff->{$b}->[$v+1];
+        HPlot::PlotFill('StartRateSimple',$diff->{$b}->[$v+1],$v%16,$xpos+$v/16);
+        }
+      #my $s = sprintf("0x%04x",$b);
+      #$data->{$s}= int(100*($ratesum / 32) +0.5) /100;
+      
+      #$min = $data->{$s} if $data->{$s} < $min;
+      #$max = $data->{$s} if  $data->{$s}> $max;
+      }
+    HPlot::PlotDraw('StartRateSimple');    
+    
+    
+    
+   # $data->{max} = $max;
+   # $data->{min} = $min;
+   # $data->{symbol} = " Hits/s";
+   # $data->{title} = "Mean DiRICH TDC Rate";
+    
+   
+   # $data->{updatetime} = getTimeString; 
+    
+   # my $fh;
+   # open($fh, ">", Hmon::HMONDIR."/files/richMeanRateDiRICH.json");
+   # print $fh   encode_json($data);
+   # close $fh;
+   }
+    
+  $old = $o;
+  $oldtime = time();
+  sleep 1;
+  }
index 9642182c6c2e20824e8f5c720f40082a9bd9cf3e..5ce70b00c0798dddaf55b207356a38f06819d866 100755 (executable)
@@ -19,19 +19,19 @@ my $plot1 = {
 name    => "TofRate",
 file    => "files/TofRate",
 title   => "TOF Rate",
-entries => 16,
-curves  => 60,
+entries => 32,
+curves  => 30,
 type    => HPlot::TYPE_HEATMAP,
 output  => HPlot::OUT_PNG,
 zlabel  => "Hitrate",
-sizex   => 310,
+sizex   => 470,
 sizey   => 310,
 nokey   => 1,
 buffer  => 1,
-ymin    => 59.5,
+ymin    => 29.5,
 ymax    => -0.5,
 xmin    => -0.5,
-xmax    => 15.5,
+xmax    => 31.5,
 cbmax   => "100<*<1E5",
 cbmin   => 0,
 noinit  => 1,
@@ -40,7 +40,7 @@ showvalues => 0,  };
 HPlot::PlotInit($plot1);
 
 
-my $str  = Hmon::MakeTitle(4, 7, "TOF Hit Rate",0);
+my $str  = Hmon::MakeTitle(6, 7, "TOF Hit Rate",0);
 $str .= qq@<img src="%ADDPNG files/TofRate.png%" type="image/png"><br>\n@;
 
 $str .= Hmon::MakeFooter();
@@ -70,7 +70,7 @@ while(1) {
     foreach my $b (keys %$o) {
       #my $ratesum = 0;
       next unless ($b>=0x5c00 && $b<=0x5cff);
-      my $xpos =  (($b>>4)&0xF)*10 + ($b&0xF)*2;
+      my $xpos =  (($b>>4)&0xF)*5 + ($b&0xF);
 
       for my $v (0..31) {
         my $vdiff = ($o->{$b}->[$v+1]&0xfffffff) - ($old->{$b}->[$v+1]&0xfffffff);
@@ -78,7 +78,7 @@ while(1) {
         if ($vdiff < 0) { $vdiff += 2**28;}
         $diff->{$b}->[$v+1] = $vdiff/$tdiff;
         #$ratesum += $diff->{$b}->[$v+1];
-        HPlot::PlotFill('TofRate',$diff->{$b}->[$v+1],$v%16,$xpos+$v/16);
+        HPlot::PlotFill('TofRate',$diff->{$b}->[$v+1],$v,$xpos);
         }
       #my $s = sprintf("0x%04x",$b);
       #$data->{$s}= int(100*($ratesum / 32) +0.5) /100;
index 57d678390328031af82563c92c769abb42a34e24..f5736dc8e3058d191ef38bef7b2feaa59f930818 100755 (executable)
@@ -43,7 +43,7 @@ while($a = <FLOG>) {
 #Generate output file at most once per second
   if($oldtime < time) {
     $oldtime = scalar time();
-    $str  = Hmon::MakeTitle(7,14,"Tactical Overview",1);
+    $str  = Hmon::MakeTitle(7,16,"Tactical Overview",1);
     $str .= "<div class=\"QA\">";
     foreach my $c (@{$entries->{'cats'}}) {
       $str .= "<div class=\"header\" style=\"clear:both\">$cats->{$c}</div>\n";
index 9f727e55568538494eba626fdf3be607f88bd9d3..80bfa0fdc445c1b92d63a42ee9639c5a4ab868dc 100644 (file)
@@ -1,16 +1,19 @@
-# #Assign addresses
-# !ifndef RESTART 
-#   set_addresses  serials_hub.db  addresses_hub.db     #addresses for old hubs
-#   set_addresses  serials_trb3.db  addresses_hub_trb3.db     #addresses for hubs
-#   set_addresses  serials_trb3sc.db  addresses_hub_trb3sc.db     #addresses for hubs
-#   set_addresses  serials_mdcaddon.db  addresses_mdcaddon.db     #addresses for addons  
-# !endif
-# wait
 
 
 exec_cmd{local} ~/trbsoft/daq/main/merge_serial_address.pl  ~/trbsoft/daq/hub/serials_trb3.db      ~/trbsoft/daq/hub/addresses_hub_trb3.db     #addresses for hubs
 exec_cmd{local} ~/trbsoft/daq/main/merge_serial_address.pl  ~/trbsoft/daq/hub/serials_trb3sc.db    ~/trbsoft/daq/hub/addresses_hub_trb3sc.db     #addresses for hubs
 exec_cmd{local} ~/trbsoft/daq/main/merge_serial_address.pl  ~/trbsoft/daq/hub/serials_mdcaddon.db  ~/trbsoft/daq/hub/addresses_mdcaddon.db     #addresses for addons  
+wait
+
+  trbcmd w 0xfffe 0xc5 0x4000
+
+
+
+#Retransmission on as early as possible
+ trbcmd setbit 0xfffd 0x22 0x08000000   #enable retransmission on oep
+ trbcmd setbit 0xfe11 0x22 0x08000000   #enable retransmission on mdchub
+
 
 
 #Switch off Trigger Generation Boards from trigger
@@ -30,9 +33,6 @@ trbcmd clearbit 0x8810 0xc1 0x4
 trbcmd clearbit 0x8000 0xc0 0x200 #remove pexor from trigger
 trbcmd clearbit 0x8000 0xc1 0x200
 
-
-
-wait
 #Configure GbE
   load_register  register_configgbe.db