Jpp 19.3.0-rc.3
the software that should make you happy
Loading...
Searching...
No Matches
pre-calibration_D0ORCA018.sh
Go to the documentation of this file.
1#!/usr/bin/env zsh
2script=${0##*/}
3
4# --------------------------------------------------------------------------------------------
5#
6# Steering script for the global-fit-of-global-fits procedure of the D0ORCA018 (148) detector.
7#
8# --------------------------------------------------------------------------------------------
9
10if [ -z $JPP_DIR ]; then
11 echo "Variable JPP_DIR undefined."
12 exit
13fi
14
15source $JPP_DIR/setenv.sh $JPP_DIR >& /dev/null
16
17set_variable DETECTOR_ID 148
18set_array RUNS 16662-16668
19set_variable: THREADS ACOUSTICS_THREADS 5
20set_variable SINGULARITY -
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
99REMOVE_STRINGS=(27 28)
100
101FINAL_STRINGS=(${FINAL_STRINGS:|REMOVE_STRINGS})
102FIXED_STRINGS=(${FIXED_STRINGS:|REMOVE_STRINGS})
103
104JEditDetector -a detector.datx -r "$REMOVE_STRINGS[*]" -o detector.datx --!
105
106typeset -A TRIPODS
107
108get_tripods $TRIPOD_INITIAL TRIPODS; FINAL_TRIPODS=(${(k)TRIPODS[*]})
109get_tripods $TRIPOD TRIPODS; FIXED_TRIPODS=(${(k)TRIPODS[*]})
110
111cp -p $TRIPOD_INITIAL tripod.txt
112
113JEditTripod -f tripod.txt -r "${FIXED_TRIPODS}" -o tripod.txt
114JMergeTripod -f tripod.txt -f $TRIPOD -o tripod.txt
115JEditTripod -f tripod.txt -k "${FINAL_TRIPODS}" -o tripod.txt
116
117cat>waveform.txt<<EOF
118# waveform identifier; emitter identifier
119 23 5
120-24 5
121 28 6
122-29 6
123 16 8
124-17 8
125 31 9
126-32 9
127EOF
128
129cat>acoustics_trigger_parameters.txt<<EOF
130Q = 0.0;
131TMax_s = 0.015;
132numberOfHits = 210;
133EOF
134
135cat>disable.txt<<EOF
136# disable transmissions
137# $20fac36a-495b-4b25-b814-9f297c3db1da$
138# GIT 18.3.0-305-g4e82b04f4-D
139# ROOT 6.30/02
140# application JEditDisable
141# command /data1/dejong/km3net/GIT/Jpp/out//Linux/bin//JEditDisable -f disable.log -o disable.log -a detector.datx -q -d 2 --!
142# namespace KM3NET
143# system Linux verster.lorentz.leidenuniv.nl 6.6.8-200.fc39.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 21 04:01:49 UTC 2023 x86_64
1441 809521500
1452 808472260
1462 808966194
1472 808977319
1483 808966194
1493 813553576
1505 806487231
1515 808978694
1526 817329086
1538 806483369
1548 806487231
1558 808964883
1568 817338744
157EOF
158
159cat>transmitter.txt<<EOF
160# Data from D0ORCA018_baseAcousticBeacon.csv
161 9 27 0 -0.74 -0.64 0.71
162EOF
163
164cat>hydrophone.txt<<EOF
165# Data from D0ORCA018_hydrophones.csv
166 1 -1 -0.93 0.46 0.55
167 2 0 0.02 1.04 0.55
168 3 0 0.46 0.93 0.55
169 9 0 -0.75 -0.72 0.55
170 10 -1 0.11 1.04 0.55
171 12 0 0.46 0.93 0.55
172 4 0 0.20 1.02 0.55
173 18 0 0.61 0.84 0.55
174 28 0 0.69 0.78 0.55
175 11 0 -0.07 1.04 0.55
176 19 0 0.46 0.93 0.55
177 20 0 0.61 0.84 0.55
178 29 0 0.46 0.93 0.55
179 30 0 0.46 0.93 0.55
180 21 0 0.11 1.04 0.55
181 17 0 0.46 0.93 0.55
182 27 0 1.04 0.07 0.55
183 31 0 0.75 0.72 0.55
184EOF
185
186JAcousticsEventBuilder.sh detector.datx $RUNS[*]
187
188INPUT_FILES=(`ls KM3NeT_${(l:8::0::0:)DETECTOR_ID}_0*${^RUNS}_event.root`)
189
190
191# Run in WORKDIR
192
193cd $WORKDIR
194
195if [ ! $HOMEDIR -ef $WORKDIR ]; then
196 cp -p $HOMEDIR/$ACOUSTICS_DETECTOR $WORKDIR
197 cp -p $HOMEDIR/${^ACOUSTICS_KEYS}.txt $WORKDIR
198 cp -p $HOMEDIR/${^ACOUSTICS_AUXS}.txt $WORKDIR
199 cp -p $HOMEDIR/${^INPUT_FILES} $WORKDIR
200fi
201
202cat>script.txt<<EOF
203
204fix string $FIXED_STRINGS[*]
205fix tripod $FIXED_TRIPODS[*]
206
207stage 1B ${SINGULARITY}1 0 100.0e-6 10.0 0 0.001 0.1
208stage 2A ${SINGULARITY}1 0 100.0e-6 10.0 20 0.2 0.5
209stage 2C ${SINGULARITY}1 0 100.0e-6 10.0 20 0.2
210
211initialise
212
213stage 2a ${SINGULARITY}1 0 100.0e-6 10.0 20 0.2 0.5
214stage 2c ${SINGULARITY}1 0 100.0e-6 10.0 20 0.2
215stage 3a ${SINGULARITY}1 0 50.0e-6 10.0 20 0.2 0.5
216stage 3c ${SINGULARITY}1 0 50.0e-6 10.0 20 0.2
217EOF
218
219JSydney.sh detector.datx $INPUT_FILES[*] script.txt
220
221if [ ! $HOMEDIR -ef $WORKDIR ]; then
222 cp -vru * $HOMEDIR
223fi