Jpp test-rotations-old
the software that should make you happy
Loading...
Searching...
No Matches
pre-calibration_D_ORCA006.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 D_ORCA006 (49) 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 49
18set_array RUNS 7600 7700 7800 7900 8000 8100 8200
19set_variable: THREADS ACOUSTICS_THREADS 5
20set_variable SINGULARITY -
21set_variable WORKDIR `pwd`
22set_variable HOMEDIR $WORKDIR
23
24if do_usage $*; then
25 usage "$script [user directory]"\
26 "\nThe user directory should be specified when this script is submitted in a batch queue."
27fi
28
29case $# in
30 1) set_variable HOMEDIR $1;;
31 0) ;;
32 *) fatal "Wrong number of arguments."
33esac
34
35source JAcousticsToolkit.sh
36
37set_variable DETECTOR_INITIAL detector_initial.datx
38set_variable TRIPOD_INITIAL tripod_initial.txt
39expand_array RUNS
40
41
42# Run in HOMEDIR
43
44mkdir -p $HOMEDIR
45cd $HOMEDIR
46
47JDetectorDB \
48 -D $DETECTOR_ID \
49 -r $RUNS[1] \
50 -WW \
51 -o $DETECTOR_INITIAL
52
53cat>$TRIPOD_INITIAL<<EOF
54# Data are from V. Bertin, private communications.
551 256877.5 4743716.7 -2438.4
562 256815.5 4743395.0 -2435.5
573 257096.2 4743636.0 -2439.5
58EOF
59
60# Apply modifications.
61
62JEditDetector \
63 -a $DETECTOR_INITIAL \
64 -s "-1 addz -6.9" \
65 -o detector.datx --!
66
67eval `JPrintDetector -a detector.datx -O SUMMARY`
68
69for STRING in ${STRINGS[*]}; do
70
71 set_variable MODULE `getModule -a detector.datx -L "$STRING 0"`
72
73 JEditDetector \
74 -a detector.datx \
75 -M "$MODULE setz -2.9" \
76 -o detector.datx --!
77done
78
79JEditDetector \
80 -a detector.datx \
81 -M "808972598 swap 27 28" \
82 -o detector.datx --!
83
84cp -p $TRIPOD_INITIAL tripod.txt
85
86cat>waveform.txt<<EOF
87# waveform identifier; emitter identifier
88 12 1
89-13 1
90 14 2
91-15 2
92 16 3
93-17 3
94EOF
95
96cat>acoustics_trigger_parameters.txt<<EOF
97Q = 0.0;
98TMax_s = 0.020;
99numberOfHits = 90;
100EOF
101
102cat>disable.txt<<EOF
103# disable transmissions
104# $214a44c8-fb8c-490a-920e-41897730822a$
105# GIT 18.3.0-305-g4e82b04f4-D
106# ROOT 6.30/02
107# application JEditDisable
108# command /data1/dejong/km3net/GIT/Jpp/out//Linux/bin//JEditDisable -f disable.log -o disable.log -a detector.datx -q -d 2 --!
109# namespace KM3NET
110# 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
1111 808971812
1121 809521500
1132 808472260
1142 808966194
1152 808976219
1162 808977319
1172 808978694
1183 808966194
119EOF
120
121cat>transmitter.txt<<EOF
122# $script
123EOF
124
125cat>hydrophone.txt<<EOF
126# Data from D_ORCA006_hydrophones.csv
127 1 -1 -0.93 0.46 0.55
128 2 0 0.02 1.04 0.55
129 3 0 0.46 0.93 0.55
130 9 0 -0.75 -0.72 0.55
131 10 -1 0.11 1.04 0.55
132 11 -1 0.54 0.89 0.55
133EOF
134
135JAcousticsEventBuilder.sh detector.datx $RUNS[*]
136
137INPUT_FILES=(`ls KM3NeT_${(l:8::0::0:)DETECTOR_ID}_0*${^RUNS}_event.root`)
138
139
140# Run in WORKDIR
141
142cd $WORKDIR
143
144if [ ! $HOMEDIR -ef $WORKDIR ]; then
145 cp -p $HOMEDIR/$ACOUSTICS_DETECTOR $WORKDIR
146 cp -p $HOMEDIR/${^ACOUSTICS_KEYS}.txt $WORKDIR
147 cp -p $HOMEDIR/${^ACOUSTICS_AUXS}.txt $WORKDIR
148 cp -p $HOMEDIR/${^INPUT_FILES} $WORKDIR
149fi
150
151cat>script.txt<<EOF
152stage 1b ${SINGULARITY}1 0 100.0e-6 10.0 0 0.001 0.1
153stage 2a ${SINGULARITY}1 0 100.0e-6 10.0 20 0.2 0.5
154stage 2c ${SINGULARITY}1 0 100.0e-6 10.0 20 0.2
155stage 3a ${SINGULARITY}1 0 50.0e-6 10.0 20 0.2 0.5
156stage 3c ${SINGULARITY}1 0 50.0e-6 10.0 20 0.2
157EOF
158
159JSydney.sh detector.datx $INPUT_FILES[*] script.txt
160
161if [ ! $HOMEDIR -ef $WORKDIR ]; then
162 cp -vru * $HOMEDIR
163fi