14ffb0ace5d54da50dacc5490c14d55e07925750
[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
5 runlist=$1
6 bqueues=$2
7 mydir=`pwd`
8 for adir in `cat $runlist`; do
9     myvar=0;
10     cd $mydir
11     cd $adir
12     echo Run $adir 
13     nesd=`wc -l < esd.txt.Good`
14     if [ $nesd -gt 0 ] ; then
15         rm -f CalibObjects*.root
16         find  `pwd`/*_*  | grep CalibObjectsTrain1.root > mergelistTrain1.txt
17         find  `pwd`/*_*  | grep CalibObjectsTrain2.root > mergelistTrain2.txt
18         nfiles=`cat mergelistTrain1.txt  | grep -c .root`
19         if [ $nfiles -gt 0 ] ; then
20             bsub -q $bqueues -oo outm1_$myvar.log aliroot $ALICE_ROOT/TPC/macros/CalibFileMerger.C+\(\"CalibObjectsTrain1.root\",10000,\"mergelistTrain1.txt\"\)
21             bsub -q $bqueues  -oo outm2_$myvar.log aliroot $ALICE_ROOT/TPC/macros/CalibFileMerger.C+\(\"CalibObjectsTrain2.root\",10000,\"mergelistTrain2.txt\"\)
22             echo Run $adir  Nfiles=$nfiles
23         else
24             echo Run $adir Calib Missing
25         fi;
26     fi; 
27     cd $mydir
28 done
29