Jpp  master_rocky-43-ge265d140c
the software that should make you happy
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 set_variable PRESCALE 1
26 set_variable: FORMAT GRAPHICS_FORMAT gif
27 set_variable+ BATCH GRAPHICS_BATCH -B
28 
29 if do_usage $*; then
30  usage "$script <input file> [prescale]"
31 fi
32 
33 case $# in
34  2) set_variable PRESCALE $2;&
35  1) set_variable INPUT_FILE $1;;
36  *) fatal "Wrong number of arguments."
37 esac
38 
39 set_variable OUTPUT_FILE profile.root
40 
41 if (( 1 )); then
42 
43  $JPP_DIR/examples/JDAQ/JDAQProfile \
44  -f $INPUT_FILE \
45  -o $OUTPUT_FILE \
46  -P $PRESCALE \
47  -d $DEBUG --!
48 fi
49 
50 
51 if (( 1 )); then
52 
53  JPlot1D \
54  -w 1200x600 \
55  -f"${OUTPUT_FILE}:#N" \
56  -f"${OUTPUT_FILE}:#M" \
57  -f"${OUTPUT_FILE}:#L" \
58  -> "time [100 ms]" \
59  -\^ "number of modules" \
60  -T "summary" \
61  -L BR \
62  -O HIST \
63  -o N.$FORMAT $BATCH
64 fi
65 
66 
67 if (( 1 )); then
68 
69  JPlot1D \
70  -w 1200x600 \
71  -f ${OUTPUT_FILE}:L0 \
72  -> "time [100 ms]" \
73  -\^ "rate [kHz]" \
74  -T "L0 rate" \
75  -L BR \
76  -O HIST \
77  -o L0.$FORMAT $BATCH
78 fi
79 
80 if (( 1 )); then
81 
82  JPlot1D \
83  -w 1200x600 \
84  -f ${OUTPUT_FILE}:WR \
85  -> "time [100 ms]" \
86  -\^ "probability" \
87  -T "WR status" \
88  -O HIST \
89  -o WR.$FORMAT $BATCH
90 fi
91 
92 if (( 1 )); then
93 
94  JPlot1D \
95  -w 1200x600 \
96  -f ${OUTPUT_FILE}:trigger \
97  -> "time [100 ms]" \
98  -\^ "rate [Hz]" \
99  -T "Trigger rate" \
100  -O HIST \
101  -o trigger.$FORMAT $BATCH
102 fi