Jpp test-rotations-old
the software that should make you happy
Loading...
Searching...
No Matches
pre-calibration_D0ORCA010.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 D0ORCA010 (100) 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 100
18set_array RUNS 11342 11345 11347 11374 11376
19set_variable: TREADS ACOUSTICS_TREADS 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 D_ORCA006 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# Very preliminary acoustic emitter positions from survey
582 +256815.500 +4743395.000 -2436.677
593 +257096.200 +4743636.000 -2439.354
604 +256919.238 +4743354.178 -2439.354
61EOF
62
63eval `JPrintDetector -a $DETECTOR_INITIAL -O SUMMARY`; FINAL_STRINGS=($STRINGS[*])
64eval `JPrintDetector -a $DETECTOR -O SUMMARY`; FIXED_STRINGS=($STRINGS[*])
65
66# Apply modifications.
67
68JEditDetector \
69 -a $DETECTOR_INITIAL \
70 -o detector.datx --!
71
72eval `JPrintDetector -a detector.datx -O SUMMARY`
73
74for STRING in ${STRINGS[*]}; do
75
76 set_variable MODULE `getModule -a detector.datx -L "$STRING 0"`
77
78 JEditDetector \
79 -a detector.datx \
80 -M "$MODULE setz -2.9" \
81 -o detector.datx --!
82done
83
84JEditDetector -a detector.datx -r "$FIXED_STRINGS[*]" -o detector.datx --!
85JMergeDetector -a detector.datx -a $DETECTOR -o detector.datx --!
86JEditDetector -a detector.datx -k "$FINAL_STRINGS[*]" -o detector.datx --!
87
88JEditDetector \
89 -a detector.datx \
90 -R "817295048 B1" \
91 -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 14 2
107-15 2
108 16 3
109-17 3
110 24 4
111-25 4
112EOF
113
114cat>acoustics_trigger_parameters.txt<<EOF
115Q = 0.0;
116TMax_s = 0.015;
117numberOfHits = 150;
118EOF
119
120cat>disable.txt<<EOF
121# disable transmissions
122# $c96382df-37c8-441a-8e9f-656f4a98677a$
123# GIT 18.3.0-305-g4e82b04f4-D
124# ROOT 6.30/02
125# application JEditDisable
126# command /data1/dejong/km3net/GIT/Jpp/out//Linux/bin//JEditDisable -f disable.log -o disable.log -a detector.datx -q -d 2 --!
127# namespace KM3NET
128# 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
1291 808971812
1301 809521500
1312 808472260
1322 808966194
1332 808976219
1342 808977319
1352 808978694
1363 808966194
137EOF
138
139cat>transmitter.txt<<EOF
140# $script
141EOF
142
143cat>hydrophone.txt<<EOF
144# Data from D0ORCA010_hydrophones.csv
145 1 -1 -0.93 0.46 0.55
146 2 0 0.02 1.04 0.55
147 3 0 0.46 0.93 0.55
148 9 0 -0.75 -0.72 0.55
149 10 -1 0.11 1.04 0.55
150 11 -1 0.54 0.89 0.55
151 12 0 0.46 0.93 0.55
152 17 0 0.61 0.84 0.55
153 18 0 1.03 0.16 0.55
154 19 0 0.11 1.04 0.55
155EOF
156
157JAcousticsEventBuilder.sh detector.datx $RUNS[*]
158
159INPUT_FILES=(`ls KM3NeT_${(l:8::0::0:)DETECTOR_ID}_0*${^RUNS}_event.root`)
160
161
162# Run in WORKDIR
163
164cd $WORKDIR
165
166if [ ! $HOMEDIR -ef $WORKDIR ]; then
167 cp -p $HOMEDIR/$ACOUSTICS_DETECTOR $WORKDIR
168 cp -p $HOMEDIR/${^ACOUSTICS_KEYS}.txt $WORKDIR
169 cp -p $HOMEDIR/${^ACOUSTICS_AUXS}.txt $WORKDIR
170 cp -p $HOMEDIR/${^INPUT_FILES} $WORKDIR
171fi
172
173cat>script.txt<<EOF
174
175fix string $FIXED_STRINGS[*]
176fix tripod $FIXED_TRIPODS[*]
177
178stage 0 ${SINGULARITY}1 0 100.0e-6 10.0 10 0.5
179stage 1B ${SINGULARITY}1 0 100.0e-6 10.0 0 0.001 0.1
180stage 2A ${SINGULARITY}1 0 100.0e-6 10.0 20 0.2 0.5
181stage 2C ${SINGULARITY}1 0 100.0e-6 10.0 20 0.2
182
183initialise
184
185stage 2a ${SINGULARITY}1 0 100.0e-6 10.0 20 0.2 0.5
186stage 2c ${SINGULARITY}1 0 100.0e-6 10.0 20 0.2
187stage 3a ${SINGULARITY}1 0 50.0e-6 10.0 20 0.2 0.5
188stage 3c ${SINGULARITY}1 0 50.0e-6 10.0 20 0.2
189EOF
190
191JSydney.sh detector.datx $INPUT_FILES[*] script.txt
192
193if [ ! $HOMEDIR -ef $WORKDIR ]; then
194 cp -vru * $HOMEDIR
195fi