]> git.uio.no Git - u/mrichter/AliRoot.git/blame - AliGeant4/config/test_create.sh
This commit was generated by cvs2svn to compensate for changes in r1459,
[u/mrichter/AliRoot.git] / AliGeant4 / config / test_create.sh
CommitLineData
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
14if [ $# -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
19fi
20
21# default parameters
22DIR=$1
23GEN="0"
24VIS="0"
25
26# get input parameters
27for param in $*
28do
29 case $param in
30 -g) GEN=$3; shift 2;;
31 -v) VIS=$3; shift 2;;
32 esac
33done
34
35CURDIR=`pwd`
36SRC=$ALICE_ROOT
37TO=$AG4_INSTALL/"test"
38MAX=10
39
40# create destination directory if it does not exist
41if [ ! -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
47fi
48
49cd $SRC
50if [ "$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
58 echo "test_create_in.sh $DIR v$VER test$GEN$VIS"
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
66else
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
75 echo "test_create_struct.sh $MODULE v$VER test$GEN$VIS"
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
83# specified detector only
84 if [ -d $SRC/$DIR ] ; then
85 cd $SRC/$DIR
86 VER=0
87 until [ "$VER" = "$MAX" ] ; do
88 if [ -f "Ali"$DIR"v"$VER".cxx" ]; then
89 echo "test_create_in.sh $DIR v$VER test$GEN$VIS"
90 test_create_in.sh $DIR -d $VER -g $GEN -v $VIS
91 fi
92 let VER=$VER+1
93 done
94 cd $TO
95 fi
96 fi
97fi
98cd $CURDIR