Jpp test-rotations-old
the software that should make you happy
Loading...
Searching...
No Matches
pre-calibration_DAORCA018.sh
Go to the documentation of this file.
1#!/bin/zsh
2script=${0##*/}
3
4# --------------------------------------------------------------------------------------------
5#
6# Steering script for the global-fit-of-global-fits procedure of the D0ORCA018 (148) detector.
7# It includes ORCA.0027 and ORCA.0028. For use during the run period for when they were disentangled
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 DETECTOR_ID 148
19set_array RUNS 19441-19450
20set_variable: THREADS ACOUSTICS_THREADS 5
21set_variable WORKDIR `pwd`
22set_variable HOMEDIR $WORKDIR
23
24if do_usage $*; then
25 usage "$script <source directory> [user directory]"\
26 "\nThe source directory corresponds to a pre-calibrated D1ORCA015 detector."\
27 "\nThe user directory should be specified when this script is submitted in a batch queue."
28fi
29
30case $# in
31 2) set_variable HOMEDIR $2;&
32 1) set_variable DIR ${1:a};;
33 *) fatal "Wrong number of arguments."
34esac
35
36source JAcousticsToolkit.sh
37
38set_variable DETECTOR $DIR/detector.datx
39set_variable TRIPOD $DIR/tripod.txt
40set_variable DETECTOR_INITIAL detector_initial.datx
41set_variable TRIPOD_INITIAL tripod_initial.txt
42expand_array RUNS
43
44
45# Run in HOMEDIR
46
47mkdir -p $HOMEDIR
48cd $HOMEDIR
49
50JDetectorDB \
51 -D $DETECTOR_ID \
52 -r $RUNS[1] \
53 -WW \
54 -o $DETECTOR_INITIAL
55
56cat>$TRIPOD_INITIAL<<EOF
57# position of emitter 5 taken from https://elog.km3net.de/Operations+FR/8271 (RAB1v2)
58# position of emitter 6 taken from https://elog.km3net.de/Operations+FR/8731 (RAB2)
59# position of emitter 8 taken from https://elog.km3net.de/Operations+FR/9603 (RAB3)
605 +257040.800 +4743317.600 -2439.900
616 +256807.500 +4743636.500 -2442.500
628 +257118.100 +4743781.100 -2440.300
63EOF
64
65JEditDetector \
66 -a $DETECTOR \
67 -o detector_tmp.datx --!
68
69eval `JPrintDetector -a $DETECTOR_INITIAL -O SUMMARY`; FINAL_STRINGS=($STRINGS[*])
70eval `JPrintDetector -a detector_tmp.datx -O SUMMARY`; FIXED_STRINGS=($STRINGS[*])
71
72# Apply modifications.
73
74JEditDetector \
75 -a $DETECTOR_INITIAL \
76 -o detector.datx --!
77
78eval `JPrintDetector -a detector.datx -O SUMMARY`
79
80for STRING in ${STRINGS[*]}; do
81
82 set_variable MODULE `getModule -a detector.datx -L "$STRING 0"`
83
84 JEditDetector \
85 -a detector.datx \
86 -M "$MODULE setz -2.9" \
87 -o detector.datx --!
88done
89
90JEditDetector -a detector.datx -r "$FIXED_STRINGS[*]" -o detector.datx --!
91JMergeDetector -a detector.datx -a detector_tmp.datx -o detector.datx --!
92JEditDetector -a detector.datx -k "$FINAL_STRINGS[*]" -o detector.datx --!
93
94JEditDetector \
95 -a detector.datx \
96 -M "817315169 swap 14 18" \
97 -o detector.datx --!
98
99typeset -A TRIPODS
100
101get_tripods $TRIPOD_INITIAL TRIPODS; FINAL_TRIPODS=(${(k)TRIPODS[*]})
102get_tripods $TRIPOD TRIPODS; FIXED_TRIPODS=(${(k)TRIPODS[*]})
103
104cp -p $TRIPOD_INITIAL tripod.txt
105
106JEditTripod -f tripod.txt -r "${FIXED_TRIPODS}" -o tripod.txt
107JMergeTripod -f tripod.txt -f $TRIPOD -o tripod.txt
108JEditTripod -f tripod.txt -k "${FINAL_TRIPODS}" -o tripod.txt
109
110cat>acoustics_trigger_parameters.txt<<EOF
111Q = 0.0;
112TMax_s = 0.015;
113numberOfHits = 210;
114EOF
115
116cat>disable.txt<<EOF
117# disable transmissions
118# <emitter identifier> <module identifier>
119# all emitters and ORCA.0003.16
120# emitter 3 and ORCA.0018.06
121# emitter 3 and ORCA.0001.12
122-1 808966194
123EOF
124
125cat>transmitter.txt<<EOF
126# Data from D0ORCA018_baseAcousticBeacon.csv
127 9 27 0 -0.74 -0.64 0.71
128EOF
129
130cat>hydrophone.txt<<EOF
131# Data from D0ORCA018_hydrophones.csv
132 1 -1 -0.93 0.46 0.55
133 2 0 0.02 1.04 0.55
134 3 0 0.46 0.93 0.55
135 9 0 -0.75 -0.72 0.55
136 10 -1 0.11 1.04 0.55
137 12 0 0.46 0.93 0.55
138 4 0 0.20 1.02 0.55
139 18 0 0.61 0.84 0.55
140 28 0 0.69 0.78 0.55
141 11 0 -0.07 1.04 0.55
142 19 0 0.46 0.93 0.55
143 20 0 0.61 0.84 0.55
144 29 0 0.46 0.93 0.55
145 30 0 0.46 0.93 0.55
146 21 0 0.11 1.04 0.55
147 17 0 0.46 0.93 0.55
148 27 0 1.04 0.07 0.55
149 31 0 0.75 0.72 0.55
150EOF
151
152JAcousticsEventBuilder.sh detector.datx $RUNS[*]
153
154INPUT_FILES=(`ls KM3NeT_${(l:8::0::0:)DETECTOR_ID}_0*${^RUNS}_event.root`)
155
156
157# Run in WORKDIR
158
159cd $WORKDIR
160
161if [ ! $HOMEDIR -ef $WORKDIR ]; then
162 cp -p $HOMEDIR/$ACOUSTICS_DETECTOR $WORKDIR
163 cp -p $HOMEDIR/${^ACOUSTICS_KEYS}.txt $WORKDIR
164 cp -p $HOMEDIR/${^ACOUSTICS_AUXS}.txt $WORKDIR
165 cp -p $HOMEDIR/${^INPUT_FILES} $WORKDIR
166fi
167
168cat>script.txt<<EOF
169
170fix string $FIXED_STRINGS[*]
171fix tripod $FIXED_TRIPODS[*]
172
173stage 1B 1 0 100.0e-6 10.0 0 0.001 0.1
174stage 2A 1 0 100.0e-6 10.0 20 0.2 0.5
175stage 2C 1 0 100.0e-6 10.0 20 0.2
176
177initialise
178
179stage 2a 1 0 100.0e-6 10.0 20 0.2 0.5
180stage 2c 1 0 100.0e-6 10.0 20 0.2
181stage 3a 1 0 50.0e-6 10.0 20 0.2 0.5
182stage 3c 1 0 50.0e-6 10.0 20 0.2
183EOF
184
185JSydney.sh detector.datx $INPUT_FILES[*] script.txt
186
187if [ ! $HOMEDIR -ef $WORKDIR ]; then
188 cp -vru * $HOMEDIR
189fi