source: trunk/DataCheck/Processing/FillNumEvts.sh@ 17892

Last change on this file since 17892 was 17115, checked in by Daniela Dorner, 11 years ago
process only current night between 19 and 7h
  • Property svn:executable set to *
File size: 3.2 KB
Line 
1#!/bin/bash
2
3source `dirname $0`/../Sourcefile.sh
4printprocesslog "INFO starting "$0
5
6logfile=$runlogpath"/FillNumEvts-"$datetime".log"
7date >> $logfile
8
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" != "" ]
14then
15 getdates $certaindate
16else
17 # get all night
18 #getdates "all"
19 # get last 6 nights if hour between 7 and 19h, else only current night
20 getdates 6 7 19
21fi
22
23
24printprocesslog "INFO processing the following night(s): "${dates[@]}
25echo `date`": processing the following night(s): "${dates[@]} >> $logfile 2>&1
26
27cd $mars
28
29# do filling of aux data
30for date in ${dates[@]}
31do
32 runnumber=`echo $date | sed -e 's/\///g'`
33
34 # process only data which are available
35 if [ $runnumber -lt $firstnight ]
36 then
37 continue
38 fi
39
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\)"
68
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
80done
81
82finish
83
84
Note: See TracBrowser for help on using the repository browser.