4# --------------------------------------------------------------------------------------------
6# Steering script for the creep correction of the D1ARCA030 (267) BC strings.
8# The D1ARCA051 detector (ID 277) is used as a starting point since it already contains
9# the optimized geometry of the D1ARCA030 BC strings. Only the BC strings are kept,
10# and the creep correction is applied using runs from the D1ARCA051 period (27923-27938).
12# --------------------------------------------------------------------------------------------
14if [ -z $JPP_DIR ]; then
15 echo "Variable JPP_DIR undefined."
19source $JPP_DIR/setenv.sh $JPP_DIR >& /dev/null
21set_variable DETECTOR_ID 277
22set_array RUNS 27923-27938
23set_variable WORKDIR `pwd`
27 usage "$script <source directory>"\
28 "\nThe source directory corresponds to a pre-calibrated D1ARCA030 detector."
31source JAcousticsToolkit.sh
33# Retrieve detector and auxiliary files from calibration archive and JPP inputs
34getFile.sh $CALIBRATION_ARCHIVE 267 1 tripod $WORKDIR/tripod
35getFile.sh $CALIBRATION_ARCHIVE 267 1 waveform $WORKDIR/waveform
36getFile.sh $CALIBRATION_ARCHIVE 267 1 disable $WORKDIR/disable
37getFile.sh $CALIBRATION_ARCHIVE 267 1 hydrophone $WORKDIR/hydrophone
38getFile.sh $CALIBRATION_ARCHIVE 267 1 transmitter $WORKDIR/transmitter
39getFile.sh $JPP_DIR/inputs 267 1 acoustics_fit_parameters $WORKDIR/acoustics_fit_parameters
40getFile.sh $JPP_DIR/inputs 267 1 sound_velocity $WORKDIR/sound_velocity
41getFile.sh $JPP_DIR/inputs 267 1 acoustics_trigger_parameters $WORKDIR/acoustics_trigger_parameters
42getFile.sh $JPP_DIR/inputs 267 1 mechanics $WORKDIR/mechanics
44set_variable DETECTOR_INITIAL detector_initial.datx
45set_variable DETECTOR detector.datx
55# Keep only BC sector strings (1-32)
62 -a $DETECTOR_INITIAL \
66cp -p detector.datx detector_D1ARCA030_before_creep.datx
69JAcousticsEventBuilder.sh $DETECTOR $RUNS[*]
71INPUT_FILES=(`ls KM3NeT_${(l:8::0::0:)DETECTOR_ID}_0*${^RUNS}_event.root`)
73JKatoomba.sh $DETECTOR $INPUT_FILES[*] katoomba.root