Jpp test-rotations-old
the software that should make you happy
Loading...
Searching...
No Matches
pre-calibration_DBORCA018.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 SINGULARITY -
22set_variable WORKDIR `pwd`
23set_variable HOMEDIR $WORKDIR
24
25if do_usage $*; then
26 usage "$script <source directory> [user directory]"\
27 "\nThe source directory corresponds to a pre-calibrated D1ORCA015 detector."\
28 "\nThe user directory should be specified when this script is submitted in a batch queue."
29fi
30
31case $# in
32 2) set_variable HOMEDIR $2;&
33 1) set_variable DIR ${1:a};;
34 *) fatal "Wrong number of arguments."
35esac
36
37source JAcousticsToolkit.sh
38
39set_variable DETECTOR $DIR/detector.datx
40set_variable TRIPOD $DIR/tripod.txt
41set_variable DETECTOR_INITIAL detector_initial.datx
42set_variable TRIPOD_INITIAL tripod_initial.txt
43expand_array RUNS
44
45
46# Run in HOMEDIR
47
48mkdir -p $HOMEDIR
49cd $HOMEDIR
50
51JDetectorDB \
52 -D $DETECTOR_ID \
53 -r $RUNS[1] \
54 -WW \
55 -o $DETECTOR_INITIAL
56
57cat>$TRIPOD_INITIAL<<EOF
58# position of emitter 5 taken from https://elog.km3net.de/Operations+FR/8271 (RAB1v2)
59# position of emitter 6 taken from https://elog.km3net.de/Operations+FR/8731 (RAB2)
60# position of emitter 8 taken from https://elog.km3net.de/Operations+FR/9603 (RAB3)
615 +257040.800 +4743317.600 -2439.900
626 +256807.500 +4743636.500 -2442.500
638 +257118.100 +4743781.100 -2440.300
64EOF
65
66JEditDetector \
67 -a $DETECTOR \
68 -o detector_tmp.datx --!
69
70eval `JPrintDetector -a $DETECTOR_INITIAL -O SUMMARY`; FINAL_STRINGS=($STRINGS[*])
71eval `JPrintDetector -a detector_tmp.datx -O SUMMARY`; FIXED_STRINGS=($STRINGS[*])
72
73# Apply modifications.
74
75JEditDetector \
76 -a $DETECTOR_INITIAL \
77 -o detector.datx --!
78
79eval `JPrintDetector -a detector.datx -O SUMMARY`
80
81for STRING in ${STRINGS[*]}; do
82
83 set_variable MODULE `getModule -a detector.datx -L "$STRING 0"`
84
85 JEditDetector \
86 -a detector.datx \
87 -M "$MODULE setz -2.9" \
88 -o detector.datx --!
89done
90
91JEditDetector -a detector.datx -r "$FIXED_STRINGS[*]" -o detector.datx --!
92JMergeDetector -a detector.datx -a detector_tmp.datx -o detector.datx --!
93JEditDetector -a detector.datx -k "$FINAL_STRINGS[*]" -o detector.datx --!
94
95JEditDetector \
96 -a detector.datx \
97 -M "817315169 swap 14 18" \
98 -o detector.datx --!
99
100typeset -A TRIPODS
101
102get_tripods $TRIPOD_INITIAL TRIPODS; FINAL_TRIPODS=(${(k)TRIPODS[*]})
103get_tripods $TRIPOD TRIPODS; FIXED_TRIPODS=(${(k)TRIPODS[*]})
104
105cp -p $TRIPOD_INITIAL tripod.txt
106
107JEditTripod -f tripod.txt -r "${FIXED_TRIPODS}" -o tripod.txt
108JMergeTripod -f tripod.txt -f $TRIPOD -o tripod.txt
109JEditTripod -f tripod.txt -k "${FINAL_TRIPODS}" -o tripod.txt
110
111cat>waveform.txt<<EOF
112# waveform identifier; emitter identifier
113 23 5
114-24 5
115 28 6
116-29 6
117 16 8
118-17 8
119 31 9
120-32 9
121EOF
122
123cat>acoustics_trigger_parameters.txt<<EOF
124Q = 0.0;
125TMax_s = 0.015;
126numberOfHits = 210;
127EOF
128
129cat>disable.txt<<EOF
130# disable transmissions
131# $20fac36a-495b-4b25-b814-9f297c3db1da$
132# GIT 18.3.0-305-g4e82b04f4-D
133# ROOT 6.30/02
134# application JEditDisable
135# command /data1/dejong/km3net/GIT/Jpp/out//Linux/bin//JEditDisable -f disable.log -o disable.log -a detector.datx -q -d 2 --!
136# namespace KM3NET
137# 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
1381 809521500
1392 808472260
1402 808966194
1412 808977319
1423 808966194
1433 813553576
1445 806487231
1455 808978694
1466 817329086
1478 806483369
1488 806487231
1498 808964883
1508 817338744
151EOF
152
153cat>transmitter.txt<<EOF
154# Data from D0ORCA018_baseAcousticBeacon.csv
155 9 27 0 -0.74 -0.64 0.71
156EOF
157
158cat>hydrophone.txt<<EOF
159# Data from D0ORCA018_hydrophones.csv
160 1 -1 -0.93 0.46 0.55
161 2 0 0.02 1.04 0.55
162 3 0 0.46 0.93 0.55
163 9 0 -0.75 -0.72 0.55
164 10 -1 0.11 1.04 0.55
165 12 0 0.46 0.93 0.55
166 4 0 0.20 1.02 0.55
167 18 0 0.61 0.84 0.55
168 28 0 0.69 0.78 0.55
169 11 0 -0.07 1.04 0.55
170 19 0 0.46 0.93 0.55
171 20 0 0.61 0.84 0.55
172 29 0 0.46 0.93 0.55
173 30 0 0.46 0.93 0.55
174 21 0 0.11 1.04 0.55
175 17 0 0.46 0.93 0.55
176 27 0 1.04 0.07 0.55
177 31 0 0.75 0.72 0.55
178EOF
179
180JAcousticsEventBuilder.sh detector.datx $RUNS[*]
181
182INPUT_FILES=(`ls KM3NeT_${(l:8::0::0:)DETECTOR_ID}_0*${^RUNS}_event.root`)
183
184
185# Run in WORKDIR
186
187cd $WORKDIR
188
189if [ ! $HOMEDIR -ef $WORKDIR ]; then
190 cp -p $HOMEDIR/$ACOUSTICS_DETECTOR $WORKDIR
191 cp -p $HOMEDIR/${^ACOUSTICS_KEYS}.txt $WORKDIR
192 cp -p $HOMEDIR/${^ACOUSTICS_AUXS}.txt $WORKDIR
193 cp -p $HOMEDIR/${^INPUT_FILES} $WORKDIR
194fi
195
196cat>script.txt<<EOF
197
198fix string $FIXED_STRINGS[*]
199fix tripod $FIXED_TRIPODS[*]
200
201stage 1B ${SINGULARITY}1 0 100.0e-6 10.0 0 0.001 0.1
202stage 2A ${SINGULARITY}1 0 100.0e-6 10.0 20 0.2 0.5
203stage 2C ${SINGULARITY}1 0 100.0e-6 10.0 20 0.2
204
205initialise
206
207stage 2a ${SINGULARITY}1 0 100.0e-6 10.0 20 0.2 0.5
208stage 2c ${SINGULARITY}1 0 100.0e-6 10.0 20 0.2
209stage 3a ${SINGULARITY}1 0 50.0e-6 10.0 20 0.2 0.5
210stage 3c ${SINGULARITY}1 0 50.0e-6 10.0 20 0.2
211EOF
212
213JSydney.sh detector.datx $INPUT_FILES[*] script.txt
214
215if [ ! $HOMEDIR -ef $WORKDIR ]; then
216 cp -vru * $HOMEDIR
217fi