4if [ -z $JPP_DIR ]; then
 
    5    echo "Variable JPP_DIR undefined."
 
    9source $JPP_DIR/setenv.sh $JPP_DIR >& /dev/null
 
   11set_variable:  DEBUG           ACOUSTICS_DEBUG          2
 
   12set_variable:  WORKDIR         ACOUSTICS_WORKDIR        ./
 
   13set_variable:  QUALITY_FACTOR  ACOUSTICS_QUALITYFACTOR  2.0e3
 
   16    usage "$script <detector identifier> (run[-run])+"\
 
   17          "\nAuxiliary script to download acoustic data from database."
 
   21    set_variable  DETID           $argv[1]
 
   22    set_array     RUNS            $argv[2,-1]
 
   24    fatal "Wrong number of arguments."
 
   30let "NUMBER_OF_ERRORS = 0"
 
   34set_variable  DETECTOR_ID  `getDetector -D $DETID -O int`
 
   36BUFFER=(`JRuns -D $DETECTOR_ID -F RUN`)
 
   38for RUN in ${RUNS:*BUFFER}; do
 
   40    set_variable  OUTPUT_FILE   $WORKDIR/KM3NeT_${(l:8::0::0:)DETECTOR_ID}_${(l:8::0::0:)RUN}_toa.root
 
   42    if [[ ! -f $OUTPUT_FILE ]]; then
 
   45            -@ "detid  = `getDetector -D $DETID -O string`"  \
 
   48            -@ "QUALITYFACTOR >= $QUALITY_FACTOR"            \
 
   52        if (( $? != 0 )); then
 
   53            let "NUMBER_OF_ERRORS = $NUMBER_OF_ERRORS + 1"
 
   58if (( $NUMBER_OF_ERRORS != 0 )); then
 
   59    error "Number of errors $NUMBER_OF_ERRORS"