Jpp test-rotations-old
the software that should make you happy
Loading...
Searching...
No Matches
software/JAcoustics/JToA.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 ./
13set_variable: QUALITY_FACTOR ACOUSTICS_QUALITYFACTOR 2.0e3
14
15if do_usage $*; then
16 usage "$script <detector identifier> (run[-run])+"\
17 "\nAuxiliary script to download acoustic data from database."
18fi
19
20if (( $# > 1 )); then
21 set_variable DETID $argv[1]
22 set_array RUNS $argv[2,-1]
23else
24 fatal "Wrong number of arguments."
25fi
26
27JCookie.sh
28
29
30let "NUMBER_OF_ERRORS = 0"
31
32expand_array RUNS
33
34set_variable DETECTOR_ID `getDetector -D $DETID -O int`
35
36BUFFER=(`JRuns -D $DETECTOR_ID -F RUN`)
37
38for RUN in ${RUNS:*BUFFER}; do
39
40 set_variable OUTPUT_FILE $WORKDIR/KM3NeT_${(l:8::0::0:)DETECTOR_ID}_${(l:8::0::0:)RUN}_toa.root
41
42 if [[ ! -f $OUTPUT_FILE ]]; then
43
44 JToA \
45 -@ "detid = `getDetector -D $DETID -O string`" \
46 -@ "minrun = $RUN" \
47 -@ "maxrun = $RUN" \
48 -@ "QUALITYFACTOR >= $QUALITY_FACTOR" \
49 -o $OUTPUT_FILE \
50 -d $DEBUG --!
51
52 if (( $? != 0 )); then
53 let "NUMBER_OF_ERRORS = $NUMBER_OF_ERRORS + 1"
54 fi
55 fi
56done
57
58if (( $NUMBER_OF_ERRORS != 0 )); then
59 error "Number of errors $NUMBER_OF_ERRORS"
60fi