Jpp test-rotations-new
the software that should make you happy
Loading...
Searching...
No Matches
JSTDevK40.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
16zmodload zsh/mathfunc
17
18set_variable DEBUG 2
19set_variable WORKDIR `pwd`
20set_variable OUTPUT_FILE $WORKDIR/stdev.root
21set_variable DIR $JPP_DIR/examples/JCalibrate/
22set_variable: ZMAX CALIBRATION_ZMAX -3.0
23set_variable: ZMIN CALIBRATION_ZMIN +3.0
24set_variable: OPTION CALIBRATION_OPTION address
25set_variable: FORMAT GRAPHICS_FORMAT gif
26set_variable+ BATCH GRAPHICS_BATCH -B
27
28
29if do_usage $*; then
30 usage "$script <detector file> <input file> <input file>" \
31 "\nThe 1st input file corresponds to the output of JMergeCalibrateK40 and the 2nd to the output of JFitK40."
32fi
33
34if (( $# != 3 )); then
35 fatal "Wrong number of parameters."
36fi
37
38set_variable DETECTOR $argv[1]
39set_array INPUT_FILES $argv[2,-1]
40
41$DIR/JSTDevK40 \
42 -a $DETECTOR \
43 -f"$INPUT_FILES[1] $INPUT_FILES[2]" \
44 -o $OUTPUT_FILE \
45 -O $OPTION
46
47eval `JPrintDetector -a $DETECTOR -O SUMMARY`
48
49set_variable FIRST_FLOOR 1
50
51
52
53typeset -Z 4 STRING
54typeset -Z 2 FLOOR
55
56for STRING in $STRINGS[*]; do
57
58 echo -n "Creating graphics for string $STRING.."
59
60 for (( FLOOR = $FIRST_FLOOR; $FLOOR <= $LAST_FLOOR; FLOOR += 1 )); do
61
62 eval MODULE=\${STRING_${(l:4::0::0:)STRING}\[$(($FLOOR))\]:--1}
63
64 JTestRange2D \
65 -f ${OUTPUT_FILE}:$MODULE.2X \
66 -z "$((-1 * fabs($ZMIN))) $((+1 * fabs($ZMIN)))" \
67 -d 3 |& grep -E failed
68
69 JPlot2D \
70 -f ${OUTPUT_FILE}:$MODULE.2X \
71 -> "PMT" \
72 -< "PMT" \
73 -z "$ZMIN $ZMAX" \
74 -O COLZ \
75 -G X \
76 -G Y \
77 -T "(${STRING},${FLOOR})" \
78 -o ${TMPDIR:-/tmp}/M_${STRING}_${FLOOR}.$FORMAT $BATCH
79 done
80
81 montage \
82 -tile 6x3 \
83 -geometry +0+0 \
84 ${TMPDIR:-/tmp}/M_${STRING}_{01..18}.$FORMAT \
85 $WORKDIR/M_${STRING}.$FORMAT >& /dev/null
86
87 echo " => $WORKDIR/M_${STRING}.$FORMAT"
88done
89
90
91rm -f ${TMPDIR:-/tmp}/M_*_*.$FORMAT