Jpp test-rotations-old
the software that should make you happy
Loading...
Searching...
No Matches
plot-Ballarat.sh
Go to the documentation of this file.
1#!/usr/bin/env zsh
2#
3#
4# \author mdejong
5#
6version=1.0
7script=${0##*/}
8
9if [ -z $JPP_DIR ]; then
10 echo "Variable JPP_DIR undefined."
11 exit
12fi
13
14source $JPP_DIR/setenv.sh $JPP_DIR
15
16set_variable: DEBUG DYNAMICS_DEBUG 2
17set_variable: WORKDIR DYNAMICS_WORKDIR ./
18set_variable: FLOORS DYNAMICS_FLOORS 1-18
19set_variable: HISTOGRAM DYNAMICS_HISTOGRAM H
20set_variable: TMAX_S DYNAMICS_TMAX_S 100
21set_variable: TIMESTAMP DYNAMICS_TIMESTAMP UTC
22set_variable: FORMAT GRAPHICS_FORMAT gif
23set_variable+ BATCH GRAPHICS_BATCH -B
24
25if do_usage $*; then
26 usage "$script <detector file> <input file>+"
27fi
28
29if (( $# < 2 )); then
30 fatal "Wrong number of parameters."
31fi
32
33set_variable DETECTOR $argv[1]
34set_variable INPUT_FILE $argv[2,-1]
35
36eval `JPrintDetector -a $DETECTOR -O IDENTIFIER`
37eval `JPrintDetector -a $DETECTOR -O SUMMARY`
38
39
40typeset -Z 4 STRING
41typeset -Z 2 FLOOR
42
43for STRING in $STRINGS[*]; do
44
45 JEditDetector -a $DETECTOR -k $STRING -o ${TMPDIR:-/tmp}/detector.datx
46
47
48 $JPP_DIR/examples/JDynamics/JBallarat \
49 -a ${TMPDIR:-/tmp}/detector.datx \
50 -f "$INPUT_FILE[*]" \
51 -o ${TMPDIR:-/tmp}/ballarat.root \
52 -T $TMAX_S \
53 -d $DEBUG
54
55 MODULES=()
56
57 echo "Creating graphics for string $STRING"
58
59 for (( FLOOR = ${FLOORS%%-*}; $FLOOR <= ${FLOORS##*-}; FLOOR += 1 )); do
60
61 eval MODULE=\${STRING_${(l:4::0::0:)STRING}\[$(($FLOOR))\]:--1}
62
63 JPlot1D \
64 -f ${TMPDIR:-/tmp}/ballarat.root:"U\["${MODULE}"\].twist" \
65 -Y \
66 -> "#Delta#phi [deg]" \
67 -s 1110 \
68 -T "${STRING}.${FLOOR}" \
69 -o ${TMPDIR:-/tmp}/U${STRING}_${FLOOR}.$FORMAT $BATCH
70
71 MODULES+=($MODULE)
72 done
73
74
75 montage \
76 -tile 6x3 \
77 -geometry +0+0 \
78 ${TMPDIR:-/tmp}/U${STRING}_{01..18}.$FORMAT \
79 $WORKDIR/U${STRING}.$FORMAT >& /dev/null
80
81 JPlot1D \
82 -w 1200x600 \
83 -f${TMPDIR:-/tmp}/ballarat.root:"${HISTOGRAM}\["${^MODULES}"\]" \
84 -y "-3.15 +3.15" \
85 -\^ "twist [rad]" \
86 -N "X 505" \
87 -t "$TIMESTAMP" \
88 -S 0.3 \
89 -T "${STRING}" \
90 -O "][" \
91 -o $WORKDIR/${STRING}.$FORMAT $BATCH
92done
93
94montage \
95 -tile 3x40 \
96 -geometry +0+0 \
97 $WORKDIR/0*.$FORMAT \
98 $WORKDIR/twist.$FORMAT >& /dev/null
99