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 
   43     usage "source $script"\
 
   44           "\nThis script contains auxiliary functions for the pre-calibration of specific detectors."\
 
   45           "\nIt should be sourced by the detector specific scripts." 
   48 source JAcousticsToolkit.sh
 
   54 typeset -
a    CHI2                # 
chi2 values; index [1] corresponds to best value
 
   60 # ----------------------------------------------------------------------------------------------------- 
   63 # Install input files in working directory and create temporary directory TMPDIR. 
   65 # ----------------------------------------------------------------------------------------------------- 
   68     eval `JPrintDetector -
a $DETECTOR -O IDENTIFIER`
 
   72     JAcoustics.sh  $DETECTOR_ID
 
   76     TRANSMITTERS=(`get_strings_with_transmitter 
$WORKDIR/transmitter.txt`)
 
   82 # -----------------------------------------------------------------------------------------------------
 
   85 # -----------------------------------------------------------------------------------------------------
 
   88     rm -rf $TMPDIR >& /dev/
null 
   90     rm -
f  {acoustics_fit_parameters,acoustics_trigger_parameters}.txt
 
   92     JAcoustics.sh  $DETECTOR_ID    
 
   96 # ----------------------------------------------------------------------------------------------------- 
   99 # \param  1-N     identifiers 
  100 # ----------------------------------------------------------------------------------------------------- 
  107     if (( ${#BUFFER} > 0 )); 
then 
  109         TRANSMITTERS=(${TRANSMITTERS:|BUFFER})
 
  114 # -----------------------------------------------------------------------------------------------------
 
  117 # \param  1-
N     identifiers
 
  118 # -----------------------------------------------------------------------------------------------------
 
  125     if (( ${#BUFFER} > 0 )); 
then 
  126         for ID in $BUFFER[*]; 
do 
  127             unset 
"TRIPODS[${ID}]" 
  133 # ----------------------------------------------------------------------------------------------------- 
  134 # Get center-of-gravity of tripods. 
  137 # ----------------------------------------------------------------------------------------------------- 
  140     typeset -
A __TRIPODS__
 
  148     if (( ${#__TRIPODS__} >= 1 )); 
then 
  150         for _X _Y _Z 
in `
echo ${(@
v)__TRIPODS__}`; 
do 
  156         let 
"X = $X / ${#__TRIPODS__}" 
  157         let 
"Y = $Y / ${#__TRIPODS__}" 
  158         let 
"Z = $Z / ${#__TRIPODS__}" 
  161     printf 
"%15.5f %15.5f %15.5f"  $X  $Y  $Z   
 
  165 # ----------------------------------------------------------------------------------------------------- 
  166 # Set detector and tripods to given center-of-gravity. 
  171 # ----------------------------------------------------------------------------------------------------- 
  180     printf 
"Fix center %15.5f %15.5f %15.5f\n"  $X  $Y  $Z
 
  187 # ----------------------------------------------------------------------------------------------------- 
  188 # Evaluate current chi2. 
  190 # \param  1       variable containing chi2 value on return 
  191 # ----------------------------------------------------------------------------------------------------- 
  194     for (( m = 0; $m != 3; ++m )); 
do 
  198         date >& $TMPDIR/katoomba.log
 
  202             -
f "$INPUT_FILES[*]"                      \
 
  203             -
o $TMPDIR/katoomba.root                  \
 
  208             -@ $TMPDIR/acoustics_fit_parameters.txt   \
 
  213             -
d 2 --!                                  >>& $TMPDIR/katoomba.log
 
  217         if (( $ERROR == 0 )); 
then 
  219             let 
"VALUE = $(JPrintResult -f $TMPDIR/katoomba.root:chi2 -F GetMean)" >>& $TMPDIR/katoomba.log
 
  223             if (( $ERROR == 0 )); 
then 
  229                 printf 
"warning: exit code let %d\n" $ERROR
 
  232             printf 
"warning: exit code JKatoomba %d\n" $ERROR
 
  235         # backup error status 
  239         cp -p $TMPDIR/katoomba.log      $UDIR
 
  240         cp -p $TMPDIR/katoomba.root     $UDIR
 
  245         printf 
"warning: backup %s\n" $UDIR
 
  248     printf 
"warning: no valid chi2 -> exit\n" 
  253 # ----------------------------------------------------------------------------------------------------- 
  254 # Fit given coordinate of string position. 
  256 # \param  1       string identifier 
  257 # \param  2       coordinate (X|Y|Z) 
  259 # ----------------------------------------------------------------------------------------------------- 
  264     BUFFER=(
X 0.0 
Y 0.0 
Z 0.0)
 
  268     if [[ 
"$2" == 
"Z" ]]; 
then 
  269         OPTION=-s                  # optical modules only
 
  271         OPTION=-S                  # all modules
 
  274     for (( ; $N != $NUMBER_OF_ITERATIONS; ++
N )); 
do 
  282         if (( $CHI2[2] >= $CHI2[1] - $PRECISION )); 
then 
  292     for (( ; $N != $NUMBER_OF_ITERATIONS; ++
N )); 
do 
  300         if (( $CHI2[2] >= $CHI2[1] - $PRECISION )); 
then 
  310     printf 
"string     %04d  %s %6.4f        %6d %8.4f\n" $1 $2 $3 $N $CHI2[1]
 
  314 # ----------------------------------------------------------------------------------------------------- 
  315 # Fit stretching of string. 
  317 # \param  1       string identifier 
  318 # \param  2       multiplication factor 
  319 # ----------------------------------------------------------------------------------------------------- 
  322     let 
"Z = $CAN_ZMAX_M * $2" 
  324     for (( ; $N != $NUMBER_OF_ITERATIONS; ++
N )); 
do 
  332         if (( $CHI2[2] >= $CHI2[1] - $PRECISION )); 
then 
  342     for (( ; $N != $NUMBER_OF_ITERATIONS; ++
N )); 
do 
  350         if (( $CHI2[2] >= $CHI2[1] - $PRECISION )); 
then 
  360     printf 
"string     %04d  M %6.4f        %6d %8.4f\n" $1 $2 $N $CHI2[1]
 
  364 # ----------------------------------------------------------------------------------------------------- 
  365 # Fit given coordinate of tripod position. 
  367 # \param  1       tripod identifier 
  368 # \param  2       coordinate (X|Y|Z) 
  370 # ----------------------------------------------------------------------------------------------------- 
  375     BUFFER=(
X 0.0 
Y 0.0 
Z 0.0)
 
  379     for (( ; $N != $NUMBER_OF_ITERATIONS; ++
N )); 
do 
  387         if (( $CHI2[2] >= $CHI2[1] - $PRECISION )); 
then 
  397     for (( ; $N != $NUMBER_OF_ITERATIONS; ++
N )); 
do 
  405         if (( $CHI2[2] >= $CHI2[1] - $PRECISION )); 
then 
  415     printf 
"tripod       %2d  %s %6.4f        %6d %8.4f\n" $1 $2 $3 $N $CHI2[1]
 
  419 # ----------------------------------------------------------------------------------------------------- 
  420 # Fit module z-position. 
  422 # \param  1       string identifier 
  425 # ----------------------------------------------------------------------------------------------------- 
  430     BUFFER=(
X 0.0 
Y 0.0 
Z $3)
 
  435     for (( i=0 ; 
$i != $NUMBER_OF_STEPS && $N != $NUMBER_OF_ITERATIONS; ++i, ++
N )); 
do 
  443         if (( $CHI2[2] >= $CHI2[1] - $PRECISION )); 
then 
  453     for (( i=0 ; 
$i != $NUMBER_OF_STEPS && $N != $NUMBER_OF_ITERATIONS; ++i, ++
N )); 
do 
  461         if (( $CHI2[2] >= $CHI2[1] - $PRECISION )); 
then 
  471     printf 
"module     %04d.%02d %6.4f        %6d %8.4f\n" $1 $2 $3 $N $CHI2[1]
 
  475 # ----------------------------------------------------------------------------------------------------- 
  476 # Fit given coordinate of anchor position. 
  478 # Note that the position of the anchor corresponds to the position of the base module in the detector. 
  479 # The z-position can independently be changed whereas a change in the (x,y) position 
  480 # affects the complete string (i.e. including optical modules).  
  482 # \param  1       string identifier 
  483 # \param  2       coordinate (X|Y|Z) 
  485 # ----------------------------------------------------------------------------------------------------- 
  490     BUFFER=(
X 0.0 
Y 0.0 
Z 0.0)
 
  494     if [[ 
"$2" == 
"Z" ]]; 
then 
  498         ADD=
"-M $MODULE add ${(v)BUFFER}"                  # base module only
 
  499         SUB=
"-M $MODULE sub ${(v)BUFFER}"                  # base module only
 
  501         ADD=
"-S $1      add ${(v)BUFFER}"                  # all modules
 
  502         SUB=
"-S $1      sub ${(v)BUFFER}"                  # all modules
 
  505     for (( ; $N != $NUMBER_OF_ITERATIONS; ++
N )); 
do 
  513         if (( $CHI2[2] >= $CHI2[1] - $PRECISION )); 
then 
  523     for (( ; $N != $NUMBER_OF_ITERATIONS; ++
N )); 
do 
  531         if (( $CHI2[2] >= $CHI2[1] - $PRECISION )); 
then 
  541     printf 
"anchor     %04d  %s %6.4f        %6d %8.4f\n" $1 $2 $3 $N $CHI2[1]
 
  545 # ----------------------------------------------------------------------------------------------------- 
  546 # Fit rotation of anchor. 
  548 # Note that a rotation of the anchor corresponds to a change of the relative positions of 
  549 # the hydrophone and emitter with respect to the T-bar. 
  551 # \param  1       string identifier 
  552 # \param  2       rotation angle [rad] 
  553 # ----------------------------------------------------------------------------------------------------- 
  558     for (( ; $N != $NUMBER_OF_ITERATIONS; ++
N )); 
do 
  560         cp $WORKDIR/hydrophone.txt  $TMPDIR/hydrophone.txt
 
  561         cp $WORKDIR/transmitter.txt $TMPDIR/transmitter.txt
 
  568         if (( $CHI2[2] >= $CHI2[1] - $PRECISION )); 
then 
  570             mv $TMPDIR/hydrophone.txt  
$WORKDIR/hydrophone.txt
 
  571             mv $TMPDIR/transmitter.txt 
$WORKDIR/transmitter.txt
 
  579     let 
"ROT = -1.0 * $ROT" 
  581     for (( ; $N != $NUMBER_OF_ITERATIONS; ++
N )); 
do 
  583         cp $WORKDIR/hydrophone.txt  $TMPDIR/hydrophone.txt
 
  584         cp $WORKDIR/transmitter.txt $TMPDIR/transmitter.txt
 
  591         if (( $CHI2[2] >= $CHI2[1] - $PRECISION )); 
then 
  593             mv $TMPDIR/hydrophone.txt  
$WORKDIR/hydrophone.txt
 
  594             mv $TMPDIR/transmitter.txt 
$WORKDIR/transmitter.txt
 
  602     printf 
"string     %04d  R %6.4f        %6d %8.4f\n" $1 $2 $N $CHI2[1]
 
  606 # ----------------------------------------------------------------------------------------------------- 
  608 # This stage can be used to determine the (x,y,z) positions of tripods when a number of strings is fixed. 
  610 # ----------------------------------------------------------------------------------------------------- 
  613     cat>$TMPDIR/acoustics_fit_parameters.txt<<EOF
 
  614 `egrep Tmax_s 
$WORKDIR/acoustics_fit_parameters.txt`
 
  622     if (( ${#STRINGS} > 0 )); 
then 
  623         JEditDetector  -
a $DETECTOR  -
o $TMPDIR/detector_0.datx  -
k "$STRINGS[*]" -q -
d 0 >& /dev/
null 
  631     for DX_M 
in 0.5 0.2 0.1; 
do              # determine (
x,y,z) positions of 
tripods 
  633         let 
"A_RAD = $DX_M / $RADIUS_M"      # use maximal horizontal 
distance between 
T-bar and emitter/hydrophone
 
  635         for (( 
N = 0; $N < $NUMBER_OF_ITERATIONS; ++
N )); 
do 
  639             for ID in ${(
k)TRIPODS}; 
do 
  652             if (( $CHI2[3] - $CHI2[1] < $EPSILON )); 
then 
  657         if (( $N >= $NUMBER_OF_ITERATIONS )); 
then 
  658             printf 
"warning: reached maximum number of iterations %d - convergence %7.3f\n" $N $(($CHI2[3] - $CHI2[1]))
 
  662     if (( ${#STRINGS} > 0 )); 
then 
  668 # ----------------------------------------------------------------------------------------------------- 
  670 # This stage can be used to roughly determine the positions of the strings, tripods and modules. 
  671 # During this procedure, the strings are kept vertical in the global fits. 
  673 # ----------------------------------------------------------------------------------------------------- 
  676     cat>$TMPDIR/acoustics_fit_parameters.txt<<EOF
 
  677 `egrep Tmax_s 
$WORKDIR/acoustics_fit_parameters.txt`
 
  691         let 
"A_RAD = $DX_M / $RADIUS_M"      # use maximal horizontal 
distance between 
T-bar and emitter/hydrophone
 
  693         for (( 
N = 0; $N < $NUMBER_OF_ITERATIONS; ++
N )); 
do 
  703             for ID in ${(
k)TRIPODS}; 
do 
  716             if (( $CHI2[3] - $CHI2[1] < $EPSILON )); 
then 
  721         if (( $N >= $NUMBER_OF_ITERATIONS )); 
then 
  722             printf 
"warning: reached maximum number of iterations %d - convergence %7.3f\n" $N $(($CHI2[3] - $CHI2[1]))
 
  730     for DX_M 
in 0.1; 
do                      # determine (z) positions of modules
 
  732         for (( 
N = 0; $N < $NUMBER_OF_ITERATIONS; ++
N )); 
do 
  737                 for (( FLOOR = 1; $FLOOR <= 18; FLOOR += 1 )); 
do 
  742             if (( $CHI2[3] - $CHI2[1] < $EPSILON )); 
then 
  747         if (( $N >= $NUMBER_OF_ITERATIONS )); 
then 
  748             printf 
"warning: reached maximum number of iterations %d - convergence %7.3f\n" $N $(($CHI2[3] - $CHI2[1]))
 
  754 # ----------------------------------------------------------------------------------------------------- 
  756 # This stage can be used to determine the z-positions and stretching of individual strings. 
  758 # ----------------------------------------------------------------------------------------------------- 
  761     cat>$TMPDIR/acoustics_fit_parameters.txt<<EOF
 
  762 `egrep Tmax_s 
$WORKDIR/acoustics_fit_parameters.txt`
 
  770     for STRING in $STRINGS[*]; 
do            # determine stretching and (z) position of given 
string           
  772         JEditDetector  -
a $DETECTOR  -
o $TMPDIR/detector_1.datx  -
r "$STRING" -q -
d 0 >& /dev/
null 
  779         for MUL 
in 0.005 0.001; 
do 
  783             for (( 
N = 0; $N < $NUMBER_OF_ITERATIONS; ++
N )); 
do 
  790                 if (( $CHI2[3] - $CHI2[1] < $EPSILON )); 
then 
  795             if (( $N >= $NUMBER_OF_ITERATIONS )); 
then 
  796                 printf 
"warning: reached maximum number of iterations %d - convergence %7.3f\n" $N $(($CHI2[3] - $CHI2[1]))
 
  805 # ----------------------------------------------------------------------------------------------------- 
  807 # This stage can be used to improve the determination the positions of the strings, tripods and modules. 
  809 # ----------------------------------------------------------------------------------------------------- 
  812     cat>$TMPDIR/acoustics_fit_parameters.txt<<EOF
 
  813 `egrep Tmax_s 
$WORKDIR/acoustics_fit_parameters.txt`
 
  827         let 
"A_RAD = $DX_M / $RADIUS_M"      # use maximal horizontal 
distance between 
T-bar and emitter/hydrophone
 
  829         for (( 
N = 0; $N < $NUMBER_OF_ITERATIONS; ++
N )); 
do 
  839             for ID in ${(
k)TRIPODS}; 
do 
  852             if (( $CHI2[3] - $CHI2[1] < $EPSILON )); 
then 
  857         if (( $N >= $NUMBER_OF_ITERATIONS )); 
then 
  858             warning 
"reached maximum number of iterations $N - convergence $(($CHI2[3] - $CHI2[1]))" 
  866     for DX_M 
in 0.1; 
do                      # determine (z) positions of modules and (
x,y) positions of 
strings 
  868         for (( 
N = 0; $N < $NUMBER_OF_ITERATIONS; ++
N )); 
do 
  874                 for (( FLOOR = 1; $FLOOR <= 18; FLOOR += 1 )); 
do 
  882             if (( $CHI2[3] - $CHI2[1] < $EPSILON )); 
then 
  887         if (( $N >= $NUMBER_OF_ITERATIONS )); 
then 
  888             warning 
"reached maximum number of iterations $N - convergence $(($CHI2[3] - $CHI2[1]))" 
  893 # ----------------------------------------------------------------------------------------------------- 
  895 # This stage can be used to finalise the determination of the positions of the strings, tripods and modules. 
  897 # ----------------------------------------------------------------------------------------------------- 
  900     cat>$TMPDIR/acoustics_fit_parameters.txt<<EOF
 
  901 `egrep Tmax_s 
$WORKDIR/acoustics_fit_parameters.txt`
 
  915         let 
"A_RAD = $DX_M / $RADIUS_M"      # use maximal horizontal 
distance between 
T-bar and emitter/hydrophone
 
  917         for (( 
N = 0; $N < $NUMBER_OF_ITERATIONS; ++
N )); 
do 
  927             for ID in ${(
k)TRIPODS}; 
do 
  940             if (( $CHI2[3] - $CHI2[1] < $EPSILON )); 
then 
  945         if (( $N >= $NUMBER_OF_ITERATIONS )); 
then 
  946             warning 
"reached maximum number of iterations $N - convergence $(($CHI2[3] - $CHI2[1]))" 
  954     for DX_M 
in 0.05; 
do                     # determine (z) positions of modules and (
x,y) positions of 
strings 
  956         for (( 
N = 0; $N < $NUMBER_OF_ITERATIONS; ++
N )); 
do 
  962                 for (( FLOOR = 1; $FLOOR <= 18; FLOOR += 1 )); 
do 
  970             if (( $CHI2[3] - $CHI2[1] < $EPSILON )); 
then 
  975         if (( $N >= $NUMBER_OF_ITERATIONS )); 
then 
  976             warning 
"reached maximum number of iterations $N - convergence $(($CHI2[3] - $CHI2[1]))" 
  982 # ----------------------------------------------------------------------------------------------------- 
  984 # This stage can be used to determine the rotations of the strings and z-positions of the anchors. 
  985 # It is followed by a determination of the positions of the strings, tripods and modules. 
  987 # ----------------------------------------------------------------------------------------------------- 
  990     cat>$TMPDIR/acoustics_fit_parameters.txt<<EOF
 
  991 `egrep Tmax_s 
$WORKDIR/acoustics_fit_parameters.txt`
 
 1004     for DX_M 
in 0.10; 
do                     # determine rotation of 
string and z-position of anchors
 
 1006         let 
"A_RAD = $DX_M / $RADIUS_M"      # use maximal horizontal 
distance between 
T-bar and emitter/hydrophone
 
 1008         for (( 
N = 0; $N < $NUMBER_OF_ITERATIONS; ++
N )); 
do 
 1017             if (( $CHI2[3] - $CHI2[1] < $EPSILON )); 
then 
 1022         if (( $N >= $NUMBER_OF_ITERATIONS )); 
then 
 1023             warning 
"reached maximum number of iterations $N - convergence $(($CHI2[3] - $CHI2[1]))" 
 1033         for (( 
N = 0; $N < $NUMBER_OF_ITERATIONS; ++
N )); 
do 
 1044             for ID in ${(
k)TRIPODS}; 
do 
 1050             if (( $CHI2[3] - $CHI2[1] < $EPSILON )); 
then 
 1055         if (( $N >= $NUMBER_OF_ITERATIONS )); 
then 
 1056             warning 
"reached maximum number of iterations $N - convergence $(($CHI2[3] - $CHI2[1]))" 
 1064     for DX_M 
in 0.05; 
do                     # determine (z) positions of modules and (
x,y) positions of 
strings 
 1066         for (( 
N = 0; $N < $NUMBER_OF_ITERATIONS; ++
N )); 
do 
 1072                 for (( FLOOR = 1; $FLOOR <= 18; FLOOR += 1 )); 
do 
 1080             if (( $CHI2[3] - $CHI2[1] < $EPSILON )); 
then 
 1085         if (( $N >= $NUMBER_OF_ITERATIONS )); 
then 
 1086             warning 
"reached maximum number of iterations $N - convergence $(($CHI2[3] - $CHI2[1]))" 
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 usage $script< detector >< run >< outputfile > fi case set_variable OPTION
then fatal No hydrophone data file $HYDROPHONE_TXT fi sort gr k
std::istream & read(std::istream &in, JTestSummary &summary, const char delimiter= ' ')
Read test summary. 
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< detector specific pre-calibration script >< option > nAuxiliary script to make scan of pre stretching of detector strings(see JEditDetector)." "\nPossible options
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
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
no fit printf nominal n $STRING awk v X
do set_variable MODULE getModule a $WORKDIR detector_a datx L $STRING JEditDetector a $WORKDIR detector_a datx M $MODULE setz o $WORKDIR detector_a datx JEditDetector a $WORKDIR detector_b datx M $MODULE setz o $WORKDIR detector_b datx done echo Output stored at $WORKDIR detector_a datx and $WORKDIR tripod_a txt JDrawDetector2D a $WORKDIR detector_a datx a $WORKDIR detector_b datx L BL o detector $FORMAT $BATCH JDrawDetector2D T $WORKDIR tripod_a txt T $WORKDIR tripod_b txt L BL o tripod $FORMAT $BATCH JCompareDetector a $WORKDIR detector_a datx b $WORKDIR detector_b datx o $WORKDIR abc root &dev null for KEY in X Y Z
then echo Creating output directory
do set_variable DETECTOR_TXT $WORKDIR detector
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
*fatal Wrong option $OPTION
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