Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JShowerPostfit.sh
Go to the documentation of this file.
1 #!/bin/zsh
2 #
3 # \author adomi
4 #
5 script=${0##*/}
6 
7 # ------------------------------------------------------------------------------------------
8 #
9 # Utility script to plot fit results.
10 #
11 # ------------------------------------------------------------------------------------------
12 
13 
14 if [ -z $JPP_DIR ]; then
15  echo "Variable JPP_DIR undefined."
16  exit
17 fi
18 
19 
20 source $JPP_DIR/setenv.sh $JPP_DIR
21 
22 
23 # list of applications in the processing chain
24 
25 APPLICATIONS=(prefit pointsimplex positionfit energyprefit directionprefit completefit)
26 
32 
33 if ( do_usage $* ); then
34  usage "$script [input file [working directory [muons]]]"
35 fi
36 
37 case $# in
41 esac
42 
43 
44 # Number of prefits as a function of application (0 = all)
45 
46 typeset -A NUMBER_OF_FIT
47 
49  prefit 1
50  pointsimplex 1
51  positionfit 1
52  energyprefit 1
53  directionprefit 1
54  completefit 1)
55 
56 # Fit application identifier
57 
58 typeset -A ENUMERATION
59 
60 ENUMERATION=(
61  prefit 101
62  pointsimplex 106
63  positionfit 102
64  energyprefit 105
65  directionprefit 107
66  completefit 103)
67 
68 # user interaction
69 
70 for APP in $APPLICATIONS[*]; do
71 
72  set_variable OUTPUT_FILE $WORKDIR/jshowerpostfit\[${APP}\].root
73 
74  if [[ -f $OUTPUT_FILE ]]; then
75  rm -i $OUTPUT_FILE
76  fi
77 done
78 
79 
80 # processing
81 
82 for APP in $APPLICATIONS[*]; do
83 
84  set_variable OUTPUT_FILE $WORKDIR/jshowerpostfit\[${APP}\].root
85 
86  if [[ ! -f $OUTPUT_FILE ]]; then
87 
88  echo "************************************************ " $MUONS
89  if [[ -z $MUONS ]]; then
90  JShowerPostfit \
91  -f $INPUT_FILE \
92  -o $OUTPUT_FILE \
93  -N ${NUMBER_OF_FIT[${APP}]} \
94  -A ${ENUMERATION[${APP}]} \
95  -O ${OPTION} \
96  -w \
97  -d ${DEBUG} --!
98  else
99  JShowerPostfit \
100  -f $INPUT_FILE \
101  -o $OUTPUT_FILE \
102  -N ${NUMBER_OF_FIT[${APP}]} \
103  -A ${ENUMERATION[${APP}]} \
104  -I \
105  -O ${OPTION} \
106  -d ${DEBUG} --!
107  fi
108  fi
109 
110 done
111 
112 
113 if (( 1 )); then
114 
115  JPlot1D \
116  -f $WORKDIR/jshowerpostfit\[completefit\].root:ha \
117  -\> "angle wrt selected fermion [deg]" \
118  -\^ "number of events [a.u]" \
119  -s "111111" \
120  -o $WORKDIR/angle.gif
121 
122 fi
123 
124 
125 if (( 1 )); then
126 
127  QUANTILES="0.33 0.5 0.66"
128 
129  for APP in prefit pointsimplex positionfit energyprefit directionprefit completefit; do
130 
131  JQuantiles2D \
132  -f $WORKDIR/jshowerpostfit\[${APP}\].root:h2 \
133  -Q "$QUANTILES" \
134  -o $WORKDIR/jshowerquantiles\[${APP}\].root
135  done
136 
137 fi
138 
139 
140 if (( 1 )); then
141 
142  JPlot2D \
143  -f $WORKDIR/jshowerpostfit\[completefit\].root:ee \
144  -O COLZ \
145  -XX -YY -T "" \
146  -\> "E_{true} [GeV]" \
147  -\< "E_{fit} [GeV]" \
148  -o $WORKDIR/jshoweree.gif
149 
150 fi
151 
152 
data_type w[N+1][M+1]
Definition: JPolint.hh:741
void set_variable(const std::string &name, const std::string &value)
Set environment variable.
esac typeset A NUMBER_OF_FIT NUMBER_OF_FIT
Definition: JMuonPostfit.sh:51
TFitResultPtr Fit(TH1D *h)
Definition: JNanobeacon.hh:14
set_variable INPUT_FILE
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR APPLICATIONS
Definition: JMuonPostfit.sh:25
exit
Definition: JPizza.sh:36
do set_array DAQHEADER JPrintDAQHeader f
Definition: JTuneHV.sh:79
then echo
do set_variable APP
do set_variable OUTPUT_DIRECTORY $WORKDIR T
do $DIR JTransitTime o
Definition: JTransitTime.sh:44
* usage
then JFileTuna f $INPUT_FILE
Definition: file-Tuna.sh:66
&set_variable OUTPUT_FILE
then JMuonMCEvt f $INPUT_FILE o $INTERMEDIATE_FILE d
Definition: JMuonPath.sh:45
then display $WORKDIR
Definition: plot-Domino.sh:127
then usage $script< detector >< run >< outputfile > fi case set_variable OPTION
Definition: JTuna.sh:26
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
then usage $script[input file[working directory[muons]]] fi case set_variable MUONS
then usage $script[input file[working directory[option]]] nWhere option can be N
Definition: JMuonPostfit.sh:37
script
Definition: JAcoustics.sh:2
then usage $script< detector file >< inputfile > fi case set_variable WORKDIR
Definition: JLegolas.sh:28
source $JPP_DIR setenv csh $JPP_DIR eval JShellParser o a A
esac done
Definition: JAddHDE.sh:21
#define DEBUG(A)
Message macros.
Definition: JMessage.hh:62
then QUANTILES
then rm i $OUTPUT_FILE fi done for APP in $APPLICATIONS[*]