Extra header added to the list
[u/mrichter/AliRoot.git] / test / QA / AnaQA.sh
CommitLineData
3d886162 1#!/bin/sh
2
3# AnaQA.sh
4#
5#
6# Created by schutz on 30/09/08.
7# Copyright 2008 CERN. All rights reserved.
8macroname="AnaQA"
9validateout=`dirname $0`
10validatetime=`date`
11validated="0";
12if [ -z $validateout ]
13then
14 validateout="."
15fi
16
17cd $validateout;
18validateworkdir=`pwd`;
19
20echo "*******************************************************" >> stdout;
21echo "* AliRoot QA Validation Script V1.0 *" >> stdout;
22echo "* Time: $validatetime " >> stdout;
23echo "* Dir: $validateout" >> stdout;
24echo "* Workdir: $validateworkdir" >> stdout;
25echo "* ----------------------------------------------------*" >> stdout;
26detectorlist="ITS TPC TRD TOF PHOS HMPID EMCAL FMD ZDC T0 VZERO PMD ACORDE Global"
27if [ $# -eq 0 ] ; then
28 echo "syntax: AnaQA.sh #runNumber"
29 exit 1
30fi
31if [ ! -f ${macroname}.C ] ; then
32 echo "* ########## Job not validated - no validation macro (${macroname}.C) ###" >> stdout;
33 exit 2
34fi
35run=$1
36logfile=${macroname}_${run}.log
37if [ -e $logfile ] ; then
38 rm $logfile
39fi
40aliroot -b > $logfile <<EOF
41.L ${macroname}.C+
42${macroname}($run)
43EOF
44if [ ! -f $logfile ] ; then
45 echo "* ########## Job not validated - no log file ($logfile) ###" >> stdout;
46 exit 2
47fi
48let error=0
49declare -a array
50for pb in `grep -i "Problem signalled" $logfile | awk '{print $1"_"$2"_"$NF}'` ; do
51 for det in detectorlist ; do
52 array[$error]=`echo $pb | awk '{ split($0, a, "_"); print a[1]" "a[3]" in "a[2]}'`
53 ((error++))
54 done
55done
56if [ "$error" = "0" ] ; then
57 echo "* ---------------- Job Validated ------------------*" >> stdout;
58else
59 errors=${#array[@]}
60 echo "* ########## Job not validated - number of errors: $errors ###" >> stdout;
61 for (( i=0;i<$errors;i++ )); do
62 echo $i-- ${array[${i}]} >> stdout;
63 done
64fi
65echo "* ----------------------------------------------------*" >> stdout;
66echo "*******************************************************" >> stdout;