Jpp test-rotations-new
the software that should make you happy
Loading...
Searching...
No Matches
JRootfitToGauss3D.sh
Go to the documentation of this file.
1#!/usr/bin/env zsh
2version=1.0
3script=${0##*/}
4
5source $JPP_DIR/setenv.sh $JPP_DIR
6
7
8set_variable DEBUG 1
9set_variable WORKDIR `pwd`
10
11if do_usage $*; then
12 usage "$script [working directory]"
13fi
14
15if (( $# == 1 )); then
16 set_variable WORKDIR $1
17fi
18
19set_variable X "-4.0 +4.0"
20set_variable Y "-4.0 +4.0"
21set_variable Z "-4.0 +4.0"
22set_variable N 4000000
23
24if (( $N < 100000 )); then
25 OPTION=count
26else
27 OPTION=value
28fi
29
30$JPP_DIR/examples/JROOT/JRootfitToGauss3D \
31 -o $WORKDIR/fit.root \
32 -x "$X" \
33 -y "$Y" \
34 -z "$Z" \
35 -n "$N" \
36 -O $OPTION \
37 -d $DEBUG --!
38
39set_variable FORMULA "[6] * " \
40 "exp(-0.5 * (x-[0])*(x-[0]) / ([1]*[1])) * " \
41 "exp(-0.5 * (y-[2])*(y-[2]) / ([3]*[3])) * " \
42 "exp(-0.5 * (z-[4])*(z-[4]) / ([5]*[5])) / " \
43 "(2*pi*sqrt(2*pi)*[1]*[3]*[5]) + [7]"
44
45JFit3D \
46 -f $WORKDIR/fit.root:h3 \
47 -f $WORKDIR/fit.root:h3 \
48 -o /dev/null \
49 -x "$X" \
50 -y "$Y" \
51 -z "$Z" \
52 -F "$FORMULA" \
53 -@ "p0 = GetMean(1)" \
54 -@ "p1 = GetStdDev(1) * 0.33" \
55 -@ "p2 = GetMean(2)" \
56 -@ "p3 = GetStdDev(2) * 0.33" \
57 -@ "p4 = GetMean(3)" \
58 -@ "p5 = GetStdDev(3) * 0.33" \
59 -@ "p6 = GetSumOfWeights() / (sqrt(2*pi)*2*pi)" \
60 -@ "p7 = GetMinimum" \
61 -O NLQ \
62 -d $DEBUG