Jpp test-rotations-old
the software that should make you happy
Loading...
Searching...
No Matches
sound-V:run.sh
Go to the documentation of this file.
1#!/usr/bin/env zsh
2script=${0##*/}
3
4if [ -z $JPP_DIR ]; then
5 echo "Variable JPP_DIR undefined."
6 exit
7fi
8
9source $JPP_DIR/setenv.sh $JPP_DIR >& /dev/null
10
11set_variable: DEBUG ACOUSTICS_DEBUG 2
12set_variable: WORKDIR ACOUSTICS_WORKDIR ./
13
14if do_usage $*; then
15 usage "$script <detector file> (input file)+"
16fi
17
18if (( $# < 2 )); then
19 fatal "Wrong number of arguments."
20fi
21
22set_variable DETECTOR $argv[1]
23set_array INPUT_FILES $argv[2,-1]
24
25eval `JPrintDetector -a $DETECTOR -O IDENTIFIER`
26
27JAcoustics.sh $DETECTOR_ID
28
29CHECK_EXIT_CODE
30
31awk '$1 !~ /^#/ { print $0 }' $WORKDIR/sound_velocity.txt | read A B Z0
32
33set_variable VELOCITY_TXT $WORKDIR/soundv.txt
34
35for (( VELOCITY = $A - 10.0; $VELOCITY <= $A + 10.0; VELOCITY += 0.2 )); do
36
37 rm -f $WORKDIR/katoomba.root
38
39 JKatoomba \
40 -a $DETECTOR \
41 -f "$INPUT_FILES[*]" \
42 -o $WORKDIR/katoomba.root \
43 -T $WORKDIR/tripod.txt \
44 -V "$VELOCITY $B $Z0" \
45 -M $WORKDIR/mechanics.txt \
46 -@ $WORKDIR/acoustics_fit_parameters.txt \
47 -! $WORKDIR/disable.txt \
48 -d $DEBUG --!
49
50 if (( `JPrintResult -f $WORKDIR/katoomba.root:chi2 -F "GetSumOfWeights"` > 1.0 )); then
51
52 set_array RESULT `JPrintResult -f $WORKDIR/katoomba.root:chi2 -F "GetMean" -F "GetRMS / sqrt(GetSumOfWeights)"`
53
54 printf "%12.5f %7.3f %7.3f\n" $VELOCITY $RESULT[*] >> $VELOCITY_TXT
55 else
56 error "No result."
57 fi
58done