Jpp 19.3.0-rc.1
the software that should make you happy
Loading...
Searching...
No Matches
billabong-random:plot.sh
Go to the documentation of this file.
1#!/usr/bin/env zsh
2script=${0:t}
3
4source $JPP_DIR/setenv.sh $JPP_DIR >& /dev/null
5
6zmodload zsh/mathfunc
7
8set_variable DEBUG 2
9set_variable: FORMAT GRAPHICS_FORMAT gif
10set_variable+ BATCH GRAPHICS_BATCH -B
11
12if do_usage $*; then
13 usage "$script <input file>"
14fi
15
16if (( $# != 1 )); then
17 fatal "Wrong number of arguments."
18fi
19
20set_variable GRAPH_TXT $1
21set_variable GRAPH_ROOT graph.root
22
23JGraph \
24 -f $GRAPH_TXT \
25 -o $GRAPH_ROOT
26
27let "XMIN = $(awk '{ print $1 }' $GRAPH_TXT | sort -g | head -1) - 0.05"
28let "XMAX = $(awk '{ print $1 }' $GRAPH_TXT | sort -g | tail -1) + 0.50"
29
30if (( 1 )) && [[ $GRAPH_TXT == *noise* ]]; then
31
32 JFit \
33 -f ${GRAPH_ROOT}:\.\* \
34 -F "[0] * pow(x,[1])" \
35 -@ "p0 = 1.0e-6" \
36 -@ "p1 = 10.0" \
37 -o fit.root
38
39 JPlot1D \
40 -@ "leftMargin = 0.2" \
41 -@ "titleOffset = 1.3" \
42 -f fit.root:\.\* \
43 -> "noise rate [Hz]" \
44 -\^ "event rate [Hz]" \
45 -x "$XMIN $XMAX" -X \
46 -y "1.0e-6 1.0e0" -Y \
47 -T "" \
48 -o noise.$FORMAT $BATCH
49fi
50
51if (( 0 )) && [[ $GRAPH_TXT == *noise* ]]; then
52
53 JPlot1D \
54 -@ "leftMargin = 0.2" \
55 -@ "titleOffset = 1.3" \
56 -f ${GRAPH_ROOT}:\.\* \
57 -> "noise rate [Hz]" \
58 -\^ "event rate [Hz]" \
59 -x "$XMIN $XMAX" -X \
60 -y "1.0e-6 1.0e0" -Y \
61 -T "" \
62 -o noise.$FORMAT $BATCH
63fi
64
65if [[ $GRAPH_TXT == *cpu* ]]; then
66
67 JFit \
68 -f ${GRAPH_ROOT}:\.\* \
69 -F "[0] * pow(x,[1])" \
70 -@ "p0 = 2.0" \
71 -@ "p1 = 3.5" \
72 -o fit.root
73
74 JPlot1D \
75 -@ "leftMargin = 0.2" \
76 -@ "titleOffset = 1.3" \
77 -f fit.root:\.\* \
78 -> "noise rate [Hz]" \
79 -\^ "cpu" \
80 -x "$XMIN $XMAX" -X \
81 -y "1.00 5.0e3" -Y \
82 -G XY \
83 -T "" \
84 -o cpu.$FORMAT $BATCH
85fi
86
87rm -f $GRAPH_ROOT >& /dev/null
88rm -f fit.root >& /dev/null