Jpp  19.1.0-rc.1
the software that should make you happy
JEMShower.sh
Go to the documentation of this file.
1 #!/bin/zsh
2 #
3 # \author mdejong
4 #
5 version=1.0
6 script=${0##*/}
7 
8 # ------------------------------------------------------------------------------------------
9 #
10 # Utility script to plot number of photons - GeV for EM-showers
11 #
12 # ------------------------------------------------------------------------------------------
13 
14 if [ -z $JPP_DIR ]; then
15  echo "Variable JPP_DIR undefined."
16  exit
17 fi
18 
19 source $JPP_DIR/setenv.sh $JPP_DIR
20 
21 
22 set_variable DEBUG 2
23 set_variable WORKDIR ./
24 set_variable: FORMAT GRAPHICS_FORMAT gif
25 set_variable+ BATCH GRAPHICS_BATCH -B
26 
27 if do_usage $*; then
28  usage "$script [working directory]"
29 fi
30 
31 case $# in
32  1) set_variable WORKDIR $1;;
33 esac
34 
35 set_variable GRAPH_TXT $WORKDIR/graph.txt
36 set_variable GRAPH_ROOT $WORKDIR/graph\[Geant4\].root
37 set_variable GEANC_ROOT $WORKDIR/geanc\[JSirene\].root
38 
39 # number of photons per GeV
40 # from Geant4 simulation by Daniel Lopez
41 
42 cat>$GRAPH_TXT<<EOF
43  1.0e-3 90.96
44  2.0e-3 277.36
45  3.0e-3 485.82
46  4.0e-3 692.83
47  5.0e-3 890.01
48  6.0e-3 1098.53
49  7.0e-3 1285.47
50  8.0e-3 1502.86
51  9.0e-3 1687.15
52  10.0e-3 1856.97
53 100.0e-3 1.905e4
54  1.0 1.889e5
55  10.0 1.875e6
56 100.0 1.881e7
57 EOF
58 
59 JGraph \
60  -f $GRAPH_TXT \
61  -o $GRAPH_ROOT
62 
63 JEMShower \
64  -o $GEANC_ROOT
65 
66 JPlot1D \
67  -f ${GRAPH_ROOT}:\.\* \
68  -f ${GEANC_ROOT}:h0 \
69  -x "-4 +4" \
70  -XX \
71  -y "1e1 1e9" \
72  -Y \
73  -> "E [GeV]" \
74  -\^ "number of photons" \
75  -T "" \
76  -o $WORKDIR/geant4.$FORMAT $BATCH
77 
78 
79 JPlot1D \
80  -f ${GEANC_ROOT}:h1 \
81  -XX \
82  -y "0.0 1.1" \
83  -> "E [GeV]" \
84  -\^ "Geant4/JSirene" \
85  -T "" \
86  -o $WORKDIR/ratio.$FORMAT $BATCH