]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
macro to perform the QA process
authorschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 6 May 2007 13:43:24 +0000 (13:43 +0000)
committerschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 6 May 2007 13:43:24 +0000 (13:43 +0000)
ESDCheck/CheckESD.sh [new file with mode: 0755]

diff --git a/ESDCheck/CheckESD.sh b/ESDCheck/CheckESD.sh
new file mode 100755 (executable)
index 0000000..986d1d8
--- /dev/null
@@ -0,0 +1,72 @@
+#!/bin/bash
+currentDir=`pwd`
+PACKAGES="ESD ANALYSIS AnalysisCheck"
+DETECTORS="PHOS EMCal PMD HMPID T0 MUON TOF VZERO"
+LOGFILE=`echo $0 | sed -e 's/sh/log/'`
+function testpack()
+{
+ test=`cat CheckESD.log | grep "$2 done"` 
+ if [ "$test" = "" ]; then 
+    echo --ERROR $1 $2
+    rv=1 
+ else 
+    echo ++OK $1 $2
+    rv=0 
+ fi
+ return $rv
+}
+function testdet()
+{
+ test=`cat CheckESD.log | grep "$2 Summary Report: OK"`
+ if [ "$test" = "" ]; then
+    echo --ERROR $1 $2 
+    rv=1
+ else 
+    echo ++OK $1 $2
+    rv=0
+ fi
+ return $rv
+}
+#Start
+if [ -e $LOGFILE ]; then
+ rm $LOGFILE
+fi
+echo $0 LOG > $LOGFILE
+# make the par files
+cd $ALICE_ROOT
+for pack in $PACKAGES; do
+ make $pack.par            >> $currentDir/$LOGFILE
+done
+# copy the par file to the working directory
+cd $currentDir
+for pack in $PACKAGES; do
+ rm -fr $pack* 
+ mv $ALICE_ROOT/$pack.par .
+done
+cp $ALICE_ROOT/ESDCheck/ana.C .
+# run root
+if [ ! -e "AliESDs.root" ]; then 
+ echo File AliESDs.root not found >> $LOGFILE
+ exit 1 
+fi
+root -b -q ana.C >> $LOGFILE 2>&1
+#test function for parsing log file
+# parse the log file
+error=0
+for pack in $PACKAGES; do
+ testpack creating $pack.par  
+ testpack loading lib$pack 
+ let "error +=$?"
+done
+
+for det in $DETECTORS; do
+ testdet Checking $det
+ let "error +=$?"
+done 
+if [ "$error" > "0" ]; then 
+ echo --------------- $error errors signaled 
+else 
+ echo +++++++++++++++ All OK
+fi 
+exit $error