Jpp 20.0.0-rc.2
the software that should make you happy
Loading...
Searching...
No Matches
pre-calibration_D0ORCA023.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 D1ORCA024 (234) 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 196
18set_array RUNS 20999-21007
19set_variable: THREADS ACOUSTICS_THREADS 32
20set_variable SINGULARITY -
21set_variable WORKDIR `pwd`
22set_variable HOMEDIR $WORKDIR
23set_variable ACOUSTICS_TRANSMITTER
24
25if do_usage $*; then
26 usage "$script <source directory> [user directory]"\
27 "\nThe source directory corresponds to a pre-calibrated D0ORCA018 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# Data from D0ORCA023_tripods.csv
595 257040.800 4743317.600 -2439.900
608 257118.100 4743781.100 -2440.300
61EOF
62
63JEditDetector \
64 -a $DETECTOR \
65 -o detector_tmp.datx --!
66
67eval `JPrintDetector -a $DETECTOR_INITIAL -O SUMMARY`; FINAL_STRINGS=($STRINGS[*])
68eval `JPrintDetector -a detector_tmp.datx -O SUMMARY`; FIXED_STRINGS=($STRINGS[*])
69
70# Apply modifications.
71
72JEditDetector \
73 -a $DETECTOR_INITIAL \
74 -o detector.datx --!
75
76eval `JPrintDetector -a detector.datx -O SUMMARY`
77
78for STRING in ${STRINGS[*]}; do
79
80 set_variable MODULE `getModule -a detector.datx -L "$STRING 0"`
81
82 JEditDetector \
83 -a detector.datx \
84 -M "$MODULE setz -2.9" \
85 -o detector.datx --!
86done
87
88JEditDetector -a detector.datx -r "$FIXED_STRINGS[*]" -o detector.datx --!
89JMergeDetector -a detector.datx -a detector_tmp.datx -o detector.datx --!
90JEditDetector -a detector.datx -k "$FINAL_STRINGS[*]" -o detector.datx --!
91
92typeset -A TRIPODS
93
94get_tripods $TRIPOD_INITIAL TRIPODS; FINAL_TRIPODS=(${(k)TRIPODS[*]})
95get_tripods $TRIPOD TRIPODS; FIXED_TRIPODS=(${(k)TRIPODS[*]})
96
97cp -p $TRIPOD_INITIAL tripod.txt
98
99JEditTripod -f tripod.txt -r "${FIXED_TRIPODS}" -o tripod.txt
100JMergeTripod -f tripod.txt -f $TRIPOD -o tripod.txt
101JEditTripod -f tripod.txt -k "${FINAL_TRIPODS}" -o tripod.txt
102
103cat>waveform.txt<<EOF
104# waveform identifier; emitter identifier
105 23 5
106-24 5
107 16 8
108-17 8
109 35 9
110-36 9
111 34 10
112-35 10
113EOF
114
115cat>acoustics_trigger_parameters.txt<<EOF
116Q = 0.0;
117TMax_s = 0.020;
118numberOfHits = 350;
119EOF
120
121cat>disable.txt<<EOF
122# disable transmissions
123# fb63b-82cd-4b85-b28b-4ff8a59d6aff$
124# GIT 18.6.0-rc.1-71-g7499cad9f
125# ROOT 6.22/06
126# application JEditDisable
127# command /sps/km3net/users/martin/Jpp/out//Linux/bin//JEditDisable -f disable.log -o disable.log -a detector.datx -q -d 2 --!
128# namespace KM3NET
129# system Linux ccwslurm0329 3.10.0-1160.118.1.el7.x86_64 #1 SMP Wed Apr 24 16:01:50 UTC 2024 x86_64
1301 809521500
1312 808472260
1322 808966194
1332 808977319
1343 808966194
1353 813553576
1365 806487231
1375 808978694
1385 816935869
1396 817301284
1406 817329086
1418 806483369
1428 806487231
1438 808964883
1448 817338744
1458 817605247
146EOF
147
148cat>transmitter.txt<<EOF
149# Data from D1ORCA024_transmitters.csv
150 9 27 0 -0.74 -0.64 0.71
15110 41 0 -0.40 -0.89 0.71
152EOF
153
154cat>hydrophone.txt<<EOF
155# Data from D0ORCA023_hydrophones.csv
156 1 -1 -0.93 0.46 0.55
157 2 0 0.02 1.04 0.55
158 3 0 0.46 0.93 0.55
159 9 0 -0.75 -0.72 0.55
160 10 -1 0.11 1.04 0.55
161 12 0 0.46 0.93 0.55
162 4 0 0.20 1.02 0.55
163 18 0 0.61 0.84 0.55
164 28 0 0.69 0.78 0.55
165 11 0 -0.07 1.04 0.55
166 19 0 0.46 0.93 0.55
167 20 0 0.61 0.84 0.55
168 29 0 0.46 0.93 0.55
169 30 0 0.46 0.93 0.55
170 21 0 0.11 1.04 0.55
171 17 0 0.46 0.93 0.55
172 27 0 1.04 0.07 0.55
173 31 0 0.75 0.72 0.55
174 39 0 0.46 0.93 0.55
175 40 0 0.46 0.93 0.55
176 41 0 0.91 0.50 0.55
177 42 0 0.29 1.00 0.55
178 38 0 0.89 -0.54 0.55
179EOF
180
181JAcousticsEventBuilder.sh detector.datx $RUNS[*]
182
183INPUT_FILES=(`ls KM3NeT_${(l:8::0::0:)DETECTOR_ID}_0*${^RUNS}_event.root`)
184
185
186# Run in WORKDIR
187
188cd $WORKDIR
189
190if [ ! $HOMEDIR -ef $WORKDIR ]; then
191 cp -p $HOMEDIR/$ACOUSTICS_DETECTOR $WORKDIR
192 cp -p $HOMEDIR/${^ACOUSTICS_KEYS}.txt $WORKDIR
193 cp -p $HOMEDIR/${^ACOUSTICS_AUXS}.txt $WORKDIR
194 cp -p $HOMEDIR/${^INPUT_FILES} $WORKDIR
195fi
196
197cat>script.txt<<EOF
198
199fix string $FIXED_STRINGS[*]
200fix tripod $FIXED_TRIPODS[*]
201
202stage 0 ${SINGULARITY}1 0 100.0e-6 10.0 10 0.5
203stage 1B ${SINGULARITY}1 0 100.0e-6 10.0 0 0.001 0.1
204stage 2A ${SINGULARITY}1 0 100.0e-6 10.0 20 0.2 0.5
205stage 2C ${SINGULARITY}1 0 100.0e-6 10.0 20 0.2
206
207initialise
208
209stage 2a ${SINGULARITY}1 0 100.0e-6 10.0 20 0.2 0.5
210stage 2c ${SINGULARITY}1 0 100.0e-6 10.0 20 0.2
211stage 3a ${SINGULARITY}1 0 50.0e-6 10.0 20 0.2 0.5
212stage 3c ${SINGULARITY}1 0 50.0e-6 10.0 20 0.2
213EOF
214
215JSydney.sh detector.datx $INPUT_FILES[*] script.txt
216
217if [ ! $HOMEDIR -ef $WORKDIR ]; then
218 cp -vru * $HOMEDIR
219fi