Jpp test-rotations-old
the software that should make you happy
Loading...
Searching...
No Matches
JDB/JToAshortMonitor.sh
Go to the documentation of this file.
1#!/usr/bin/env zsh
2script=${0##*/}
3
4if [ -z $JPP_DIR ]; then
5 echo "Variable JPP_DIR undefined."
6 exit
7fi
8
9source $JPP_DIR/setenv.sh $JPP_DIR >& /dev/null
10
11set_variable: DEBUG ACOUSTICS_DEBUG 2
12set_variable: WORKDIR ACOUSTICS_WORKDIR ./
13set_variable: QUALITY_FACTOR ACOUSTICS_QUALITYFACTOR 2.0e3
14set_variable: FORMAT GRAPHICS_FORMAT gif
15set_variable+ BATCH GRAPHICS_BATCH -B
16
17if do_usage $*; then
18 usage "$script <detector identifier> (run[-run])+"\
19 "\nAuxiliary script to monitor acoustic data from database."
20fi
21
22if (( $# > 1 )); then
23 set_variable DETECTOR_ID $argv[1]
24 set_array RUNS $argv[2,-1]
25else
26 fatal "Wrong number of arguments."
27fi
28
29JCookie.sh
30
31INPUT_FILES=()
32
33expand_array RUNS
34
35for RUN in $RUNS[*]; do
36
37 set_variable INPUT_FILE $WORKDIR/KM3NeT_${(l:8::0::0:)DETECTOR_ID}_${(l:8::0::0:)RUN}_toa.root
38
39 if [[ ! -f $INPUT_FILE ]]; then
40
41 JToA \
42 -@ "detid = `getDetector -D $DETECTOR_ID`" \
43 -@ "minrun = $RUN" \
44 -@ "maxrun = $RUN" \
45 -@ "QUALITYFACTOR >= $QUALITY_FACTOR" \
46 -o $INPUT_FILE \
47 -d $DEBUG --!
48 fi
49
50 if [[ -f $INPUT_FILE ]]; then
51 INPUT_FILES+=($INPUT_FILE)
52 fi
53done
54
55$JPP_DIR/examples/JDB/JToAshortMonitor \
56 -f${^INPUT_FILES} \
57 -o ${TMPDIR:-/tmp}/toashort.root \
58 -d $DEBUG
59
60JPlot1D \
61 -f ${TMPDIR:-/tmp}/toashort.root:quality \
62 -> "log10(quality)" \
63 -\^ "number of entries" \
64 -XX \
65 -T "" \
66 -L "TL 0.6" \
67 -o $WORKDIR/quality.$FORMAT $BATCH
68
69JPlot1D \
70 -w 1200x600 \
71 -f ${TMPDIR:-/tmp}/toashort.root:toa \
72 -\^ "log10(quality)" \
73 -N "X 505" \
74 -t "$TIMESTAMP" \
75 -S 0.5 \
76 -T "" \
77 -L "BL 0.6" \
78 -o $WORKDIR/toa.$FORMAT $BATCH