Jpp 20.0.0-27-g39925593c-D
the software that should make you happy
Loading...
Searching...
No Matches
JCompareSummaryslice.sh
Go to the documentation of this file.
1#!/usr/bin/env zsh
2#
3# \author mdejong
4#
5script=${0##*/}
6
7source $JPP_DIR/setenv.sh $JPP_DIR >& /dev/null
8
9set_variable DEBUG 2
10set_variable: FORMAT GRAPHICS_FORMAT gif
11set_variable+ BATCH GRAPHICS_BATCH -B
12
13if do_usage $*; then
14 usage "$script <input file> <input file>"
15fi
16
17if (( $# == 2 )); then
18 INPUT_FILES=($argv[1,2])
19else
20 fatal "Wrong number of arguments."
21fi
22
23$JPP_DIR/examples/JSummaryslice/JCompareSummaryslice \
24 -f "$INPUT_FILES[1,2]" \
25 -R "-0.1 +0.1" \
26 -o summary.root \
27 -d $DEBUG --!
28
29JPlot1D \
30 -f summary.root:h0 \
31 -> "#DeltaR [kHz]" \
32 -\^ "number of events [a.u.]" \
33 -T "" \
34 -s 110 \
35 -o h0.$FORMAT $BATCH
36
37JPlot2D \
38 -f summary.root:ha \
39 -> "R [kHz]" \
40 -< "#DeltaR [kHz]" \
41 -X \
42 -Z \
43 -O colz \
44 -T "" \
45 -o ha.$FORMAT $BATCH
46
47JPlot2D \
48 -f summary.root:hb \
49 -> "R [kHz]" \
50 -< "#Deltabit" \
51 -y "-10 +10" \
52 -X \
53 -Z \
54 -O colz \
55 -T "" \
56 -o hb.$FORMAT $BATCH
57
58typeset -A H2
59
60H2[h1]="R [kHz]"
61H2[h2]="high-rate veto"
62H2[h3]="FIFO (almost) full"
63H2[h4]="UDP maximum"
64H2[h5]="UDP count"
65H2[h6]="UDP trailer"
66
67JPrintRange2D -f summary.root:h1 | read -A BUFFER
68
69JLine -p "$BUFFER[1] $BUFFER[2] $BUFFER[4] $BUFFER[5]" -@ "width = 1" -o line.root
70
71for KEY VALUE in ${(kv)H2}; do
72
73 if [[ "$VALUE" == *"Hz"* ]]; then
74 OPTIONS=(-X -Y)
75 else
76 OPTIONS=()
77
78 if (( $(JPrintResult -f summary.root:$KEY -F GetNbinsX) <= 2 )); then
79 OPTIONS+=("-N X 2")
80 fi
81 if (( $(JPrintResult -f summary.root:$KEY -F GetNbinsY) <= 2 )); then
82 OPTIONS+=("-N Y 2")
83 fi
84 fi
85
86 if [[ "$KEY" == "h1" ]]; then
87 OPTIONS+=("-f line.root:TLine")
88 fi
89
90 JPlot2D \
91 -f summary.root:$KEY \
92 -> "$VALUE" \
93 -< "$VALUE" \
94 $OPTIONS[*] \
95 -Z \
96 -O colz \
97 -T "" \
98 -o $KEY.$FORMAT $BATCH
99done