Jpp test-rotations-new
the software that should make you happy
Loading...
Searching...
No Matches
JRadiation.sh
Go to the documentation of this file.
1#!/usr/bin/env zsh
2#
3# \author mdejong
4#
5version=1.0
6script=${0##*/}
7
8# ------------------------------------------------------------------------------------------
9#
10# Utility script to plot radiation cross sections, shower energy, range and b(E)
11#
12# ------------------------------------------------------------------------------------------
13
14if [ -z $JPP_DIR ]; then
15 echo "Variable JPP_DIR undefined."
16 exit
17fi
18
19source $JPP_DIR/setenv.sh $JPP_DIR
20
21set_variable DEBUG 2
22set_variable WORKDIR ${TMPDIR:-/tmp}/
23set_variable: FORMAT GRAPHICS_FORMAT gif
24set_variable+ BATCH GRAPHICS_BATCH -B
25
26if do_usage $*; then
27 usage "$script [working directory]"
28fi
29
30case $# in
31 1) set_variable WORKDIR $1;;
32esac
33
34if (( 1 )); then
35
36 $JPP_DIR/examples/JPhysics/JRadiation \
37 -o $WORKDIR/lambda.root \
38 -O length \
39 -d $DEBUG
40
41 for TYPE in eerad Brems gnrad; do
42
43 JPlot1D \
44 -f "$WORKDIR/lambda.root:${TYPE}" \
45 -y "1e-1 1e6" \
46 -XXY \
47 -\^ "\lambda [m]" \
48 -> "E [GeV]" \
49 -L TR -T "interaction length" \
50 -O "HIST][" \
51 -G Y \
52 -o lamdba-$TYPE.$FORMAT $BATCH
53 done
54
55fi
56
57
58if (( 1 )); then
59
60 $JPP_DIR/examples/JPhysics/JRadiation \
61 -o $WORKDIR/radiation.root \
62 -O energy \
63 -n 40000 \
64 -d $DEBUG
65
66 for TYPE in eerad Brems gnrad; do
67
68 JPlot1D \
69 -f "$WORKDIR/radiation.root:$TYPE" \
70 -y "0.1 1e9" \
71 -XXY \
72 -\^ "<E_{s}> [GeV]" \
73 -> "E [GeV]" \
74 -L TL -T "shower energy" \
75 -G Y \
76 -o Es-$TYPE.$FORMAT $BATCH
77 done
78
79fi
80
81
82if (( 1 )); then
83
84 $JPP_DIR/examples/JPhysics/JRadiation \
85 -o $WORKDIR/radiation.root \
86 -O range \
87 -n 1000 \
88 -d $DEBUG
89
90 JPlot1D \
91 -f $WORKDIR/radiation.root:R\.\* \
92 -y "0 40" \
93 -XX \
94 -> "E [GeV]" \
95 -\^ "R [km]" \
96 -L TL -T "muon range" \
97 -o range.$FORMAT $BATCH
98
99fi
100
101
102if (( 1 )); then
103
104 $JPP_DIR/examples/JPhysics/JRadiation \
105 -o $WORKDIR/radiation.root \
106 -O eloss \
107 -n 4000000 \
108 -d $DEBUG
109
110 JPlot1D \
111 -f $WORKDIR/radiation.root:hb \
112 -y "0 0.5" \
113 -XX \
114 -> "E [GeV]" \
115 -\^ "b [km^{-1}]" \
116 -T "Energy loss" \
117 -o b.$FORMAT $BATCH
118
119fi
120
121rm -f $WORKDIR/lambda.root >& /dev/null
122rm -f $WORKDIR/radiation.root >& /dev/null