Jpp  15.0.3
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JBallarat.sh
Go to the documentation of this file.
1 #!/bin/zsh
2 #
3 #
4 # \author mdejong
5 #
6 version=1.0
7 script=${0##*/}
8 
9 if [ -z $JPP_DIR ]; then
10  echo "Variable JPP_DIR undefined."
11  exit
12 fi
13 
14 source $JPP_DIR/setenv.sh $JPP_DIR
15 
16 set_variable: DEBUG COMPASS_DEBUG 2
17 set_variable: WORKDIR COMPASS_WORKDIR ./
18 set_variable: ANGLE_DEG COMPASS_ANGLE_DEG 5.0
19 
20 if do_usage $*; then
21  usage "$script <detector file> (run[-run])+ <output file>"\
22  "\nAuxiliary script to process AHRS data for dynamic orientation calibration."
23 fi
24 
25 if (( $# < 2 )); then
26  fatal "Wrong number of parameters."
27 fi
28 
30 set_array RUNS $argv[2,-2]
31 set_variable OUTPUT_FILE $argv[-1]
32 
33 set_variable AHRS_CALIBRATION_FILE $WORKDIR/ahrs_calibration.txt
34 
35 eval `JPrintDetector -a $DETECTOR -O IDENTIFIER`
36 
37 typeset -a INPUT_FILES
38 
40 
41 for RANGE in $RUNS[*]; do
42 
43  for (( RUN = ${RANGE%%-*}; $RUN <= ${RANGE##*-}; RUN += 1 )); do
44 
45  set_variable INPUT_FILE $WORKDIR/KM3NeT_${(l:8::0::0:)DETECTOR_ID}_${(l:8::0::0:)RUN}_ahrs.root
46 
47  if [[ ! -f $INPUT_FILE ]]; then
48 
49  echo -n "Writing $INPUT_FILE... "
50 
51  JConvertDB \
52  -q "ahrs" \
53  -@ "detid = $DETECTOR_ID" \
54  -@ "minrun = $RUN" \
55  -@ "maxrun = $RUN" \
56  -o $INPUT_FILE \
57  -d $DEBUG --
58 
59  if (( $? == 0 )); then
60  echo "OK"
61  else
62  echo "no data"
63  let NUMBER_OF_ERRORS="$NUMBER_OF_ERRORS + 1"
64  fi
65  fi
66 
67  if [[ -f $INPUT_FILE ]]; then
69  fi
70  done
71 done
72 
73 if (( $NUMBER_OF_ERRORS != 0 )); then
74  echo "Number of errors $NUMBER_OF_ERRORS"
75 fi
76 
77 if [[ ! -f $AHRS_CALIBRATION_FILE ]]; then
78 
79  JAHRSCalibration \
80  -D $DETECTOR_ID \
81  -o $AHRS_CALIBRATION_FILE \
82  -d $DEBUG
83 fi
84 
86 
87 JBallarat \
88  -a $DETECTOR \
89  -c $AHRS_CALIBRATION_FILE \
90  -f "$INPUT_FILES[*]" \
91  -o $OUTPUT_FILE \
92  -S $ANGLE_DEG \
93  -d $DEBUG --!
94 
95 timer_stop
96 timer_print
then usage $script< detector file >< detectorfile > nIf the range of floors is the first detector file is aligned to the second before the comparison nIn only modules within the given range of floors are used fi case set_variable RANGE $argv[3]
then usage $script< input file >< inputfile > fi case set_variable ANGLE_DEG
Definition: JPostfit2F.sh:35
set_variable INPUT_FILE
o $QUALITY_ROOT d $DEBUG!JPlot1D f
Definition: JDataQuality.sh:66
exit
Definition: JPizza.sh:36
then echo
const int n
Definition: JPolint.hh:660
then timer_start(JRandomTimesliceWriter-a ${DETECTOR}-o ${PIPE}-n ${NUMBER_OF_SLICES}-P ${PMT_FILE}-d ${DEBUG}-S ${SEED}-B"$BACKGROUND_HZ"-N"$RECYCLING"--!&&for((i=0;$i!=10;++i));do;echo 'EOF' > $PIPE;usleep 100000;done &&rm-f $PIPE)&JTimesliceReprocessor-a $
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 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 JFileTuna f $INPUT_FILE
Definition: file-Tuna.sh:66
do sput $STRING $FLOOR sget MODULE INPUT_FILES
Definition: JCanberra.sh:73
then usage else fatal Wrong number of arguments fi JCookie sh eval JPrintDetector a $DETECTOR O IDENTIFIER source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE let NUMBER_OF_ERRORS
do set_variable SIGMA_NS set_variable OUTLIERS set_variable OUTPUT_FILE matrix[${ALPHA_DEG}\deg\] root $JPP JMatrixNZ a $DETECTOR f $INPUT_FILE o $OUTPUT_FILE S
Definition: JMatrixNZ.sh:58
&set_variable OUTPUT_FILE
then JMuonMCEvt f $INPUT_FILE o $INTERMEDIATE_FILE d
Definition: JMuonPath.sh:47
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 usage $script< input_file >< detector_file > fi set_variable OUTPUT_DIR set_variable SELECTOR JDAQTimesliceL1 set_variable DEBUG case set_variable DEBUG
then display $WORKDIR
Definition: plot-Domino.sh:128
$WORKDIR ev_configure_domsimulator txt echo process $DOM_SIMULATOR $i $SOURCE_HOST[$index] csh c(setenv ROOTSYS $ROOTSYS &&source $JPP_DIR/setenv.csh $JPP_DIR &&($DOM_SIMULATOR\-u\$NAME\$\-H\$SERVER\$\-M\$LOGGER\$\-d $DEBUG</dev/null > &/dev/null &))'
set_variable DETECTOR
do set_variable INPUT_FILE $WORKDIR KM3NeT_
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
do echo Generating $dir eval D
Definition: JDrawLED.sh:53
version
Definition: JCalibratePMT.sh:7
set_array RUNS
Definition: JDataQuality.sh:23
do if[[!-f $ACOUSTICS_WORKDIR/${KEY}.txt]]
Definition: JAcoustics.sh:39