Jpp test-rotations-old
the software that should make you happy
Loading...
Searching...
No Matches
JDrawPDF.sh
Go to the documentation of this file.
1#!/usr/bin/env zsh
2#
3# \author mdejong, bofearraigh
4#
5version=1.0
6script=${0##*/}
7
8# ------------------------------------------------------------------------------------------
9#
10# Utility script to plot PDFs.
11#
12# ------------------------------------------------------------------------------------------
13
14
15if [ -z $JPP_DIR ]; then
16 echo "Variable JPP_DIR undefined."
17 exit
18fi
19
20
21source $JPP_DIR/setenv.sh $JPP_DIR
22
23
24set_variable NORTH "0.00 0.00"
25set_variable EAST "1.57 0.00"
26set_variable SOUTH "3.14 0.00"
27set_variable WEST "1.57 3.14"
28
29set_variable WORKDIR ${TMPDIR:-/tmp}
30set_variable E 1e3
31set_variable R 50
32set_variable z 60
33set_variable: YMAX PHYSICS_YMAX 2e-2
34set_variable: YMIN PHYSICS_YMIN 1e-7
35set_variable: HISTOGRAM PHYSICS_HISTOGRAM "1040 -20 +500"
36
37set_variable: FORMAT GRAPHICS_FORMAT gif
38set_variable+ BATCH GRAPHICS_BATCH -B
39
40if do_usage $*; then
41 usage "$script [energy [distance [z of PMT]]]"
42fi
43
44case $# in
45 3) set_variable z $3;&
46 2) set_variable R $2;&
47 1) set_variable E $1;;
48esac
49
50
51if (( 1 )); then
52
53 for dir in NORTH EAST SOUTH WEST; do
54
55 echo "Generating $dir."
56
57 eval D=\$$dir
58
59 JDrawPDF \
60 -F1 -F3 -F5 \
61 -F2 -F4 -F6 \
62 -D "${D}" -R $R -E $E -z $z \
63 -H "${HISTOGRAM}" \
64 -o $WORKDIR/f\[${dir}\].root
65
66 done
67
68fi
69
70
71if (( 1 )); then
72
73 JPlot1D \
74 -f $WORKDIR/f\[NORTH\].root:h0 \
75 -f $WORKDIR/f\[EAST\].root:h0 \
76 -f $WORKDIR/f\[SOUTH\].root:h0 \
77 -f $WORKDIR/f\[WEST\].root:h0 \
78 -y "$YMIN $YMAX" -Y \
79 -> "#Deltat [ns]" \
80 -\^ "dP/dt [npe/ns]" \
81 -L TR \
82 -T "E = ${E} GeV#; R = ${R} m#; z = ${z} m" \
83 -o $WORKDIR/pdf.$FORMAT $BATCH
84
85fi