Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 7752)
+++ trunk/MagicSoft/Mars/Changelog	(revision 7753)
@@ -18,4 +18,14 @@
 
                                                  -*-*- END OF LINE -*-*-
+
+ 2006/06/26 Thomas Bretz
+
+   * mjobs/MJCut.[h,cc]:
+     - added error codes for some fatal errors
+
+   * ganymed.cc:
+     - pipe error codes to shell
+
+
 
  2006/05/29 Thomas Bretz
Index: trunk/MagicSoft/Mars/ganymed.cc
===================================================================
--- trunk/MagicSoft/Mars/ganymed.cc	(revision 7752)
+++ trunk/MagicSoft/Mars/ganymed.cc	(revision 7753)
@@ -264,9 +264,26 @@
     //    job.EnableStorageOfResult();
 
-    if (!job.Process(seq))
+    const Int_t rc = job.Process(seq);
+    if (rc<=0)
     {
         gLog << err << "Calculation of cuts failed." << endl << endl;
-        return 2;
-    }
+
+        //error coding for the automatic analysis (to be filled into the database)
+        switch (rc)
+        {
+        case  0:        // MJCut failed
+            return 3;
+        case -1:        // Source not found
+            return 4;
+        case -2:        // FillRndSrcCam failed
+            return 5;
+        case -3:        // Processing off-data failed
+            return 6;
+        case -4:        // Processing on-data failed
+            return 7;
+        }
+        return 2;
+    }
+
     if (kDebugEnv>0)
         env.PrintUntouched();
Index: trunk/MagicSoft/Mars/mjobs/MJCut.cc
===================================================================
--- trunk/MagicSoft/Mars/mjobs/MJCut.cc	(revision 7752)
+++ trunk/MagicSoft/Mars/mjobs/MJCut.cc	(revision 7753)
@@ -515,5 +515,5 @@
 }
 
-Bool_t MJCut::Process(const MDataSet &set)
+Int_t MJCut::Process(const MDataSet &set)
 {
     if (!set.IsValid())
@@ -532,5 +532,5 @@
     {
         if (!set.GetSourcePos(source))
-            return kFALSE;
+            return -1;
         *fLog << all;
         source.Print("RaDec");
@@ -545,5 +545,5 @@
     {
         if (!FillSrcPosCam(set, source, hsrcpos))
-            return kFALSE;
+            return -2;
         plist.AddToList(&hsrcpos);
     }
@@ -698,7 +698,7 @@
         tlist2.AddToList(&hcalc2);
     //tlist2.AddToList(&taskenv1);
+    tlist2.AddToList(&cont0);
     tlist2.AddToList(&taskenv2);
     tlist2.AddToList(&taskenv3);
-    tlist2.AddToList(&cont0);
     if (write0)
         tlist2.AddToList(write0);
@@ -769,5 +769,5 @@
         {
             *fLog << err << GetDescriptor() << ": Processing of off-sequences failed." << endl;
-            return kFALSE;
+            return -3;
         }
 
@@ -914,5 +914,5 @@
     {
         *fLog << err << GetDescriptor() << ": Processing of on-sequences failed." << endl;
-        return kFALSE;
+        return -4;
     }
 
Index: trunk/MagicSoft/Mars/mjobs/MJCut.h
===================================================================
--- trunk/MagicSoft/Mars/mjobs/MJCut.h	(revision 7752)
+++ trunk/MagicSoft/Mars/mjobs/MJCut.h	(revision 7753)
@@ -55,5 +55,5 @@
     ~MJCut();
 
-    Bool_t Process(const MDataSet &set);
+    Int_t Process(const MDataSet &set);
 
     void EnableStorageOfSummary(Bool_t b=kTRUE)  { fStoreSummary = b; } // See SetNameSummary
