Jpp
JDAQEvent.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 JDAQEvent.
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 define_variable INPUT_FILE
27 set_variable OUTPUT_FILE $WORKDIR/histogram.root
28 #set_variable TRIGGER_MASK 10 # 3D Shower
29 #set_variable TRIGGER_MASK 100 # MX Shower
30 #set_variable TRIGGER_MASK 10000 # 3D Muon
31 set_variable TRIGGER_MASK 11111 # All
32 
33 if ( do_usage $* ); then
34  usage "$script <input file> [output file]"
35 fi
36 
37 case $# in
38  2) set_variable OUTPUT_FILE $2;&
39  1) set_variable INPUT_FILE $1;;
40  *) fatal "Wrong number of arguments."
41 esac
42 
43 if (( 1 )); then
44 
45  print_variable INPUT_FILE OUTPUT_FILE
46  check_input_file $INPUT_FILE
47 
48  timer_start
49 
50  $JPP_DIR/examples/JDAQ/JDAQEvent \
51  -f $INPUT_FILE \
52  -o $OUTPUT_FILE \
53  -T $TRIGGER_MASK \
54  -d $DEBUG --!
55 
56  timer_stop
57  timer_print
58 fi
59 
60 if (( 1 )); then
61  JPlot1D \
62  -f ${OUTPUT_FILE}:hn \
63  -f ${OUTPUT_FILE}:hm \
64  -> "hits" \
65  -\^ "number of events [a.u.]"
66 
67  JPlot1D \
68  -f ${OUTPUT_FILE}:h0 \
69  -> "PMT" \
70  -\^ "number of events [a.u.]"
71 
72  JPlot1D \
73  -f ${OUTPUT_FILE}:h1 \
74  -> "time-over-threshold [ns]" \
75  -\^ "number of events [a.u.]" \
76 
77  JPlot1D \
78  -f ${OUTPUT_FILE}:h2 \
79  -> "time [ns]" \
80  -\^ "number of events [a.u.]" \
81  -w 800x400
82 fi