Jpp
JGandalfFitToGauss.sh
Go to the documentation of this file.
1 #!/bin/zsh
2 #
3 #
4 # \author mdejong
5 #
6 version=1.0
7 script=${0##*/}
8 
9 # ------------------------------------------------------------------------------------------
10 #
11 # Example script to test JGandalf.
12 #
13 # ------------------------------------------------------------------------------------------
14 
15 if [ -z $JPP_DIR ]; then
16  echo "Variable JPP_DIR undefined."
17  exit
18 fi
19 
20 source $JPP_DIR/setenv.sh $JPP_DIR
21 
22 set_variable DEBUG 1
23 set_variable WORKDIR /tmp/
24 
25 if ( do_usage $* ); then
26  usage "$script [working directory]"
27 fi
28 
29 case $# in
30  1) set_variable WORKDIR $1;;
31 esac
32 
33 set_variable DIR $JPP_DIR/examples/JFit/
34 set_variable OUTPUT_FILE $WORKDIR/gandalf.root
35 set_variable NUMBER_OF_EVENTS 1000
36 set_variable GAUSS "0.0 1.0 1000.0 100.0"
37 set_variable PRECISION "0.05 0.05 20.0 20.0"
38 
39 $DIR/JGandalfFitToGauss \
40  -o $OUTPUT_FILE \
41  -n $NUMBER_OF_EVENTS \
42  -@ "$GAUSS" \
43  -e "$PRECISION" \
44  -d $DEBUG --!
45 
46 typeset -A X_LABEL
47 
48 X_LABEL[ha]=mean
49 X_LABEL[hb]=sigma
50 X_LABEL[hc]=signal
51 X_LABEL[hd]=background
52 
53 for H1 in ha hb hc hd; do
54  JPlot1D \
55  -f ${OUTPUT_FILE}:${H1} \
56  -> "$X_LABEL[${H1}]" \
57  -\^ "number of events [a.u]" \
58  -s 111111 -T ""
59 done