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 );
}
use strict;
use POSIX qw(strftime);
use FileHandle;
-use lib "../../tools";
-use lib ".";
use HPlot;
use Data::Dumper;
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";
$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;
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;
#!/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
#
# ./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