Jpp  18.6.0-rc.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
pre-calibration_D0ARCA028.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 D0ARCA028 (160) 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 
18 set_array RUNS 18826-18833
19 set_variable: MUL ACOUSTICS_MUL -1.21e-2
20 set_variable: THREADS ACOUSTICS_THREADS 5
21 set_variable SINGULARITY -
24 
25 if do_usage $*; then
26  usage "$script <source directory> [user directory]"\
27  "\nThe source directory corresponds to a pre-calibrated D0ARCA021 detector."\
28  "\nThe user directory should be specified when this script is submitted in a batch queue."
29 fi
30 
31 case $# in
33  1) set_variable DIR ${1:a};;
34  *) fatal "Wrong number of arguments."
35 esac
36 
37 source JAcousticsToolkit.sh
38 
39 
40 # post-calibration of input detector
41 
42 mkdir -p $WORKDIR/post-calibration
43 pushd $WORKDIR/post-calibration
44 
45 post-calibration_D0ARCA021.sh $DIR
46 
47 popd
48 
49 set_variable DETECTOR $WORKDIR/post-calibration/detector.datx
50 set_variable TRIPOD $WORKDIR/post-calibration/tripod.txt
51 set_variable DETECTOR_INITIAL detector_initial.datx
52 expand_array RUNS
53 
54 
55 # Run in HOMEDIR
56 
57 mkdir -p $HOMEDIR
58 cd $HOMEDIR
59 
60 JDetectorDB \
61  -D $DETECTOR_ID \
62  -r $RUNS[1] \
63  -V "" \
64  -WW \
65  -o $DETECTOR_INITIAL
66 
67 JEditDetector \
68  -a $DETECTOR \
69  -r "14 15" \
70  -o detector_tmp.datx --!
71 
72 eval `JPrintDetector -a $DETECTOR_INITIAL -O SUMMARY`; FINAL_STRINGS=($STRINGS[*])
73 eval `JPrintDetector -a detector_tmp.datx -O SUMMARY`; FIXED_STRINGS=($STRINGS[*])
74 
75 # Apply modifications.
76 
77 JEditDetector \
78  -a $DETECTOR_INITIAL \
79  -s "-1 mul $MUL" \
80  -o detector.datx --!
81 
82 eval `JPrintDetector -a detector.datx -O SUMMARY`
83 
84 for STRING in ${STRINGS[*]}; do
85 
86  set_variable MODULE `getModule -a detector.datx -L "$STRING 0"`
87 
88  JEditDetector \
89  -a detector.datx \
90  -M "$MODULE setz -11.7" \
91  -o detector.datx --!
92 done
93 
94 JEditDetector -a detector.datx -r "$FIXED_STRINGS[*]" -o detector.datx --!
95 JMergeDetector -a detector.datx -a detector_tmp.datx -o detector.datx --!
96 
97 JEditTripod \
98  -f $TRIPOD \
99  -r "12" \
100  -o tripod.txt
101 
102 cat>acoustics_trigger_parameters.txt<<EOF
103 Q = 0.0;
104 TMax_s = 0.020;
105 numberOfHits = 400;
106 EOF
107 
108 cat>disable.txt<<EOF
109 # disable transmissions
110 # $9136f45a-c2f3-450e-b450-ba8ea4497983$
111 # GIT 18.3.0-306-g8309c53d6-D
112 # ROOT 6.30/02
113 # application JEditDisable
114 # command /data1/dejong/km3net/GIT/Jpp/out//Linux/bin//JEditDisable -f disable.log -o disable.log -a detector.datx -q -d 2 --!
115 # namespace KM3NET
116 # 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
117 2 808964925
118 3 808430571
119 3 808474602
120 3 808964925
121 3 808971936
122 3 808978646
123 3 808981369
124 4 808474602
125 4 808964925
126 7 806476519
127 7 806649098
128 7 808430571
129 7 808480499
130 7 808974928
131 7 808974966
132 7 808975010
133 7 808976351
134 7 808985071
135 7 816919166
136 7 816943531
137 7 817595446
138 7 817606460
139 7 819737799
140 8 806649098
141 8 808430571
142 8 808469556
143 8 808491794
144 8 808944706
145 8 808964757
146 8 808964845
147 8 808972687
148 8 808974966
149 8 808980070
150 8 808984610
151 8 817565754
152 8 817581876
153 8 817595516
154 8 817597135
155 8 817597212
156 8 817597230
157 8 817605775
158 8 817605786
159 8 817612559
160 8 817801419
161 9 806649098
162 9 806657372
163 9 808432849
164 9 808454978
165 9 808474602
166 9 808957378
167 9 808958576
168 9 808981206
169 9 808981369
170 9 808987098
171 9 816919071
172 9 817595373
173 9 817605768
174 9 817608140
175 9 817802210
176 10 806649098
177 10 806657372
178 10 808430036
179 10 808437870
180 10 808468365
181 10 808474602
182 10 808964876
183 10 808974966
184 10 808977563
185 10 808984610
186 10 808984662
187 10 817606460
188 10 817608135
189 10 817616429
190 10 817802231
191 10 819852785
192 12 808454978
193 12 808474243
194 12 808491794
195 12 808982550
196 12 808995481
197 12 808998966
198 13 806649098
199 13 808430036
200 13 808430571
201 13 808447081
202 13 808474243
203 13 808474602
204 13 808480499
205 13 808952499
206 13 808964925
207 13 808974966
208 13 808981369
209 13 808984662
210 13 817802231
211 EOF
212 
213 cat>transmitter.txt<<EOF
214 # Data from D0ARCA028_baseAcousticBeacon.csv
215 11 16 0 0.03 -0.77 0.48
216 14 5 0 0.74 0.23 0.48
217 15 32 0 -0.38 -0.67 0.48
218 16 8 0 0.44 0.63 0.48
219 17 18 0 0.12 0.76 0.48
220 EOF
221 
222 cat>hydrophone.txt<<EOF
223 # Data from D0ARCA028_hydrophones.csv
224  9 -1 -0.57 -0.42 0.57
225  10 0 -0.67 0.39 0.62
226  11 0 -0.67 0.39 0.62
227  13 0 -0.68 -0.37 0.62
228  14 0 -0.20 -0.75 0.62
229  12 0 -0.12 0.76 0.62
230  15 0 -0.72 -0.27 0.62
231  19 0 -0.16 -0.76 0.62
232  16 0 0.07 0.77 0.62
233  20 0 0.09 -0.77 0.62
234  23 0 -0.59 -0.49 0.62
235  24 0 -0.68 -0.37 0.62
236  21 0 -0.46 0.62 0.62
237  22 0 -0.26 0.73 0.62
238  25 0 -0.74 -0.22 0.62
239  30 0 -0.08 -0.77 0.62
240  26 0 -0.06 0.77 0.62
241  27 0 -0.21 0.74 0.62
242  28 0 0.12 0.76 0.62
243  32 0 0.47 0.62 0.62
244  5 0 -0.76 -0.13 0.62
245  1 0 -0.20 -0.75 0.62
246  3 0 0.12 -0.76 0.62
247  4 0 0.62 -0.46 0.62
248  8 0 -0.52 -0.57 0.62
249  14 0 -0.20 -0.75 0.62
250  15 0 -0.75 -0.20 0.62
251  17 0 0.08 0.77 0.62
252  18 0 -0.22 -0.74 0.62
253  31 0 0.71 0.31 0.62
254 EOF
255 
256 JAcousticsEventBuilder.sh detector.datx $RUNS[*]
257 
258 INPUT_FILES=(`ls KM3NeT_${(l:8::0::0:)DETECTOR_ID}_0*${^RUNS}_event.root`)
259 
260 
261 # Run in WORKDIR
262 
263 cd $WORKDIR
264 
265 if [ ! $HOMEDIR -ef $WORKDIR ]; then
266  cp -p $HOMEDIR/$ACOUSTICS_DETECTOR $WORKDIR
267  cp -p $HOMEDIR/${^ACOUSTICS_KEYS}.txt $WORKDIR
268  cp -p $HOMEDIR/${^ACOUSTICS_AUXS}.txt $WORKDIR
269  cp -p $HOMEDIR/${^INPUT_FILES} $WORKDIR
270 fi
271 
272 cat>script.txt<<EOF
273 
274 fix string $FIXED_STRINGS[*]
275 fix tripod $FIXED_TRIPODS[*]
276 
277 stage 1A 0 2 250.0e-6 10.0 20 0.5 0.5
278 stage 1B 0 2 250.0e-6 10.0 0 0.0005 0.2
279 stage 1C ${SINGULARITY}2 0 250.0e-6 10.0 20 0.3
280 stage 2A ${SINGULARITY}2 0 100.0e-6 10.0 20 0.2 0.2
281 stage 2C ${SINGULARITY}2 0 100.0e-6 10.0 20 0.2
282 
283 initialise
284 
285 stage 2a ${SINGULARITY}2 0 100.0e-6 10.0 20 0.2 0.2
286 stage 2c ${SINGULARITY}2 0 100.0e-6 10.0 20 0.2
287 stage 3a ${SINGULARITY}2 0 50.0e-6 10.0 20 0.2 0.2
288 stage 3c ${SINGULARITY}2 0 50.0e-6 10.0 20 0.2
289 EOF
290 
291 JSydney.sh detector.datx $INPUT_FILES[*] script.txt
292 
293 if [ ! $HOMEDIR -ef $WORKDIR ]; then
294  cp -vru * $HOMEDIR
295 fi
*fatal Wrong number of arguments esac source JAcousticsToolkit sh mkdir p $WORKDIR post calibration pushd $WORKDIR post calibration post calibration_D0ARCA021 sh $DIR popd set_variable DETECTOR $WORKDIR post calibration detector datx set_variable TRIPOD $WORKDIR post calibration tripod txt set_variable DETECTOR_INITIAL detector_initial datx expand_array RUNS mkdir p $HOMEDIR cd $HOMEDIR JDetectorDB D $DETECTOR_ID r $RUNS[1] V WW o $DETECTOR_INITIAL JEditDetector a $DETECTOR r o detector_tmp datx!eval JPrintDetector a $DETECTOR_INITIAL O SUMMARY
Q(UTCMax_s-UTCMin_s)-livetime_s
clean eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY set_variable STRING
then usage eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID JCanberra sh $DETECTOR $INPUT_FILES[*] $WORKDIR canberra[%\] root source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS kill_child_processes_at_exit attach getModule a $DETECTOR typeset Z STRING typeset Z FLOOR for STRING in $STRINGS[*]
then JLigier sh continue fi cat
Definition: JDAQDriver.sh:51
then usage $script[user directory] nThe user directory should be specified when this script is submitted in a batch queue fi case set_variable HOMEDIR
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O SUMMARY JPrintDAQHeader f $INPUT_FILE read A DAQ_HEADER set_variable DETECTOR_ID
Definition: JSquid.sh:28
o $QUALITY_ROOT d $DEBUG!CHECK_EXIT_CODE JPlot1D f
Definition: JDataQuality.sh:76
exit
Definition: JPizza.sh:36
data_type r[M+1]
Definition: JPolint.hh:868
V(JDAQEvent-JTriggerReprocessor)*1.0/(JDAQEvent+1.0e-10)
then
Definition: datalogs.sh:34
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR &dev null set_variable DETECTOR_ID set_array RUNS if do_usage *then usage $script< source directory > nThe source directory corresponds to a pre calibrated D0ARCA009 detector fi case set_variable DIR
then fatal Wrong number of arguments fi JConvertDetectorFormat a o
then fatal Missing detector file $DETECTOR fi eval JPrintDetector a $DETECTOR O IDENTIFIER RUNS
static const double C
Physics constants.
then $DIR JKatoomba a $DETECTOR o $WORKDIR katoomba root T $TRIPOD
then JCalibrateToT a
Definition: JTuneHV.sh:107
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR set_variable DEBUG set_variable WORKDIR if do_usage *then usage for INPUT_FILE in $INPUT_FILES[*]
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR &dev null set_variable
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR &dev null set_variable DEBUG set_variable WORKDIR
Definition: JLegolas.sh:20
* usage
$WORKDIR ev_configure_dqsimulator txt echo process $DQ_SIMULATOR $i $SOURCE_HOST[$index] csh c(setenv ROOTSYS $ROOTSYS &&source $JPP_DIR/setenv.csh $JPP_DIR &&($DQ_SIMULATOR\-u\$NAME\$\-H\$SERVER\$\-M\$LOGGER\$\-d $DEBUG</dev/null > &/dev/null &))'
set_array INPUT_FILES argv[2,$((START_INDEX_STRING-1))] set_array STRINGS
do set_variable INPUT_FILE $WORKDIR KM3NeT_
then fatal The output file must have the wildcard in the e g root fi eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:48
then set_variable MODULE getModule a $DETECTOR L $STRING $FLOOR JEditDetector a $DETECTOR M $MODULE add $X o $DETECTOR else echo No update of detector $DETECTOR
then error Missing CDF files error Run
Definition: JSirene.sh:59
do sput $STRING $FLOOR sget MODULE INPUT_FILES
*fatal Wrong number of arguments esac for INPUT_FILE in eval ls rt $DIR stage
then cp
then fatal Abort fi fi done for RUN in $RUNS[*]
set_variable DETECTOR
do set_variable DETECTOR_TXT $WORKDIR detector
then echo
Definition: JQAQC.sh:92
source $JPP_DIR setenv csh $JPP_DIR &dev null eval JShellParser o a A
do echo Generating $dir eval D
Definition: JDrawLED.sh:53
then getFile sh $JPP_ARCHIVE $DETECTOR_ID $RUNS[1] $KEY $VERSION $WORKDIR
esac $JPP_BIN JLogger sh $LOGGER until pgrep JGetMessage</dev/null > dev null
const JModule & getModule(const JDetector &detector, const JModuleLocation &location)
find module with a given string and floor number
esac done
Definition: JAddHDE.sh:21