Jpp
JDAQHitRouter.sh
Go to the documentation of this file.
1 #!/bin/zsh
2 #
3 # \author mdejong
4 #
5 version=1.0
6 script=${0##*/}
7 
8 # ------------------------------------------------------------------------------------------
9 #
10 # Example script for JDAQHitRouter.
11 #
12 # ------------------------------------------------------------------------------------------
13 
14 
15 if [ -z $JPP_DIR ]; then
16  echo "Variable JPP_DIR undefined."
17  exit
18 fi
19 
20 
21 source $JPP_DIR/setenv.sh $JPP_DIR
22 
23 
24 set_variable DEBUG 2
25 set_variable WORKDIR /tmp/
26 set_variable DETECTOR $JPP_DATA/km3net_reference.detx
27 set_variable INPUT_FILE $JPP_DATA/trigger_efficiency+background.root
28 set_variable OUTPUT_FILE histogram.root
29 
30 if ( do_usage $* ); then
31  usage "$script [detector [input file [output file]]]"
32 fi
33 
34 case $# in
35  3) set_variable OUTPUT_FILE $3;&
36  2) set_variable INPUT_FILE $2;&
37  1) set_variable DETECTOR $1;;
38  *) fatal "Wrong number of arguments."
39 esac
40 
41 
42 if (( 1 )); then
43 
44  print_variable DETECTOR INPUT_FILE OUTPUT_FILE
45  check_input_file $DETECTOR $INPUT_FILE
46 
47  timer_start
48 
49  $JPP_DIR/examples/JDAQ/JDAQHitRouter \
50  -a $DETECTOR \
51  -f $INPUT_FILE \
52  -o $OUTPUT_FILE \
53  -d $DEBUG
54 
55  timer_stop
56  timer_print
57 
58 fi
59 
60 
61 if (( 1 )); then
62 
63  JPlot1D \
64  -f ${OUTPUT_FILE}:h1 \
65  -> "#Deltat [#mus]" \
66  -\^ "number of events [a.u.]"
67 
68 fi
69 
70 
71 if (( 1 )); then
72 
73  JPlot2D \
74  -f ${OUTPUT_FILE}:h2 \
75  -> "string" \
76  -< "floor" \
77  -OCOLZ \
78  -w 800x400 \
79  -N XY
80 
81 fi