Jpp test-rotations-old
the software that should make you happy
Loading...
Searching...
No Matches
test-PMTParameters.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
9if [ -z $JPP_DIR ]; then
10 echo "Variable JPP_DIR undefined."
11 exit
12fi
13
14source $JPP_DIR/setenv.sh $JPP_DIR
15
16
17set_variable: DEBUG PMT_PARAMETERS_DEBUG 2
18set_variable WORKDIR `pwd`
19set_variable OUTPUT_FILE ${TMPDIR:-/tmp}/pmt_parameters.root
20set_variable DIR $JPP_DIR/examples/JDetector/
21
22
23if do_usage $*; then
24 usage "$script <detector file> <PMT parameters file>"
25fi
26
27case $# in
28 2) set_variable DETECTOR $1;
29 set_variable INPUT_FILE $2;;
30 *) fatal "Wrong number of parameters."
31esac
32
33
34# acceptance criteria
35
36typeset -A ACCEPTANCE_WINDOW
37typeset -A NUMBER_OF_OUTLIERS
38
39ACCEPTANCE_WINDOW+=(QE "0.8 1.2")
40ACCEPTANCE_WINDOW+=(gain "0.8 1.2")
41ACCEPTANCE_WINDOW+=(gainSpread "0.2 0.4")
42
43NUMBER_OF_OUTLIERS+=(QE 1)
44NUMBER_OF_OUTLIERS+=(gain 1)
45NUMBER_OF_OUTLIERS+=(gainSpread 1)
46
47
48$DIR/JPlotPMTParameters \
49 -a $DETECTOR \
50 -P $INPUT_FILE \
51 -o $OUTPUT_FILE \
52 -d 0 --!
53
54for KEY in ${(k)ACCEPTANCE_WINDOW}; do
55
56 debug "Test $KEY"
57
58 JWindowTest1D \
59 -f ${OUTPUT_FILE}:\.\*${KEY}\$ \
60 -y ${ACCEPTANCE_WINDOW[${KEY}]} \
61 -N ${NUMBER_OF_OUTLIERS[${KEY}]} \
62 -d ${DEBUG}
63
64done