Ignore:
Timestamp:
09/06/13 17:58:38 (11 years ago)
Author:
Daniela Dorner
Message:
added doing nightly lc plot
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DataCheck/QuickLook/Step3.sh

    r15518 r17109  
    2121if [ "$1" = "run" ]
    2222then
    23    tablenam=$resulttable1
     23   tablename=$resulttable1
     24   timebins=( 5 10 20 30 40 60 90 120 180 240 300 360 )
     25   timename="min"
    2426fi
    2527
    2628if [ "$1" = "night" ]
    2729then
    28    tablenam=$resulttable2
     30   tablename=$resulttable2
     31   timebins=( 1 2 3 4 5 6 7 8 9 10 )
     32   timename="night"
     33fi
     34
     35# possibility to give table name as second option
     36if [ "$2" != "" ]
     37then
     38   tablename=$2
     39else
     40   printprocesslog "INFO no second option given -> using table resulttable1 or resulttable2 for producing plots. "
    2941fi
    3042
     
    4355#dates=( `find -L $auxdata -mindepth 3 -type d | sort -r | sed "s/\${auxdata_for_sed}//g" | sed -e 's/^\///'` ) #all available dates in /loc_data/zipraw
    4456
    45 #dates=( "2013/04/19" )
     57#dates=( "2013/08/31" )
    4658
    4759# source info on daq in /loc_data/analysis/sources.txt
    4860#    (dump of DB scheduling.sources)
    4961
    50 timebins=( 5 10 20 30 40 60 90 120 180 240 300 360 )
    5162
    5263#echo ${dates[@]}
     
    5869      continue
    5970   fi
     71   #echo "date: "$date
    6072   query="SELECT fSourceKEY FROM RunInfo WHERE fNight="$date2" AND fSourceKey > 0 AND fRunTypeKEY=1 GROUP BY fSourceKey "
    6173   sources=( `sendquery` )
     
    7183      do
    7284         # doing the plots for one night
    73          logfile=$outpath"/lightcurve"$source"_"$timebin"min_"$date2".log"
    74          outfile=$outpath"/lightcurve"$source"_"$timebin"min_"$date2".root"
     85         logfile=$outpath"/lightcurve"$source"_"$timebin$timename"_"$date2".log"
     86         outfile=$outpath"/lightcurve"$source"_"$timebin$timename"_"$date2".root"
    7587         #echo $outfile
    76          printprocesslog "INFO starting lightcurve.C+ for source "$source" timebin "$timebin" night "$date2
    77      
    78          check1=`root -q -b fact/analysis/lightcurve.C+\($source\,$date2\\,$date2\,$timebin\,"\"$resulttable1"\"\,"\"$outfile\""\) | tee $logfile | intgrep`
     88         printprocesslog "INFO starting lightcurve.C+ for source "$source" timebin "$timebin" "$timename" night "$date2
     89     
     90         check1=`root -q -b fact/analysis/lightcurve.C+\($source\,$date2\\,$date2\,$timebin\,"\"$tablename"\"\,"\"$outfile\""\,kFALSE\) | tee $logfile | intgrep`
    7991     
    8092         case $check1 in
    81             0)   printprocesslog "INFO lightcurve.C was successful for source "$source" timebin "$timebin" night "$date2" (check1=$check1)"
     93            0)   printprocesslog "INFO lightcurve.C was successful for source "$source" timebin "$timebin" "$timename" night "$date2" (check1=$check1)"
    8294                 if ! ./showplot -b --save-as-png $outfile >/dev/null
    8395                 then
     
    8597                 fi
    8698                 ;;
    87             1)   printprocesslog "INFO lightcurve.C was successful for source "$source" timebin "$timebin" night "$date2", but nothing to plot (check1=$check1)"
    88                  ;;
    89             *)   printprocesslog "ERROR lightcurve.C failed for source "$source" timebin "$timebin" night "$date2" (check1=$check1)"
     99            1)   printprocesslog "INFO lightcurve.C was successful for source "$source" timebin "$timebin" "$timename" night "$date2", but nothing to plot (check1=$check1)"
     100                 ;;
     101            *)   printprocesslog "ERROR lightcurve.C failed for source "$source" timebin "$timebin" "$timename" night "$date2" (check1=$check1)"
    90102                 ;;
    91103         esac
     
    94106         # doing the plots for last week
    95107         lastweek=`date +%Y%m%d --date="$date -1 week"`
    96          logfile=$outpath"/lightcurve"$source"_"$timebin"min_week.log"
    97          outfile=$outpath"/lightcurve"$source"_"$timebin"min_week.root"
     108         logfile=$outpath"/lightcurve"$source"_"$timebin$timename"_week.log"
     109         outfile=$outpath"/lightcurve"$source"_"$timebin$timename"_week.root"
    98110         #echo $outfile
    99          printprocesslog "INFO starting lightcurve.C+ for source "$source" timebin "$timebin" night "$date2" last week ("$lastweek")"
    100      
    101          check1=`root -q -b fact/analysis/lightcurve.C+\($source\,$lastweek\\,$date2\,$timebin\,"\"$resulttable1"\"\,"\"$outfile\""\) | tee $logfile | intgrep`
     111         printprocesslog "INFO starting lightcurve.C+ for source "$source" timebin "$timebin" "$timename" night "$date2" last week ("$lastweek")"
     112     
     113         check1=`root -q -b fact/analysis/lightcurve.C+\($source\,$lastweek\\,$date2\,$timebin\,"\"$tablename"\"\,"\"$outfile\""\,kFALSE\) | tee $logfile | intgrep`
    102114     
    103115         case $check1 in
    104             0)   printprocesslog "INFO lightcurve.C was successful for source "$source" timebin "$timebin" night "$date2" last week (check1=$check1)"
     116            0)   printprocesslog "INFO lightcurve.C was successful for source "$source" timebin "$timebin" "$timename" night "$date2" last week (check1=$check1)"
    105117                 #./showplot -b --save-as-png $outfile
    106118                 if ! ./showplot -b --save-as-png $outfile >/dev/null
     
    109121                 fi
    110122                 ;;
    111             1)   printprocesslog "INFO lightcurve.C was successful for source "$source" timebin "$timebin" night "$date2" last week, but nothing to plot (check1=$check1)"
    112                  ;;
    113             *)   printprocesslog "ERROR lightcurve.C failed for source "$source" timebin "$timebin" night "$date2" last week (check1=$check1)"
     123            1)   printprocesslog "INFO lightcurve.C was successful for source "$source" timebin "$timebin" "$timename" night "$date2" last week, but nothing to plot (check1=$check1)"
     124                 ;;
     125            *)   printprocesslog "ERROR lightcurve.C failed for source "$source" timebin "$timebin" "$timename" night "$date2" last week (check1=$check1)"
    114126                 ;;
    115127         esac
    116128
    117129         # doing the plots for all nights
    118          logfile=$outpath"/lightcurve"$source"_"$timebin"min_all.log"
    119          outfile=$outpath"/lightcurve"$source"_"$timebin"min_all.root"
     130         logfile=$outpath"/lightcurve"$source"_"$timebin$timename"_all.log"
     131         outfile=$outpath"/lightcurve"$source"_"$timebin$timename"_all.root"
    120132         #echo $outfile
    121          printprocesslog "INFO starting lightcurve.C+ for source "$source" timebin "$timebin" night "$date2" all nights"
    122      
    123          check1=`root -q -b fact/analysis/lightcurve.C+\($source\,$firstnight\\,$date2\,$timebin\,"\"$resulttable1"\"\,"\"$outfile\""\) | tee $logfile | intgrep`
     133         printprocesslog "INFO starting lightcurve.C+ for source "$source" timebin "$timebin" "$timename" night "$date2" all nights"
     134     
     135         check1=`root -q -b fact/analysis/lightcurve.C+\($source\,$firstnight\\,$date2\,$timebin\,"\"$tablename"\"\,"\"$outfile\""\,kFALSE\) | tee $logfile | intgrep`
    124136     
    125137         case $check1 in
    126             0)   printprocesslog "INFO lightcurve.C was successful for source "$source" timebin "$timebin" night "$date2" all nights (check1=$check1)"
     138            0)   printprocesslog "INFO lightcurve.C was successful for source "$source" timebin "$timebin" "$timename" night "$date2" all nights (check1=$check1)"
    127139                 #./showplot -b --save-as-png $outfile
    128140                 if ! ./showplot -b --save-as-png $outfile >/dev/null
     
    131143                 fi
    132144                 ;;
    133             1)   printprocesslog "INFO lightcurve.C was successful for source "$source" timebin "$timebin" night "$date2" all nights, but nothing to plot (check1=$check1)"
    134                  ;;
    135             *)   printprocesslog "ERROR lightcurve.C failed for source "$source" timebin "$timebin" night "$date2" all nights (check1=$check1)"
     145            1)   printprocesslog "INFO lightcurve.C was successful for source "$source" timebin "$timebin" "$timename" night "$date2" all nights, but nothing to plot (check1=$check1)"
     146                 ;;
     147            *)   printprocesslog "ERROR lightcurve.C failed for source "$source" timebin "$timebin" "$timename" night "$date2" all nights (check1=$check1)"
    136148                 ;;
    137149         esac
    138150      done
     151     
     152     
     153      # doing nightly plots
     154     
     155      # doing the plots for one night
     156      logfile=$outpath"/lightcurve"$source"_1night_"$date2".log"
     157      outfile=$outpath"/lightcurve"$source"_1night_"$date2".root"
     158      #echo $outfile
     159      printprocesslog "INFO starting lightcurve.C+ for source "$source" 1 night for night "$date2
     160   
     161      check1=`root -q -b fact/analysis/lightcurve.C+\($source\,$date2\\,$date2\,-1\,"\"$tablename"\"\,"\"$outfile\""\,kFALSE\) | tee $logfile | intgrep`
     162   
     163      case $check1 in
     164         0)   printprocesslog "INFO lightcurve.C was successful for source "$source" timebin 1 night for night "$date2" (check1=$check1)"
     165              if ! ./showplot -b --save-as-png $outfile >/dev/null
     166              then
     167                 printprocesslog "WARN showplot -b --save-as-png "$outfile" failed."
     168              fi
     169              ;;
     170         1)   printprocesslog "INFO lightcurve.C was successful for source "$source" timebin 1 night for night "$date2", but nothing to plot (check1=$check1)"
     171              ;;
     172         *)   printprocesslog "ERROR lightcurve.C failed for source "$source" timebin 1 night for night "$date2" (check1=$check1)"
     173              ;;
     174      esac
     175
     176     
     177      # doing the plots for last week
     178      lastweek=`date +%Y%m%d --date="$date -1 week"`
     179      logfile=$outpath"/lightcurve"$source"_1night_week.log"
     180      outfile=$outpath"/lightcurve"$source"_1night_week.root"
     181      #echo $outfile
     182      printprocesslog "INFO starting lightcurve.C+ for source "$source" timebin 1 night for night "$date2" last week ("$lastweek")"
     183   
     184      check1=`root -q -b fact/analysis/lightcurve.C+\($source\,$lastweek\\,$date2\,-1\,"\"$tablename"\"\,"\"$outfile\""\,kFALSE\) | tee $logfile | intgrep`
     185   
     186      case $check1 in
     187         0)   printprocesslog "INFO lightcurve.C was successful for source "$source" timebin 1 night for night "$date2" last week (check1=$check1)"
     188              #./showplot -b --save-as-png $outfile
     189              if ! ./showplot -b --save-as-png $outfile >/dev/null
     190              then
     191                 printprocesslog "WARN showplot -b --save-as-png "$outfile" failed."
     192              fi
     193              ;;
     194         1)   printprocesslog "INFO lightcurve.C was successful for source "$source" timebin 1 night for night "$date2" last week, but nothing to plot (check1=$check1)"
     195              ;;
     196         *)   printprocesslog "ERROR lightcurve.C failed for source "$source" timebin 1 night for night "$date2" last week (check1=$check1)"
     197              ;;
     198      esac
     199
     200      # doing the plots for all nights
     201      logfile=$outpath"/lightcurve"$source"_1night_all.log"
     202      outfile=$outpath"/lightcurve"$source"_1night_all.root"
     203      #echo $outfile
     204      printprocesslog "INFO starting lightcurve.C+ for source "$source" timebin 1 night for night "$date2" all nights"
     205   
     206      check1=`root -q -b fact/analysis/lightcurve.C+\($source\,$firstnight\\,$date2\,-1\,"\"$tablename"\"\,"\"$outfile\""\,kFALSE\) | tee $logfile | intgrep`
     207   
     208      case $check1 in
     209         0)   printprocesslog "INFO lightcurve.C was successful for source "$source" timebin 1 night for night "$date2" all nights (check1=$check1)"
     210              #./showplot -b --save-as-png $outfile
     211              if ! ./showplot -b --save-as-png $outfile >/dev/null
     212              then
     213                 printprocesslog "WARN showplot -b --save-as-png "$outfile" failed."
     214              fi
     215              ;;
     216         1)   printprocesslog "INFO lightcurve.C was successful for source "$source" timebin 1 night for night "$date2" all nights, but nothing to plot (check1=$check1)"
     217              ;;
     218         *)   printprocesslog "ERROR lightcurve.C failed for source "$source" timebin 1 night for night "$date2" all nights (check1=$check1)"
     219              ;;
     220      esac
     221     
    139222   done
    140223   printprocesslog "INFO rsync output of source "$source" to gate."
Note: See TracChangeset for help on using the changeset viewer.