Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JPlotNPE-PDG.sh
Go to the documentation of this file.
1 #!/bin/zsh
2 #
3 # \author lquinn
4 #
5 version=1.0
6 script=${0##*/}
7 
8 # ------------------------------------------------------------------------------------------
9 #
10 # Utility script to plot integrals of 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 DIR $JPP_DIR/examples/JPhysics
25 
26 set_variable NORTH "0.00 0.00"
27 set_variable EAST "1.57 0.00"
28 set_variable SOUTH "3.14 0.00"
29 set_variable WEST "1.57 3.14"
30 
33 set_variable TYPE 14
34 set_variable E 1.0
35 set_variable YMAX 1e+2
36 set_variable YMIN 1e-5
37 
38 set_variable PDF $JPP_DATA/J%p.dat
39 set_variable CDF $JPP_DATA/I%p.dat
40 
41 
42 if ( do_usage $* ); then
43  usage "$script [energy]"
44 fi
45 
46 case $# in
47  1) set_variable E $1;;
48 esac
49 
50 
51 for dir in NORTH EAST SOUTH WEST; do
52 
53  echo "Generating $dir."
54 
55  eval D=\$$dir
56 
57  if (( 1 )); then
58 
59  $DIR/JPlotNPE-PDG \
60  -P ${PDF/\%/${TYPE}} \
61  -C ${CDF/\%/${TYPE}} \
62  -D "${D}" \
63  -E "${E}" \
64  -o $WORKDIR/npe\[${dir}\].root \
65  -d $DEBUG --!
66 
67  fi
68 
69  if (( 0 )); then
70 
71  for FUNCTION in pdf npe cdf; do
72 
73  JPlot2D \
74  -f $WORKDIR/npe\[${dir}\].root:${FUNCTION} \
75  -z "$YMIN $YMAX" -Z \
76  -T "${dir} E = ${E} GeV" \
77  -O "colz" \
78  -\> "D [m]" \
79  -\< "cos #theta_{0}" \
80  -o $WORKDIR/${FUNCTION}-${dir}-${E}GeV.gif
81  done
82  fi
83 
84  if (( 1 )); then
85 
86  set_variable YMIN 0.90
87  set_variable YMAX 1.10
88 
89  for FUNCTION in npe cdf; do
90 
91  JOpera2D \
92  -f $WORKDIR/npe\[${dir}\].root:${FUNCTION} \
93  -f $WORKDIR/npe\[${dir}\].root:pdf \
94  -u Divide \
95  -o $WORKDIR/ratio-${FUNCTION}-${dir}.root
96 
97  JPlot2D \
98  -f $WORKDIR/ratio-${FUNCTION}-${dir}.root:Divide \
99  -z "$YMIN $YMAX" \
100  -T "${FUNCTION}/pdf ${dir}" \
101  -\> "D [m]" \
102  -\< "cos #theta_{0}" \
103  -O COLZ \
104  -o $WORKDIR/ratio-${FUNCTION}-${dir}.gif
105  done
106  fi
107 done
do echo Generating $dir eval D
Definition: JDrawLED.sh:50
void set_variable(const std::string &name, const std::string &value)
Set environment variable.
exit
Definition: JPizza.sh:36
do set_array DAQHEADER JPrintDAQHeader f
Definition: JTuneHV.sh:79
do echo Generating $dir eval DIR
Definition: JPlotNPE1D.sh:52
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 echo
static const double C
Physics constants.
then usage $script< detector file >< inputfile >< outputfile > fi case set_variable PDF
do set_variable OUTPUT_DIRECTORY $WORKDIR T
do $DIR JTransitTime o
Definition: JTransitTime.sh:44
then usage $script[detector file[input file[output file[CDF file descriptor]]]] nNote that if more than one input file is all other arguments must be provided fi case set_variable CDF
Definition: JSirene.sh:33
* usage
then for FUNCTION in pdf npe cdf
Definition: JPlotNPE-PDG.sh:71
then JMuonMCEvt f $INPUT_FILE o $INTERMEDIATE_FILE d
Definition: JMuonPath.sh:45
then display $WORKDIR
Definition: plot-Domino.sh:127
double u[N+1]
Definition: JPolint.hh:739
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY source JAcoustics sh $DETECTOR_ID typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
Definition: JCanberra.sh:36
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
then $DIR JPlotNPE PDG P
Definition: JPlotNPE-PDG.sh:60
esac done
Definition: JAddHDE.sh:21
#define DEBUG(A)
Message macros.
Definition: JMessage.hh:62