9# ------------------------------------------------------------------------------------------
11# Utility script to test sea time calibration.
13# ------------------------------------------------------------------------------------------
14# all data related to intradom time calibration have to be set in the same directory
16# When performing a time calibration between DOMs, some PMT time offsets must be kept fixed.
17# for standard sea time calibration, the time offsets kept fixed are those of the
18# reference PMTs. The identity of the reference PMT can be given in argument as an integer
19# (since all DOMs are supposed to have the same reference PMT, 7 or 15 most of the time).
21# In case of a time calibration after a threshold tuning, or in case of different
22# reference PMT identity for each DOM, a file can be given as an argument. The file
23# contains a list of DOM and PMT identities that must have a fix time offset.
25if [ -z $JPP_DIR ]; then
26 echo "Variable JPP_DIR undefined."
30source $JPP_DIR/setenv.sh $JPP_DIR
35 usage "$script <working directory> <detector file> <intra data directory> <reference PMTs>"
39 4) set_variable PMT $4;
40 set_variable INTRADIR $3;
42 set_variable WORKDIR $1;;
43 *) fatal "wrong number of arguments!";;
46if [[ ${PMT} =~ ^[+-]?[0-9]+$ ]]; then
47 set_variable pmtList "-1 ${PMT}"
48 set_variable pmtName ${PMT}
50 set_variable pmtList "`cat ${WORKDIR}/${PMT}`"
51 set_variable pmtName "Mixed"
55for FILEPATH in $(ls ${WORKDIR}/${INTRADIR}/); do
56 FILELISTINTRA1+=("${WORKDIR}/${INTRADIR}/${FILEPATH}")
58set_variable FILELISTINTRA2 ${FILELISTINTRA1}
59set_variable BASENAME ${DETX%.detx}
63 -f ${FILELISTINTRA2} \
64 -a ${WORKDIR}/${DETX} \
65 -o calibrateK40_sea.root \
73 -f calibrateK40_sea.root \
74 -o mergecalibrateK40_sea.root
76JConvertDetectorFormat -a ${WORKDIR}/${DETX} -o ${WORKDIR}/${BASENAME}_seaCalibration_pmt${pmtName}.detx
80 -f mergecalibrateK40_sea.root \
81 -a ${WORKDIR}/${BASENAME}_seaCalibration_pmt${pmtName}.detx \
82 -o fitK40_pmt${pmtName}_sea.root \