Jpp 20.0.0-rc.2
the software that should make you happy
Loading...
Searching...
No Matches
pre-calibration_D1ORCA019.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 172
18set_array RUNS 20125-20135
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 D1ORCA019_tripods.csv
595 257040.800 4743317.600 -2439.900
606 256807.500 4743636.500 -2442.50
618 257118.100 4743781.100 -2440.300
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 28 6
109-29 6
110 16 8
111-17 8
112 35 9
113-36 9
114EOF
115
116cat>acoustics_trigger_parameters.txt<<EOF
117Q = 0.0;
118TMax_s = 0.020;
119numberOfHits = 350;
120EOF
121
122cat>disable.txt<<EOF
123# disable transmissions
124# fb63b-82cd-4b85-b28b-4ff8a59d6aff$
125# GIT 18.6.0-rc.1-71-g7499cad9f
126# ROOT 6.22/06
127# application JEditDisable
128# command /sps/km3net/users/martin/Jpp/out//Linux/bin//JEditDisable -f disable.log -o disable.log -a detector.datx -q -d 2 --!
129# namespace KM3NET
130# system Linux ccwslurm0329 3.10.0-1160.118.1.el7.x86_64 #1 SMP Wed Apr 24 16:01:50 UTC 2024 x86_64
1311 809521500
1322 808472260
1332 808966194
1342 808977319
1353 808966194
1363 813553576
1375 806487231
1385 808978694
1395 816935869
1406 817301284
1416 817329086
1428 806483369
1438 806487231
1448 808964883
1458 817338744
1468 817605247
147EOF
148
149cat>transmitter.txt<<EOF
150# Data from D1ORCA024_transmitters.csv
151 9 27 0 -0.74 -0.64 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
175EOF
176
177JAcousticsEventBuilder.sh detector.datx $RUNS[*]
178
179INPUT_FILES=(`ls KM3NeT_${(l:8::0::0:)DETECTOR_ID}_0*${^RUNS}_event.root`)
180
181
182# Run in WORKDIR
183
184cd $WORKDIR
185
186if [ ! $HOMEDIR -ef $WORKDIR ]; then
187 cp -p $HOMEDIR/$ACOUSTICS_DETECTOR $WORKDIR
188 cp -p $HOMEDIR/${^ACOUSTICS_KEYS}.txt $WORKDIR
189 cp -p $HOMEDIR/${^ACOUSTICS_AUXS}.txt $WORKDIR
190 cp -p $HOMEDIR/${^INPUT_FILES} $WORKDIR
191fi
192
193cat>script.txt<<EOF
194
195fix string $FIXED_STRINGS[*]
196fix tripod $FIXED_TRIPODS[*]
197
198stage 0 ${SINGULARITY}1 0 100.0e-6 10.0 10 0.5
199stage 1B ${SINGULARITY}1 0 100.0e-6 10.0 0 0.001 0.1
200stage 2A ${SINGULARITY}1 0 100.0e-6 10.0 20 0.2 0.5
201stage 2C ${SINGULARITY}1 0 100.0e-6 10.0 20 0.2
202
203initialise
204
205stage 2a ${SINGULARITY}1 0 100.0e-6 10.0 20 0.2 0.5
206stage 2c ${SINGULARITY}1 0 100.0e-6 10.0 20 0.2
207stage 3a ${SINGULARITY}1 0 50.0e-6 10.0 20 0.2 0.5
208stage 3c ${SINGULARITY}1 0 50.0e-6 10.0 20 0.2
209EOF
210
211JSydney.sh detector.datx $INPUT_FILES[*] script.txt
212
213if [ ! $HOMEDIR -ef $WORKDIR ]; then
214 cp -vru * $HOMEDIR
215fi