Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JPlotPDF.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 tabulated PDFs.
11 #
12 # ------------------------------------------------------------------------------------------
13 
14 
15 if [ -z $JPP_DIR ]; then
16  echo "Variable JPP_DIR undefined."
17  exit
18 fi
19 
20 
21 source $JPP_DIR/setenv.sh $JPP_DIR
22 
23 
24 set_variable NORTH "0.00 0.00"
25 set_variable EAST "1.57 0.00"
26 set_variable SOUTH "3.14 0.00"
27 set_variable WEST "1.57 3.14"
28 
30 set_variable E 1e3
31 set_variable R 50
32 set_variable YMAX 2e-2
33 set_variable YMIN 1e-7
34 
35 set_variable PDF $JPP_DATA/J%p.dat
36 set_variable HISTOGRAM "1040 -20 +500"
37 
38 
39 if ( do_usage $* ); then
40  usage "$script [energy [distance]]"
41 fi
42 
43 case $# in
44  2) R=$2;&
45  1) E=$1;;
46 esac
47 
48 
49 if (( 1 )); then
50 
51  for dir in NORTH EAST SOUTH WEST; do
52 
53  echo "Generating $dir."
54 
55  eval D=\$$dir
56 
57  JPlotPDF \
58  -f ${PDF/\%/1} \
59  -f ${PDF/\%/2} \
60  -f ${PDF/\%/3} \
61  -f ${PDF/\%/4} \
62  -f ${PDF/\%/5} \
63  -f ${PDF/\%/6} \
64  -D "${D}" -R $R -E $E \
65  -H "$HISTOGRAM" \
66  -o $WORKDIR/F\[${dir}\].root
67 
68  done
69 
70 fi
71 
72 
73 if (( 1 )); then
74 
75  JPlot1D \
76  -f $WORKDIR/F\[NORTH\].root:h0 \
77  -f $WORKDIR/F\[EAST\].root:h0 \
78  -f $WORKDIR/F\[SOUTH\].root:h0 \
79  -f $WORKDIR/F\[WEST\].root:h0 \
80  -y "$YMIN $YMAX" -Y \
81  -\> "#Deltat [ns]" \
82  -\^ "dP/dt [npe/ns]" \
83  -L TR \
84  -T "E = ${E} GeV#; R = ${R} m" \
85  -o $WORKDIR/PDF.gif
86 
87 fi
static const double H
Planck constant [eV s].
Definition: JConstants.hh:25
do echo Generating $dir eval D
Definition: JDrawLED.sh:50
void set_variable(const std::string &name, const std::string &value)
Set environment variable.
then check_input_file $DETECTOR $INPUT_FILE for OPTION in A B C D E F
Definition: JFilter.sh:47
esac print_variable DETECTOR INPUT_FILE OUTPUT_FILE CDF for TYPE in
Definition: JSirene.sh:45
exit
Definition: JPizza.sh:36
then for dir in NORTH EAST SOUTH WEST
Definition: JDrawLED.sh:46
fatal Invalid number of arguments esac let YMIN
Definition: testToT.sh:39
then JPizza f
Definition: JPizza.sh:46
then echo
do set_variable OUTPUT_DIRECTORY $WORKDIR T
* usage
then usage $script< detector file >< inputfile >< outputfile > fi case set_variable PDF
then usage $script[distance] fi case set_variable R
Definition: JDrawLED.sh:40
then display $WORKDIR
Definition: plot-Domino.sh:142
version
Definition: JCalibratePMT.sh:7
then usage $script< detector file >< inputfile > fi case set_variable WORKDIR
Definition: JLegolas.sh:28
then usage $script[input file[working directory[option]]] nWhere option can be E
Definition: JMuonPostfit.sh:37
esac done
Definition: JAddHDE.sh:21