Jpp 19.3.0-rc.1
the software that should make you happy
Loading...
Searching...
No Matches
billabong.sh
Go to the documentation of this file.
1#!/usr/bin/env zsh
2script=${0:t}
3
4source $JPP_DIR/setenv.sh $JPP_DIR >& /dev/null
5
6zmodload zsh/mathfunc
7
8let "NS = 441" # number of strings
9let "NZ = 10" # number of floors
10let "DS = 300.0" # string spacing
11let "DZ = 150.0" # floor spacing
12
13set_variable DEBUG 2
14
15if do_usage $*; then
16 usage "$script <detector>"
17fi
18
19if (( $# != 1 )); then
20 fatal "Wrong number of arguments."
21fi
22
23set_variable DETECTOR $1
24
25if [[ ! -f $DETECTOR ]]; then
26
27 echo "Creating detector $DETECTOR"
28
29 set_variable FOOTPRINT_TXT `mktemp footprint_XXXXXX.txt`
30
31 ns=`printf "%d" $((sqrt($NS) * 0.5))` # number of steps in (x,y)
32
33 let "n = 1" # string counter
34
35 for (( ix = -$ns; $ix <= $ns; ix += 1 )); do
36 for (( iy = -$ns; $iy <= $ns; iy += 1 )); do
37 printf "%3d %8.2f %8.2f\n" $n $(($ix * $DS)) $(($iy * $DS)) >> $FOOTPRINT_TXT; let "n += 1"
38 done
39 done
40
41 JDetector \
42 -D 1001 \
43 -@ "detectorType = 1" \
44 -@ "numberOfLines = $NS" \
45 -@ "numberOfFloors = $NZ" \
46 -@ "floorDistance_m = $DZ" \
47 -z $DS \
48 -f $FOOTPRINT_TXT \
49 -o $DETECTOR \
50 -O NOPMTs \
51 -d 0
52
53 rm -f $FOOTPRINT_TXT
54fi