Added ignores
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / trains / test.sh
1 #!/bin/sh
2
3 type=
4 proto=
5 host=
6 file=
7 opts=
8 anchor="esdTree"
9 dbg=
10 ex=
11 par=0
12 dir=/data/alice/data/ppb/LHC12g/pass1/188359/
13
14 usage()
15 {
16 cat<<EOF
17 Usage: $0 -t TYPE [OPTIONS]
18
19 Options:
20         -t,--type  TYPE       Set type of job [$type]
21         -v,--verbose LEVEL    Set verbosity
22         -d,--debug            Run in debugger [$dbg]
23         -b,--batch            Run batch mode [$ex]
24         -p,--par              Run with PAR files [$par]
25         -h,--help             Show this help
26
27 TYPE is one of 
28
29         local        Run over local files 
30         lite         Run in Proof-lite
31         hehi         Run on hehi Proof farm
32         caf          Run on CAF 
33         caf plugin   Run on CAF using plugin 
34         grid         Run in AliEn - Real data
35         grid hijing  Run in AliEn - Hijing simulation
36         grid dpmjet  Run in AliEn - DPMJet simulation
37 EOF
38 }
39
40 while test $# -gt 0 ; do 
41     case $1 in 
42         -t|--type) type=$2 ; shift ;; 
43         -d|--debug) dbg="gdb --args" ;; 
44         -b|--batch) ex="$ex --batch" ;; 
45         -v|--verbose) ex="$ex --verbose=$2" ; shift ;; 
46         -p|--par)   par=1 ;;
47         -h|--help)  usage ; exit 0 ;;
48     esac
49     shift 
50 done
51 case $type in 
52     local|lite) 
53         proto=$type
54         file="$dir"
55         if test "x$type" = "xlite" ; then opts="workers=10" ; fi
56         ;;
57     hehi*)
58         proto=proof
59         host="hehi00.nbi.dk";
60         file="/default/cholm/LHC12g_pass1_uncalibrated_ESD_188359_partial";
61         opts="mode=default&dsname"
62         if test $par -gt 0 ; then opts="$opts&par=tasks" ; fi
63         ;;
64     caf*)
65         proto=proof
66         host="alice-caf.cern.ch";
67         file="/alice/data/LHC12g_000188359_ESDs_p1_uncalibrated";
68         opts="mode=default&workers=60&aliroot=v5-03-68-AN&dsname"
69         if test $par -gt 0 ; then opts="$opts&par=tasks" ; fi
70         case $type in 
71             *plugin*) opts="${opts}&plugin" ;;
72         esac
73         ;;
74     grid*)
75         proto=alien
76         opts="run=188359-188359"
77         case $type in 
78             *hijing*)
79                 file="/alice/sim/2012/LHC12g1/";
80                 opts="$opts&pattern=*/AliESDs.root&mc"
81                 ;;
82             *dpmjet*)
83                 file="/alice/sim/2012/LHC12g4a/";
84                 opts="$opts&pattern=*/AliESDs.root&mc"
85                 ;;
86             *)
87                 file="/alice/data/2012/LHC12g";
88                 opts="$opts&pattern=ESDs/pass1_uncalibrated/*/AliESDs.root"
89                 ;;
90         esac
91         if test $par -gt 0 ; then opts="$opts&par=tasks" ; fi
92         ;;
93     help*)
94         ;;
95 esac
96
97 echo "Building runTrain ..."
98 bld="g++ -g `root-config --cflags --glibs` \
99     -lVMC -lGeom -lMinuit -lXMLIO -lTree -lTreePlayer \
100     -I$ALICE_ROOT/include -L$ALICE_ROOT/lib/tgt_${ALICE_TARGET} \
101     -lSTEERBase -lESD -lAOD -lANALYSIS -lOADB -lANALYSISalice \
102     trainMain.cxx -o runTrain"
103 echo $bld
104 $bld || exit 1
105
106 echo "Cleaning previous run ($name) ..."
107 name=test_`echo $type | tr ' \t&/' '_'`
108 rm -rf $name
109
110 echo "Running the job ..."
111 cmd="./runTrain --class=MakeAODTrain --name=$name \
112     --url=${proto}://${host}/${file}?${opts}#${anchor} \
113     --sys=3 --snn=5023 --field=-5  --cent \
114     $ex $@"
115 echo "$dbg $cmd"
116 $dbg $cmd
117
118 echo "done"