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

Last change on this file since 17814 was 17155, checked in by Daniela Dorner, 11 years ago
adapted macro paths, included wait in case there are already enough callisto.C running
  • Property svn:executable set to *
File size: 1.4 KB
Line 
1#!/bin/bash
2#
3
4source `dirname $0`/../Sourcefile.sh
5printprocesslog "INFO starting $0"
6
7seqfile=$1
8seqnum=`basename $seqfile | sed -e 's/[.]seq//g'`
9#outpath=`dirname $seqfile | sed -e "s/sequences/${1}\/callisto/"`
10outpath=`dirname $seqfile | sed -e "s/sequences/callisto/"`
11makedir $outpath
12logfile=$outpath"/"$seqnum"-calibration.log"
13
14# make sure that no other RunCallisto.sh is started for this seq
15touch $logfile
16
17cd $mars
18
19# check how many callistos are running
20callistocount=`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`
21
22while [ $callistocount -ge $numcallistos ]
23do
24 source `dirname $0`/../Sourcefile.sh
25 printprocesslog "INFO wait "$callistowait" as "$callistocound" callistos running ( "$numcallistos" allowed). "
26 sleep $callistowait
27 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`
28done
29
30# run callisto
31printprocesslog "INFO starting callisto.C for sequence "$seqnum
32
33check1=`root -q -b fact/analysis/callisto.C\("\"$seqfile\""\,"\"$outpath\""\) | tee $logfile | intgrep`
34
35case $check1 in
36 0) printprocesslog "INFO callisto was successful for sequence "$seqnum" (check1=$check1)"
37 `dirname $0`/RunStar.sh $seqfile &
38 ;;
39 *) printprocesslog "ERROR callisto.C failed for sequence "$seqnum" (check1=$check1)"
40 ;;
41esac
42
43finish
44
Note: See TracBrowser for help on using the repository browser.