| 1 | #!/bin/bash
|
|---|
| 2 | #
|
|---|
| 3 | source `dirname $0`/../Sourcefile.sh
|
|---|
| 4 | printprocesslog "INFO starting $0"
|
|---|
| 5 |
|
|---|
| 6 | #root=/opt/root_svn/bin/thisroot.sh
|
|---|
| 7 | #source $root
|
|---|
| 8 |
|
|---|
| 9 | anapath=/loc_data/analysis
|
|---|
| 10 | auxpath=/loc_data/aux
|
|---|
| 11 |
|
|---|
| 12 | printprocesslog "INFO get list of calibrated files"
|
|---|
| 13 |
|
|---|
| 14 | date="2014/05/24"
|
|---|
| 15 | #calfiles=( `find $anapath -type f -name '*_C.root' 2>/dev/null | grep -v failed_stuff | sort` )
|
|---|
| 16 | calfiles=( `find $anapath/callisto/$date -type f -name '*_C.root' 2>/dev/null | sort` )
|
|---|
| 17 | if [ ${#calfiles[@]} -eq 0 ]
|
|---|
| 18 | then
|
|---|
| 19 | printprocesslog "INFO no calibrated files available "
|
|---|
| 20 | finish
|
|---|
| 21 | fi
|
|---|
| 22 | #starfiles=( `find $anapath -type f -name '*_I.root' 2>/dev/null | grep -v failed_stuff | sort` )
|
|---|
| 23 | starfiles=( `find $anapath/star/$date -type f -name '*_I.root' 2>/dev/null | sort` )
|
|---|
| 24 | if [ ${#starfiles[@]} -eq 0 ]
|
|---|
| 25 | then
|
|---|
| 26 | printprocesslog "INFO no star files available "
|
|---|
| 27 | # finish
|
|---|
| 28 | fi
|
|---|
| 29 |
|
|---|
| 30 | echo ${#calfiles[@]}" "${#starfiles[@]}
|
|---|
| 31 | printprocesslog "INFO #cal-files:"${#calfiles[@]}" #star-files:"${#starfiles[@]}
|
|---|
| 32 |
|
|---|
| 33 | if [ ${#starfiles[@]} -lt ${#calfiles[@]} ]
|
|---|
| 34 | then
|
|---|
| 35 | for calfile in ${calfiles[@]}
|
|---|
| 36 | do
|
|---|
| 37 | starfile=`echo $calfile | sed -e 's/callisto/star/' -e 's/_C/_I/'`
|
|---|
| 38 | logfile=`echo $starfile | sed -e 's/_I.root/-images.log/'`
|
|---|
| 39 | if ! ls $starfile >/dev/null 2>&1
|
|---|
| 40 | then
|
|---|
| 41 | echo $starfile" is missing -> reprocess. "
|
|---|
| 42 | outpath=`dirname $starfile`
|
|---|
| 43 | makedir $outpath
|
|---|
| 44 | `dirname $0`/RunStar.sh $logfile $calfile $outpath $starfile &
|
|---|
| 45 | if ! ls $starfile >/dev/null 2>&1
|
|---|
| 46 | then
|
|---|
| 47 | echo " failed: check log "`echo $starfile | sed -e 's/_I.root/-images.log/'`
|
|---|
| 48 | echo " check calfile "$calfile
|
|---|
| 49 | fi
|
|---|
| 50 | echo ""
|
|---|
| 51 | fi
|
|---|
| 52 | done
|
|---|
| 53 | fi
|
|---|
| 54 |
|
|---|
| 55 |
|
|---|