Jpp master_rocky-44-g75b7c4f75
the software that should make you happy
Loading...
Searching...
No Matches
pre-calibration_D0ORCA010.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 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>acoustics_trigger_parameters.txt<<EOF
105Q = 0.0;
106TMax_s = 0.015;
107numberOfHits = 150;
108EOF
109
110cat>disable.txt<<EOF
111# disable transmissions
112# $c96382df-37c8-441a-8e9f-656f4a98677a$
113# GIT 18.3.0-305-g4e82b04f4-D
114# ROOT 6.30/02
115# application JEditDisable
116# command /data1/dejong/km3net/GIT/Jpp/out//Linux/bin//JEditDisable -f disable.log -o disable.log -a detector.datx -q -d 2 --!
117# namespace KM3NET
118# 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
1191 808971812
1201 809521500
1212 808472260
1222 808966194
1232 808976219
1242 808977319
1252 808978694
1263 808966194
127EOF
128
129cat>transmitter.txt<<EOF
130# $script
131EOF
132
133cat>hydrophone.txt<<EOF
134# Data from D0ORCA010_hydrophones.csv
135 1 -1 -0.93 0.46 0.55
136 2 0 0.02 1.04 0.55
137 3 0 0.46 0.93 0.55
138 9 0 -0.75 -0.72 0.55
139 10 -1 0.11 1.04 0.55
140 11 -1 0.54 0.89 0.55
141 12 0 0.46 0.93 0.55
142 17 0 0.61 0.84 0.55
143 18 0 1.03 0.16 0.55
144 19 0 0.11 1.04 0.55
145EOF
146
147JAcousticsEventBuilder.sh detector.datx $RUNS[*]
148
149INPUT_FILES=(`ls KM3NeT_${(l:8::0::0:)DETECTOR_ID}_0*${^RUNS}_event.root`)
150
151
152# Run in WORKDIR
153
154cd $WORKDIR
155
156if [ ! $HOMEDIR -ef $WORKDIR ]; then
157 cp -p $HOMEDIR/$ACOUSTICS_DETECTOR $WORKDIR
158 cp -p $HOMEDIR/${^ACOUSTICS_KEYS}.txt $WORKDIR
159 cp -p $HOMEDIR/${^ACOUSTICS_AUXS}.txt $WORKDIR
160 cp -p $HOMEDIR/${^INPUT_FILES} $WORKDIR
161fi
162
163cat>script.txt<<EOF
164
165fix string $FIXED_STRINGS[*]
166fix tripod $FIXED_TRIPODS[*]
167
168stage 0 ${SINGULARITY}1 0 100.0e-6 10.0 10 0.5
169stage 1B ${SINGULARITY}1 0 100.0e-6 10.0 0 0.001 0.1
170stage 2A ${SINGULARITY}1 0 100.0e-6 10.0 20 0.2 0.5
171stage 2C ${SINGULARITY}1 0 100.0e-6 10.0 20 0.2
172
173initialise
174
175stage 2a ${SINGULARITY}1 0 100.0e-6 10.0 20 0.2 0.5
176stage 2c ${SINGULARITY}1 0 100.0e-6 10.0 20 0.2
177stage 3a ${SINGULARITY}1 0 50.0e-6 10.0 20 0.2 0.5
178stage 3c ${SINGULARITY}1 0 50.0e-6 10.0 20 0.2
179EOF
180
181JSydney.sh detector.datx $INPUT_FILES[*] script.txt
182
183if [ ! $HOMEDIR -ef $WORKDIR ]; then
184 cp -vru * $HOMEDIR
185fi