Ignore:
Timestamp:
09/06/13 15:44:44 (11 years ago)
Author:
Daniela Dorner
Message:
added filling of nightly information, usage of getdates function
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DataCheck/Processing/FillNumEvts.sh

    r16674 r17088  
    77date >> $logfile
    88
    9 # get current hour
    10 hour=`date +%k`
    11 if [ $hour -le 7 ] || [ $hour -ge 19 ]
     9# this script doesn't need variable $doupdate
     10# filling is done by macro. therefore update is always done
     11
     12# get dates
     13if [ "$certaindate" != "" ]
    1214then
    13    dates=( `date +%Y/%m/%d --date="-12hour"` )
     15   getdates $certaindate
    1416else
    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            )
     17   # get all night
     18   #getdates "all"
     19   # get last 6 nights
     20   getdates 6
    2021fi
    2122
    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" )
    2523
    2624printprocesslog "INFO processing the following night(s): "${dates[@]}
    2725echo  `date`": processing the following night(s): "${dates[@]} >> $logfile 2>&1
    2826
    29 #echo ${dates[@]}
    30 
    31 mars=/home/fact/SW.automatic.processing/Mars.svn.2013.04.29
    3227cd $mars
    3328
     
    3732   runnumber=`echo $date | sed -e 's/\///g'`
    3833   
    39    # data which are not processed in LP
    40    if [ $runnumber -lt 20121212 ]
     34   # process only data which are available
     35   if [ $runnumber -lt $firstnight ]
    4136   then
    4237      continue
    4338   fi
    4439   
    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`
     40   # fill run-wise processing
     41   if [ -d $anapath/ganymed_run/$date ]
     42   then
     43      echo "run numevts.C for night "$runnumber" (run-wise processing) for table "$resulttable1 >> $logfile 2>&1
     44      printprocesslog "INFO run numevts.C for night "$runnumber" (run-wise processing) for table "$resulttable1
     45      printprocesslog "DEBUG root -q -b -l fact/processing/numevents.C+\("\"$runnumber"\"\,"\"$anapath"\"\,"\"$resulttable1"\"\,kFALSE\,kFALSE\)"
     46      check1=`root -q -b -l fact/processing/numevents.C+\("\"$runnumber"\"\,"\"$anapath"\"\,"\"$resulttable1"\"\,kFALSE\,kFALSE\) | tee $logfile | intgrep`
     47     
     48      case $check1 in
     49         1)   printprocesslog "INFO filling numevts.C was successfully for night "$runnumber" and table "$resulttable1" (check1=$check1)"
     50              ;;
     51         0)   printprocesslog "WARN connection to DB failed in numevts.C (check1=$check1)"
     52              ;;
     53         *)   printprocesslog "ERROR numevts.C failed for night "$runnumber" and table "$resulttable1" (check1=$check1)"
     54              ;;
     55      esac
     56   fi
     57   
     58   query="SELECT fSourceKEY FROM RunInfo WHERE fNight="$runnumber" AND fSourceKey > 0 AND fRunTypeKEY=1 GROUP BY fSourceKey "
     59   sources=( `sendquery` )
     60   # fill night-wise processing
     61   for source in ${sources[@]}
     62   do
     63      if [ -d $anapath/ganymed_night/$source/$date ]
     64      then
     65         echo "run numevts.C for night "$runnumber" and source "$source" (night-wise processing) " >> $logfile 2>&1
     66         printprocesslog "INFO run numevents.C for night "$runnumber" and source "$source" (night-wise processing) "
     67         printprocesslog "DEBUG root -q -b -l fact/processing/numevents.C+\("\"$runnumber"\"\,"\"$anapath"\"\,"\"$resulttable2"\"\,kFALSE\,kTRUE\,$source\)"
    4968
    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 
     69         check1=`root -q -b -l fact/processing/numevents.C+\("\"$runnumber"\"\,"\"$anapath"\"\,"\"$resulttable2"\"\,kFALSE\,kTRUE\,$source\) | tee $logfile | intgrep`
     70         case $check1 in
     71            1)   printprocesslog "INFO filling numevts.C was successfully for night "$runnumber" and table "$resulttable2" (check1=$check1)"
     72                 ;;
     73            0)   printprocesslog "WARN connection to DB failed in numevts.C (check1=$check1)"
     74                 ;;
     75            *)   printprocesslog "ERROR numevts.C failed for night "$runnumber" and table "$resulttable2" (check1=$check1)"
     76                 ;;
     77         esac
     78      fi
     79   done
    6280done
    6381
Note: See TracChangeset for help on using the changeset viewer.