Jpp  17.1.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
plot-acoustics-fit.sh
Go to the documentation of this file.
1 #!/bin/zsh
2 script=${0##*/}
3 
4 # --------------------------------------------------------------------------------------------
5 #
6 # Auxiliary script to plot chi2 evolution of acoustics-fit.sh
7 #
8 # --------------------------------------------------------------------------------------------
9 
10 if [ -z $JPP_DIR ]; then
11  echo "Variable JPP_DIR undefined."
12  exit
13 fi
14 
15 source $JPP_DIR/setenv.sh $JPP_DIR >& /dev/null
16 
17 set_variable: DEBUG ACOUSTICS_DEBUG 2
18 set_variable: WORKDIR ACOUSTICS_WORKDIR ./
19 set_variable: OPTION GRAPHICS_OPTION
20 set_variable: FORMAT GRAPHICS_FORMAT gif
21 set_variable+ BATCH GRAPHICS_BATCH -B
22 
23 if do_usage $*; then
24  usage "$script (stage file)+"
25 fi
26 
27 if (( $# >= 1 )); then
28  set_array INPUT_FILES $argv[1,-1]
29 else
30  fatal "Wrong number of arguments."
31 fi
32 
33 for (( i = 1; $i <= ${#INPUT_FILES}; ++i )); do
34 
36  set_variable GRAPH_TXT ${TMPDIR:-/tmp}/graph\[$i\].txt
37  set_variable GRAPH_ROOT ${TMPDIR:-/tmp}/graph\[$i\].root
38 
39  eval awk \'\/Processing stage\/,\/Elapsed\/ \{ print \$0 \}\' $INPUT_FILE \
40  | head -n -1 \
41  | tail -n +2 > ${TMPDIR:-/tmp}/graph.txt
42 
43  if (( `cat ${TMPDIR:-/tmp}/graph.txt | wc -l` == 0 )); then
44  cat $INPUT_FILE > ${TMPDIR:-/tmp}/graph.txt
45  fi
46 
47  cat ${TMPDIR:-/tmp}/graph.txt \
48  | grep -v "warning" \
49  | awk '{ printf "%5d %8.3f\n", NR, $(NF) }' > $GRAPH_TXT
50 
51  JGraph \
52  -f $GRAPH_TXT \
53  -o $GRAPH_ROOT
54 done
55 
56 GRAPH_ROOT=(${TMPDIR:-/tmp}/graph\[{1..${#INPUT_FILES}}\].root)
57 
58 JPlot1D \
59  -f${^GRAPH_ROOT}:\.\* \
60  $OPTION \
61  -> "step" \
62  -\^ "#chi^{2}/NDF" \
63  -S 0.5 \
64  -T "" \
65  -o acoustics-fit.$FORMAT $BATCH
66 
67 rm -f ${TMPDIR:-/tmp}/graph*.{txt,root}
then usage $script< detector >< run >< outputfile > fi case set_variable OPTION
Definition: JTuna.sh:26
then usage $script< detector identifier >< startdate\"YYYY-MM-DDHH:MM:SS\"><finaldate\"YYYY-MM-DDHH:MM:SS\"><QA/QCfile> fi case set_variable QAQC_TXT $argv[4]
Definition: JDataMonitor.sh:24
exit
Definition: JPizza.sh:36
then echo
*fatal Wrong number of arguments esac set_variable GRAPH_TXT
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR &dev null set_variable
Definition: JAcoustics.sh:21
do set_variable STRING_TXT awk
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR if do_usage *then usage $script[(input file)+] fi set_variable DEBUG set_variable WORKDIR TMPDIR
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
set_variable INPUT_FILE
do sput $STRING $FLOOR sget MODULE INPUT_FILES
Definition: JCanberra.sh:77
script
Definition: JAcoustics.sh:2
esac $JPP_BIN JLogger sh $LOGGER until pgrep JGetMessage</dev/null > dev null
#define DEBUG(A)
Message macros.
Definition: JMessage.hh:62
do alias $i