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

Last change on this file since 18093 was 18080, checked in by Daniela Dorner, 10 years ago
added comments
  • Property svn:executable set to *
File size: 2.8 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_ | 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 "$callistocount" callistos running ( "$numcallistos" allowed). "
21 sleep $callistowait
22 callistocount=`ps aux | grep callisto_ | 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 printprocesslog "DEBUG fact/analysis/callisto_data.C\("\"$3\""\,"\"$4\""\,"\"$5\""\,"\"\""\,"\"$6\""\) | tee $logfile "
28 check1=`root -q -b fact/analysis/callisto_data.C\("\"$3\""\,"\"$4\""\,"\"$5\""\,"\"\""\,"\"$6\""\) | tee $logfile | intgrep`
29 ;;
30 prun) # process pedestal run
31 # currently not done (s Step1.sh)
32 printprocesslog "DEBUG 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 # currently not done (s Step1.sh)
37 printprocesslog "DEBUG fact/analysis/callisto_lightpulser.C\("\"$3\""\,"\"$4\""\,"\"$5\""\,"\"$6\""\) | tee $logfile "
38 check1=`root -q -b fact/analysis/callisto_lightpulser.C\("\"$3\""\,"\"$4\""\,"\"$5\""\,"\"$6\""\) | tee $logfile | intgrep`
39 ;;
40 time) # do drs-calib
41 printprocesslog "DEBUG fact/analysis/callisto_drstime.C\("\"$3\""\,"\"$4\"","\"$5\""\) | tee $logfile "
42 check1=`root -q -b fact/analysis/callisto_drstime.C\("\"$3\""\,"\"$4\"","\"$5\""\) | tee $logfile | intgrep`
43 ;;
44 *) # default
45 printprocesslog "WARN wrong parameter given to script RunCallisto.sh :"$1
46 ;;
47esac
48
49case $check1 in
50 0) printprocesslog "INFO callisto was successful for file "$3" (check1=$check1)"
51 if [ "$1" == "drun" ]
52 then
53 printprocesslog "INFO start RunStar.sh for file "$7
54 starfile=`echo $7 | sed -e 's/callisto/star/g' -e 's/_C/_I/'`
55 starlog=`echo $starfile | sed -e 's/_I.root/-images.log/'`
56 outpath=`dirname $starfile`
57 makedir $outpath
58 `dirname $0`/RunStar.sh $starlog $7 $outpath $starfile
59 fi
60 ;;
61 *) printprocesslog "ERROR callisto failed for file "$3" (check1=$check1)"
62 # allow for reprocessing in case callisto fails once
63 cplogfile=$logfile.cp
64 if ! ls $cplogfile >/dev/null
65 then
66 mv $logfile $cplogfile
67 fi
68 ;;
69esac
70
71finish
72
Note: See TracBrowser for help on using the repository browser.