| 1 | #!/bin/bash
|
|---|
| 2 |
|
|---|
| 3 | source `dirname $0`/../Sourcefile.sh
|
|---|
| 4 | printprocesslog "INFO starting "$0
|
|---|
| 5 |
|
|---|
| 6 | logfile=$runlogpath"/FillNumEvts-"$datetime".log"
|
|---|
| 7 | date >> $logfile
|
|---|
| 8 |
|
|---|
| 9 | # get current hour
|
|---|
| 10 | hour=`date +%k`
|
|---|
| 11 | if [ $hour -le 7 ] || [ $hour -ge 19 ]
|
|---|
| 12 | then
|
|---|
| 13 | dates=( `date +%Y/%m/%d --date="-12hour"` )
|
|---|
| 14 | else
|
|---|
| 15 | # get last 3, 6 or 9 nights
|
|---|
| 16 | dates=( `date +%Y/%m/%d --date="-12hour"` `date +%Y/%m/%d --date="-36hour"` `date +%Y/%m/%d --date="-60hour"` \
|
|---|
| 17 | # `date +%Y/%m/%d --date="-84hour"` `date +%Y/%m/%d --date="-108hour"` `date +%Y/%m/%d --date="-132hour"` \
|
|---|
| 18 | # `date +%Y/%m/%d --date="-156hour"` `date +%Y/%m/%d --date="-180hour"` `date +%Y/%m/%d --date="-204hour"` \
|
|---|
| 19 | )
|
|---|
| 20 | fi
|
|---|
| 21 |
|
|---|
| 22 | #dates=( `find -L $auxdata -mindepth 3 -type d | sort -r | grep -v bad | sed "s/\${auxdata_for_sed}//g" | sed -e 's/^\///'` ) #all available dates in /loc_data/zipraw
|
|---|
| 23 |
|
|---|
| 24 | #dates=( "2013/04/17" )
|
|---|
| 25 |
|
|---|
| 26 | printprocesslog "INFO processing the following night(s): "${dates[@]}
|
|---|
| 27 | echo `date`": processing the following night(s): "${dates[@]} >> $logfile 2>&1
|
|---|
| 28 |
|
|---|
| 29 | #echo ${dates[@]}
|
|---|
| 30 |
|
|---|
| 31 | mars=/home/fact/SW.automatic.processing/Mars.svn.2013.04.29
|
|---|
| 32 | cd $mars
|
|---|
| 33 |
|
|---|
| 34 | # do filling of aux data
|
|---|
| 35 | for date in ${dates[@]}
|
|---|
| 36 | do
|
|---|
| 37 | runnumber=`echo $date | sed -e 's/\///g'`
|
|---|
| 38 |
|
|---|
| 39 | # data which are not processed in LP
|
|---|
| 40 | if [ $runnumber -lt 20121212 ]
|
|---|
| 41 | then
|
|---|
| 42 | continue
|
|---|
| 43 | fi
|
|---|
| 44 |
|
|---|
| 45 | echo "run numevts.C for night "$runnumber" (run-wise processing) " >> $logfile 2>&1
|
|---|
| 46 | printprocesslog "run numevts.C for night "$runnumber" (run-wise processing) "
|
|---|
| 47 | printprocesslog "root -q -b -l fact/processing/numevents.C\("\"$runnumber"\"\,"\"$anapath"\"\,"\"$resulttable1"\"\,kFALSE\,kFALSE\)"
|
|---|
| 48 | check1=`root -q -b -l fact/processing/numevents.C\("\"$runnumber"\"\,"\"$anapath"\"\,"\"$resulttable1"\"\,kFALSE\,kFALSE\) | tee $logfile | intgrep`
|
|---|
| 49 |
|
|---|
| 50 | case $check1 in
|
|---|
| 51 | 1) printprocesslog "INFO filling numevts.C was successfully (check1=$check1)"
|
|---|
| 52 | ;;
|
|---|
| 53 | 0) printprocesslog "WARN connection to DB failed in numevts.C (check1=$check1)"
|
|---|
| 54 | ;;
|
|---|
| 55 | *) printprocesslog "ERROR numevts.C failed (check1=$check1)"
|
|---|
| 56 | ;;
|
|---|
| 57 | esac
|
|---|
| 58 |
|
|---|
| 59 | #echo "run numevts.C for night "$runnumber" (night-wise processing) "
|
|---|
| 60 | #root -q -b -l fact/processing/numevts.C\("\"$runnumber"\"\,"\"$inpath"\"\,"\"$resulttable2"\"\,kFALSE\,kTRUE\)
|
|---|
| 61 |
|
|---|
| 62 | done
|
|---|
| 63 |
|
|---|
| 64 | finish
|
|---|
| 65 |
|
|---|
| 66 |
|
|---|