]> jspc29.x-matter.uni-frankfurt.de Git - daqtools.git/commitdiff
Update from RICH scripts
authorCbm Rich <richdaq@wuppertal>
Mon, 17 Nov 2014 10:03:47 +0000 (11:03 +0100)
committerCbm Rich <richdaq@wuppertal>
Mon, 17 Nov 2014 10:03:47 +0000 (11:03 +0100)
thresholds/thresholds_automatic.pl
thresholds/thresholds_compare.pl
users/cern_cbmrich/ChannelMapping.pm
users/cern_cbmrich/makethresholds.sh

index a0898ee8e6bacb276417852cc19df05f6fb143f3..b3f49d36d5ddd20c972af68fc23a8bc4dc0165f5 100755 (executable)
@@ -244,6 +244,7 @@ foreach my $i (reverse (0..3)) {
 my $str;
 #$logger_data->info("thresholds have been set to the following values:");
 #$logger_data->info(sprintf "endpoint: %04x, chain: %02d, uid: $uid", $endpoint, $chain);
+$logger_data->info("\t".time);
 foreach my $i (0..15) {
   $logger_data->info(sprintf "endpoint: 0x%04x, chain: %02d, channel: %2d threshold: 0x%04x, uid: %s", $endpoint, $chain, $i, $best_thresh[$i], $uid );
 }
index ebc2c1ba952e9b661d9edee04477038281405f76..0f0e756f051ff893dfb2a6acc2726c528c8d3a97 100755 (executable)
@@ -4,8 +4,6 @@ use warnings;
 use strict;
 use POSIX qw(strftime);
 use FileHandle;
-use lib "../../tools";
-use lib ".";
 use HPlot;
 use Data::Dumper;
 use ChannelMapping;
@@ -13,8 +11,8 @@ use ChannelMapping;
 my $plot2 = ();
 $plot2->{name}    = "HeatmapRich";
 $plot2->{file}    = "thresh_heatmap";
-$plot2->{entries} = 33;
-$plot2->{curves}  = 33;
+$plot2->{entries} = $ChannelMapping::chanmap->{xsize}+1;
+$plot2->{curves}  = $ChannelMapping::chanmap->{ysize}+1;
 $plot2->{type}    = HPlot::TYPE_HEATMAP;
 $plot2->{output}  = HPlot::OUT_PNG;
 $plot2->{zlabel}  = "Hitrate";
@@ -23,9 +21,9 @@ $plot2->{sizey}   = 650;
 $plot2->{nokey}   = 1;
 $plot2->{buffer}  = 0;
 $plot2->{xmin}    = 0.5;
-$plot2->{xmax}    = 32.5;
+$plot2->{xmax}    = $ChannelMapping::chanmap->{xsize}+0.5;
 $plot2->{ymin}    = 0.5;
-$plot2->{ymax}    = 32.5;
+$plot2->{ymax}    = $ChannelMapping::chanmap->{ysize}+0.5;
 $plot2->{cbmin}   = "-400<*";
 $plot2->{cbmax}   = "*<400";
 $plot2->{showvalues} = 0;
@@ -58,18 +56,19 @@ sub readSettings {
   my $fn1 = $ARGV[0] or die("usage: thresholds_compare.pl file1 [file2]. omit file2 to get abs value, include for file1-file2");
   my $fn2 = $ARGV[1];
 
+  my $totalsize = ($ChannelMapping::chanmap->{xsize}*$ChannelMapping::chanmap->{ysize});
   my %threshs1 = readSettings($fn1);
-  print "WARNING: Expected 1024 settings in $fn1. Got " . scalar(keys %threshs1) unless scalar(keys %threshs1) == 1024
+  print "WARNING: Expected ".$totalsize." settings in $fn1. Got " . scalar(keys %threshs1) unless scalar(keys %threshs1) == $totalsize
 
   my %threshs2 = ();
   if ($fn2) {
     %threshs2 = readSettings($fn2);
-    print "WARNING: Expected 1024 settings in $fn2. Got " . scalar(keys %threshs2) unless scalar(keys %threshs2) == 1024
+    print "WARNING: Expected ".$totalsize." settings in $fn2. Got " . scalar(keys %threshs2) unless scalar(keys %threshs2) == $totalsize
   }
 
 # plot heatmap
-  for my $x (1..32) {
-    for my $y (1..32) {
+  for my $x (1..$ChannelMapping::chanmap->{xsize}) {
+    for my $y (1..$ChannelMapping::chanmap->{ysize}) {
       my $fpga    = $ChannelMapping::chanmap->{fpga}->[$x]->[$y];
       my $channel = ($ChannelMapping::chanmap->{chan}->[$x]->[$y]-1)/2;
       
index d675007b072d6eda2ac168df1e0d6aa2e8ac0934..c58f2fc1868282bb94b97f89f7ca8fc4dcd187c1 100644 (file)
@@ -3,6 +3,8 @@ use warnings;
 use strict;
 
 our $chanmap;
+$chanmap->{xsize} = 32;
+$chanmap->{ysize} = 32;
 
 $chanmap->{fpga}->[32]->[ 32]=0x0010;
 $chanmap->{fpga}->[32]->[ 31]=0x0010;
index d767ac2eedc6b9793f7cc5529d0c9e66e7d1ecea..9208b5cf7210101b8c8b28081c81b7da35026764 100755 (executable)
@@ -1,8 +1,23 @@
 #!/bin/bash
 rm padiwa_threshold_results.log
-./write_thresholds.pl thresh/dummythresholds.thr -o 0
+./write_thresholds.pl thresh/dummythresholds.thr -o 0
 trbcmd setbit 0x7005 0xa00c 0x80000000
 
+./run_thresh_on_system.pl --endpoints=0x0010-0x0013,0x0020-0x0023,0x0030-0x0033,0x0040-0x0043,0x0050-0x0053,0x0060-0x0063,0x0070-0x0073,0x0080-0x0083,0x0090-0x0093,0x00a0-0x00a3,0x00b0-0x00b3,0x00c0-0x00c3,0x00d0-0x00d3,0x00e0-0x00e3,0x00f0-0x00f3,0x0100-0x0103\
+  --32channel --chains=0 --offset=0 --polarity 1  --tool ./thresholds_new.pl 
+
+export TIMEST=`date +%Y%m%d%H%M`
+
+mv padiwa_threshold_results.log thresh/$TIMEST.thr
+
+./write_thresholds.pl thresh/$TIMEST.thr -o 0
+trbcmd clearbit 0x7005 0xa00c 0x80000000
+
+
+
+
+
+
 # ./run_thresh_on_system.pl \
 #  --endpoints=0x0013,0x0021,0x0033,0x0041,0x0053,0x0061,0x0073,0x0081,0x0093,0x00a1,0x00b3,0x00c1,0x00d3,0x00e1,0x00f3,0x0101 \
 #  --32channel --chains=0 --offset=0 --polarity 1 
@@ -22,9 +37,3 @@ trbcmd setbit 0x7005 0xa00c 0x80000000
 # 
 # ./run_thresh_on_system.pl --endpoints=0x0010-0x0013,0x0020-0x0023,0x0030-0x0033,0x0040-0x0043,0x0050-0x0053,0x0060-0x0063,0x0070-0x0073,0x0080-0x0083,0x0090-0x0093,0x00a0-0x00a3,0x00b0-0x00b3,0x00c0-0x00c3,0x00d0-0x00d3,0x00e0-0x00e3,0x00f0-0x00f3,0x0100-0x0103\
 #   --32channel --chains=0 --offset=0 --polarity 0 --tool ./thresholds_automatic.pl
-
-./run_thresh_on_system.pl --endpoints=0x0010-0x0013,0x0020-0x0023,0x0030-0x0033,0x0040-0x0043,0x0050-0x0053,0x0060-0x0063,0x0070-0x0073,0x0080-0x0083,0x0090-0x0093,0x00a0-0x00a3,0x00b0-0x00b3,0x00c0-0x00c3,0x00d0-0x00d3,0x00e0-0x00e3,0x00f0-0x00f3,0x0100-0x0103\
-  --32channel --chains=0 --offset=0 --polarity 1  --tool ./thresholds_new.pl 
-
-./write_thresholds.pl padiwa_threshold_results.log -o 0
-trbcmd clearbit 0x7005 0xa00c 0x80000000