Jpp 20.0.0-rc.7
the software that should make you happy
Loading...
Searching...
No Matches
upperlimit_mset.sh
Go to the documentation of this file.
1#!/bin/env zsh
2#
3# \author mdejong
4#
5version=1.0
6script=${0##*/}
7
8source $JPP_DIR/setenv.sh $JPP_DIR >& /dev/null
9
10set_variable: SNR ASTRONOMY_SNR 0.0
11set_variable: M_SIZE ASTRONOMY_M_SIZE 10000
12set_variable: BOOST ASTRONOMY_BOOST 1.0
13set_variable: DEBUG ASTRONOMY_DEBUG 1
14set_variable: FORMAT GRAPHICS_FORMAT gif
15set_variable+ BATCH GRAPHICS_BATCH -B
16
17if do_usage $*; then
18 usage "$script <signal histogram> <background histogram> <number of tests>"\
19 "\nThe histograms correspond to \"<file name>:<histogram name>\"."
20fi
21
22if (( $# != 2 )); then
23 fatal "Wrong number of arguments."
24fi
25
26set_variable CONFIG $argv[1]
27let "NUMBER_OF_TESTS = $argv[2]"
28
29# pseudo experiments
30
31if (( $NUMBER_OF_TESTS > 0 )); then
32
33 timer_start
34
35 $JPP_DIR/examples/JAstronomy/JGen2UpperLimit \
36 -o benchmark.root \
37 -E $CONFIG \
38 -n $NUMBER_OF_TESTS \
39 -M $M_SIZE \
40 -R $SNR \
41 -x "500 -1.0e2 +2.0e1" \
42 -S 0 \
43 -d $DEBUG >& pseudo-experiment-limit.log
44 timer_stop
45 timer_print
46
47 awk '/<mu>/ { print $(NF) }' pseudo-experiment-limit.log | read UPPER_LIMIT
48
49 SIGMAREL=`echo "sqrt( (1./$NUMBER_OF_TESTS) + 1./($NUMBER_OF_TESTS*5.)*0.9/0.1 )" | bc -l`
50 SIGMA=`echo "$UPPER_LIMIT*$SIGMAREL" | bc -l`
51
52 printf "<mu> %1.2e +- %1.2e\n" $UPPER_LIMIT $SIGMA
53fi