Index: trunk/DataCheck/Processing/FillAuxContTemp.sh
===================================================================
--- trunk/DataCheck/Processing/FillAuxContTemp.sh	(revision 17596)
+++ trunk/DataCheck/Processing/FillAuxContTemp.sh	(revision 17597)
@@ -46,6 +46,24 @@
    auxdir=$auxdata/$date
    runnumber=`echo $date | sed -e 's/\///g'`
+   # the container temperature was not available before this date
    if [ $runnumber -lt 20130413 ]
    then
+      printprocesslog "INFO container temperature was not available before 20130413 "
+      continue
+   fi
+
+   # get file numbers from DB
+   #   but only for not-corrupted files
+   query="SELECT fRunID from RunInfo WHERE fNight="$runnumber" AND fFitsFileErrors=0 "
+   if [ "$doupdate" = "no" ]
+   then
+      query=$query" AND ISNULL(fContainerTempMean) "
+   fi
+   printprocesslog "DEBUG get filenumbers from DB: QUERY: "$query
+   filenumbers=( `sendquery $query` )
+   # proceed only if there are files available
+   if [ ${#filenumbers} -eq 0 ]
+   then
+      printprocesslog "INFO No files found in the DB for night "$date
       continue
    fi
@@ -60,20 +78,4 @@
    fi
 
-   # get file numbers from DB
-   #   but only for not-corrupted files
-   query="SELECT fRunID from RunInfo WHERE fNight="$runnumber" AND fFitsFileErrors=0 "
-   if [ "$doupdate" = "no" ]
-   then
-      query=$query" AND ISNULL(fContainerTempMean) "
-   fi
-
-   printprocesslog "DEBUG get filenumbers from DB: QUERY: "$query
-   filenumbers=( `sendquery $query` )
-   if [ ${#filenumbers} -eq 0 ]
-   then
-      printprocesslog "INFO No files found in the DB for night "$date
-      continue
-   fi
-
    # get daily fits files 
    conttempfile=$auxdir/$runnumber.TEMPERATURE_DATA.fits
@@ -81,5 +83,4 @@
    then 
       printprocesslog "WARN "$conttempfile" not found."
-      echo "WARN "$conttempfile" not found."
       continue
    else
Index: trunk/DataCheck/Processing/FillAuxCtrDev.sh
===================================================================
--- trunk/DataCheck/Processing/FillAuxCtrDev.sh	(revision 17596)
+++ trunk/DataCheck/Processing/FillAuxCtrDev.sh	(revision 17597)
@@ -67,7 +67,7 @@
       query=$query" AND ISNULL(fCtrlDevMean) "
    fi
-
    printprocesslog "DEBUG get filenumbers from DB: QUERY: "$query
    filenumbers=( `sendquery $query` )
+   # proceed only if there are files available
    if [ ${#filenumbers} -eq 0 ]
    then
Index: trunk/DataCheck/Processing/FillAuxCurrents.sh
===================================================================
--- trunk/DataCheck/Processing/FillAuxCurrents.sh	(revision 17596)
+++ trunk/DataCheck/Processing/FillAuxCurrents.sh	(revision 17597)
@@ -52,90 +52,4 @@
    #fi
    
-   # check if aux files are available from that night
-   if ! [ -d $auxdir ]
-   then
-      printprocesslog "INFO no data available in "$auxdir
-      continue
-   else
-      printprocesslog "INFO processing files in "$auxdir
-   fi
-
-   rawdir=$rawdata/$date
-   # check if raw files are available from that night
-   if ! [ -d $rawdir ]
-   then
-      logtext="INFO"
-   else
-      logtext="WARN"
-   fi
-
-   biasvoltagefile=$auxdir/$runnumber.BIAS_CONTROL_VOLTAGE.fits
-   if ! [ -e $biasvoltagefile ]
-   then 
-      printprocesslog $logtext" "$biasvoltagefile" not found."
-      continue
-   else
-      biasnumerrors=`fverify $biasvoltagefile 2>/dev/null | grep -o '[0-9][ ]error(s)'  | grep -E -o '[0-9]'`
-      if [ $biasnumerrors -gt 0 ]
-      then 
-         printprocesslog "WARN for $biasvoltagefile fverify returned "$biasnumerrors" error(s)."
-      fi
-   fi
-
-   biascurrentfile=$auxdir/$runnumber.BIAS_CONTROL_CURRENT.fits
-   if ! [ -e $biascurrentfile ]
-   then 
-      printprocesslog $logtext" "$biascurrentfile" not found."
-      continue
-   else
-      biascurrnumerrors=`fverify $biascurrentfile 2>/dev/null | grep -o '[0-9][ ]error(s)'  | grep -E -o '[0-9]'`
-      if [ $biascurrnumerrors -gt 0 ]
-      then 
-         printprocesslog "WARN for $biascurrentfile fverify returned "$biascurrnumerrors" error(s)."
-      fi
-   fi
-
-   # this file is needed for the calibration of the currents
-   feedbackcalfile=$auxdir/$runnumber.FEEDBACK_CALIBRATION.fits
-   if ! [ -e $feedbackcalfile ]
-   then 
-      printprocesslog $logtext" "$feedbackcalfile" not found."
-      continue
-   else
-      feedbacknumerrors=`fverify $feedbackcalfile 2>/dev/null | grep -o '[0-9][ ]error(s)'  | grep -E -o '[0-9]'`
-      if [ $feedbacknumerrors -gt 0 ]
-      then 
-         printprocesslog "WARN for $feedbackcalfile fverify returned "$feedbacknumerrors" error(s)."
-      fi
-   fi
-
-   calcurrentsfile=$auxdir/$runnumber.FEEDBACK_CALIBRATED_CURRENTS.fits
-   if ! [ -e $calcurrentsfile ]
-   then 
-      calcurrentsfile=/gpfs/scratch/fact/calibrated_currents/$runnumber.CALIBRATED_CURRENTS.fits
-      if ! [ -e $calcurrentsfile ]
-      then 
-         printprocesslog "INFO run calibrate.C for night "$runnumber >> $logfile 2>&1
-         root -q -b -l fact/processing/calibrate.C\($runnumber\)
-      fi
-   fi
-   printprocesslog "INFO using calibrated currents from file "$calcurrentsfile
-
-   #calcurrentsfile=$auxdir/$runnumber.FEEDBACK_CALIBRATED_CURRENTS.fits
-   #calcurrentsfile=/scratch_nfs/calibrated_currents/$runnumber.CALIBRATED_CURRENTS.fits
-   #calcurrentsfile=/gpfs/scratch/fact/calibrated_currents/$runnumber.CALIBRATED_CURRENTS.fits
-   if ! [ -e $calcurrentsfile ]
-   then 
-      printprocesslog $logtext" "$calcurrentsfile" not found."
-      continue
-   else
-      calnumerrors=`fverify $calcurrentsfile 2>/dev/null | grep -o '[0-9][ ]error(s)'  | grep -E -o '[0-9]'`
-      if [ $calnumerrors -gt 0 ]
-      then 
-         printprocesslog "WARN for $calcurrentsfile fverify returned "$calnumerrors" error(s)."
-      fi
-   fi
-   
-
    # get file numbers from DB
    #   but only for not-corrupted files
@@ -145,7 +59,7 @@
       query=$query" AND ISNULL(fCurrentsMedMean) "
    fi
-
    printprocesslog "DEBUG get filenumbers from DB: QUERY: "$query
    filenumbers=( `sendquery $query` )
+   # proceed only if there are files available
    if [ ${#filenumbers} -eq 0 ]
    then
@@ -154,4 +68,80 @@
    fi
 
+   # check if aux files are available from that night
+   if ! [ -d $auxdir ]
+   then
+      printprocesslog "INFO no data available in "$auxdir
+      continue
+   else
+      printprocesslog "INFO processing files in "$auxdir
+   fi
+
+   biasvoltagefile=$auxdir/$runnumber.BIAS_CONTROL_VOLTAGE.fits
+   if ! [ -e $biasvoltagefile ]
+   then 
+      printprocesslog "WARN "$biasvoltagefile" not found."
+      continue
+   else
+      biasnumerrors=`fverify $biasvoltagefile 2>/dev/null | grep -o '[0-9][ ]error(s)'  | grep -E -o '[0-9]'`
+      if [ $biasnumerrors -gt 0 ]
+      then 
+         printprocesslog "WARN for $biasvoltagefile fverify returned "$biasnumerrors" error(s)."
+      fi
+   fi
+
+   biascurrentfile=$auxdir/$runnumber.BIAS_CONTROL_CURRENT.fits
+   if ! [ -e $biascurrentfile ]
+   then 
+      printprocesslog "WARN "$biascurrentfile" not found."
+      continue
+   else
+      biascurrnumerrors=`fverify $biascurrentfile 2>/dev/null | grep -o '[0-9][ ]error(s)'  | grep -E -o '[0-9]'`
+      if [ $biascurrnumerrors -gt 0 ]
+      then 
+         printprocesslog "WARN for $biascurrentfile fverify returned "$biascurrnumerrors" error(s)."
+      fi
+   fi
+
+   # this file is needed for the calibration of the currents
+   feedbackcalfile=$auxdir/$runnumber.FEEDBACK_CALIBRATION.fits
+   if ! [ -e $feedbackcalfile ]
+   then 
+      printprocesslog "WARN "$feedbackcalfile" not found."
+      continue
+   else
+      feedbacknumerrors=`fverify $feedbackcalfile 2>/dev/null | grep -o '[0-9][ ]error(s)'  | grep -E -o '[0-9]'`
+      if [ $feedbacknumerrors -gt 0 ]
+      then 
+         printprocesslog "WARN for $feedbackcalfile fverify returned "$feedbacknumerrors" error(s)."
+      fi
+   fi
+
+   calcurrentsfile=$auxdir/$runnumber.FEEDBACK_CALIBRATED_CURRENTS.fits
+   if ! [ -e $calcurrentsfile ]
+   then 
+      calcurrentsfile=/gpfs/scratch/fact/calibrated_currents/$runnumber.CALIBRATED_CURRENTS.fits
+      if ! [ -e $calcurrentsfile ]
+      then 
+         printprocesslog "INFO run calibrate.C for night "$runnumber >> $logfile 2>&1
+         root -q -b -l fact/processing/calibrate.C\($runnumber\)
+      fi
+   fi
+   printprocesslog "INFO using calibrated currents from file "$calcurrentsfile
+
+   #calcurrentsfile=$auxdir/$runnumber.FEEDBACK_CALIBRATED_CURRENTS.fits
+   #calcurrentsfile=/scratch_nfs/calibrated_currents/$runnumber.CALIBRATED_CURRENTS.fits
+   #calcurrentsfile=/gpfs/scratch/fact/calibrated_currents/$runnumber.CALIBRATED_CURRENTS.fits
+   if ! [ -e $calcurrentsfile ]
+   then 
+      printprocesslog "WARN "$calcurrentsfile" not found."
+      continue
+   else
+      calnumerrors=`fverify $calcurrentsfile 2>/dev/null | grep -o '[0-9][ ]error(s)'  | grep -E -o '[0-9]'`
+      if [ $calnumerrors -gt 0 ]
+      then 
+         printprocesslog "WARN for $calcurrentsfile fverify returned "$calnumerrors" error(s)."
+      fi
+   fi
+   
    # fill auxiliary information for files
    for filenum in ${filenumbers[@]}
Index: trunk/DataCheck/Processing/FillAuxData.sh
===================================================================
--- trunk/DataCheck/Processing/FillAuxData.sh	(revision 17596)
+++ trunk/DataCheck/Processing/FillAuxData.sh	(revision 17597)
@@ -116,13 +116,4 @@
    runnumber=`echo $date | sed -e 's/\///g'`
 
-   # check if aux files are available from that night
-   if ! [ -d $auxdir ]
-   then
-      printprocesslog "INFO no data available in "$auxdir
-      continue
-   else
-      printprocesslog "INFO processing files in "$auxdir
-   fi
-
    # get file numbers from DB
    #   but only for not-corrupted files
@@ -135,8 +126,18 @@
    printprocesslog "DEBUG get filenumbers from DB: QUERY: "$query
    filenumbers=( `sendquery $query` )
+   # proceed only if there are files available
    if [ ${#filenumbers} -eq 0 ]
    then
       printprocesslog "INFO No files found in the DB for night "$date
       continue
+   fi
+
+   # check if aux files are available from that night
+   if ! [ -d $auxdir ]
+   then
+      printprocesslog "INFO no data available in "$auxdir
+      continue
+   else
+      printprocesslog "INFO processing files in "$auxdir
    fi
 
Index: trunk/DataCheck/Processing/FillAuxTemp.sh
===================================================================
--- trunk/DataCheck/Processing/FillAuxTemp.sh	(revision 17596)
+++ trunk/DataCheck/Processing/FillAuxTemp.sh	(revision 17597)
@@ -67,7 +67,7 @@
       query=$query" AND ISNULL(fCameraTempMean) "
    fi
-
    printprocesslog "DEBUG get filenumbers from DB: QUERY: "$query
    filenumbers=( `sendquery $query` )
+   # proceed only if there are files available
    if [ ${#filenumbers} -eq 0 ]
    then
Index: trunk/DataCheck/Processing/FillAuxThresholds.sh
===================================================================
--- trunk/DataCheck/Processing/FillAuxThresholds.sh	(revision 17596)
+++ trunk/DataCheck/Processing/FillAuxThresholds.sh	(revision 17597)
@@ -50,53 +50,4 @@
    runnumber=`echo $date | sed -e 's/\///g'`
 
-   # check if aux files are available from that night
-   if ! [ -d $auxdir ]
-   then
-      printprocesslog "INFO no data available in "$auxdir
-      continue
-   else
-      printprocesslog "INFO processing files in "$auxdir
-   fi
-   
-   rawdir=$rawdata/$date
-   # check if raw files are available from that night
-   if ! [ -d $rawdir ]
-   then
-      logtext="INFO"
-   else
-      logtext="WARN"
-   fi
-
-   thresholdfile=$auxdir/$runnumber.RATE_CONTROL_THRESHOLD.fits
-   printprocesslog "INFO processing "$thresholdfile
-   echo "INFO processing "$thresholdfile >> $logfile 2>&1
-   if ! [ -e $thresholdfile ]
-   then 
-      printprocesslog $logtext" "$thresholdfile" not found."
-      continue
-   else
-      threshnumerrors=`fverify $thresholdfile 2>/dev/null | grep -o '[0-9][ ]error(s)'  | grep -E -o '[0-9]'`
-      if [ $threshnumerrors -gt 0 ]
-      then 
-         printprocesslog "WARN for $thresholdfile fverify returned "$threshnumerrors" error(s)."
-      fi
-   fi
-
-   thresholdfile2=$auxdir/$runnumber.FTM_CONTROL_STATIC_DATA.fits
-   #ls $thresholdfile2
-   if ! [ -e $thresholdfile2 ]
-   then 
-      printprocesslog $logtext" "$thresholdfile2" not found."
-      continue
-   else
-      threshnumerrors2=`fverify $thresholdfile2 2>/dev/null | grep -o '[0-9][ ]error(s)'  | grep -E -o '[0-9]'`
-      if [ $threshnumerrors2 -gt 0 ]
-      then 
-         printprocesslog "WARN for $thresholdfile2 fverify returned "$threshnumerrors2" error(s)."
-      fi
-   fi
-
-
-
    # get file numbers from DB
    #   but only for not-corrupted files
@@ -106,11 +57,49 @@
       query=$query" AND ISNULL(fThresholdMedMean) AND ISNULL(fThresholdMinSet) "
    fi
-
    printprocesslog "DEBUG get filenumbers from DB: QUERY: "$query
    filenumbers=( `sendquery $query` )
+   # proceed only if there are files available
    if [ ${#filenumbers} -eq 0 ]
    then
       printprocesslog "INFO No files found in the DB for night "$date
       continue
+   fi
+
+   # check if aux files are available from that night
+   if ! [ -d $auxdir ]
+   then
+      printprocesslog "INFO no data available in "$auxdir
+      continue
+   else
+      printprocesslog "INFO processing files in "$auxdir
+   fi
+   
+   thresholdfile=$auxdir/$runnumber.RATE_CONTROL_THRESHOLD.fits
+   printprocesslog "INFO processing "$thresholdfile
+   echo "INFO processing "$thresholdfile >> $logfile 2>&1
+   if ! [ -e $thresholdfile ]
+   then 
+      printprocesslog "WARN "$thresholdfile" not found."
+      continue
+   else
+      threshnumerrors=`fverify $thresholdfile 2>/dev/null | grep -o '[0-9][ ]error(s)'  | grep -E -o '[0-9]'`
+      if [ $threshnumerrors -gt 0 ]
+      then 
+         printprocesslog "WARN for $thresholdfile fverify returned "$threshnumerrors" error(s)."
+      fi
+   fi
+
+   thresholdfile2=$auxdir/$runnumber.FTM_CONTROL_STATIC_DATA.fits
+   #ls $thresholdfile2
+   if ! [ -e $thresholdfile2 ]
+   then 
+      printprocesslog "WARN "$thresholdfile2" not found."
+      continue
+   else
+      threshnumerrors2=`fverify $thresholdfile2 2>/dev/null | grep -o '[0-9][ ]error(s)'  | grep -E -o '[0-9]'`
+      if [ $threshnumerrors2 -gt 0 ]
+      then 
+         printprocesslog "WARN for $thresholdfile2 fverify returned "$threshnumerrors2" error(s)."
+      fi
    fi
 
Index: trunk/DataCheck/Processing/FillDrsTemp.sh
===================================================================
--- trunk/DataCheck/Processing/FillDrsTemp.sh	(revision 17596)
+++ trunk/DataCheck/Processing/FillDrsTemp.sh	(revision 17597)
@@ -71,7 +71,7 @@
       query=$query" AND ISNULL(fCameraTempMean) "
    fi
-
    printprocesslog "DEBUG get filenumbers from DB: QUERY: "$query
    filenumbers=( `sendquery $query` )
+   # proceed only if there are files available
    if [ ${#filenumbers} -eq 0 ]
    then
Index: trunk/DataCheck/Processing/FillEffectiveOn.sh
===================================================================
--- trunk/DataCheck/Processing/FillEffectiveOn.sh	(revision 17596)
+++ trunk/DataCheck/Processing/FillEffectiveOn.sh	(revision 17597)
@@ -49,4 +49,20 @@
 #   echo $auxdir" @ "`date` 
 
+   # get file numbers from DB
+   #   but only for not-corrupted files
+   query="SELECT fRunID from RunInfo WHERE fNight="$runnumber" AND fFitsFileErrors=0 "
+   if [ "$doupdate" = "no" ]
+   then
+      query=$query" AND ISNULL(fEffectiveOn) "
+   fi
+   printprocesslog "DEBUG get filenumbers from DB: QUERY: "$query
+   filenumbers=( `sendquery $query` )
+   # proceed only if there are files available
+   if [ ${#filenumbers} -eq 0 ]
+   then
+      printprocesslog "INFO No files found in the DB for night "$date
+      continue
+   fi
+
    # check if aux files are available from that night
    if ! [ -d $auxdir ]
@@ -58,17 +74,8 @@
    fi
    
-   rawdir=$rawdata/$date
-   # check if raw files are available from that night
-   if ! [ -d $rawdir ]
-   then
-      logtext="INFO"
-   else
-      logtext="WARN"
-   fi
-
    ftmcontrolfile=$auxdir/$runnumber.FTM_CONTROL_TRIGGER_RATES.fits
    if ! [ -e $ftmcontrolfile ]
    then 
-      printprocesslog $logtext" "$ftmcontrolfile" not found."
+      printprocesslog "WARN "$ftmcontrolfile" not found."
       continue
    else
@@ -78,20 +85,4 @@
          printprocesslog "WARN for $ftmcontrolfile fverify returned "$ftmnumerrors" error(s)."
       fi
-   fi
-
-   # get file numbers from DB
-   #   but only for not-corrupted files
-   query="SELECT fRunID from RunInfo WHERE fNight="$runnumber" AND fFitsFileErrors=0 "
-   if [ "$doupdate" = "no" ]
-   then
-      query=$query" AND ISNULL(fEffectiveOn) "
-   fi
-
-   printprocesslog "DEBUG get filenumbers from DB: QUERY: "$query
-   filenumbers=( `sendquery $query` )
-   if [ ${#filenumbers} -eq 0 ]
-   then
-      printprocesslog "INFO No files found in the DB for night "$date
-      continue
    fi
 
Index: trunk/DataCheck/Processing/FillMoonInfo.sh
===================================================================
--- trunk/DataCheck/Processing/FillMoonInfo.sh	(revision 17596)
+++ trunk/DataCheck/Processing/FillMoonInfo.sh	(revision 17597)
@@ -48,4 +48,5 @@
    fi
    printprocesslog "DEBUG get filenumbers from DB: QUERY: "$query
+   # proceed only if there are files available
    filenumbers=( `sendquery` )
    if [ ${#filenumbers} -eq 0 ]
Index: trunk/DataCheck/Processing/FillRatescans.sh
===================================================================
--- trunk/DataCheck/Processing/FillRatescans.sh	(revision 17596)
+++ trunk/DataCheck/Processing/FillRatescans.sh	(revision 17597)
@@ -44,13 +44,4 @@
    fi
    
-   rawdir=$rawdata/$date
-   # check if raw files are available from that night
-   if ! [ -d $rawdir ]
-   then
-      logtext="INFO"
-   else
-      logtext="WARN"
-   fi
-
    ratescanfile=$auxdir/$runnumber.RATE_SCAN_DATA.fits
    printprocesslog "INFO processing "$ratescanfile
@@ -58,5 +49,12 @@
    if ! [ -e $ratescanfile ]
    then 
-      printprocesslog $logtext" "$ratescanfile" not found."
+      rawdir=$rawdata/$date
+      # check if raw files are available from that night
+      if ! [ -d $rawdir ]
+      then
+         printprocesslog "INFO "$ratescanfile" not found."
+      else
+         printprocesslog "WARN "$ratescanfile" not found."
+      fi
       continue
    else
