4 # ----------------------------------------------------------------------------------------------------- 
    6 # Toolkit for the determination of the fixed parameters in the system, a.k.a. "pre-calibration". 
    7 # The list of parameters includes (x,y,z) positions of strings and tripods, stretching of strings, 
    8 # z-positions of the optical modules, orientations of the strings and possibly z-positions of anchors. 
   10 # The value of a given parameter is optimised by minimising the average chi2/NDF 
   11 # of a series of global fits applied to a predefined set of acoustic events. 
   12 # For each parameter, there exists a designated function. 
   14 # There are also steering functions to consistently determine the optimal values for a set of parameters. 
   15 # In these, the current accuracy of the parameter values is taken into account. 
   16 # These are therefore referred to as "stages". 
   17 # The pre-calibration thus consists of a sequence of stages. 
   18 # For each detector, a complete pre-calibration procedure is implemented in a designated script. 
   20 # Mandatory input variables: 
   22 # DETECTOR              # detector file 
   23 # TRIPOD                # tripod file 
   24 # INPUT_FILES           # list of input files (output of JAcousticsEventBuilder[.sh]) 
   26 # Optional input variables: 
   28 # HYDROPHONE            # if defined, use hydrophones in global fit; else do not use hydrophones 
   32 # STRINGS corresponds to list of strings to be fitted; this can be changed with function fixStrings. 
   33 # TRIPODS corresponds to list of tripods to be fitted; this can be changed with function fixTripods. 
   35 # TRANSMITTERS corresponds to list of strings which have an emitter on the anchor (maybe empty). 
   36 # For these strings, the orientations and the z-positions of the anchors will separately be fitted. 
   37 # This list will also be changed with function fixStrings. 
   38 # ----------------------------------------------------------------------------------------------------- 
   40 source $JPP_DIR/setenv.sh $JPP_DIR >& /dev/
null 
   41 source $JPP_BIN/gradient.sh
 
   44     usage "source $script"\
 
   45           "\nThis script contains auxiliary functions for the pre-calibration of specific detectors."\
 
   46           "\nIt should be sourced by the detector specific scripts." 
   49 source JAcousticsToolkit.sh
 
   56 typeset -
a    CHI2                  # 
chi2 values; index [1] corresponds to best value
 
   58 let 
"NUMBER_OF_ITERATIONS = 100"    # maximal number of iterations
 
   59 let 
"EPSILON              = 5.0E-4" # maximal 
distance to minimum of 
chi2 
   63 # ----------------------------------------------------------------------------------------------------- 
   66 # Install input files in working directory and create temporary directory TMPDIR. 
   68 # ----------------------------------------------------------------------------------------------------- 
   71     eval `JPrintDetector -
a $DETECTOR -O IDENTIFIER`
 
   75     JAcoustics.sh  $DETECTOR_ID
 
   79     TRANSMITTERS=(`get_strings_with_transmitter 
$WORKDIR/transmitter.txt`)
 
   85 # -----------------------------------------------------------------------------------------------------
 
   89 # -----------------------------------------------------------------------------------------------------
 
   99 # ----------------------------------------------------------------------------------------------------- 
  100 # Remove temporary directory and restore input files in working directory. 
  102 # ----------------------------------------------------------------------------------------------------- 
  105     rm -rf $TMPDIR >& /dev/
null 
  107     rm -
f  {acoustics_fit_parameters,acoustics_trigger_parameters}.txt
 
  109     JAcoustics.sh  $DETECTOR_ID    
 
  113 # ----------------------------------------------------------------------------------------------------- 
  116 # \param  1-N     identifiers 
  117 # ----------------------------------------------------------------------------------------------------- 
  124     if (( ${#BUFFER} > 0 )); 
then 
  126         TRANSMITTERS=(${TRANSMITTERS:|BUFFER})
 
  131 # -----------------------------------------------------------------------------------------------------
 
  134 # \param  1-
N     identifiers
 
  135 # -----------------------------------------------------------------------------------------------------
 
  142     if (( ${#BUFFER} > 0 )); 
then 
  143         for ID in $BUFFER[*]; 
do 
  144             unset 
"TRIPODS[${ID}]" 
  150 # ----------------------------------------------------------------------------------------------------- 
  151 # Evaluate current chi2. 
  153 # \param  1       variable containing chi2 value on return 
  154 # ----------------------------------------------------------------------------------------------------- 
  157     for (( m = 0; $m != 3; ++m )); 
do 
  161         date >& $TMPDIR/katoomba.log
 
  165             -
f "$INPUT_FILES[*]"                      \
 
  166             -
o $TMPDIR/katoomba.root                  \
 
  171             -@ $TMPDIR/acoustics_fit_parameters.txt   \
 
  176             -
d 2 --!                                  >>& $TMPDIR/katoomba.log
 
  180         if (( $ERROR == 0 )); 
then 
  182             let 
"UV = $(JPrintResult -f $TMPDIR/katoomba.root:chi2 -F GetMean)" >>& $TMPDIR/katoomba.log
 
  186             if (( $ERROR == 0 )); 
then 
  192                 printf 
"warning: exit code let %d\n" $ERROR
 
  195             printf 
"warning: exit code JKatoomba %d\n" $ERROR
 
  198         # backup error status 
  202         cp -p $TMPDIR/katoomba.log      $UDIR
 
  203         cp -p $TMPDIR/katoomba.root     $UDIR
 
  208         printf 
"warning: backup %s\n" $UDIR
 
  211     printf 
"warning: no valid chi2 -> exit\n" 
  216 # ----------------------------------------------------------------------------------------------------- 
  218 # This stage can be used to determine the (x,y,z) positions of tripods when a number of strings is fixed. 
  220 # ----------------------------------------------------------------------------------------------------- 
  223     cat>$TMPDIR/acoustics_fit_parameters.txt<<EOF
 
  224 `egrep Tmax_s 
$WORKDIR/acoustics_fit_parameters.txt`
 
  232     if (( ${#STRINGS} > 0 )); 
then 
  233         JEditDetector  -
a $DETECTOR  -
o $TMPDIR/detector_0.datx  -
k "$STRINGS[*]" -q -
d 0 >& /dev/
null 
  242     for ID in ${(
k)TRIPODS}; 
do 
  243         PARAMETERS[
'JEditTripod -f $TRIPOD -T "$ID addx %" -T "$ID suby %" -o $TRIPOD -q -d 0 >& /dev/null']=$DX_M
 
  244         PARAMETERS[
'JEditTripod -f $TRIPOD -T "$ID addx %" -T "$ID addy %" -o $TRIPOD -q -d 0 >& /dev/null']=$DX_M
 
  245         PARAMETERS[
'JEditTripod -f $TRIPOD -T "$ID addz %"                 -o $TRIPOD -q -d 0 >& /dev/null']=$DX_M
 
  250     printf 
"detector                         %6d %8.4f\n" $N $Y
 
  252     if (( ${#STRINGS} > 0 )); 
then 
  258 # ----------------------------------------------------------------------------------------------------- 
  260 # This stage can be used to roughly determine the positions of the strings, tripods and modules. 
  261 # During this procedure, the strings are kept vertical in the global fits. 
  263 # ----------------------------------------------------------------------------------------------------- 
  266     cat>$TMPDIR/acoustics_fit_parameters.txt<<EOF
 
  267 `egrep Tmax_s 
$WORKDIR/acoustics_fit_parameters.txt`
 
  277     let 
"A_RAD    =  $DX_M / $RADIUS_M" 
  282         PARAMETERS[
'JEditDetector -a $DETECTOR -S "$STRING addx %" -o $DETECTOR -q -d 0 >& /dev/null']=$DX_M
 
  283         PARAMETERS[
'JEditDetector -a $DETECTOR -S "$STRING addy %" -o $DETECTOR -q -d 0 >& /dev/null']=$DX_M
 
  284         PARAMETERS[
'JEditDetector -a $DETECTOR -s "$STRING addz %" -o $DETECTOR -q -d 0 >& /dev/null']=$DX_M
 
  287     for ID in ${(
k)TRIPODS}; 
do 
  288         PARAMETERS[
'JEditTripod -f $TRIPOD -T "$ID addx %" -o $TRIPOD -q -d 0 >& /dev/null']=$((2.5 * $DX_M))
 
  289         PARAMETERS[
'JEditTripod -f $TRIPOD -T "$ID addy %" -o $TRIPOD -q -d 0 >& /dev/null']=$((2.5 * $DX_M))
 
  290         PARAMETERS[
'JEditTripod -f $TRIPOD -T "$ID addz %" -o $TRIPOD -q -d 0 >& /dev/null']=$((2.5 * $DX_M))
 
  297         PARAMETERS[
'JEditDetector -a $DETECTOR -M "$MODULE addz %" -o $DETECTOR -q -d 0 >& /dev/null']=$DX_M
 
  302     printf 
"detector                         %6d %8.4f\n" $N $Y
 
  311         for (( FLOOR = 1; $FLOOR <= 18; FLOOR += 1 )); 
do 
  315             PARAMETERS[
'JEditDetector -a $DETECTOR -M "$MODULE addz %" -o $DETECTOR -q -d 0 >& /dev/null']=$DX_M
 
  322     printf 
"detector                         %6d %8.4f\n" $N $Y
 
  326 # ----------------------------------------------------------------------------------------------------- 
  328 # This stage can be used to determine the z-positions and stretching of individual strings. 
  330 # ----------------------------------------------------------------------------------------------------- 
  333     cat>$TMPDIR/acoustics_fit_parameters.txt<<EOF
 
  334 `egrep Tmax_s 
$WORKDIR/acoustics_fit_parameters.txt`
 
  348         JEditDetector  -
a $DETECTOR  -
o $TMPDIR/detector_1.datx  -
r "$STRING" -q -
d 0 >& /dev/
null 
  353         PARAMETERS[
'JEditDetector -a $DETECTOR -s "$STRING addz %" -o $DETECTOR -q -d 0 >& /dev/null']=$DX_M
 
  354         PARAMETERS[
'JEditDetector -a $DETECTOR -s "$STRING mul %"  -o $DETECTOR -q -d 0 >& /dev/null; JEditDetector -a $DETECTOR -s "$STRING subz \$\(\(% * $CAN_ZMAX_M\)\)"  -o $DETECTOR -q -d 0 >& /dev/null']=$MUL
 
  358         printf 
"string     %04d                  %6d %8.4f\n" $STRING $N $Y
 
  365 # ----------------------------------------------------------------------------------------------------- 
  367 # This stage can be used to improve the determination the positions of the strings, tripods and modules. 
  369 # ----------------------------------------------------------------------------------------------------- 
  372     cat>$TMPDIR/acoustics_fit_parameters.txt<<EOF
 
  373 `egrep Tmax_s 
$WORKDIR/acoustics_fit_parameters.txt`
 
  383     let 
"A_RAD    =  $DX_M / $RADIUS_M" 
  388         PARAMETERS[
'JEditDetector -a $DETECTOR -S "$STRING addx %" -o $DETECTOR -q -d 0 >& /dev/null']=$DX_M
 
  389         PARAMETERS[
'JEditDetector -a $DETECTOR -S "$STRING addy %" -o $DETECTOR -q -d 0 >& /dev/null']=$DX_M
 
  390         PARAMETERS[
'JEditDetector -a $DETECTOR -s "$STRING addz %" -o $DETECTOR -q -d 0 >& /dev/null']=$DX_M
 
  393     for ID in ${(
k)TRIPODS}; 
do 
  394         PARAMETERS[
'JEditTripod -f $TRIPOD -T "$ID addx %" -o $TRIPOD -q -d 0 >& /dev/null']=$((2.5 * $DX_M))
 
  395         PARAMETERS[
'JEditTripod -f $TRIPOD -T "$ID addy %" -o $TRIPOD -q -d 0 >& /dev/null']=$((2.5 * $DX_M))
 
  396         PARAMETERS[
'JEditTripod -f $TRIPOD -T "$ID addz %" -o $TRIPOD -q -d 0 >& /dev/null']=$((2.5 * $DX_M))
 
  403         PARAMETERS[
'JEditDetector -a $DETECTOR -M "$MODULE addz %" -o $DETECTOR -q -d 0 >& /dev/null']=$DX_M
 
  406     for STRING in ${TRANSMITTERS:*STRINGS}; 
do 
  407         PARAMETERS[
'JEditHydrophone -f $WORKDIR/hydrophone.txt -S "$STRING rot %" -o $WORKDIR/hydrophone.txt -q -d 0 >& /dev/null; JEditTransmitter -f $WORKDIR/transmitter.txt -S "$STRING rot %" -o $WORKDIR/transmitter.txt -q -d 0 >& /dev/null']=$A_RAD
 
  412     printf 
"detector                         %6d %8.4f\n" $N $Y
 
  416 # ----------------------------------------------------------------------------------------------------- 
  418 # This stage can be used to improve the determination the positions of the strings, tripods and modules. 
  420 # ----------------------------------------------------------------------------------------------------- 
  423     cat>$TMPDIR/acoustics_fit_parameters.txt<<EOF
 
  424 `egrep Tmax_s 
$WORKDIR/acoustics_fit_parameters.txt`
 
  440         for (( FLOOR = 1; $FLOOR <= 18; FLOOR += 1 )); 
do 
  444             PARAMETERS[
'JEditDetector -a $DETECTOR -M "$MODULE addz %" -o $DETECTOR -q -d 0 >& /dev/null']=$DZ_M
 
  447         #PARAMETERS['JEditDetector -a $DETECTOR -S "$STRING addx %" -o $DETECTOR -q -d 0 >& /dev/null']=$DX_M 
  448         #PARAMETERS['JEditDetector -a $DETECTOR -S "$STRING addy %" -o $DETECTOR -q -d 0 >& /dev/null']=$DX_M 
  454     printf 
"detector                         %6d %8.4f\n" $N $Y
 
  460 # ----------------------------------------------------------------------------------------------------- 
  462 # This stage can be used to improve the determination the positions of the strings, tripods and modules. 
  464 # ----------------------------------------------------------------------------------------------------- 
  472 # ----------------------------------------------------------------------------------------------------- 
  474 # This stage can be used to finalise the determination of the positions of the strings, tripods and modules. 
  476 # ----------------------------------------------------------------------------------------------------- 
  479    cat>$TMPDIR/acoustics_fit_parameters.txt<<EOF
 
  480 `egrep Tmax_s 
$WORKDIR/acoustics_fit_parameters.txt`
 
  490     let 
"A_RAD    =  $DX_M / $RADIUS_M" 
  495         PARAMETERS[
'JEditDetector -a $DETECTOR -S "$STRING addx %" -o $DETECTOR -q -d 0 >& /dev/null']=$DX_M
 
  496         PARAMETERS[
'JEditDetector -a $DETECTOR -S "$STRING addy %" -o $DETECTOR -q -d 0 >& /dev/null']=$DX_M
 
  497         PARAMETERS[
'JEditDetector -a $DETECTOR -s "$STRING addz %" -o $DETECTOR -q -d 0 >& /dev/null']=$DX_M
 
  500     for ID in ${(
k)TRIPODS}; 
do 
  501         PARAMETERS[
'JEditTripod -f $TRIPOD -T "$ID addx %" -o $TRIPOD -q -d 0 >& /dev/null']=$((2.5 * $DX_M))
 
  502         PARAMETERS[
'JEditTripod -f $TRIPOD -T "$ID addy %" -o $TRIPOD -q -d 0 >& /dev/null']=$((2.5 * $DX_M))
 
  503         PARAMETERS[
'JEditTripod -f $TRIPOD -T "$ID addz %" -o $TRIPOD -q -d 0 >& /dev/null']=$((2.5 * $DX_M))
 
  510         PARAMETERS[
'JEditDetector -a $DETECTOR -M "$MODULE addz %" -o $DETECTOR -q -d 0 >& /dev/null']=$DX_M
 
  513     for STRING in ${TRANSMITTERS:*STRINGS}; 
do 
  515         PARAMETERS[
'JEditHydrophone -f $WORKDIR/hydrophone.txt -S "$STRING rot %" -o $WORKDIR/hydrophone.txt -q -d 0 >& /dev/null; JEditTransmitter -f $WORKDIR/transmitter.txt -S "$STRING rot %" -o $WORKDIR/transmitter.txt -q -d 0 >& /dev/null']=$A_RAD
 
  520     printf 
"detector                         %6d %8.4f\n" $N $Y
 
  524 # ----------------------------------------------------------------------------------------------------- 
  526 # This stage can be used to finalise the determination of the positions of the strings, tripods and modules. 
  528 # ----------------------------------------------------------------------------------------------------- 
  531     cat>$TMPDIR/acoustics_fit_parameters.txt<<EOF
 
  532 `egrep Tmax_s 
$WORKDIR/acoustics_fit_parameters.txt`
 
  548         for (( FLOOR = 1; $FLOOR <= 18; FLOOR += 1 )); 
do 
  552             PARAMETERS[
'JEditDetector -a $DETECTOR -M "$MODULE addz %" -o $DETECTOR -q -d 0 >& /dev/null']=$DZ_M
 
  555         #PARAMETERS['JEditDetector -a $DETECTOR -S "$STRING addx %" -o $DETECTOR -q -d 0 >& /dev/null']=$DX_M 
  556         #PARAMETERS['JEditDetector -a $DETECTOR -S "$STRING addy %" -o $DETECTOR -q -d 0 >& /dev/null']=$DX_M 
  562     printf 
"detector                         %6d %8.4f\n" $N $Y
 
  568 # ----------------------------------------------------------------------------------------------------- 
  570 # This stage can be used to finalise the determination of the positions of the strings, tripods and modules. 
  572 # ----------------------------------------------------------------------------------------------------- 
  580 # ----------------------------------------------------------------------------------------------------- 
  582 # This stage can be used to determine the rotations of the strings and z-positions of the anchors 
  583 # including the response of hydrophones. 
  584 # It includes a determination of the positions of the strings, tripods and modules. 
  586 # ----------------------------------------------------------------------------------------------------- 
  589     cat>$TMPDIR/acoustics_fit_parameters.txt<<EOF
 
  590 `egrep Tmax_s 
$WORKDIR/acoustics_fit_parameters.txt`
 
  602     let 
"A_RAD    =  $DX_M / $RADIUS_M" 
  610         PARAMETERS[
'JEditDetector -a $DETECTOR -S "$STRING addx %" -o $DETECTOR -q -d 0 >& /dev/null']=$DX_M
 
  611         PARAMETERS[
'JEditDetector -a $DETECTOR -S "$STRING addy %" -o $DETECTOR -q -d 0 >& /dev/null']=$DX_M
 
  612         PARAMETERS[
'JEditDetector -a $DETECTOR -s "$STRING addz %" -o $DETECTOR -q -d 0 >& /dev/null']=$DX_M
 
  613         PARAMETERS[
'JEditDetector -a $DETECTOR -M "$MODULE addz %" -o $DETECTOR -q -d 0 >& /dev/null']=$DX_M
 
  615         PARAMETERS[
'JEditHydrophone -f $WORKDIR/hydrophone.txt -S "$STRING rot %" -o $WORKDIR/hydrophone.txt -q -d 0 >& /dev/null; JEditTransmitter -f $WORKDIR/transmitter.txt -S "$STRING rot %" -o $WORKDIR/transmitter.txt -q -d 0 >& /dev/null']=$A_RAD
 
  618     for ID in ${(
k)TRIPODS}; 
do 
  619         PARAMETERS[
'JEditTripod -f $TRIPOD -T "$ID addx %" -o $TRIPOD -q -d 0 >& /dev/null']=$((2.5 * $DX_M))
 
  620         PARAMETERS[
'JEditTripod -f $TRIPOD -T "$ID addy %" -o $TRIPOD -q -d 0 >& /dev/null']=$((2.5 * $DX_M))
 
  621         PARAMETERS[
'JEditTripod -f $TRIPOD -T "$ID addz %" -o $TRIPOD -q -d 0 >& /dev/null']=$((2.5 * $DX_M))
 
  624     for STRING in ${TRANSMITTERS:*STRINGS}; 
do 
  626         PARAMETERS[
'JEditHydrophone -f $WORKDIR/hydrophone.txt -S "$STRING rot %" -o $WORKDIR/hydrophone.txt -q -d 0 >& /dev/null; JEditTransmitter -f $WORKDIR/transmitter.txt -S "$STRING rot %" -o $WORKDIR/transmitter.txt -q -d 0 >& /dev/null']=$A_RAD
 
  631     printf 
"detector                         %6d %8.4f\n" $N $Y
 
then cat $TRIPOD_INITIAL<< EOF1 256877.5 4743716.7-2438.42 256815.5 4743395.0-2435.53 257096.2 4743636.0-2439.5EOFfiJEditDetector-a $DETECTOR_INITIAL-s"-1 addz -6.9"-o $DETECTOReval`JPrintDetector-a $DETECTOR-O SUMMARY`for STRING in ${STRINGS[*]};do set_variable MODULE`getModule-a $DETECTOR-L"$STRING 0"`JEditDetector-a $DETECTOR-M"$MODULE setz -2.9"-o $DETECTORdonecp-p $TRIPOD_INITIAL $TRIPODJAcoustics.sh $DETECTOR_IDcat > acoustics_trigger_parameters txt<< EOFQ=0.0;TMax_s=0.020;numberOfHits=90;EOFJAcousticsEventBuilder.sh $DETECTOR $RUNS[*]INPUT_FILES=(`ls KM3NeT_ ${(l:8::0::0:) DETECTOR_ID}_0 *${^RUNS}_event.root`) cd $WORKDIRif[!$HOMEDIR-ef $WORKDIR];then cp-p $HOMEDIR/$DETECTOR $WORKDIR cp-p $HOMEDIR/$TRIPOD $WORKDIR cp-p $HOMEDIR/${^INPUT_FILES}$WORKDIR cp-p $HOMEDIR/{acoustics_fit_parameters, acoustics_trigger_parameters, disable, hydrophone, mechanics, sound_velocity, tripod, waveform}.txt $WORKDIRfisource $JPP_DIR/examples/JAcoustics/acoustics-fit-toolkit.shtimer_startinitialise stage_1B > &stage log
 
then fatal No hydrophone data file $HYDROPHONE_TXT fi sort gr k
 
clean eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY set_variable STRING
 
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance. 
 
then JLigier sh continue fi cat
 
o $QUALITY_ROOT d $DEBUG!JPlot1D f
 
then JShowerPostfit f $INPUT_FILE o $OUTPUT_FILE N
 
static const double H
Planck constant [eV s]. 
 
then usage $script< input file > nFor possible input files
 
then fatal Wrong number of arguments fi set_variable STRING $argv[1] set_variable DETECTORXY_TXT $WORKDIR $DETECTORXY_TXT tail read X Y CHI2 RMS printf optimum n $X $Y $CHI2 $RMS awk v Y
 
clean for KEY in pcal ccal tripod transmitter hydrophone
 
V(JDAQEvent-JTriggerReprocessor)*1.0/(JDAQEvent+1.0e-10)
 
then fatal Wrong number of arguments fi JConvertDetectorFormat a o
 
do JCanberra a $DETECTOR f $INPUT_FILE o $WORKDIR canberra[${EMITTER}\] root T $WORKDIR tripod txt V $WORKDIR sound_velocity txt M $WORKDIR mechanics txt H $WORKDIR hydrophone txt E $EMITTER $DISABLE d $DEBUG!done kill_child_processes_at_exit attach getModule a $DETECTOR typeset Z STRING typeset Z FLOOR for STRING in $STRINGS[*]
 
then fatal Invalid string $STRING
 
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR &dev null set_variable
 
case $OPTION in clean clean
 
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR if do_usage *then usage $script[(input file)+] fi set_variable DEBUG set_variable WORKDIR TMPDIR
 
do set_variable OUTPUT_DIRECTORY $WORKDIR T
 
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR &dev null set_variable DEBUG set_variable WORKDIR
 
set_array INPUT_FILES argv[2,$((START_INDEX_STRING-1))] set_array STRINGS
 
do JPlot2D f $WORKDIR detector root
 
then $DIR JKatoomba a $DETECTOR o $WORKDIR katoomba root T $TRIPOD n sigma_s
 
then JMuonMCEvt f $INPUT_FILE o $INTERMEDIATE_FILE d
 
then set_variable MODULE getModule a $DETECTOR L $STRING $FLOOR JEditDetector a $DETECTOR M $MODULE add $X o $DETECTOR else echo No update of detector $DETECTOR
 
static const JPBS_t HYDROPHONE(4, 5)
PBS of hydrophone 
 
then if[[!-f $DETECTOR]] then JDetector sh $DETECTOR fi cat $WORKDIR trigger_parameters txt<< EOFtrigger3DMuon.enabled=1;trigger3DMuon.numberOfHits=5;trigger3DMuon.gridAngle_deg=1;ctMin=0.0;TMaxLocal_ns=15.0;EOF set_variable TRIGGEREFFICIENCY_TRIGGERED_EVENTS_ONLY INPUT_FILES=() for((i=1;$i<=$NUMBER_OF_RUNS;++i));do JSirene.sh $DETECTOR $JPP_DATA/genhen.km3net_wpd_V2_0.evt.gz $WORKDIR/sirene_ ${i}.root JTriggerEfficiency.sh $DETECTOR $DETECTOR $WORKDIR/sirene_ ${i}.root $WORKDIR/trigger_efficiency_ ${i}.root $WORKDIR/trigger_parameters.txt $JPP_DATA/PMT_parameters.txt INPUT_FILES+=($WORKDIR/trigger_efficiency_ ${i}.root) done for ANGLE_DEG in $ANGLES_DEG[*];do set_variable SIGMA_NS 3.0 set_variable OUTLIERS 3 set_variable OUTPUT_FILE $WORKDIR/matrix\[${ANGLE_DEG}\deg\].root $JPP_DIR/examples/JReconstruction-f"$INPUT_FILES[*]"-o $OUTPUT_FILE-S ${SIGMA_NS}-A ${ANGLE_DEG}-O ${OUTLIERS}-d ${DEBUG}--!fiif[[$OPTION=="plot"]];then if((0));then for H1 in h0 h1;do JPlot1D-f"$WORKDIR/matrix["${^ANGLES_DEG}" deg].root:${H1}"-y"1 2e3"-Y-L TR-T""-\^"number of events [a.u.]"-> o chi2
 
esac typeset A BUFFER $JPP_DIR examples JAcoustics JCreep f $INPUT_FILE BUFFER
 
then echo Creating output directory
 
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
 
source $JPP_DIR setenv csh $JPP_DIR &dev null eval JShellParser o a A
 
then fatal Invalid tripod $TRIPOD
 
esac $JPP_BIN JLogger sh $LOGGER until pgrep JGetMessage</dev/null > dev null
 
const JModule & getModule(const JDetector &detector, const JModuleLocation &location)
find module with a given string and floor number 
 
then usage $script< archive >< detectorfile >< run > nGet tripod
 
#define DEBUG(A)
Message macros.