4 source $JPP_DIR/setenv.sh $JPP_DIR >& /dev/null
 
    7 set_variable   WORKDIR                  `pwd`
 
    8 set_variable   ACOUSTICS_THREADS        10
 
   11     usage "$script [version]"\
 
   12           "\nAuxiliary script to run pre-calibrations of all detectors,"\
 
   13           "\nincluding automatic disabling of 'bad' transmissions (see JAcousticsDisable.sh)."
 
   16 if (( $# == 1 )); then
 
   19     fatal "Wrong number of arguments."
 
   23 # -----------------------------------------------------------------------------------------------
 
   24 # Run pre-calibration of given detector with optional inputs.
 
   25 # The last directory corresponds to the current detector and
 
   26 # the preceding directories to the input detectors.
 
   28 # \param 1-N   directories
 
   29 # -----------------------------------------------------------------------------------------------
 
   32     DETECTORS=($argv[1,-2])     
 
   35     DIR=$WORKDIR/${DETECTOR}.${VERSION}.A     # without disabled transmissions
 
   40     JMergeDisable -f$WORKDIR/${^DETECTORS}.${VERSION}.B/disable.txt -o disable.log
 
   41     #JMergeDisable -o disable.log
 
   43     # replace disabled transmissions by those of input detectors
 
   45     sed '/cat>disable.txt<<EOF/,/EOF/ccat>disable.txt<<EOF\n# disable transmissions\nEOF'  \
 
   46         $JPP_DIR/software/JAcoustics/pre-calibration_${DETECTOR}.sh                        >  pre-calibration_${DETECTOR}.sh
 
   47     sed -i '/disable transmissions/r disable.log'                                             pre-calibration_${DETECTOR}.sh
 
   49     chmod +x pre-calibration_${DETECTOR}.sh
 
   51     ./pre-calibration_${DETECTOR}.sh  $WORKDIR/${^DETECTORS}.${VERSION}.B  >&  pre-calibration.log
 
   54     # disable transmissions
 
   56     eval `JPrintDetector -a detector.datx -O IDENTIFIER`
 
   58     JAcousticsDisable.sh  detector.datx  KM3NeT_${(l:8::0::0:)DETECTOR_ID}_*_event.root  disable.log
 
   63     DIR=$WORKDIR/${DETECTOR}.${VERSION}.B     # with disabled transmissions
 
   68     cp $WORKDIR/${DETECTOR}.${VERSION}.A/disable.log .
 
   70     # introduce disabled transmissions
 
   72     sed '/cat>disable.txt<<EOF/,/EOF/ccat>disable.txt<<EOF\n# disable transmissions\nEOF'  \
 
   73         $JPP_DIR/software/JAcoustics/pre-calibration_${DETECTOR}.sh                        >  pre-calibration_${DETECTOR}.sh
 
   74     sed -i '/disable transmissions/r disable.log'                                             pre-calibration_${DETECTOR}.sh
 
   76     chmod +x pre-calibration_${DETECTOR}.sh
 
   78     ./pre-calibration_${DETECTOR}.sh  $WORKDIR/${^DETECTORS}.${VERSION}.B  >&  pre-calibration.log
 
   87 run  D_ORCA006             D0ORCA010
 
   88 run  D0ORCA010             D1ORCA011
 
   89 run  D1ORCA011             D0ORCA015
 
   90 run  D0ORCA015             D1ORCA015
 
   91 run  D1ORCA015             D0ORCA018
 
   97 run  D0ARCA006             D0ARCA009
 
   98 run  D0ARCA009             D0ARCA021
 
   99 run  D0ARCA021             D0ARCA028