Jpp  19.1.0-rc.1
the software that should make you happy
diff-Tuna.sh
Go to the documentation of this file.
1 #!/bin/zsh
2 script=${0##*/}
3 
4 # ------------------------------------------------------------------------------------------
5 #
6 # Auxiliary script to compare slow control data from database.
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 DATABASE_DEBUG 2
18 set_variable: WORKDIR DATABASE_WORKDIR ${TMPDIR:-/tmp}/
19 
20 if do_usage $*; then
21  usage "$script <detector> <source run> <target run> [working directory]"
22 fi
23 
24 case $# in
25  4) set_variable WORKDIR $4;&
26  3) set_variable TARGET_RUN $3;
27  set_variable SOURCE_RUN $2;
28  set_variable DETECTOR $1;;
29  *) fatal "Wrong number of arguments."
30 esac
31 
32 JCookie.sh
33 
34 typeset -Z 8 DETECTOR
35 typeset -Z 8 SOURCE_RUN
36 typeset -Z 8 TARGET_RUN
37 
38 set_variable PARAMETERS_FILE $WORKDIR/parameters-${DETECTOR}-${SOURCE_RUN}.txt
39 
40 if [[ ! -f $PARAMETERS_FILE ]]; then
41 
42  notice "Creating parameters file $PARAMETERS_FILE."
43 
44  set_variable OUTPUT_FILE $WORKDIR/${DETECTOR}-${SOURCE_RUN}_tuna.root
45 
46  JTuna.sh $DETECTOR $SOURCE_RUN $OUTPUT_FILE -G
47 
48  file-Tuna.sh $OUTPUT_FILE $PARAMETERS_FILE
49 
50 # rm -f $OUTPUT_FILE
51 else
52  notice "File $PARAMETERS_FILE exists; remove to overwrite."
53 fi
54 
55 set_variable OUTPUT_FILE $WORKDIR/${DETECTOR}-${TARGET_RUN}_tuna.root
56 set_variable TGRAPH_FILE $WORKDIR/${DETECTOR}-${TARGET_RUN}_graph.root
57 
58 JTuna.sh $DETECTOR $TARGET_RUN $OUTPUT_FILE -G
59 
60 mkdir -p $WORKDIR/$DETECTOR/$TARGET_RUN
61 
62 test-Tuna.sh $OUTPUT_FILE $PARAMETERS_FILE $WORKDIR/$DETECTOR/$TARGET_RUN
63 
64 #rm -f $OUTPUT_FILE