Jpp  18.3.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 
27 set_variable: DEBUG RECONSTRUCTION_DEBUG 1
28 set_variable: NUMBER_OF_EVENTS RECONSTRUCTION_NUMBER_OF_EVENTS $((2**31))
29 
30 set_variable: PALETTE GRAPHICS_PALETTE 57
31 set_variable: FORMAT GRAPHICS_FORMAT gif
32 set_variable+ BATCH GRAPHICS_BATCH -B
33 
37 
38 if do_usage $*; then
39  usage "$script <input file> [option [muons [working directory]]]\n" \
40  "Where option can be N, E, LINE, LOGE.\n" \
41  "Note that if more than one input file is specified, all other arguments must be provided."
42 fi
43 
44 case $# in
45  4) set_variable WORKDIR $4;&
48  1) set_array INPUT_FILES $1;;
49  0) fatal "Wrong number of arguments";;
50  *) set_array INPUT_FILES ${argv[1,-4]}
51  set_variable OPTION ${argv[-3]}
52  set_variable MUONS ${argv[-2]}
53  set_variable WORKDIR ${argv[-1]}
54 esac
55 
56 
57 # Number of prefits as a function of application (0 = all)
58 
59 typeset -A NUMBER_OF_FIT
60 
61 NUMBER_OF_FIT=(
62  prefit 1
63  pointsimplex 1
64  positionfit 1
65  energyprefit 1
66  directionprefit 1
67  completefit 1)
68 
69 # Fit application identifier
70 
71 typeset -A ENUMERATION
72 
73 ENUMERATION=(
74  prefit 101
75  pointsimplex 106
76  positionfit 102
77  energyprefit 105
78  directionprefit 107
79  completefit 103)
80 
81 # user interaction
82 
83 for APP in $APPLICATIONS[*]; do
84 
85  set_variable OUTPUT_FILE $WORKDIR/jshowerpostfit\[${APP}\].root
86 
87  if [[ -f $OUTPUT_FILE ]]; then
88  rm -i $OUTPUT_FILE
89  fi
90 done
91 
92 
93 # processing
94 
95 for APP in $APPLICATIONS[*]; do
96 
97  set_variable OUTPUT_FILE $WORKDIR/jshowerpostfit\[${APP}\].root
98 
99  if [[ ! -f $OUTPUT_FILE ]]; then
100 
101  JShowerPostfit \
102  -f "${INPUT_FILES[*]}" \
103  -o $OUTPUT_FILE \
104  -n ${NUMBER_OF_EVENTS} \
105  -N ${NUMBER_OF_FIT[${APP}]} \
106  -A ${ENUMERATION[${APP}]} \
107  -O ${OPTION} \
108  ${${MUONS:+-I}:--w} \
109  -d ${DEBUG} --!
110  fi
111 done
112 
113 
114 if (( 1 )); then
115 
116  JPlot1D \
117  -f $WORKDIR/jshowerpostfit\[completefit\].root:ha \
118  -\> "angle wrt selected fermion [deg]" \
119  -\^ "number of events [a.u.]" \
120  -s "111111" \
121  -o $WORKDIR/angle.$FORMAT $BATCH
122 
123 fi
124 
125 
126 if (( 1 )); then
127 
128  QUANTILES="0.33 0.5 0.66"
129 
130  for APP in prefit pointsimplex positionfit energyprefit directionprefit completefit; do
131 
132  JQuantiles2D \
133  -f $WORKDIR/jshowerpostfit\[${APP}\].root:h2 \
134  -Q "$QUANTILES" \
135  -o $WORKDIR/jshowerquantiles\[${APP}\].root
136  done
137 
138 fi
139 
140 
141 if (( 1 )); then
142 
143  if [[ $OPTION =~ "LOG" ]]; then
146  fi
147 
148  JPlot2D \
149  -f $WORKDIR/jshowerpostfit\[completefit\].root:ee \
150  -O COLZ -p $PALETTE \
151  $LOGX $LOGY -Z -T "" \
152  -\> "E_{true} [GeV]" \
153  -\< "E_{fit} [GeV]" \
154  -o $WORKDIR/jshoweree.$FORMAT $BATCH
155 
156 fi
157 
158 
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:867
Q(UTCMax_s-UTCMin_s)-livetime_s
then usage $script< input_file >< detector_file >< output_file(.root)> fi set_variable NUMBER_OF_TIMESLICES set_variable NUMBER_OF_SUMMARYSLICES set_variable NUMBER_OF_EVENTS set_variable ALL_PLOTS case set_variable NUMBER_OF_EVENTS
Definition: JRunAnalyzer.sh:18
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:83
then
Definition: datalogs.sh:31
then fatal Wrong number of arguments fi JConvertDetectorFormat a o
const int n
Definition: JPolint.hh:786
do set_variable APP
then rm
Definition: sftpput.zsh:30
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:87
* 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:81
&set_variable OUTPUT_FILE
do sput $STRING $FLOOR sget MODULE INPUT_FILES
Definition: JCanberra.sh:79
then usage $script< input file >[option[primary[working directory]]] nWhere option can be N
Definition: JMuonPostfit.sh:40
fi set_variable FILENAME $WORKDIR
Definition: datalogs.sh:34
then JMuonMCEvt f $INPUT_FILE o $INTERMEDIATE_FILE d
Definition: JMuonPath.sh:47
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:48
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 echo
Definition: JQAQC.sh:90
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:88