]>
Commit | Line | Data |
---|---|---|
676fb573 | 1 | # $Id$ |
2 | # ---------------------------------------------------------------- | |
3 | # This script generates test macros for all versions of | |
4 | # one detector if it specified or for all detectors otherwise | |
5 | # with specified (or default) test event generator | |
6 | # in macro/DDD/test | |
7 | # | |
8 | # Usage: test_create.sh detName [-g genNumber] [-v visNumber] | |
9 | # for all detectors: detName = ALL | |
10 | # | |
11 | # 5.11.99 I. Hrivnacova | |
12 | ||
13 | # check input parameters | |
14 | if [ $# -lt 1 ]; then | |
15 | echo "Usage: " | |
16 | echo "test_create.sh detName [-g genNumber] [-v visNumber]" | |
17 | echo " for all detectors: detName = ALL" | |
18 | exit | |
19 | fi | |
20 | ||
21 | # default parameters | |
22 | DIR=$1 | |
23 | GEN="0" | |
24 | VIS="0" | |
25 | ||
26 | # get input parameters | |
27 | for param in $* | |
28 | do | |
29 | case $param in | |
30 | -g) GEN=$3; shift 2;; | |
31 | -v) VIS=$3; shift 2;; | |
32 | esac | |
33 | done | |
34 | ||
35 | CURDIR=`pwd` | |
36 | SRC=$ALICE_ROOT | |
37 | TO=$AG4_INSTALL/"test" | |
38 | MAX=10 | |
39 | ||
40 | # create destination directory if it does not exist | |
41 | if [ ! -d $TO ] ; then | |
42 | mkdir $TO | |
43 | cd $TO | |
44 | mkdir CASTOR FMD ITS MUON PHOS PMD RICH START STRUCT TOF TPC TRD ZDC | |
45 | cd STRUCT | |
46 | mkdir ABSO BODY DIPO FRAME HALL MAG PIPE SHIL | |
47 | fi | |
48 | ||
49 | cd $SRC | |
50 | if [ "$DIR" = "ALL" ]; then | |
51 | # loop over all detectors if det is not specified | |
52 | for DIR in `ls`; do | |
53 | if [ -d $DIR ] ; then | |
54 | cd $SRC/$DIR | |
55 | VER=0 | |
56 | until [ "$VER" = "$MAX" ] ; do | |
57 | if [ -f "Ali"$DIR"v"$VER".cxx" ]; then | |
adf8b4e4 | 58 | #echo "test_create_in.sh $DIR v$VER test$GEN$VIS" |
676fb573 | 59 | test_create_in.sh $DIR -d $VER -g $GEN -v $VIS |
60 | fi | |
61 | let VER=$VER+1 | |
62 | done | |
63 | cd $SRC | |
64 | fi | |
65 | done | |
66 | else | |
67 | ||
68 | # loop over all structures | |
69 | if [ "$DIR" = "STRUCT" ]; then | |
70 | cd $TO/$DIR | |
71 | for MODULE in `ls`; do | |
72 | VER=0 | |
73 | until [ "$VER" = "$MAX" ] ; do | |
74 | if [ -f $SRC/$DIR/"Ali"$MODULE"v"$VER".cxx" ]; then | |
adf8b4e4 | 75 | #echo "test_create_struct.sh $MODULE v$VER test$GEN$VIS" |
676fb573 | 76 | test_create_struct.sh $MODULE -d $VER -g $GEN -v $VIS |
77 | fi | |
78 | let VER=$VER+1 | |
79 | done | |
80 | done | |
81 | else | |
82 | ||
adf8b4e4 | 83 | # all detectors with default versions only |
84 | if [ "$DIR" = "ALL_DEFAULT" ]; then | |
85 | cd $SRC | |
86 | for DIR in `ls`; do | |
87 | if [ -d $DIR ]; then | |
88 | cd $SRC/$DIR | |
89 | VER="d" | |
90 | #echo "test_create_in.sh $DIR v$VER test$GEN$VIS" | |
676fb573 | 91 | test_create_in.sh $DIR -d $VER -g $GEN -v $VIS |
92 | fi | |
adf8b4e4 | 93 | cd $SRC |
94 | done | |
95 | else | |
96 | ||
97 | # loop over all structures with default versions only | |
98 | if [ "$DIR" = "STRUCT_DEFAULT" ]; then | |
99 | DIR="STRUCT" | |
100 | cd $TO/$DIR | |
101 | for MODULE in `ls`; do | |
102 | VER="d" | |
103 | #echo "test_create_struct.sh $MODULE v$VER test$GEN$VIS" | |
104 | test_create_struct.sh $MODULE -d $VER -g $GEN -v $VIS | |
105 | done | |
106 | else | |
107 | ||
108 | # specified detector only | |
109 | if [ -d $SRC/$DIR ]; then | |
110 | cd $SRC/$DIR | |
111 | VER=0 | |
112 | until [ "$VER" = "$MAX" ] ; do | |
113 | if [ -f "Ali"$DIR"v"$VER".cxx" ]; then | |
114 | #echo "test_create_in.sh $DIR v$VER test$GEN$VIS" | |
115 | test_create_in.sh $DIR -d $VER -g $GEN -v $VIS | |
116 | fi | |
117 | let VER=$VER+1 | |
118 | done | |
119 | cd $TO | |
120 | fi | |
121 | fi | |
676fb573 | 122 | fi |
123 | fi | |
124 | fi | |
125 | cd $CURDIR |