Jpp  debug
the software that should make you happy
JDAQTimeslice.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 JDAQTimeslice.
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 ${TMPDIR:-/tmp}/
26 set_variable OUTPUT_FILE timeslice.root
27 
28 if do_usage $*; then
29  usage "$script <input file> [output file]"
30 fi
31 
32 case $# in
33  2) set_variable OUTPUT_FILE $2;&
34  1) set_variable INPUT_FILE $1;;
35  *) fatal "Wrong number of arguments."
36 esac
37 
38 if (( 1 )); then
39 
40  print_variable INPUT_FILE OUTPUT_FILE
41  check_input_file $INPUT_FILE
42 
43  timer_start
44 
45  $JPP_DIR/examples/JDAQ/JDAQTimeslice \
46  -f $INPUT_FILE \
47  -o $OUTPUT_FILE \
48  -d $DEBUG
49 
50  timer_stop
51  timer_print
52 
53 fi
54 
55 
56 if (( 1 )); then
57 
58  JPlot1D \
59  -f ${OUTPUT_FILE}:h0 \
60  -> "PMT" \
61  -\^ "number of events [a.u.]" \
62  -T "" -LTR
63 
64  JPlot1D \
65  -f ${OUTPUT_FILE}:h1 \
66  -> "time-over-threshold [ns]" \
67  -\^ "number of events [a.u.]" \
68  -T "" -LTR
69 
70  JPlot1D \
71  -w 800x400 \
72  -f ${OUTPUT_FILE}:h2 \
73  -> "time [ns]" \
74  -\^ "number of events [a.u.]" \
75  -T "" -LTR
76 
77  JPlot1D \
78  -f ${OUTPUT_FILE}:h3 \
79  -XX \
80  -Y \
81  -> "size" \
82  -\^ "number of events [a.u.]" \
83  -T "" -LTR
84 
85 fi