Jpp test-rotations-old
the software that should make you happy
Loading...
Searching...
No Matches
pre-calibration_D0ARCW003.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 P0ARCW016 (233) 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 236
18set_array RUNS 177-190
19set_variable: MUL ACOUSTICS_MUL -1.21e-2
20set_variable: THREADS ACOUSTICS_THREADS 32
21set_variable SINGULARITY -
22set_variable WORKDIR `pwd`
23set_variable HOMEDIR $WORKDIR
24
25if do_usage $*; then
26 usage "$script <source directory> [user directory]"\
27 "\nThe source directory corresponds to a pre-calibrated D0ARCA030 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 TRIPOD $DIR/tripod.txt
40set_variable DETECTOR_INITIAL detector_initial.datx
41expand_array RUNS
42
43
44# Run in HOMEDIR
45
46mkdir -p $HOMEDIR
47cd $HOMEDIR
48
49JDetectorDB \
50 -D $DETECTOR_ID \
51 -r $RUNS[1] \
52 -V "" \
53 -WW \
54 -o $DETECTOR_INITIAL
55
56# Apply modifications.
57
58JEditDetector \
59 -a $DETECTOR_INITIAL \
60 -s "-1 mul $MUL" \
61 -o detector.datx --!
62
63eval `JPrintDetector -a detector.datx -O SUMMARY`
64
65for STRING in ${STRINGS[*]}; do
66
67 set_variable MODULE `getModule -a detector.datx -L "$STRING 0"`
68
69 JEditDetector \
70 -a detector.datx \
71 -M "$MODULE setz -11.7" \
72 -o detector.datx --!
73done
74
75typeset -A TRIPODS
76
77get_tripods $TRIPOD TRIPODS; FIXED_TRIPODS=(${(k)TRIPODS[*]})
78
79cp -p $TRIPOD tripod.txt
80
81
82cat>waveform.txt<<EOF
83# waveform identifier; emitter identifier
84 28 9
85-29 9
86 25 10
87-26 10
88 29 13
89-30 13
90 34 14
91-35 14
92 33 16
93-34 16
94 23 18
95-24 18
96 39 19
97-40 19
98 45 20
99-46 20
100 47 21
101-48 21
102 41 22
103-42 22
104EOF
105
106cat>acoustics_trigger_parameters.txt<<EOF
107Q = 0.0;
108TMax_s = 0.035;
109numberOfHits = 40;
110EOF
111
112cat>disable.txt<<EOF
113# disable transmissions
114EOF
115
116cat>transmitter.txt<<EOF
117# Data from xxxx_baseAcousticBeacon.csv
118EOF
119
120cat>hydrophone.txt<<EOF
121# Data from xxxx_hydrophones.csv
122EOF
123
124JAcousticsEventBuilder.sh detector.datx $RUNS[*]
125
126INPUT_FILES=(`ls KM3NeT_${(l:8::0::0:)DETECTOR_ID}_0*${^RUNS}_event.root`)
127
128
129# Run in WORKDIR
130
131cd $WORKDIR
132
133if [ ! $HOMEDIR -ef $WORKDIR ]; then
134 cp -p $HOMEDIR/$ACOUSTICS_DETECTOR $WORKDIR
135 cp -p $HOMEDIR/${^ACOUSTICS_KEYS}.txt $WORKDIR
136 cp -p $HOMEDIR/${^ACOUSTICS_AUXS}.txt $WORKDIR
137 cp -p $HOMEDIR/${^INPUT_FILES} $WORKDIR
138fi
139
140cat>script.txt<<EOF
141fix tripod $FIXED_TRIPODS[*]
142
143stage 1A 0 2 250.0e-6 10.0 20 0.5 0.5
144stage 1B 0 2 250.0e-6 10.0 0 0.0005 0.2
145stage 1C ${SINGULARITY}2 0 250.0e-6 10.0 20 0.3
146stage 2A ${SINGULARITY}2 0 100.0e-6 10.0 20 0.2 0.2
147stage 2C ${SINGULARITY}2 0 100.0e-6 10.0 20 0.2
148stage 3A ${SINGULARITY}2 0 50.0e-6 10.0 20 0.2 0.2
149stage 3C ${SINGULARITY}2 0 50.0e-6 10.0 20 0.2
150EOF
151
152JSydney.sh detector.datx $INPUT_FILES[*] script.txt
153
154if [ ! $HOMEDIR -ef $WORKDIR ]; then
155 cp -vru * $HOMEDIR
156fi