]>
Commit | Line | Data |
---|---|---|
e904c42b | 1 | #!/bin/bash |
2 | currentDir=`pwd` | |
3 | PACKAGES="ESD ANALYSIS AnalysisCheck" | |
4 | DETECTORS="PHOS EMCal PMD HMPID T0 MUON TOF VZERO" | |
5 | LOGFILE=`echo $0 | sed -e 's/sh/log/'` | |
6 | function testpack() | |
7 | { | |
8 | test=`cat CheckESD.log | grep "$2 done"` | |
9 | if [ "$test" = "" ]; then | |
10 | echo --ERROR $1 $2 | |
11 | rv=1 | |
12 | else | |
13 | echo ++OK $1 $2 | |
14 | rv=0 | |
15 | fi | |
16 | return $rv | |
17 | } | |
18 | function testdet() | |
19 | { | |
20 | test=`cat CheckESD.log | grep "$2 Summary Report: OK"` | |
21 | if [ "$test" = "" ]; then | |
22 | echo --ERROR $1 $2 | |
23 | rv=1 | |
24 | else | |
25 | echo ++OK $1 $2 | |
26 | rv=0 | |
27 | fi | |
28 | return $rv | |
29 | } | |
30 | #Start | |
31 | if [ -e $LOGFILE ]; then | |
32 | rm $LOGFILE | |
33 | fi | |
34 | echo $0 LOG > $LOGFILE | |
35 | # make the par files | |
36 | cd $ALICE_ROOT | |
37 | for pack in $PACKAGES; do | |
38 | make $pack.par >> $currentDir/$LOGFILE | |
39 | done | |
40 | # copy the par file to the working directory | |
41 | cd $currentDir | |
42 | for pack in $PACKAGES; do | |
43 | rm -fr $pack* | |
44 | mv $ALICE_ROOT/$pack.par . | |
45 | done | |
46 | cp $ALICE_ROOT/ESDCheck/ana.C . | |
47 | # run root | |
48 | if [ ! -e "AliESDs.root" ]; then | |
49 | echo File AliESDs.root not found >> $LOGFILE | |
50 | exit 1 | |
51 | fi | |
52 | root -b -q ana.C >> $LOGFILE 2>&1 | |
53 | #test function for parsing log file | |
54 | # parse the log file | |
55 | error=0 | |
56 | for pack in $PACKAGES; do | |
57 | testpack creating $pack.par | |
58 | testpack loading lib$pack | |
59 | let "error +=$?" | |
60 | done | |
61 | ||
62 | for det in $DETECTORS; do | |
63 | testdet Checking $det | |
64 | let "error +=$?" | |
65 | done | |
66 | if [ "$error" > "0" ]; then | |
67 | echo --------------- $error errors signaled | |
68 | else | |
69 | echo +++++++++++++++ All OK | |
70 | fi | |
71 | exit $error | |
72 |