6echo JPP_DIR IS $JPP_DIR
8if [ -z $JPP_DIR ]; then
9 echo "Variable JPP_DIR undefined."
13source $JPP_DIR/setenv.sh $JPP_DIR >& /dev/null
16set_variable WORKDIR `pwd`
17set_variable ACOUSTICS_THREADS 32
20 usage "$script [version]"\
21 "\nAuxiliary script to run pre-calibrations of all detectors,"\
22 "\nincluding automatic disabling of 'bad' transmissions (see JAcousticsDisable.sh)."
28 fatal "Wrong number of arguments."
32# -----------------------------------------------------------------------------------------------
33# Run pre-calibration of given detector with optional inputs.
34# The last directory corresponds to the target detector and
35# the optional preceding directories to the source detectors.
37# \param 1-N directories
38# -----------------------------------------------------------------------------------------------
41 DETECTORS=($argv[1,-2])
44 if [[ ! -f $JPP_DIR/software/JAcoustics/pre-calibration_${DETECTOR}.sh ]]; then
45 fatal "No calibration for detector $DETECTOR."
48 DIR=$WORKDIR/${DETECTOR}.${VERSION}.A # without disabled transmissions
50 if [[ ! -d $DIR ]]; then
55 JMergeDisable -f$WORKDIR/${^DETECTORS}.${VERSION}.B/disable.txt -o disable.log
57 # replace disabled transmissions by those of input detectors
59 sed '/cat>disable.txt<<EOF/,/EOF/ccat>disable.txt<<EOF\n# disable transmissions\nEOF' \
60 $JPP_DIR/software/JAcoustics/pre-calibration_${DETECTOR}.sh > pre-calibration_${DETECTOR}.sh
61 sed -i '/disable transmissions/r disable.log' pre-calibration_${DETECTOR}.sh
63 chmod +x pre-calibration_${DETECTOR}.sh
65 ./pre-calibration_${DETECTOR}.sh $WORKDIR/${^DETECTORS}.${VERSION}.B >& pre-calibration.log
68 # disable transmissions
69 eval `JPrintDetector -a detector.datx -O IDENTIFIER`
70 JPrintDetector -a detector.datx -O IDENTIFIER
71 echo Disabling the acoustics
72 echo The files to Disable are KM3NeT_${(l:8::0::0:)DETECTOR_ID}_*_event.root
73 JAcousticsDisable.sh detector.datx KM3NeT_${(l:8::0::0:)DETECTOR_ID}_*_event.root disable.log
74 echo Acoustics disabled
79 DIR=$WORKDIR/${DETECTOR}.${VERSION}.B # with disabled transmissions
81 if [[ ! -d $DIR ]]; then
86 cp $WORKDIR/${DETECTOR}.${VERSION}.A/disable.log .
88 # introduce disabled transmissions
90 sed '/cat>disable.txt<<EOF/,/EOF/ccat>disable.txt<<EOF\n# disable transmissions\nEOF' \
91 $JPP_DIR/software/JAcoustics/pre-calibration_${DETECTOR}.sh > pre-calibration_${DETECTOR}.sh
92 sed -i '/disable transmissions/r disable.log' pre-calibration_${DETECTOR}.sh
94 chmod +x pre-calibration_${DETECTOR}.sh
96 ./pre-calibration_${DETECTOR}.sh $WORKDIR/${^DETECTORS}.${VERSION}.B >& pre-calibration.log
102# -----------------------------------------------------------------------------------------------
103# Run 'empty' pre-calibration of given detector with required inputs.
104# The last directory corresponds to the target detector and
105# the required preceding directories to the source detectors.
107# \param 1-N directories
108# -----------------------------------------------------------------------------------------------
111 DETECTORS=($argv[1,-2])
114 DIR=$WORKDIR/${DETECTOR}.${VERSION}.B
116 if [[ ! -d $DIR ]]; then
121 $JPP_DIR/software/JAcoustics/pre-calibration_${DETECTOR}.sh $WORKDIR/${^DETECTORS}.${VERSION}.B >& pre-calibration.B.log
130run D_ORCA006 D0ORCA010
131run D0ORCA010 D1ORCA011
132fcc D0ORCA010 D1ORCA011 D0ORCA007
133fcc D0ORCA010 D1ORCA011 D0ORCA011
134fcc D0ORCA010 D1ORCA011 D1ORCA013
135run D1ORCA011 D0ORCA015
136run D0ORCA015 D1ORCA015
137run D1ORCA015 D0ORCA018
138run D1ORCA015 DBORCA018
139run DBORCA018 D0ORCA023
140run DBORCA018 D1ORCA023
141run DBORCA018 D1ORCA024
142run DBORCA018 D2ORCA024
147run D0ARCA006 D0ARCA009
148run D0ARCA009 D0ARCA021
149fcc D0ARCA021 D0ARCA020
150run D0ARCA021 D0ARCA028
151run D0ARCA028 D0ARCA030
152run D0ARCA030 D0ARCW003
153run D0ARCA030 D1ARCA030