Jpp 19.3.0-rc.1
the software that should make you happy
Loading...
Searching...
No Matches
JRootFitToGauss.sh
Go to the documentation of this file.
1#!/usr/bin/env zsh
2#
3#
4# \author mdejong
5#
6version=1.0
7script=${0##*/}
8
9# ------------------------------------------------------------------------------------------
10#
11# Example script to test JRoot.
12#
13# ------------------------------------------------------------------------------------------
14
15if [ -z $JPP_DIR ]; then
16 echo "Variable JPP_DIR undefined."
17 exit
18fi
19
20source $JPP_DIR/setenv.sh $JPP_DIR
21
22set_variable DEBUG 1
23set_variable WORKDIR ${TMPDIR:-/tmp}/
24
25if do_usage $*; then
26 usage "$script [working directory]"
27fi
28
29case $# in
30 1) set_variable WORKDIR $1;;
31esac
32
33set_variable DIR $JPP_DIR/examples/JFit/
34set_variable OUTPUT_FILE $WORKDIR/root.root
35set_variable NUMBER_OF_EVENTS 1000
36set_variable GAUSS "0.0 1.0 1000.0 100.0"
37set_variable PRECISION "0.05 0.05 20.0 20.0"
38
39$DIR/JRootFitToGauss \
40 -o $OUTPUT_FILE \
41 -n $NUMBER_OF_EVENTS \
42 -@ "$GAUSS" \
43 -e "$PRECISION" \
44 -d $DEBUG --!
45
46typeset -A X_LABEL
47
48X_LABEL[ha]=mean
49X_LABEL[hb]=sigma
50X_LABEL[hc]=signal
51X_LABEL[hd]=background
52
53for 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 ""
59done