Index: trunk/DataCheck/QuickLook/RunCallisto.sh
===================================================================
--- trunk/DataCheck/QuickLook/RunCallisto.sh	(revision 17154)
+++ trunk/DataCheck/QuickLook/RunCallisto.sh	(revision 17155)
@@ -12,10 +12,24 @@
 logfile=$outpath"/"$seqnum"-calibration.log"
 
+# make sure that no other RunCallisto.sh is started for this seq
+touch $logfile
+
 cd $mars
 
+# check how many callistos are running
+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`
+
+while [ $callistocount -ge $numcallistos ]
+do
+   source `dirname $0`/../Sourcefile.sh
+   printprocesslog "INFO wait "$callistowait" as "$callistocound" callistos running ( "$numcallistos" allowed). "
+   sleep $callistowait
+   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`
+done
+
 # run callisto 
-printprocesslog "INFO starting callisto6.C for sequence "$seqnum
+printprocesslog "INFO starting callisto.C for sequence "$seqnum
 
-check1=`root -q -b fact/callisto6.C\("\"$seqfile\""\,"\"$outpath\""\) | tee $logfile | intgrep`
+check1=`root -q -b fact/analysis/callisto.C\("\"$seqfile\""\,"\"$outpath\""\) | tee $logfile | intgrep`
 
 case $check1 in
@@ -23,5 +37,5 @@
         `dirname $0`/RunStar.sh $seqfile &
         ;;
-   *)   printprocesslog "ERROR callisto6.C failed for sequence "$seqnum" (check1=$check1)"
+   *)   printprocesslog "ERROR callisto.C failed for sequence "$seqnum" (check1=$check1)"
         ;;
 esac
