]> git.uio.no Git - u/mrichter/AliRoot.git/blame - prod/cosmic/recpointqa.sh
Fixing problems dscovered by test/gun
[u/mrichter/AliRoot.git] / prod / cosmic / recpointqa.sh
CommitLineData
bf1afebd 1#!/bin/sh
2#############################################################################
3# recpoints.sh. Front-end script to run reconstruction from the grid chunks
4# Usage:
5# ./recpoints.sh <run_number> <pass_number>
6#############################################################################
7#
8# modification history
9# version 1.0 March 2010
10# author Yves Schutz CERN
11#
12
13# SET THE FOLLOWING PARAMETERS IF NEEDED:
14# ---------------------------------------
15# ---------------------------------------
16kill -9 `ps | grep aliroot | awk '{print $1}'`
17
18export RUNNUM=$1
19export PASS=$2
20export DET=$3
21PROGRAM=aliroot
22
23[ -z $RUNNUM ] && { echo "Please provide a run number..."; exit 1; }
24[ -z $PASS ] && { echo "Please provide a pass number..."; exit 1; }
25[ -z $DET ] && { echo "Please provide a detector name..."; exit 1; }
26
27[ ! -e "$HOME/.globus/usercert.pem" ] && { echo "FAILED: There is no certificate in $HOME/.globus"; exit 1; }
28
29alien-token-init
30source /tmp/gclient_env_$UID;
31
32[ ! "$?" -eq "0" ] && { echo "FAILED: Token creation failed"; exit 1; }
33
34VERSION=1.0
35TITLE="Standalone QA checking of Grid recpoints chunks. v$VERSION"
36
37# Retrieve the list of chunks from AliEn.......
38export BASEDIR="/alice/data/20*"
39PATTERN="$RUNNUM/ESDs/pass${PASS}/*${RUNNUM}*/${DET}.RecPoints.root"
40aliensh -c "gbbox find $BASEDIR $PATTERN" > collection.tmp
41
42[ `ls -al collection.tmp | awk '{print $5}'` -eq 0 ] && { echo "No chunks found for the given run"; exit 1; }
43rm -r collection.tmp2
44#
45for ifile in `cat collection.tmp | grep root` ; do printf $ifile" "\|" "0" " >> collection.tmp2 ; done
46list=`cat collection.tmp2`
47[ -e collection.tmp2 ] && { rm -f collection.tmp2 ; }
48totChunks=`cat collection.tmp | wc -l`
49rm -f collection.tmp
50
51tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
52trap "rm -f $tempfile" 0 1 2 5 15
53dialog --clear --no-cancel --title "$TITLE" \
54 --ok-label OK --checklist "$totChunks chunks available for run $RUNNUM (only the first 500 are shown). Select chunks for reconstruction" 18 80 10 \
55 $list 2> $tempfile
56
57CHUNKS=`cat $tempfile`
58echo "Selected chunks:"
59echo $CHUNKS
60
61
62for filename in $CHUNKS; do
63 filename="${filename//\"}"
64 set -- "${filename% /pass${PASS}*}"
65 set -- "${1##*/pass${PASS}/}"
66 CHUNK="${1/\/${DET}*}"
67 echo "Running QA for chunk $filename. Outputs will be stored in "$RUNNUM"/"$CHUNK
68 [ -d $RUNNUM"/"$CHUNK ] && echo $RUNNUM"/"$CHUNK "exists" || mkdir -p $RUNNUM"/"$CHUNK
69 cd $RUNNUM"/"$CHUNK
70 [ -f ${DET}.QA.${RUNNUM}.root ] && rm ${DET}.QA.${RUNNUM}.root
71 [ -f QAImageQA.${RUNNUM}.ps ] && rm QAImageQA.${RUNNUM}.ps
72 [ -f QA.root ] && rm QA.root
73 [ -f ${DET}.RecPoints.root ] && echo "file ${DET}.RecPoints.root already there" || alien_cp alien://$filename .
74 filename="${filename/${DET}.RecPoints/galice}"
75 [ -f galice.root ] && echo "file galice.root already there" || alien_cp alien://$filename .
76 filename="${filename/galice/AliESDs}"
77 [ -f AliESDs.root ] && echo "file AliESDs.root already there" || alien_cp alien://$filename .
78$PROGRAM -b<<EOF
79 .L $ALICE_ROOT/prod/cosmic/recpointqa.C++
80 recpointqa()
81 .q
82EOF
83cd ..
84done
85#ls */Merged.QA.Data.root > merged.list
86#outfile="Merged.QA.Data."$RUNNUM".root"
87#$PROGRAM -b <<EOF
88#.L $ALICE_ROOT/test/cosmic/MergeQAMerged.C
89#MergeQAMerged("$outfile", "merged.list") ;
90#.q
91#EOF
92#rm -f merged.list
93#$PROGRAM -b -q $ALICE_ROOT/test/cosmic/qasummary.C
94#$PROGRAM -b $ALICE_ROOT/test/QA/menuQA.C
95#cd ..