-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunTelemHkMaker.sh
executable file
·86 lines (70 loc) · 1.86 KB
/
runTelemHkMaker.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
#!/bin/bash
if [ "$3" = "" ]
then
echo "usage: `basename $0` <run no> <raw run ir> <root run dir>" 1>&2
exit 1
fi
RUN=$1
RAW_RUN_DIR=$2
ROOT_RUN_DIR=$3
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 "Starting Hk File"
HKCAL_FILE_LIST=`mktemp`
for file in ${RAW_RUN_DIR}/house/hk/cal/*/*/hk*gz;
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*gz;
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"
HKCAL_FILE_LIST=`mktemp`
for file in ${RAW_RUN_DIR}/house/hk/cal/*/*/sshk*;
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/*/*/sshk*;
do
if [[ -f $file ]]; then
echo $file >> ${HKRAW_FILE_LIST}
fi
done
HK_ROOT_FILE=${ROOT_RUN_DIR}/sshkFile${RUN}.root
if test `cat ${HKRAW_FILE_LIST} | wc -l` -gt 0 ; then
makeSSHkTree ${HKCAL_FILE_LIST} ${HKRAW_FILE_LIST} ${HK_ROOT_FILE}
rm ${HKRAW_FILE_LIST} ${HKCAL_FILE_LIST}
else
rm ${HKRAW_FILE_LIST} ${HKCAL_FILE_LIST}
echo "No Hk Files"
fi
echo "Done Hk File"