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