-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunNonEventFileMakerWHead.sh
executable file
·460 lines (383 loc) · 10.5 KB
/
runNonEventFileMakerWHead.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
#/bin/bash
if [ "$1" = "" ]
then
echo "usage: `basename $0` <run no>" 1>&2
exit 1
fi
RUN=$1
BASE_DIR=${ANITA4_BASE_DIR}
RAW_RUN_DIR=${BASE_DIR}/raw/run${RUN}
EVENT_BASE_DIR=${BASE_DIR}/root
ROOT_RUN_DIR=${EVENT_BASE_DIR}/run${RUN}
if [ -d $ROOT_RUN_DIR ]; then
echo "Output dir exists"
elif [ -d $RAW_RUN_DIR ]; then
mkdir ${ROOT_RUN_DIR}
else
echo "$RAW_RUN_DIR doesn't exist what are we suppposed to rootify?"
exit 0;
fi
echo "Using $RAW_RUN_DIR"
ls ${RAW_RUN_DIR}
echo "Rootifying non-event data..."
echo "Non-event data includes: calib, gps, gpu, hk, monitor, rtl, surfhk, tuff, turfhk, aux files and well as header files"
cd ${ANITA_UTIL_INSTALL_DIR}/bin
echo "Starting Header File"
HEAD_FILE_LIST=`mktemp`
for file in ${RAW_RUN_DIR}/event/*/ev?/hd*gz;
do
if [ -f $file ]; then
echo $file >> ${HEAD_FILE_LIST}
fi
done
for file in ${RAW_RUN_DIR}/event/*/ev??/hd*gz;
do
if [ -f $file ]; then
echo $file >> ${HEAD_FILE_LIST}
fi
done
for file in ${RAW_RUN_DIR}/event/*/ev???/hd*gz;
do
if [ -f $file ]; then
echo $file >> ${HEAD_FILE_LIST}
fi
done
for file in ${RAW_RUN_DIR}/event/*/ev????/hd*gz;
do
if [ -f $file ]; then
echo $file >> ${HEAD_FILE_LIST}
fi
done
for file in ${RAW_RUN_DIR}/event/*/ev?????/hd*gz;
do
if [ -f $file ]; then
echo $file >> ${HEAD_FILE_LIST}
fi
done
for file in ${RAW_RUN_DIR}/event/*/ev??????/hd*gz;
do
if [ -f $file ]; then
echo $file >> ${HEAD_FILE_LIST}
fi
done
for file in ${RAW_RUN_DIR}/event/*/ev???????/hd*gz;
do
if [ -f $file ]; then
echo $file >> ${HEAD_FILE_LIST}
fi
done
for file in ${RAW_RUN_DIR}/event/*/ev????????/hd*gz;
do
if [ -f $file ]; then
echo $file >> ${HEAD_FILE_LIST}
fi
done
cat ${HEAD_FILE_LIST}
if test `cat ${HEAD_FILE_LIST} | wc -l` -gt 0 ; then
HEAD_ROOT_FILE=${ROOT_RUN_DIR}/headFile${RUN}.root
./makeRawHeadTree ${HEAD_FILE_LIST} ${HEAD_ROOT_FILE}
rm ${HEAD_FILE_LIST}
DONE_HEAD_FILE=true
echo "Done Header File"
else
rm ${HEAD_FILE_LIST}
DONE_HEAD_FILE=false
echo "No header files"
fi
echo "Starting TURF Rate File"
TURF_FILE_LIST=`mktemp`
for file in ${RAW_RUN_DIR}/house/turfhk/*/*/t*gz;
do
if [ -f $file ]; then
echo $file >> ${TURF_FILE_LIST}
fi
done
if test `cat ${TURF_FILE_LIST} | wc -l` -gt 0 ; then
TURF_ROOT_FILE=${ROOT_RUN_DIR}/turfRateFile${RUN}.root
./makeTurfRateTree ${TURF_FILE_LIST} ${TURF_ROOT_FILE}
rm ${TURF_FILE_LIST}
echo "Done TURF Rate File"
else
rm ${TURF_FILE_LIST}
echo "No TURF Rate Files"
fi
echo "Starting SURF Hk File"
SURF_FILE_LIST=`mktemp`
for file in ${RAW_RUN_DIR}/house/surfhk/*/*/s*gz;
do
if [ -f $file ]; then
echo $file >> ${SURF_FILE_LIST}
fi
done
#cat ${SURF_FILE_LIST}
if test `cat ${SURF_FILE_LIST} | wc -l` -gt 0 ; then
SURF_ROOT_FILE=${ROOT_RUN_DIR}/surfHkFile${RUN}.root
./makeSurfHkTree ${SURF_FILE_LIST} ${SURF_ROOT_FILE}
rm ${SURF_FILE_LIST}
echo "Done SURF Hk File"
else
rm ${SURF_FILE_LIST}
echo "No SURF Hk Files"
fi
echo "Starting Averaged SURF Hk File"
AVGSURF_FILE_LIST=`mktemp`
for file in ${RAW_RUN_DIR}/house/surfhk/*/*/a*gz;
do
if [ -f $file ]; then
echo $file >> ${AVGSURF_FILE_LIST}
fi
done
#cat ${AVGSURF_FILE_LIST}
if test `cat ${AVGSURF_FILE_LIST} | wc -l` -gt 0 ; then
AVGSURF_ROOT_FILE=${ROOT_RUN_DIR}/avgSurfHkFile${RUN}.root
./makeAveragedSurfHkTree ${AVGSURF_FILE_LIST} ${AVGSURF_ROOT_FILE}
rm ${AVGSURF_FILE_LIST}
echo "Done Averaged SURF Hk File"
else
rm ${AVGSURF_FILE_LIST}
echo "No Averaged SURF Hk Files"
fi
echo "Starting Summed TURF Rate File"
SUMTURF_FILE_LIST=`mktemp`
for file in ${RAW_RUN_DIR}/house/turfhk/*/*/s*gz;
do
if [ -f $file ]; then
echo $file >> ${SUMTURF_FILE_LIST}
fi
done
if test `cat ${SUMTURF_FILE_LIST} | wc -l` -gt 0 ; then
SUMTURF_ROOT_FILE=${ROOT_RUN_DIR}/sumTurfRateFile${RUN}.root
./makeSummedTurfRateTree ${SUMTURF_FILE_LIST} ${SUMTURF_ROOT_FILE}
rm ${SUMTURF_FILE_LIST}
echo "Done SUMTURF Rate File"
else
rm ${SUMTURF_FILE_LIST}
echo "No Summed TURF Rate Files"
fi
echo "Starting SURF Raw Scaler File"
SCALER_FILE_LIST=`mktemp`
for file in ${RAW_RUN_DIR}/house/surfhk/*/*/raw*gz;
do
if [ -f $file ]; then
echo $file >> ${SCALER_FILE_LIST}
fi
done
#cat ${SCALER_FILE_LIST}
if test `cat ${SCALER_FILE_LIST} | wc -l` -gt 0 ; then
SCALER_ROOT_FILE=${ROOT_RUN_DIR}/rawScalerFile${RUN}.root
./makeRawScalerTree ${SCALER_FILE_LIST} ${SCALER_ROOT_FILE}
rm ${SCALER_FILE_LIST}
echo "Done Raw Scaler File"
else
rm ${SCALER_FILE_LIST}
echo "No Raw Scaler Files"
fi
echo "Starting Monitor File"
MONITOR_FILE_LIST=`mktemp`
for file in ${RAW_RUN_DIR}/house/monitor/*/*/mon*gz;
do
if [ -f $file ]; then
echo $file >> ${MONITOR_FILE_LIST}
fi
done
if test `cat ${MONITOR_FILE_LIST} | wc -l` -gt 0 ; then
MONITOR_ROOT_FILE=${ROOT_RUN_DIR}/monitorFile${RUN}.root
./makeMonitorTree ${MONITOR_FILE_LIST} ${MONITOR_ROOT_FILE}
rm ${MONITOR_FILE_LIST}
echo "Done Monitor Rate File"
else
rm ${MONITOR_FILE_LIST}
echo "No Monitor Rate Files"
fi
echo "Starting Gpu File"
GPU_FILE_LIST=`mktemp`
for file in ${RAW_RUN_DIR}/house/gpu/*/*/gpu*.da*;
do
if [ -f $file ]; then
echo $file >> ${GPU_FILE_LIST}
fi
done
if test `cat ${GPU_FILE_LIST} | wc -l` -gt 0 ; then
GPU_ROOT_FILE=${ROOT_RUN_DIR}/gpuFile${RUN}.root
./makeGpuTree ${GPU_FILE_LIST} ${GPU_ROOT_FILE}
rm ${GPU_FILE_LIST}
echo "Done Gpu File"
else
rm ${GPU_FILE_LIST}
echo "No Gpu Files"
fi
echo "Starting Other File"
OTHER_FILE_LIST=`mktemp`
for file in ${RAW_RUN_DIR}/house/monitor/*/*/other*.dat;
do
if [ -f $file ]; then
echo $file >> ${OTHER_FILE_LIST}
fi
done
if test `cat ${OTHER_FILE_LIST} | wc -l` -gt 0 ; then
OTHER_ROOT_FILE=${ROOT_RUN_DIR}/monitorFile${RUN}.root
./makeOtherTree ${OTHER_FILE_LIST} ${OTHER_ROOT_FILE}
rm ${OTHER_FILE_LIST}
echo "Done Other Rate File"
else
rm ${OTHER_FILE_LIST}
echo "No Other Rate Files"
fi
echo "Starting Hk File"
HKCAL_FILE_LIST=`mktemp`
for file in ${RAW_RUN_DIR}/house/hk/cal/*/*/hk*;
do
if [ -f $file ]; then
echo $file >> ${HKCAL_FILE_LIST}
fi
done
HKRAW_FILE_LIST=`mktemp`
for file in ${RAW_RUN_DIR}/house/hk/raw/*/*/hk*;
do
if [ -f $file ]; then
echo $file >> ${HKRAW_FILE_LIST}
fi
done
HK_ROOT_FILE=${ROOT_RUN_DIR}/hkFile${RUN}.root
if test `cat ${HKRAW_FILE_LIST} | wc -l` -gt 0 ; then
./makeHkTree ${HKCAL_FILE_LIST} ${HKRAW_FILE_LIST} ${HK_ROOT_FILE}
rm ${HKRAW_FILE_LIST} ${HKCAL_FILE_LIST}
if [ "$HEAD_ROOT_FILE" ]; then
echo "Making pretty hk file (interpolated)"
PRETTYHK_ROOT_FILE=${ROOT_RUN_DIR}/prettyHkFile${RUN}.root
./makePrettyHkTree ${HK_ROOT_FILE} ${HEAD_ROOT_FILE} ${PRETTYHK_ROOT_FILE}
fi
else
rm ${HKRAW_FILE_LIST} ${HKCAL_FILE_LIST}
echo "No Hk Files"
fi
echo "Done Hk File"
echo "Starting SSHk File"
SSHKCAL_FILE_LIST=`mktemp`
for file in ${RAW_RUN_DIR}/house/hk/cal/*/*/sshk*;
do
if [ -f $file ]; then
echo $file >> ${SSHKCAL_FILE_LIST}
fi
done
SSHKRAW_FILE_LIST=`mktemp`
for file in ${RAW_RUN_DIR}/house/hk/raw/*/*/sshk*;
do
if [ -f $file ]; then
echo $file >> ${SSHKRAW_FILE_LIST}
fi
done
SSHK_ROOT_FILE=${ROOT_RUN_DIR}/sshkFile${RUN}.root
if test `cat ${SSHKRAW_FILE_LIST} | wc -l` -gt 0 ; then
./makeSSHkTree ${SSHKCAL_FILE_LIST} ${SSHKRAW_FILE_LIST} ${SSHK_ROOT_FILE}
rm ${SSHKRAW_FILE_LIST} ${SSHKCAL_FILE_LIST}
else
rm ${SSHKRAW_FILE_LIST} ${SSHKCAL_FILE_LIST}
echo "No Hk Files"
fi
echo "Done Hk File"
echo "Starting GPS File"
ADU5_PAT_FILE_LIST=`mktemp`
for file in ${RAW_RUN_DIR}/house/gps/adu5?/pat/*/*/*gz;
do
if [ -f $file ]; then
echo $file >> ${ADU5_PAT_FILE_LIST}
fi
done
ADU5_SAT_FILE_LIST=`mktemp`
for file in ${RAW_RUN_DIR}/house/gps/adu5?/sat/*/*/*gz;
do
if [ -f $file ]; then
echo $file >> ${ADU5_SAT_FILE_LIST}
fi
done
cat ${ADU5_SAT_FILE_LIST}
ADU5_VTG_FILE_LIST=`mktemp`
for file in ${RAW_RUN_DIR}/house/gps/adu5?/vtg/*/*/*gz;
do
if [ -f $file ]; then
echo $file >> ${ADU5_VTG_FILE_LIST}
fi
done
G12_POS_FILE_LIST=`mktemp`
for file in ${RAW_RUN_DIR}/house/gps/g12/pos/*/*/*gz;
do
if [ -f $file ]; then
echo $file >> ${G12_POS_FILE_LIST}
fi
done
G12_SAT_FILE_LIST=`mktemp`
for file in ${RAW_RUN_DIR}/house/gps/g12/sat/*/*/*gz;
do
if [ -f $file ]; then
echo $file >> ${G12_SAT_FILE_LIST}
fi
done
GPS_GGA_FILE_LIST=`mktemp`
for file in ${RAW_RUN_DIR}/house/gps/*/gga/*/*/*gz;
do
if [ -f $file ]; then
echo $file >> ${GPS_GGA_FILE_LIST}
fi
done
GPS_ROOT_FILE=${ROOT_RUN_DIR}/gpsFile${RUN}.root
./makeGpsTree ${ADU5_PAT_FILE_LIST} ${ADU5_SAT_FILE_LIST} ${ADU5_VTG_FILE_LIST} ${G12_POS_FILE_LIST} ${G12_SAT_FILE_LIST} ${GPS_GGA_FILE_LIST} ${GPS_ROOT_FILE}
rm ${ADU5_PAT_FILE_LIST} ${ADU5_SAT_FILE_LIST} ${ADU5_VTG_FILE_LIST} ${G12_POS_FILE_LIST} ${G12_SAT_FILE_LIST} ${GPS_GGA_FILE_LIST}
echo "Done GPS File"
echo "Starting Auxiliary File"
ACQD_START_FILE_LIST=`mktemp`
for file in ${RAW_RUN_DIR}/start/a*;
do
if [ -f $file ]; then
echo $file >> ${ACQD_START_FILE_LIST}
fi
done
GPSD_START_FILE_LIST=`mktemp`
for file in ${RAW_RUN_DIR}/start/g*;
do
if [ -f $file ]; then
echo $file >> ${GPSD_START_FILE_LIST}
fi
done
LOGWATCHD_START_FILE_LIST=`mktemp`
for file in ${RAW_RUN_DIR}/start/l*;
do
if [ -f $file ]; then
echo $file >> ${LOGWATCHD_START_FILE_LIST}
fi
done
CMD_ECHO_FILE_LIST=`mktemp`
for file in ${RAW_RUN_DIR}/house/cmd/*/*/*gz;
do
if [ -f $file ]; then
echo $file >> ${CMD_ECHO_FILE_LIST}
fi
done
AUX_ROOT_FILE=${ROOT_RUN_DIR}/auxFile${RUN}.root
./makeAuxiliaryTree ${ACQD_START_FILE_LIST} ${GPSD_START_FILE_LIST} ${LOGWATCHD_START_FILE_LIST} ${CMD_ECHO_FILE_LIST} ${AUX_ROOT_FILE}
rm ${ACQD_START_FILE_LIST} ${GPSD_START_FILE_LIST} ${LOGWATCHD_START_FILE_LIST} ${CMD_ECHO_FILE_LIST}
echo "Done Auxiliary File"
echo "Start Tuff Status File"
TUFF_STATUS_FILE_LIST=`mktemp`
for file in ${RAW_RUN_DIR}/house/tuff/*/*/tuff*;
do
if [ -f $file ]; then
echo $file >> ${TUFF_STATUS_FILE_LIST}
fi
done
TUFF_STATUS_ROOT_FILE=${ROOT_RUN_DIR}/tuffStatusFile${RUN}.root
./makeTuffStatusTree ${TUFF_STATUS_FILE_LIST} ${TUFF_STATUS_ROOT_FILE}
rm ${TUFF_STATUS_FILE_LIST}
echo "Done Tuff Status File"
echo "Start RTL Spectrum File"
RTL_FILE_LIST=`mktemp`
for file in ${RAW_RUN_DIR}/house/rtl/*/*/rtl*;
do
if [ -f $file ]; then
echo $file >> ${RTL_FILE_LIST}
fi
done
RTL_ROOT_FILE=${ROOT_RUN_DIR}/rtlSpectrumFile${RUN}.root
./makeRtlSdrTree ${RTL_FILE_LIST} ${RTL_ROOT_FILE}
rm ${RTL_FILE_LIST}
echo "Done RTL Spectrum File"