Jpp  master_rocky
the software that should make you happy
JDB/JToAshortMonitor.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 
11 set_variable: DEBUG ACOUSTICS_DEBUG 2
12 set_variable: WORKDIR ACOUSTICS_WORKDIR ./
13 set_variable: QUALITY_FACTOR ACOUSTICS_QUALITYFACTOR 2.0e3
14 set_variable: FORMAT GRAPHICS_FORMAT gif
15 set_variable+ BATCH GRAPHICS_BATCH -B
16 
17 if do_usage $*; then
18  usage "$script <detector identifier> (run[-run])+"\
19  "\nAuxiliary script to monitor acoustic data from database."
20 fi
21 
22 if (( $# > 1 )); then
23  set_variable DETECTOR_ID $argv[1]
24  set_array RUNS $argv[2,-1]
25 else
26  fatal "Wrong number of arguments."
27 fi
28 
29 JCookie.sh
30 
31 INPUT_FILES=()
32 
33 expand_array RUNS
34 
35 for 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
54 done
55 
56 $JPP_DIR/examples/JDB/JToAshortMonitor \
57  -f${^INPUT_FILES} \
58  -o ${TMPDIR:-/tmp}/toashort.root \
59  -d $DEBUG
60 
61 JPlot1D \
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 
70 JPlot1D \
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