Jpp master_rocky-44-g75b7c4f75
the software that should make you happy
Loading...
Searching...
No Matches
JDB/JToAshortMonitor.sh
Go to the documentation of this file.
1#!/bin/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}_toashort.root
38
39 if [[ ! -f $INPUT_FILE ]]; then
40
41 JConvertDB \
42 -q toashort \
43 -@ "detid = `getDetector -D $DETECTOR_ID`" \
44 -@ "minrun = $RUN" \
45 -@ "maxrun = $RUN" \
46 -@ "QUALITYFACTOR >= $QUALITY_FACTOR" \
47 -o $INPUT_FILE \
48 -d $DEBUG --!
49 fi
50
51 if [[ -f $INPUT_FILE ]]; then
52 INPUT_FILES+=($INPUT_FILE)
53 fi
54done
55
56$JPP_DIR/examples/JDB/JToAshortMonitor \
57 -f${^INPUT_FILES} \
58 -o ${TMPDIR:-/tmp}/toashort.root \
59 -d $DEBUG
60
61JPlot1D \
62 -f ${TMPDIR:-/tmp}/toashort.root:quality \
63 -> "log10(quality)" \
64 -\^ "number of entries" \
65 -XX \
66 -T "" \
67 -L "TL 0.6" \
68 -o $WORKDIR/quality.$FORMAT $BATCH
69
70JPlot1D \
71 -w 1200x600 \
72 -f ${TMPDIR:-/tmp}/toashort.root:toa \
73 -\^ "log10(quality)" \
74 -N "X 505" \
75 -t "$TIMESTAMP" \
76 -S 0.5 \
77 -T "" \
78 -L "BL 0.6" \
79 -o $WORKDIR/toa.$FORMAT $BATCH