Jpp test-rotations-old
the software that should make you happy
Loading...
Searching...
No Matches
JTuna.sh
Go to the documentation of this file.
1#!/usr/bin/env zsh
2script=${0##*/}
3
4# ------------------------------------------------------------------------------------------
5#
6# Auxiliary script to convert slow control data from database to ROOT TTree or TGraph's.
7#
8# ------------------------------------------------------------------------------------------
9
10if [ -z $JPP_DIR ]; then
11 echo "Variable JPP_DIR undefined."
12 exit
13fi
14
15source $JPP_DIR/setenv.sh $JPP_DIR >& /dev/null
16
17set_variable: DEBUG DATABASE_DEBUG 2
18set_variable: WORKDIR DATABASE_WORKDIR ${TMPDIR:-/tmp}/
19set_variable OPTION
20
21if do_usage $*; then
22 usage "$script <detector> <run> <output file> [option]"
23fi
24
25case $# in
26 4) set_variable OPTION $4;&
27 3) set_variable OUTPUT_FILE $3;
28 set_variable RUN $2;
29 set_variable DETECTOR $1;;
30 *) fatal "Wrong number of arguments."
31esac
32
33JCookie.sh
34
35#typeset -Z 8 DETECTOR
36typeset -Z 8 RUN
37
38set_variable OUTPUT_FILE ${OUTPUT_FILE/\%/${DETECTOR}}
39set_variable OUTPUT_FILE ${OUTPUT_FILE/\%/${RUN}}
40
41if [[ ! -f $OUTPUT_FILE ]]; then
42
43 JTuna \
44 -D ${DETECTOR} \
45 -R "$RUN $RUN" \
46 -o ${OUTPUT_FILE} \
47 ${OPTION} \
48 -d ${DEBUG} --!
49else
50 notice "File $OUTPUT_FILE exists; remove to overwrite."
51fi