Jpp  16.0.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
acoustics-fit_00000075.sh
Go to the documentation of this file.
1 #!/bin/zsh
2 script=${0##*/}
3 
4 # --------------------------------------------------------------------------------------------
5 #
6 # Steering script for the global-fit-of-global-fits procedure of the D0ARCA006 (75) detector.
7 #
8 # --------------------------------------------------------------------------------------------
9 
10 if [ -z $JPP_DIR ]; then
11  echo "Variable JPP_DIR undefined."
12  exit
13 fi
14 
15 source $JPP_DIR/setenv.sh $JPP_DIR >& /dev/null
16 
18 #set_array RUNS 9345-9356
19 #set_variable: MUL ACOUSTICS_MUL -1.17e-2
20 set_array RUNS 9700 9777 9884 9984 10000 10113 10200 10263
21 set_variable: MUL ACOUSTICS_MUL -1.21e-2
22 set_variable: STAGES ACOUSTICS_STAGES A 2 3
23 
24 if do_usage $*; then
25  usage "$script [user directory]"\
26  "\nThe user directory should be specified when this script is submitted in a batch queue."
27 fi
28 
30 
31 if (( $# == 1 )); then
33 else
35 fi
36 
37 set_variable TRIPOD_INITIAL tripod_initial.txt
38 set_variable TRIPOD tripod.txt
39 set_variable DETECTOR_INITIAL detector_initial.datx
41 
42 
43 # Run in HOMEDIR
44 
45 mkdir -p $HOMEDIR
46 
47 cd $HOMEDIR
48 
49 if [[ ! -f $DETECTOR_INITIAL ]]; then
50 
51  JDetectorDB \
52  -D $DETECTOR_ID \
53  -t A03166911 \
54  -p A02980895 \
55  -q A02980908 \
56  -WW \
57  -o $DETECTOR_INITIAL
58 fi
59 
60 if [[ ! -f $TRIPOD_INITIAL ]]; then
61 
62  cat>$TRIPOD_INITIAL<<EOF
63 # See https://git.km3net.de/calibration/input_tables for the origin(s) of the values
64 2 +587441.700 +4017014.700 -3459.600
65 3 +587848.700 +4016749.700 -3459.600
66 4 +587657.170 +4017113.940 -3459.600
67 5 +587906.500 +4017094.300 -3459.600
68 EOF
69 fi
70 
71 # Apply modifications to the detector, if any.
72 
73 JEditDetector \
74  -a $DETECTOR_INITIAL \
75  -s "-1 mul $MUL" \
76  -o $DETECTOR
77 
78 cp -p $TRIPOD_INITIAL $TRIPOD
79 
80 JAcoustics.sh $DETECTOR_ID
81 
82 JAcousticsEventBuilder.sh $DETECTOR $RUNS[*]
83 
84 
85 # Run in WORKDIR
86 
87 cd $WORKDIR
88 
89 if [ ! $HOMEDIR -ef $WORKDIR ]; then
90 
91  cp -p $HOMEDIR/$TRIPOD $WORKDIR
92  cp -p $HOMEDIR/$DETECTOR $WORKDIR
93 
94  for RANGE in $RUNS[*]; do
95  for (( RUN = ${RANGE%%-*}; $RUN <= ${RANGE##*-}; RUN += 1 )); do
96  cp -p $HOMEDIR/KM3NeT_${(l:8::0::0:)DETECTOR_ID}_${(l:8::0::0:)RUN}_event.root $WORKDIR
97  done
98  done
99 
100  JAcoustics.sh $DETECTOR_ID
101 
102 fi
103 
104 for STAGE in `echo $STAGES`; do
105 
106  $JPP_DIR/examples/JAcoustics/acoustics-fit.sh $DETECTOR $TRIPOD $STAGE $WORKDIR/KM3NeT_${(l:8::0::0:)DETECTOR_ID}_*event.root > $HOMEDIR/stage-${STAGE}.log
107 
108  if [ ! $HOMEDIR -ef $WORKDIR ]; then
109  cp -vru * $HOMEDIR
110  fi
111 done
112 
set_array RUNS
then JLigier sh continue fi cat
Definition: JDAQDriver.sh:51
o $QUALITY_ROOT d $DEBUG!JPlot1D f
Definition: JDataQuality.sh:66
exit
Definition: JPizza.sh:36
then usage $script[< detector file >< tripod file >][user directory] nThe user directory should be specified when this script is submitted in a batch queue nThe optional detector file and tripod file correspond to a pre calibrated sub detector fi set_variable WORKDIR pwd set_variable HOMEDIR $WORKDIR case set_variable HOMEDIR
then echo
*fatal invalid stage $STAGE(possible stages:1, 2, 3, A, D)"
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR &dev null if do_usage *then usage $script< detector identifier > fi case set_variable DETECTOR_ID
Definition: JTDC.sh:11
then fatal Detector file should be binary format fi eval JPrintDetector a $DETECTOR O IDENTIFIER typeset a INPUT_FILES for RANGE in $RUNS[*]
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR &dev null set_variable
Definition: JAcoustics.sh:20
then rm i $OUTPUT_FILE fi let RUN
&set_variable TRIPOD
set_variable NUMBER_OF_ITERATIONS set_variable EPSILON cat acoustics_fit_parameters txt<< EOF $CONFIGURATION[*]Nmin=3;sigma_s=100.0e-6;stdev=10.0;mestimator=0;fixStrings=0;EOF for STRING in $STRINGS[*];do#fit stretching and(z) position of given string set_variable DETECTOR_TMP ${TMPDIR:-/tmp}/detector_A.datx JEditDetector-a $DETECTOR-o $DETECTOR_TMP-r $STRING JEditDetector-a $DETECTOR-o $DETECTOR-k $STRING for MUL in 0.005 0.001;do DX_M=0.2 for((N=0;$N< $NUMBER_OF_ITERATIONS;++N));do CHI2[3]=$CHI2[1] fitPositionOfString $STRING Z $DX_M fitStretchingOfString $STRING $MUL if(($CHI2[3]-$CHI2[1]< $EPSILON));then break fi done if(($N >=$NUMBER_OF_ITERATIONS));then printf"warning: reached maximum number of iterations %d - converenge %7.3f\n"$N $(($CHI2[3]-$CHI2[1])) fi done JMergeDetector-a $DETECTOR-a $DETECTOR_TMP-o $DETECTOR rm-f $DETECTOR_TMP JConvertDetectorFormat-a $DETECTOR-o $DETECTOR-r-d 0 > &dev null done
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR &dev null set_variable DEBUG set_variable WORKDIR
Definition: JLegolas.sh:20
* usage
then JConvertDetectorFormat a $DETECTOR[1] o
then JCalibrateToT a
Definition: JTuneHV.sh:116
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
then display $WORKDIR
Definition: plot-Domino.sh:128
then cp
set_variable DETECTOR
do set_variable INPUT_FILE $WORKDIR KM3NeT_
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 source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
Definition: JCanberra.sh:42
source $JPP_DIR setenv csh $JPP_DIR &dev null eval JShellParser o a A
script
Definition: JAcoustics.sh:2
do echo Generating $dir eval D
Definition: JDrawLED.sh:53
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-@"z = -2441.5"-s"-1 mul $MUL"-o $DETECTORcp-p $TRIPOD_INITIAL $TRIPODJAcoustics.sh $DETECTOR_IDJAcousticsEventBuilder.sh $DETECTOR $RUNS[*]cd $WORKDIRif[!$HOMEDIR-ef $WORKDIR];then cp-p $HOMEDIR/$TRIPOD $WORKDIR cp-p $HOMEDIR/$DETECTOR $WORKDIR for RANGE in $RUNS[*];do for((RUN=${RANGE%%-*};$RUN<=${RANGE##*-};RUN+=1));do cp-p $HOMEDIR/KM3NeT_ ${(l:8::0::0:) DETECTOR_ID}_ ${(l:8::0::0:) RUN}_event.root $WORKDIR done done JAcoustics.sh $DETECTOR_IDfifor STAGE in`echo $STAGES`;do $JPP_DIR/examples/JAcoustics/acoustics-fit.sh $DETECTOR $TRIPOD $STAGE $WORKDIR/KM3NeT_ ${(l:8::0::0:) DETECTOR_ID}_ *event.root > $HOMEDIR stage
then fatal Invalid tripod $TRIPOD
esac $JPP_BIN JLogger sh $LOGGER until pgrep JGetMessage</dev/null > dev null