M submitMerging.sh - Using groups for jobs submitting
[u/mrichter/AliRoot.git] / TPC / scripts / submitMerging.sh
1 # submit merging of the calibration train
2 # argument 1 - runlist
3 # argument 2 - batch queues
4 # argument 3 - group
5
6 runlist=$1
7 bqueues=$2 
8 bgroup=$3
9
10 if [ -z $bgroup ] ; then
11   bgroup=/merge
12   bgadd $bgroup 
13 fi;
14
15 mydir=`pwd`
16 echo bqueues $bqueues
17 for adir in `cat $runlist`; do
18     myvar=0;
19     cd $mydir
20     cd $adir
21     echo Run $adir 
22     nesd=`wc -l < esd.txt.Good`
23     if [ $nesd -gt 0 ] ; then
24         rm -f CalibObjects*.root
25         find  `pwd`/*_*  | grep CalibObjectsTrain1.root > mergelistTrain1.txt
26         find  `pwd`/*_*  | grep CalibObjectsTrain2.root > mergelistTrain2.txt
27         nfiles=`cat mergelistTrain1.txt  | grep -c .root`
28         if [ $nfiles -gt 0 ] ; then
29             bsub -q $bqueues -g $bgroup -oo outm1_$myvar.log aliroot $ALICE_ROOT/TPC/macros/CalibFileMerger.C+\(\"CalibObjectsTrain1.root\",10000,\"mergelistTrain1.txt\"\)
30             bsub -q $bqueues -g $bgroup -oo outm2_$myvar.log aliroot $ALICE_ROOT/TPC/macros/CalibFileMerger.C+\(\"CalibObjectsTrain2.root\",10000,\"mergelistTrain2.txt\"\)
31             echo Run $adir  Nfiles=$nfiles
32         else
33             echo Run $adir Calib Missing
34         fi;
35     fi; 
36     cd $mydir
37 done
38