From: Hadaq Date: Mon, 20 Jun 2016 17:08:11 +0000 (+0200) Subject: direction check, mt X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=7664c39fa02233164068a52c070a9f07090d996d;p=daqtools.git direction check, mt --- diff --git a/thresholds/thresholds_automatic.pl b/thresholds/thresholds_automatic.pl index 2e34d71..b6dd1d6 100755 --- a/thresholds/thresholds_automatic.pl +++ b/thresholds/thresholds_automatic.pl @@ -86,6 +86,10 @@ if ($offset) { #print "called with offset: $offset\n"; } +if ($default_direction =! 1 && $default_direction =! -1) { + die "direction can only be 1 or -1"; +} + die "wrong number format for chain parameter: \"$chain\"" unless $chain =~ /^\d+$/; if($endpoint !~ /^0x/) { @@ -96,8 +100,6 @@ if($endpoint !~ /^0x/) { $endpoint = hex($endpoint); - - # go to the right position my $hitchannel_multiplicator = 1; @@ -137,9 +139,9 @@ if ($opt_finetune == true) { print Dumper \@current_thresh; $interval_step = 4; - } + my $hit_diff = 0; my $number_of_steps = 0; @@ -345,7 +347,7 @@ my $rh_res; $command = $fixed_bits | ($current_channel << 16) ; my $rh_res = Dmon::PadiwaSendCmd($command,$endpoint, $chain); - push (@thresh , $rh_res->{$endpoint}); + push (@thresh , 0xffff & $rh_res->{$endpoint}); } #sleep 10 if($current_channel == 15 && $chain==1); @@ -471,7 +473,7 @@ polarity: tells what the status of bit 32 is in the TDC, when the thresholds are as green fields and therefore the padiwas need an invert of the outputs for negative signals direction: what do you want to detect: negative pulses: direction = 1 (default) - positive pulses: direction = 0 + positive pulses: direction = -1 32channel: when set the tool assums a TDC with 32 channels, leading and trailing channels use two channels finetune: tries to optimize the thresholds beginning with the current ones