source: trunk/DataCheck/QuickLook/RunCallisto.sh@ 17992

Last change on this file since 17992 was 17902, checked in by Daniela Dorner, 10 years ago
improved logging
  • Property svn:executable set to *
File size: 2.5 KB
Line 
1#!/bin/bash
2#
3
4source `dirname $0`/../Sourcefile.sh
5printprocesslog "INFO starting $0"
6
7logfile=$2
8
9# make sure that no other RunCallisto.sh is started for this run
10touch $logfile
11
12cd $mars
13
14# check how many callistos are running
15callistocount=`ps aux | grep callisto.C | grep -E -o '20[12][0-9][01][0-9][0-3][0-9]_[0-9][0-9][0-9]' | sort | uniq | wc -l`
16
17while [ $callistocount -ge $numcallistos ]
18do
19 source `dirname $0`/../Sourcefile.sh
20 printprocesslog "INFO wait "$callistowait" as "$callistocound" callistos running ( "$numcallistos" allowed). "
21 sleep $callistowait
22 callistocount=`ps aux | grep callisto.C | grep -E -o '20[12][0-9][01][0-9][0-3][0-9]_[0-9][0-9][0-9]' | sort | uniq | wc -l`
23done
24
25case $1 in
26 drun) # process data run
27 # run callisto
28 echo "fact/analysis/callisto_data.C\("\"$3\""\,"\"$4\""\,"\"$5\""\,"\"\""\,"\"$6\""\) | tee $logfile "
29 check1=`root -q -b fact/analysis/callisto_data.C\("\"$3\""\,"\"$4\""\,"\"$5\""\,"\"\""\,"\"$6\""\) | tee $logfile | intgrep`
30 ;;
31 prun) # process pedestal run
32 echo "fact/analysis/callisto_pedestal.C\("\"$3\""\,"\"$4\"","\"$5\""\) | tee $logfile "
33 check1=`root -q -b fact/analysis/callisto_pedestal.C\("\"$3\""\,"\"$4\"","\"$5\""\) | tee $logfile | intgrep`
34 ;;
35 crun) # process light-pulser run
36 echo "fact/analysis/callisto_lightpulser.C\("\"$3\""\,"\"$4\""\,"\"$5\""\,"\"$6\""\) | tee $logfile "
37 check1=`root -q -b fact/analysis/callisto_lightpulser.C\("\"$3\""\,"\"$4\""\,"\"$5\""\,"\"$6\""\) | tee $logfile | intgrep`
38 ;;
39 time) # do drs-calib
40 echo "fact/analysis/callisto_drstime.C\("\"$3\""\,"\"$4\"","\"$5\""\) | tee $logfile "
41 check1=`root -q -b fact/analysis/callisto_drstime.C\("\"$3\""\,"\"$4\"","\"$5\""\) | tee $logfile | intgrep`
42 ;;
43 *) # default
44 printprocesslog "WARN wrong parameter given to script RunCallisto.sh :"$1
45 ;;
46esac
47
48case $check1 in
49 0) printprocesslog "INFO callisto was successful for file "$3" (check1=$check1)"
50 if [ "$1" == "drun" ]
51 then
52 printprocesslog "INFO start RunStar.sh for file "$7
53 starfile=`echo $7 | sed -e 's/callisto/star/g' -e 's/_C/_I/'`
54 starlog=`echo $starfile | sed -e 's/_I.root/-images.log/'`
55 outpath=`dirname $starfile`
56 makedir $outpath
57 `dirname $0`/RunStar.sh $starlog $7 $outpath $starfile
58 fi
59 ;;
60 *) printprocesslog "ERROR callisto failed for file "$3" (check1=$check1)"
61 ;;
62esac
63
64finish
65
Note: See TracBrowser for help on using the repository browser.