Index: trunk/MagicSoft/Mars/datacenter/db/mcdefs.php
===================================================================
--- trunk/MagicSoft/Mars/datacenter/db/mcdefs.php	(revision 9605)
+++ trunk/MagicSoft/Mars/datacenter/db/mcdefs.php	(revision 9610)
@@ -51,8 +51,4 @@
      "Callisto"                 => "Callisto",
      "Star"                     => "Star",
-     "fStartTime"               => "Process",
-     "fFailedTime"              => "Failed",
-     "fReturnCode"              => "Ret<br>Code",
-     "fProgramId"               => "Prgr<br>Id",
      "fZenithDistanceMin"       => "Zd<br>Min",
      "fZenithDistanceMax"       => "Zd<br>Max",
@@ -111,13 +107,9 @@
     $tables = array
         (
-         "fNumEvents"                        => $fromtable . ".fNumEvents",
+         "fNumEvents"                        => "CorsikaInfo.fNumEvents",
          "fMCRunNumber"                      => "MCCorsikaRunData.fMCRunNumber",
          "fRawFileAvail"                     => "RunProcessStatus.fRawFileAvail",
          "SUM(fRunTime)/3600"                => "'Time [h]'",
          "SUM(fNumEvents)"                   => "'Evts'",
-         "fStartTime"                        => "fStartTime",
-         "fFailedTime"                       => "fFailedTime",
-         "fReturnCode"                       => "fReturnCode",
-         "fProgramId"                        => "fProgramId",
          "fParticleTypeName"                 => "ParticleType.fParticleTypeName",
          "fRunTypeName"                      => "RunType.fRunTypeName",
Index: trunk/MagicSoft/Mars/datacenter/db/mcinfo.php
===================================================================
--- trunk/MagicSoft/Mars/datacenter/db/mcinfo.php	(revision 9605)
+++ trunk/MagicSoft/Mars/datacenter/db/mcinfo.php	(revision 9610)
@@ -87,5 +87,5 @@
                         $query0 .= " CONCAT('failed (', " . $key . "Status.fReturnCode, ')'), ";
                         $query0 .= " CONCAT('done (', " . $key . "Status.fStopTime, ";
-                        $query0 .= " ',', TIMEDIFF(" . $key . "Status.fStopTime, " . $key . "Status.fStartTime), ')')))) ";
+                        $query0 .= " ', ', TIMEDIFF(" . $key . "Status.fStopTime, " . $key . "Status.fStartTime), ')')))) ";
 
                         //$query0 .= ", CONCAT( 'halo', " . $key . "Status.fStartTime)";
@@ -103,5 +103,5 @@
 
         foreach ($_GET as $key => $element)
-            if (($_GET[$key]=="On" || $groups>0))// && !empty($joins[$key]))
+            if (($_GET[$key]=="On" || $groups>0 || $statusgroups>0))// && !empty($joins[$key]))
                 $query0 .= GetJoin($fromtable,$key);
 
@@ -210,20 +210,13 @@
         printf("<img id='allbutton' src='minus.png' alt='-' onclick=\"showhide('all')\"> <b>Menu</b>&nbsp;&nbsp;&nbsp;&nbsp;\n");
         printf("&nbsp;&nbsp;<img id='infobutton'   src='plus.png' alt='+' onClick=\"showhide('info');showhide('info2')\"> MCRunInfo  \n");
-        printf("&nbsp;&nbsp;<img id='statbutton'   src='plus.png' alt='+' onClick=\"showhide('stat');showhide('fail')\">  StatusInfo \n");
+        printf("&nbsp;&nbsp;<img id='statbutton'   src='plus.png' alt='+' onClick=\"showhide('stat')\">  StatusInfo \n");
         printf("&nbsp;&nbsp;<img id='rangesbutton' src='plus.png' alt='+' onClick=\"showhide('ranges')\">                 Ranges     \n");
 
         printf(" <div id='all' style='display:block'>");
         PrintMCRunInfoMenu($host,$user,$pw,$db);
-//        PrintRunInfo2Menu($host,$user,$pw,$db);
         PrintMCRunStatMenu();
-        PrintFailMenu();
         printf(" <div id='ranges' style='display:none'>");
-//        PrintSequMenu($host,$user,$pw,$db);
-//        PrintNightRangeMenu($host,$user,$pw,$db, "RunData");
         printf("<p>");
-//        PrintZdRangeMenu($host,$user,$pw,$db);
         PrintMCRunRangeMenu($host,$user,$pw,$db);
-//        printf(" <P>\n");
-//        PrintSourceMenu($host,$user,$pw,$db);
         printf("<p>");
         printf("</div>");
Index: trunk/MagicSoft/Mars/datacenter/scripts/runcallisto_mc
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/runcallisto_mc	(revision 9605)
+++ trunk/MagicSoft/Mars/datacenter/scripts/runcallisto_mc	(revision 9610)
@@ -60,5 +60,5 @@
 setstatus "start"
 
-command="./callisto -b -q -v4 -f --out=$outpath --log=$log.log --html=$log.html --config=$callistorc $sequfile"
+command="./callisto -b -q -v4 -f --out=$outpath --ind=$inpath --log=$log.log --html=$log.html --config=$callistorc $sequfile"
 printprocesslog "INFO executing "$command
 $command
Index: trunk/MagicSoft/Mars/datacenter/scripts/runceres
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/runceres	(revision 9605)
+++ trunk/MagicSoft/Mars/datacenter/scripts/runceres	(revision 9610)
@@ -54,7 +54,4 @@
 setstatus "start"
 
-outpath=$mcpath/ceres/`printf %03d $cereskey`/`printf %08d $run | cut -c 1-4`/`printf %08d $run | cut -c 5-8`
-makedir $outpath
-log=$outpath/ceres`printf %08d $run `"."`printf %06d $file | cut -c 4-6`
 setupfile=$setuppath/$program/`printf %03d $cereskey`/ceres.rc
 
@@ -65,4 +62,7 @@
    2) printprocesslog "INFO run $run and file $file is a data run (key="$runkey")"
       inputfile=$mcpath/corsika/`printf %08d $run | cut -c 1-4`/`printf %08d $run | cut -c 5-8`/cer000`printf %06d $file | cut -c 4-6`
+      outpath=$mcpath/ceres/`printf %03d $cereskey`/`printf %08d $run | cut -c 1-4`/`printf %08d $run | cut -c 5-8`
+      makedir $outpath
+      log=$outpath/ceres`printf %08d $run `"."`printf %06d $file | cut -c 4-6`
       command="./ceres -b -q -f --config=$setupfile --out=$outpath --log=$log.log --html=$log.html --run-number=$run $inputfile"
       printprocesslog "INFO executing "$command
@@ -71,4 +71,8 @@
       ;;
    3) printprocesslog "INFO run $run and file $file is a pedestal run (key="$runkey")"
+      drun=`echo "$run + 2 " | bc -l`
+      $outpath=$mcpath/ceres/`printf %03d $cereskey`/`printf %08d $drun | cut -c 1-4`/`printf %08d $drun | cut -c 5-8`
+      makedir $outpath
+      log=$outpath/ceres`printf %08d $run `"."`printf %06d $file | cut -c 4-6`
       command="./ceres -b -q -f --config=$setupfile --out=$outpath --log=$log.log --html=$log.html --run-number=$run pedestal"
       printprocesslog "INFO executing "$command
@@ -77,4 +81,8 @@
       ;;
    4) printprocesslog "INFO run $run and file $file is a calibration run (key="$runkey")"
+      drun=`echo "$run + 1 " | bc -l`
+      $outpath=$mcpath/ceres/`printf %03d $cereskey`/`printf %08d $drun | cut -c 1-4`/`printf %08d $drun | cut -c 5-8`
+      makedir $outpath
+      log=$outpath/ceres`printf %08d $run `"."`printf %06d $file | cut -c 4-6`
       command="./ceres -b -q -f --config=$setupfile --out=$outpath --log=$log.log --html=$log.html --run-number=$run calibration"
       printprocesslog "INFO executing "$command
Index: trunk/MagicSoft/Mars/datacenter/scripts/sourcefile
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/sourcefile	(revision 9605)
+++ trunk/MagicSoft/Mars/datacenter/scripts/sourcefile	(revision 9610)
@@ -274,10 +274,19 @@
 function subquerypart()
 {
-   query=$query" SELECT COUNT(*) FROM "$need"Status "
-   query=$query" "`getjoin $need "SpecialInfluence"`" "
-   query=$query" WHERE "$step"Status."`echo ${prims[0]} | sed -e 's/,//g'`"="$step"Status."`echo ${prims[0]} | sed -e 's/,//g'`
+   query=$query" SELECT COUNT(*) FROM "$need"Status "`getjoin $need "SpecialInfluence"`
+   needinfluences=`grep $need $steps | grep "Needs" | grep -v "$need[.]Needs" | cut -d'.' -f1`
+   for needinfl in $needinfluences
+   do
+      needinfljoin=`getjoin $needinfl "Influence"`
+      if ! [ "$needinfljoin" = "" ]
+      then
+         query=$query" LEFT JOIN "$needinfl"Status USING ("$needinfljoin") "
+      fi
+      query=$query" "`getjoin $needinfl "SpecialInfluence"`" "
+   done
+   query=$query" WHERE "`echo ${prims[0]} | sed -e 's/,//g'`"="$step"Status."`echo ${prims[0]} | sed -e 's/,//g'`
    for (( j=1 ; j < ${#prims[@]} ; j++ ))
    do
-      query=$query" AND "$step"Status."`echo ${prims[$j]} | sed -e 's/,//g'`"="$step"Status."`echo ${prims[$j]} | sed -e 's/,//g'`
+      query=$query" AND "`echo ${prims[$j]} | sed -e 's/,//g'`"="$step"Status."`echo ${prims[$j]} | sed -e 's/,//g'`
    done
 }
@@ -309,4 +318,5 @@
    counter=0
    specialneedjoin=
+   specialinfljoin=
    for need in $needs
    do
@@ -316,4 +326,5 @@
       fi
       specialneedjoin=$specialneedjoin" "`getjoin $need "SpecialNeed"`
+      specialinfljoin=$specialinfljoin" "`getjoin $need "SpecialInfluence"`
       if [ "$specialneedjoin" = " " ]
       then 
@@ -323,4 +334,5 @@
          query=$query" ISNULL("$need"Status.fReturnCode) "
          specialneedjoin=
+         specialinfljoin=
       else 
          # special query to check steps which 
@@ -334,7 +346,7 @@
          query=$query" ) = ( "
          subquerypart
-         query=$query" AND NOT ISNULL(fStartTime) "
-         query=$query" AND NOT ISNULL(fStopTime) "
-         query=$query" AND ISNULL(fReturnCode)) "
+         query=$query" AND NOT ISNULL("$need"Status.fStartTime) "
+         query=$query" AND NOT ISNULL("$need"Status.fStopTime) "
+         query=$query" AND ISNULL("$need"Status.fReturnCode)) "
       fi
       counter=`echo $counter + 1 | bc -l`
@@ -504,5 +516,10 @@
          query=$query" LEFT JOIN "$influence"Status USING (${inflprims[@]}) "
       else 
-         query=$query" "$infljoin
+         query=$query" LEFT JOIN "$influence"Status USING ("$infljoin") "
+      fi
+      specialinfljoin2=`getjoin $influence "SpecialInfluence"`
+      if ! [ "$specialinfljoin2" = "" ]
+      then
+         query=$query" "$specialinfljoin2
       fi
    done
