Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
detector-XY:run.sh
Go to the documentation of this file.
1 #!/bin/zsh
2 script=${0##*/}
3 
4 if [ -z $JPP_DIR ]; then
5  echo "Variable JPP_DIR undefined."
6  exit
7 fi
8 
9 source $JPP_DIR/setenv.sh $JPP_DIR >& /dev/null
10 
12 set_variable WORKDIR ${ACOUSTICS_WORKDIR:-./}
13 set_variable FIT ${ACOUSTICS_FIT:-2}
14 
15 if ( do_usage $* ); then
16  usage "$script <string identifier> <detector file> (input file)+"
17 fi
18 
19 if (( $# < 3 )); then
20  fatal "Wrong number of arguments."
21 fi
22 
25 set_array INPUT_FILES $argv[3,-1]
26 
27 eval `JPrintDetector -a $DETECTOR -O IDENTIFIER`
28 eval `JPrintDetector -a $DETECTOR -O SUMMARY`
29 
30 source JAcoustics.sh $DETECTOR_ID
31 
32 if [[ -z "${STRINGS[(r)$STRING]}" ]]; then
33  fatal "Invalid string $STRING; "\
34  "possible values: ${STRINGS[*]}"
35 fi
36 
37 set_variable DETECTOR_TXT $WORKDIR/detectorxy_${STRING}.txt
38 set_variable TMPDIR $WORKDIR/.$$
39 mkdir -p $TMPDIR
40 
41 for (( X = -1.0; $X <= +1.0; X += 0.1 )); do
42  for (( Y = -1.0; $Y <= +1.0; Y += 0.1 )); do
43 
44  rm -f $TMPDIR/detector.detx
45 
46  JEditDetector \
47  -a $DETECTOR \
48  -S "$STRING add $X $Y 0.0" \
49  -o $TMPDIR/detector.detx
50 
51  rm -f $TMPDIR/katoomba.root
52 
53  eval JKatoomba \
54  -a $TMPDIR/detector.detx \
55  -f \"$INPUT_FILES[*]\" \
56  -o $TMPDIR/katoomba.root \
57  -T `print_tripods` \
58  -V `print_velocity` \
59  -@ `make_equation PARAMETERS` \
60  -@ \"stdev = 50\" \
61  -@ \"mestimator = 1\" \
62  -F $FIT \
63  -u \
64  -d $DEBUG --!
65 
66  set_variable CHI2 `JPrintResult -f $TMPDIR/katoomba.root:chi2 -F "GetMean"`
67  set_variable RMS `JPrintResult -f $TMPDIR/katoomba.root:chi2 -F "GetRMS / sqrt(GetEntries)"`
68 
69  printf "%7.3f %7.3f %7.3f %7.4f\n" $X $Y $CHI2 $RMS >> $DETECTOR_TXT
70 
71  done
72 done
73 
74 rm -rf $TMPDIR
void set_variable(const std::string &name, const std::string &value)
Set environment variable.
clean eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY set_variable STRING
exit
Definition: JPizza.sh:36
do set_array DAQHEADER JPrintDAQHeader f
Definition: JTuneHV.sh:79
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
then echo
do $DIR JTransitTime o
Definition: JTransitTime.sh:44
* usage
then fatal Not enough arguments fi set_variable DETECTOR $argv[1] INPUT_FILES
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR &dev null set_variable ACOUSTICS_DEBUG
Definition: JAcoustics.sh:17
*set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2,-2] set_variable OUTPUT_FILE $argv[-1]
Definition: JDomino.sh:39
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:56
then $JPP_DIR software JCalibrate JCalibrateToT a
Definition: JTuneHV.sh:108
then display $WORKDIR
Definition: plot-Domino.sh:127
then fatal Wrong number of arguments fi set_variable STRING $argv[1] set_variable DETECTOR_TXT $WORKDIR detectorxy_
set_variable DETECTOR
do set_variable DETECTOR_TXT $WORKDIR detector
script
Definition: JAcoustics.sh:2
then usage $script< detector file >< inputfile > fi case set_variable WORKDIR
Definition: JLegolas.sh:28
esac $JPP_BIN JLogger sh $LOGGER until pgrep JGetMessage</dev/null > dev null
#define DEBUG(A)
Message macros.
Definition: JMessage.hh:62