Jpp  18.0.0-rc.1
the software that should make you happy
 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 
30 set_variable: PALETTE GRAPHICS_PALETTE 57
31 set_variable: FORMAT GRAPHICS_FORMAT gif
32 set_variable+ BATCH GRAPHICS_BATCH -B
33 
34 if do_usage $*; then
35  usage "$script <input file> [option [muons [working directory]]]\n" \
36  "Where option can be N, E, LINE, LOGE.\n" \
37  "Note that if more than one input file is specified, all other arguments must be provided."
38 fi
39 
40 case $# in
41  4) set_variable WORKDIR $4;&
44  1) set_array INPUT_FILES $1;;
45  0) fatal "Wrong number of arguments";;
46  *) set_array INPUT_FILES ${argv[1,-4]}
47  set_variable OPTION ${argv[-3]}
48  set_variable MUONS ${argv[-2]}
49  set_variable WORKDIR ${argv[-1]}
50 esac
51 
52 
53 # Number of prefits as a function of application (0 = all)
54 
55 typeset -A NUMBER_OF_FIT
56 
57 NUMBER_OF_FIT=(
58  prefit 1
59  pointsimplex 1
60  positionfit 1
61  energyprefit 1
62  directionprefit 1
63  completefit 1)
64 
65 # Fit application identifier
66 
67 typeset -A ENUMERATION
68 
69 ENUMERATION=(
70  prefit 101
71  pointsimplex 106
72  positionfit 102
73  energyprefit 105
74  directionprefit 107
75  completefit 103)
76 
77 # user interaction
78 
79 for APP in $APPLICATIONS[*]; do
80 
81  set_variable OUTPUT_FILE $WORKDIR/jshowerpostfit\[${APP}\].root
82 
83  if [[ -f $OUTPUT_FILE ]]; then
84  rm -i $OUTPUT_FILE
85  fi
86 done
87 
88 
89 # processing
90 
91 for APP in $APPLICATIONS[*]; do
92 
93  set_variable OUTPUT_FILE $WORKDIR/jshowerpostfit\[${APP}\].root
94 
95  if [[ ! -f $OUTPUT_FILE ]]; then
96 
97  echo "************************************************ " $MUONS
98  if [[ -z $MUONS ]]; then
99  JShowerPostfit \
100  -f "${INPUT_FILES[*]}" \
101  -o $OUTPUT_FILE \
102  -N ${NUMBER_OF_FIT[${APP}]} \
103  -A ${ENUMERATION[${APP}]} \
104  -O ${OPTION} \
105  -w \
106  -d ${DEBUG} --!
107  else
108  JShowerPostfit \
109  -f "${INPUT_FILES[*]}" \
110  -o $OUTPUT_FILE \
111  -N ${NUMBER_OF_FIT[${APP}]} \
112  -A ${ENUMERATION[${APP}]} \
113  -I \
114  -O ${OPTION} \
115  -d ${DEBUG} --!
116  fi
117  fi
118 
119 done
120 
121 
122 if (( 1 )); then
123 
124  JPlot1D \
125  -f $WORKDIR/jshowerpostfit\[completefit\].root:ha \
126  -\> "angle wrt selected fermion [deg]" \
127  -\^ "number of events [a.u.]" \
128  -s "111111" \
129  -o $WORKDIR/angle.$FORMAT $BATCH
130 
131 fi
132 
133 
134 if (( 1 )); then
135 
136  QUANTILES="0.33 0.5 0.66"
137 
138  for APP in prefit pointsimplex positionfit energyprefit directionprefit completefit; do
139 
140  JQuantiles2D \
141  -f $WORKDIR/jshowerpostfit\[${APP}\].root:h2 \
142  -Q "$QUANTILES" \
143  -o $WORKDIR/jshowerquantiles\[${APP}\].root
144  done
145 
146 fi
147 
148 
149 if (( 1 )); then
150 
151  if [[ $OPTION =~ "LOG" ]]; then
154  fi
155 
156  JPlot2D \
157  -f $WORKDIR/jshowerpostfit\[completefit\].root:ee \
158  -O COLZ -p $PALETTE \
159  $LOGX $LOGY -Z -T "" \
160  -\> "E_{true} [GeV]" \
161  -\< "E_{fit} [GeV]" \
162  -o $WORKDIR/jshoweree.$FORMAT $BATCH
163 
164 fi
165 
166 
then usage $script< detector >< run >< outputfile > fi case set_variable OPTION
Definition: JTuna.sh:26
data_type w[N+1][M+1]
Definition: JPolint.hh:778
Q(UTCMax_s-UTCMin_s)-livetime_s
TFitResultPtr Fit(TH1D *h)
Definition: JNanobeacon.hh:14
o $QUALITY_ROOT d $DEBUG!CHECK_EXIT_CODE JPlot1D f
Definition: JDataQuality.sh:76
exit
Definition: JPizza.sh:36
set_variable LOGY YY
Definition: JMuonPostfit.sh:79
then fatal Wrong number of arguments fi JConvertDetectorFormat a o
then echo
do set_variable APP
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR &dev null set_variable
Definition: JAcoustics.sh:21
do set_variable OUTPUT_DIRECTORY $WORKDIR T
&set_variable MUONS
then rm i $OUTPUT_FILE fi done for APP in $APPLICATIONS[*]
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR &dev null set_variable DEBUG set_variable WORKDIR
Definition: JLegolas.sh:20
set_variable LOGX
Definition: JMuonPostfit.sh:83
* usage
then fatal The output file must have the wildcard in the e g root fi typeset A PARAMETERS typeset a APPLICATIONS APPLICATIONS
set_variable LOG XX
Definition: JMuonPostfit.sh:77
&set_variable OUTPUT_FILE
do sput $STRING $FLOOR sget MODULE INPUT_FILES
Definition: JCanberra.sh:77
then usage $script< input file >[option[primary[working directory]]] nWhere option can be N
Definition: JMuonPostfit.sh:36
then JMuonMCEvt f $INPUT_FILE o $INTERMEDIATE_FILE d
Definition: JMuonPath.sh:47
then display $WORKDIR
Definition: plot-Domino.sh:128
do set_variable MODULE getModule a $WORKDIR detector_a datx L $STRING JEditDetector a $WORKDIR detector_a datx M $MODULE setz o $WORKDIR detector_a datx JEditDetector a $WORKDIR detector_b datx M $MODULE setz o $WORKDIR detector_b datx done echo Output stored at $WORKDIR detector_a datx and $WORKDIR tripod_a txt JDrawDetector2D a $WORKDIR detector_a datx a $WORKDIR detector_b datx L BL o detector $FORMAT $BATCH JDrawDetector2D T $WORKDIR tripod_a txt T $WORKDIR tripod_b txt L BL o tripod $FORMAT $BATCH JCompareDetector a $WORKDIR detector_a datx b $WORKDIR detector_b datx o $WORKDIR abc root &dev null for KEY in X Y Z
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 JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:46
source $JPP_DIR setenv csh $JPP_DIR &dev null eval JShellParser o a A
script
Definition: JAcoustics.sh:2
*fatal Wrong option $OPTION
esac done
Definition: JAddHDE.sh:21
#define DEBUG(A)
Message macros.
Definition: JMessage.hh:62
set_variable LOGY
Definition: JMuonPostfit.sh:84