Jpp 19.3.0-rc.3
the software that should make you happy
Loading...
Searching...
No Matches
JReconstructDetector.sh
Go to the documentation of this file.
1#!/usr/bin/env zsh
2script=${0##*/}
3
4# ------------------------------------------------------------------------------------------
5#
6# Auxiliary script to test destruction and construction of detector.
7#
8# ------------------------------------------------------------------------------------------
9
10
11if [ -z $JPP_DIR ]; then
12 echo "Variable JPP_DIR undefined."
13 exit
14fi
15
16source $JPP_DIR/setenv.sh $JPP_DIR >& /dev/null
17
18set_variable DEBUG 2
19set_variable PRECISION 5.0e-3
20set_variable WORKDIR ${TMPDIR:-/tmp}
21
22if do_usage $*; then
23 usage "$script <detector file> [working directory]"
24fi
25
26case $# in
27 2) set_variable WORKDIR $2;&
28 1) set_variable DETECTOR $1;;
29 *) fatal "Wrong number of arguments."
30esac
31
32set_variable CALIBRATION $WORKDIR/calibration.txt
33
34function clean()
35{
36 rm -f $CALIBRATION
37 rm -f $WORKDIR/skeleton.dat
38 rm -f $WORKDIR/detector.dat
39}
40
41clean
42
43
44JDestructDetector \
45 -a $DETECTOR \
46 -o $CALIBRATION \
47 -p $PRECISION \
48 -d $DEBUG
49
50JEditDetector \
51 -a $DETECTOR \
52 -o $WORKDIR/skeleton.dat \
53 -M "-1 reset" \
54 -d $DEBUG
55
56JConstructDetector \
57 -a $WORKDIR/skeleton.dat \
58 -f $CALIBRATION \
59 -o $WORKDIR/detector.dat \
60 -d $DEBUG
61
62set_variable DEBUG 3
63
64JCompareDetector \
65 -a $DETECTOR \
66 -b $WORKDIR/detector.dat \
67 -p "tcal = $PRECISION" \
68 -p "pcal = $PRECISION" \
69 -p "rcal = $PRECISION" \
70 -p "ccal = $PRECISION" \
71 -d $DEBUG
72
73
74CHECK_EXIT_CODE
75
76#clean
77