Jpp
JDAQProfile.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 profiling.
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 define_variable INPUT_FILE
26 set_variable OUTPUT_FILE profile.root
27 set_variable PRESCALE 1
28 #set_variable PRESCALE 4000
29 
30 if ( do_usage $* ); then
31  usage "$script <input file> [output file]"
32 fi
33 
34 case $# in
35  2) set_variable OUTPUT_FILE $2;&
36  1) set_variable INPUT_FILE $1;;
37  *) fatal "Wrong number of arguments."
38 esac
39 
40 if (( 1 )); then
41 
42  check_input_file $INPUT_FILE
43 
44  timer_start
45 
46  $JPP_DIR/examples/JDAQ/JDAQProfile \
47  -f $INPUT_FILE \
48  -o $OUTPUT_FILE \
49  -P $PRESCALE \
50  -d $DEBUG --!
51 
52  timer_stop
53  timer_print
54 
55 fi
56 
57 
58 if (( 1 )); then
59 
60  JPlot1D \
61  -f ${OUTPUT_FILE}:N \
62  -T "${INPUT_FILE##*/}" \
63  -x "0 1000" \
64  -> "100 ms" \
65  -\^ "number of modules" \
66  -w 800x400 \
67  -o N.gif \
68 
69 fi
70 
71 
72 if (( 1 )); then
73 
74  JPlot1D \
75  -f ${OUTPUT_FILE}:L0 \
76  -T "L0 rate" \
77  -> "100 ms" \
78  -\^ "rate [kHz]" \
79  -w 800x400 \
80  -o L0-rate.gif \
81  -L TR
82 
83 fi
84 
85 if (( 1 )); then
86 
87  JPlot1D \
88  -f ${OUTPUT_FILE}:WR \
89  -T "WR status" \
90  -> "100 ms" \
91  -\^ "number of frames" \
92  -w 800x400 \
93  -L TR
94 
95 fi
96 
97 if (( 1 )); then
98 
99  JPlot1D \
100  -f ${OUTPUT_FILE}:trigger \
101  -T "Trigger rate" \
102  -> "100 ms" \
103  -\^ "rate [Hz]" \
104  -w 800x400 \
105  -o trigger-rate.gif
106 
107 fi