Jpp master_rocky-44-g75b7c4f75
the software that should make you happy
Loading...
Searching...
No Matches
JRadiation.sh
Go to the documentation of this file.
1#!/bin/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 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 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 -o Es-$TYPE.$FORMAT $BATCH
76 done
77
78fi
79
80
81if (( 1 )); then
82
83 JRadiation \
84 -o $WORKDIR/radiation.root \
85 -O range \
86 -n 1000 \
87 -d $DEBUG
88
89 JPlot1D \
90 -f $WORKDIR/radiation.root:R\.\* \
91 -y "0 40" \
92 -XX \
93 -> "E [GeV]" \
94 -\^ "R [km]" \
95 -L TL -T "muon range" \
96 -o range.$FORMAT $BATCH
97
98fi
99
100
101if (( 1 )); then
102
103 JRadiation \
104 -o $WORKDIR/radiation.root \
105 -O eloss \
106 -n 4000000 \
107 -d $DEBUG
108
109 JPlot1D \
110 -f $WORKDIR/radiation.root:hb \
111 -y "0 0.5" \
112 -XX \
113 -> "E [GeV]" \
114 -\^ "b [km^{-1}]" \
115 -T "Energy loss" \
116 -o b.$FORMAT $BATCH
117
118fi