Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 8222)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 8223)
@@ -31,4 +31,28 @@
    * mjobs/MJCalibration.cc, mjobs/MJCalibrateSignal.cc, mjobs/MJStar.cc:
      - improved output in case of no files found
+
+   * mjobs/MJPedestal.cc, mjobs/MJCalibTest.cc, mjobs/MJCalibration.cc,
+     mjobs/MJCalibrateSignal.cc, mjobs/MJStar.cc:
+     - moved output in case of invalid number of runs for a sequence
+       to MSequence
+     - stop execution if no or not all files were found
+
+   * mjobs/MSequence.cc:
+     - added some output and return an error if the number of requested
+       files doesn't match the number of files found.
+
+   * mjobs/MDataSet.cc:
+     - when Setting up dat-runs fails now an error is returned
+
+   * mjobs/MJSpectrum.cc, mjobs/MJCut.cc:
+     - if the number of files set from a sequence doesn't match the number
+       of files found stop execution
+
+   * mjoptim/MJOptimize.cc, mjtrain/MJTrainDisp.cc, mjtrain/MJTrainEnergy.cc:
+     - stop execution if number of requested and found files mismatch
+
+   * mjoptim/MJOptimizeCuts.cc, mjoptim/MJOptimizeDisp.cc,
+     mjoptim/MJOptimizeEnergy.cc:
+     - added more informative log output
 
 
Index: /trunk/MagicSoft/Mars/NEWS
===================================================================
--- /trunk/MagicSoft/Mars/NEWS	(revision 8222)
+++ /trunk/MagicSoft/Mars/NEWS	(revision 8223)
@@ -48,4 +48,8 @@
      PLEASE ALWAYS USE THIS PLOT FOR ANY KIND OF PRESENTATION!
 
+   - ganymed/optim/train: The cut program, trainings- and optimization
+     macros could run with less files found than expected from the
+     sequence-files. No the execution is stopped in this case.
+
    - sponde: now also allows the uasge of random forest
 
Index: /trunk/MagicSoft/Mars/mjoptim/MJOptimize.cc
===================================================================
--- /trunk/MagicSoft/Mars/mjoptim/MJOptimize.cc	(revision 8222)
+++ /trunk/MagicSoft/Mars/mjoptim/MJOptimize.cc	(revision 8223)
@@ -249,6 +249,6 @@
         if (!seq.IsValid())
             return kFALSE;
-
-        seq.SetupDatRuns(files, o->GetTitle(), "I");
+        if (seq.SetupDatRuns(files, o->GetTitle(), "I")<=0)
+            return kFALSE;
     }
 
Index: /trunk/MagicSoft/Mars/mjoptim/MJOptimizeCuts.cc
===================================================================
--- /trunk/MagicSoft/Mars/mjoptim/MJOptimizeCuts.cc	(revision 8222)
+++ /trunk/MagicSoft/Mars/mjoptim/MJOptimizeCuts.cc	(revision 8223)
@@ -299,4 +299,6 @@
         return kFALSE;
 
+    *fLog << inf << "Finished processing of " << fname << endl;
+
     // Copy the result back to be accessible by the user
     if (fit)
Index: /trunk/MagicSoft/Mars/mjoptim/MJOptimizeDisp.cc
===================================================================
--- /trunk/MagicSoft/Mars/mjoptim/MJOptimizeDisp.cc	(revision 8222)
+++ /trunk/MagicSoft/Mars/mjoptim/MJOptimizeDisp.cc	(revision 8223)
@@ -202,5 +202,6 @@
 
     // Print the result
-    *fLog << inf << "Rule: " << rule << endl;
+    *fLog << inf << "Finished processing of " << fname << endl;
+    *fLog << inf << "With Rule: " << rule << endl;
     hist.GetAlphaFitter().Print("result");
 
Index: /trunk/MagicSoft/Mars/mjoptim/MJOptimizeEnergy.cc
===================================================================
--- /trunk/MagicSoft/Mars/mjoptim/MJOptimizeEnergy.cc	(revision 8222)
+++ /trunk/MagicSoft/Mars/mjoptim/MJOptimizeEnergy.cc	(revision 8223)
@@ -143,5 +143,6 @@
 
     // Print the result
-    *fLog << inf << "Rule: " << rule << endl;
+    *fLog << inf << "Finished processing of " << fname << endl;
+    *fLog << inf << "With Rule: " << rule << endl;
     hist.Print();
 
Index: /trunk/MagicSoft/Mars/mjtrain/MJTrainEnergy.cc
===================================================================
--- /trunk/MagicSoft/Mars/mjtrain/MJTrainEnergy.cc	(revision 8222)
+++ /trunk/MagicSoft/Mars/mjtrain/MJTrainEnergy.cc	(revision 8223)
@@ -101,6 +101,8 @@
     readtst.DisableAutoScheme();
 
-    set.AddFilesOn(readtrn);
-    set.AddFilesOff(readtst);
+    if (!set.AddFilesOn(readtrn))
+        return kFALSE;
+    if (!set.AddFilesOff(readtst))
+        return kFALSE;
 
     // ----------------------- Setup Matrix ------------------
Index: /trunk/MagicSoft/Mars/mjtrain/MJTrainSeparation.cc
===================================================================
--- /trunk/MagicSoft/Mars/mjtrain/MJTrainSeparation.cc	(revision 8222)
+++ /trunk/MagicSoft/Mars/mjtrain/MJTrainSeparation.cc	(revision 8223)
@@ -57,4 +57,5 @@
 // tasks
 #include "MReadMarsFile.h"
+#include "MReadReports.h"
 #include "MContinue.h"
 #include "MFillH.h"
@@ -77,4 +78,13 @@
 #include "MFEventSelector.h"
 #include "MFilterList.h"
+
+// wobble
+#include "MPointingPos.h"
+#include "MPointingDevCalc.h"
+#include "../mastro/MObservatory.h"
+#include "MSrcPosCalc.h"
+#include "MSrcPosCorrect.h"
+#include "../mimage/MHillasCalc.h"
+
 
 ClassImp(MJTrainSeparation);
@@ -395,5 +405,6 @@
 {
     TChain chain("OriginalMC");
-    set.AddFilesOn(chain);
+    if (!set.AddFilesOn(chain))
+        return kFALSE;
 
     min = chain.GetMinimum("MMcEvtBasic.fEnergy");
@@ -411,5 +422,6 @@
 {
     TChain chain1("Events");
-    set.AddFilesOff(chain1);
+    if (!set.AddFilesOff(chain1))
+        return kFALSE;
 
     num = chain1.GetEntries();
@@ -421,5 +433,6 @@
 
     TChain chain("EffectiveOnTime");
-    set.AddFilesOff(chain);
+    if (!set.AddFilesOff(chain))
+        return kFALSE;
 
     chain.Draw("MEffectiveOnTime.fVal", "MEffectiveOnTime.fVal", "goff");
@@ -447,5 +460,6 @@
 {
     TChain chain1("Events");
-    set.AddFilesOn(chain1);
+    if (!set.AddFilesOn(chain1))
+        return kFALSE;
 
     const Double_t num = chain1.GetEntries();
@@ -610,19 +624,31 @@
 
     // --------------------- Setup files --------------------
-    MReadMarsFile read1("Events");
+    MReadReports  read1;//("Events");
     MReadMarsFile read2("Events");
     MReadMarsFile read3("Events");
-    MReadMarsFile read4("Events");
-    read1.DisableAutoScheme();
+    MReadReports  read4;//("Events");
+    //read1.DisableAutoScheme();
     read2.DisableAutoScheme();
     read3.DisableAutoScheme();
-    read4.DisableAutoScheme();
+    //read4.DisableAutoScheme();
+
+    read1.AddTree("Events", "MTime.", MReadReports::kMaster);
+    read4.AddTree("Events", "MTime.", MReadReports::kMaster);
+    read1.AddTree("Drive",            MReadReports::kRequired);
+    read4.AddTree("Drive",            MReadReports::kRequired);
+    read1.AddTree("Starguider",       MReadReports::kRequired);
+    read4.AddTree("Starguider",       MReadReports::kRequired);
 
     // Setup four reading tasks with the on- and off-data of the two datasets
-    fDataSetTrain.AddFilesOn(read1);
-    fDataSetTrain.AddFilesOff(read3);
-
-    fDataSetTest.AddFilesOff(read2);
-    fDataSetTest.AddFilesOn(read4);
+    if (!fDataSetTrain.AddFilesOn(read1))
+        return kFALSE;
+    const Bool_t setrc1 = fDataSetTrain.IsWobbleMode() ?
+        fDataSetTrain.AddFilesOn(read3) : fDataSetTrain.AddFilesOff(read3);
+    const Bool_t setrc2 = fDataSetTest.IsWobbleMode() ?
+        fDataSetTest.AddFilesOn(read2) : fDataSetTest.AddFilesOff(read2);
+    if (!setrc1  || !setrc2)
+        return kFALSE;
+    if (!fDataSetTest.AddFilesOn(read4))
+        return kFALSE;
 
     // ----------------------- Setup RF Matrix ----------------------
@@ -656,4 +682,48 @@
     had.SetVal(0);
     wgt.SetVal(1);
+
+    // How to get source position from off- and on-data?
+    MPointingPos source("MSourcePos");
+    MObservatory     obs;
+    MSrcPosCalc      scalc;
+    MSrcPosCorrect   scor;
+    MHillasCalc      hcalcw;
+    MHillasCalc      hcalcw2;
+    MPointingDevCalc devcalc;
+    scalc.SetMode(MSrcPosCalc::kDefault); // kWobble for off-source
+    hcalcw.SetFlags(MHillasCalc::kCalcHillasSrc);
+    hcalcw2.SetFlags(MHillasCalc::kCalcHillasSrc);
+    hcalcw2.SetNameHillasSrc("MHillasSrcAnti");
+    hcalcw2.SetNameSrcPosCam("MSrcPosAnti");
+    if (fDataSetTrain.IsWobbleMode())
+    {
+        // *******************************************************************
+        // Possible source position (eg. Wobble Mode)
+        if (fDataSetTrain.HasSource())
+        {
+            if (!fDataSetTrain.GetSourcePos(source))
+                return -1;
+            *fLog << all;
+            source.Print("RaDec");
+        }
+        else
+            *fLog << all << "No source position applied..." << endl;
+
+        // La Palma Magic1
+        plistx.AddToList(&obs);
+        plistx.AddToList(&source);
+
+        TList tlist2;
+        tlist2.Add(&scalc);
+        tlist2.Add(&scor);
+        tlist2.Add(&hcalcw);
+        tlist2.Add(&hcalcw2);
+
+        devcalc.SetStreamId("Starguider");
+        tlist2.Add(&devcalc);
+
+        fill.AddPreTasks(tlist2);
+        // *******************************************************************
+    }
 
     // Setup the tool class to read the gammas and read them
@@ -689,10 +759,18 @@
 
     MHillasCalc hcalc;
+    MHillasCalc hcalc2;
     hcalc.SetFlags(MHillasCalc::kCalcHillasSrc);
+    hcalc2.SetFlags(MHillasCalc::kCalcHillasSrc);
+    hcalc2.SetNameHillasSrc("MHillasSrcAnti");
+    hcalc2.SetNameSrcPosCam("MSrcPosAnti");
 
     if (fDataSetTrain.IsWobbleMode())
     {
+        scalc.SetMode(MSrcPosCalc::kWobble); // kWobble for off-source
+        fPreTasksSet[kTrainOff].AddFirst(&hcalc2);
         fPreTasksSet[kTrainOff].AddFirst(&hcalc);
-        fPreTasksSet[kTrainOff].AddFirst(&srcrndm);
+        //fPreTasksSet[kTrainOff].AddFirst(&srcrndm);
+        fPreTasksSet[kTrainOff].AddFirst(&scor);
+        fPreTasksSet[kTrainOff].AddFirst(&scalc);
     }
 
@@ -765,4 +843,5 @@
     *fLog << "Run-Time: " << Form("%.1f", clock.RealTime()/60) << "min (CPU: ";
     *fLog << Form("%.1f", clock.CpuTime()/60) << "min)" << endl;
+    *fLog << endl;
     *fLog << "Output file name: " << out << endl;
 
@@ -837,4 +916,9 @@
     // ----- Setup tasklist -----
     tlist.AddToList(&read2);
+    if (fDataSetTest.IsWobbleMode())
+    {
+        tlist.AddToList(&srcrndm);
+        tlist.AddToList(&hcalc);
+    }
     tlist.AddToList(&c1);
     tlist.AddToList(fPreTasksSet[kTestOff]);
@@ -876,4 +960,31 @@
     // replace the reading task by a new one
     tlist.Replace(&read4);
+
+    if (fDataSetTest.IsWobbleMode())
+    {
+        // *******************************************************************
+        // Possible source position (eg. Wobble Mode)
+        if (fDataSetTest.HasSource())
+        {
+            if (!fDataSetTest.GetSourcePos(source))
+                return -1;
+            *fLog << all;
+            source.Print("RaDec");
+        }
+        else
+            *fLog << all << "No source position applied..." << endl;
+
+        // La Palma Magic1
+        plist.AddToList(&obs);
+        plist.AddToList(&source);
+
+        // How to get source position from off- and on-data?
+        tlist.AddToListAfter(&scalc,  &read4);
+        tlist.AddToListAfter(&scor,   &scalc);
+        tlist.AddToListAfter(&hcalcw, &scor);
+
+        tlist.AddToList(&devcalc, "Starguider");
+        // *******************************************************************
+    }
 
     // Add the PreTasksOn directly after the reading task
