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