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