Jpp
JARCAMuonGandalf.sh
Go to the documentation of this file.
1 #!/bin/zsh
2 #
3 # \author gmaggi
4 #
5 script=${0##*/}
6 
7 # ------------------------------------------------------------------------------------------
8 #
9 # Utility script to run JGandalf.
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 1
23 set_variable WORKDIR $JPP_DATA
24 set_variable DETECTOR $WORKDIR/km3net_reference.detx
25 set_variable INPUT_FILE $WORKDIR/simplex.root
26 set_variable OUTPUT_FILE $WORKDIR/gandalf.root
27 set_variable PDF $WORKDIR/J%p.dat
28 
29 if ( do_usage $* ); then
30  usage "$script [detector file [input file [output file [PDF file descriptor]]]]"
31 fi
32 
33 case $# in
34  4) set_variable PDF $4;&
35  3) set_variable OUTPUT_FILE $3;&
36  2) set_variable INPUT_FILE $2;&
37  1) set_variable DETECTOR $1;;
38 esac
39 
40 print_variable DETECTOR INPUT_FILE OUTPUT_FILE PDF
41 check_input_file $DETECTOR $INPUT_FILE
42 check_output_file $OUTPUT_FILE
43 
44 # default input values
45 set_variable ARCA_MUON_PARAMETERS $JPP_DATA/muonReconstruction_parameters_arca.txt
46 
47 timer_start
48 
49 JMuonGandalf \
50  -a $DETECTOR \
51  -f $INPUT_FILE \
52  -P $PDF \
53  -o $OUTPUT_FILE \
54  -@ ${ARCA_MUON_PARAMETERS} \
55  -d ${DEBUG} --!
56 
57 timer_stop
58 timer_print