Jpp
JConvertEvt.sh
Go to the documentation of this file.
1 #!/bin/zsh
2 #
3 # \author mdejong
4 #
5 script=${0##*/}
6 
7 # ------------------------------------------------------------------------------------------
8 #
9 # Utility script to convert fit results to aanet format.
10 #
11 # ------------------------------------------------------------------------------------------
12 
13 if [ -z $JPP_DIR ]; then
14  echo "Variable JPP_DIR undefined."
15  exit
16 fi
17 
18 source $JPP_DIR/setenv.sh $JPP_DIR
19 
20 # default values for testing
21 
22 set_variable DEBUG 2
23 set_variable WORKDIR $JPP_DATA
24 set_variable INPUT_FILE $WORKDIR/start.root
25 set_variable OUTPUT_FILE $WORKDIR/aanet.root
26 set_variable NUMBER_OF_FITS 0
27 
28 if ( do_usage $* ); then
29  usage "$script [input file [output file]]"
30 fi
31 
32 case $# in
33  2)
34  OUTPUT_FILE=$2
35  ;&
36  1)
37  INPUT_FILE=$1
38  ;;
39  0)
40  ;;
41  *)
42  INPUT_FILE=$argv[1,-2]
43  OUTPUT_FILE=$argv[-1]
44  ;;
45 esac
46 
47 print_variable INPUT_FILE OUTPUT_FILE
48 check_input_file $INPUT_FILE
49 check_output_file $OUTPUT_FILE
50 
51 JConvertEvt \
52  -f $INPUT_FILE \
53  -o $OUTPUT_FILE \
54  -n $NUMBER_OF_FITS \
55  -d $DEBUG --!