From: Cbm Rich Date: Mon, 17 Nov 2014 10:03:47 +0000 (+0100) Subject: Update from RICH scripts X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=f5c2652859c29185091d9534d31ed1773a800d20;p=daqtools.git Update from RICH scripts --- diff --git a/thresholds/thresholds_automatic.pl b/thresholds/thresholds_automatic.pl index a0898ee..b3f49d3 100755 --- a/thresholds/thresholds_automatic.pl +++ b/thresholds/thresholds_automatic.pl @@ -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 ); } diff --git a/thresholds/thresholds_compare.pl b/thresholds/thresholds_compare.pl index ebc2c1b..0f0e756 100755 --- a/thresholds/thresholds_compare.pl +++ b/thresholds/thresholds_compare.pl @@ -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; diff --git a/users/cern_cbmrich/ChannelMapping.pm b/users/cern_cbmrich/ChannelMapping.pm index d675007..c58f2fc 100644 --- a/users/cern_cbmrich/ChannelMapping.pm +++ b/users/cern_cbmrich/ChannelMapping.pm @@ -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; diff --git a/users/cern_cbmrich/makethresholds.sh b/users/cern_cbmrich/makethresholds.sh index d767ac2..9208b5c 100755 --- a/users/cern_cbmrich/makethresholds.sh +++ b/users/cern_cbmrich/makethresholds.sh @@ -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