1 |
################################################################# |
2 |
# Shell script to run the tracker reduction programs |
3 |
################################################################# |
4 |
# |
5 |
# |
6 |
# |
7 |
#---------------------------------------------------------------- |
8 |
#local variables: |
9 |
rawdata_dir='raw-data/' |
10 |
rzdata_dir='rz-test/' |
11 |
|
12 |
if [ -n "$1" -a -n "$2" ] ;then |
13 |
|
14 |
lines=$(grep -n -c $ $1) |
15 |
list=`more $1` |
16 |
|
17 |
################################################################# |
18 |
# ------------------------- LEVEL0 ------------------------------ |
19 |
# |
20 |
# This part of the script creates the input to level0.exe and run it, |
21 |
# starting from a txt list of file IDs (format: YYMMDD_XXX). |
22 |
# |
23 |
# Tipical input of level0.exe is as follows: |
24 |
# ../level0.exe << EOF |
25 |
# 5 # N. of downlink to process |
26 |
# raw-data/ # raw-data directory |
27 |
# 050323_011 # 1^ file id |
28 |
# 050324_001 # 2^ |
29 |
# 050324_002 # .... |
30 |
# 050324_003 # |
31 |
# 050324_004 # |
32 |
# rz-test/ # output rz directory |
33 |
# 100000 # maximum number of events to be processed |
34 |
# EOF |
35 |
################################################################# |
36 |
if [ $2 = 'level0' ]; then |
37 |
echo $lines > input |
38 |
echo $rawdata_dir >> input |
39 |
for dnlk in $list |
40 |
do |
41 |
echo $dnlk >> input |
42 |
done |
43 |
echo $rzdata_dir >> input |
44 |
echo '100000' >> input |
45 |
./level0.exe < input > $1-level0 |
46 |
# rm -f input |
47 |
|
48 |
################################################################# |
49 |
# ------------------------- LEVEL1 ------------------------------ |
50 |
# |
51 |
# This script creates the input to level1.exe and run it |
52 |
# starting from a txt list of file IDs (format: YYMMDD_XXX). |
53 |
# |
54 |
# Tipical input of level1.exe is as follows: |
55 |
# ../level1.exe << EOF |
56 |
# raw-data/ # raw-data directory |
57 |
# 050323_011 # file id |
58 |
# rz-test/ # input/output rz directory |
59 |
# 100000 # maximum number of events to be processed |
60 |
# EOF |
61 |
################################################################# |
62 |
elif [ $2 = 'level1' ]; then |
63 |
if [ -f $1-level1 ];then |
64 |
rm $1-level1 |
65 |
fi |
66 |
touch $1-level1 |
67 |
for dnlk in $list |
68 |
do |
69 |
./level1.exe >> $1-level1 <<EOF |
70 |
$rzdata_dir |
71 |
$dnlk |
72 |
100000 |
73 |
EOF |
74 |
done |
75 |
################################################################# |
76 |
# ------------------------- LEVEL2 ------------------------------ |
77 |
# |
78 |
# This script creates the input to level2.exe and run it |
79 |
# starting from a txt list of file IDs (format: YYMMDD_XXX). |
80 |
# |
81 |
# Tipical input of level1.exe is as follows: |
82 |
# ../level2.exe << EOF |
83 |
# raw-data/ # raw-data directory |
84 |
# 050323_011 # file id |
85 |
# rz-test/ # input/output rz directory |
86 |
# 100000 # maximum number of events to be processed |
87 |
# F # (debug flag) |
88 |
# EOF |
89 |
################################################################# |
90 |
elif [ $2 = 'level2' ]; then |
91 |
if [ -f $1-level2 ];then |
92 |
rm $1-level2 |
93 |
fi |
94 |
touch $1-level2 |
95 |
for dnlk in $list |
96 |
do |
97 |
./level2.exe >> $1-level2 <<EOF |
98 |
$rzdata_dir |
99 |
$dnlk |
100 |
1000000 |
101 |
ETA |
102 |
F |
103 |
EOF |
104 |
done |
105 |
fi |
106 |
else |
107 |
echo "" |
108 |
echo "*** new!!! ***" |
109 |
echo "apply eta algorythm!!" |
110 |
echo "" |
111 |
echo "USAGE:" |
112 |
echo "./run-test.sh downlink-list-file-name level0/1/2" |
113 |
echo "( ex: ./run-test.sh 050323.txt level0 & )" |
114 |
echo "( ex: ./run-test.sh 050323.txt level1 & )" |
115 |
echo "( ex: ./run-test.sh 050323.txt level2 & )" |
116 |
echo "" |
117 |
fi |
118 |
|