Index: trunk/MagicSoft/Mars/mjobs/MJCut.cc
===================================================================
--- trunk/MagicSoft/Mars/mjobs/MJCut.cc	(revision 6941)
+++ trunk/MagicSoft/Mars/mjobs/MJCut.cc	(revision 6948)
@@ -227,7 +227,14 @@
 // analysis number num, see GetOutputFile()
 //
-Bool_t MJCut::WriteResult(UInt_t num) const
+Bool_t MJCut::WriteResult(const MParList &plist, UInt_t num) const
 {
     TObjArray arr;
+
+    TIter Next(plist);
+    TObject *o=0;
+    while ((o=Next()))
+        if (o->InheritsFrom(MBinning::Class()))
+            arr.Add(o);
+
     return WriteContainer(arr, GetOutputFile(num), "UPDATE");
 }
@@ -278,4 +285,5 @@
     write->AddContainer("MHillas",        "Events");
     write->AddContainer("MHillasSrc",     "Events");
+    write->AddContainer("MHillasExt",     "Events");
     write->AddContainer("MPointingPos",   "Events");
     write->AddContainer("MHillasSrcAnti", "Events", kFALSE);
@@ -293,4 +301,17 @@
 }
 
+void MJCut::DisplayResult(const MParList &plist) const
+{
+    /*
+     TObject *h1 = plist.FindObject("MHHillasOffPre",  "MHHillas");
+     TObject *h2 = plist.FindObject("MHHillasOffPost", "MHHillas");
+     TObject *h3 = plist.FindObject("MHVsSizeOffPost", "MHVsSize");
+     TObject *h4 = plist.FindObject("MHHilExtOffPost", "MHHillasExt");
+     TObject *h5 = plist.FindObject("MHHilSrcOffPost", "MHHillasSrc");
+     TObject *h6 = plist.FindObject("MHImgParOffPost", "MHImagePar");
+     TObject *h7 = plist.FindObject("MHNewParOffPost", "MHNewImagePar");
+     */
+}
+
 Bool_t MJCut::ProcessFile(const MDataSet &set)
 {
@@ -342,14 +363,16 @@
     MBinning bins3(50, 0,  60,   "BinningTheta",     "cos");
     MBinning bins4("BinningFalseSource");
-    //MBinning bins5("BinningWidth");
-    //MBinning bins6("BinningLength");
-    //MBinning bins7("BinningDist");
+    MBinning bins5("BinningWidth");
+    MBinning bins6("BinningLength");
+    MBinning bins7("BinningDist");
+    MBinning bins8("BinningMaxDist");
     plist.AddToList(&bins1);
     plist.AddToList(&bins2);
     plist.AddToList(&bins3);
     plist.AddToList(&bins4);
-    //plist.AddToList(&bins5);
-    //plist.AddToList(&bins6);
-    //plist.AddToList(&bins7);
+    plist.AddToList(&bins5);
+    plist.AddToList(&bins6);
+    plist.AddToList(&bins7);
+    plist.AddToList(&bins8);
 
     // --------------------------------------------------------------------------------
@@ -623,7 +646,9 @@
     tlist.PrintStatistics();
 
+    DisplayResult(plist);
+
     // FIXME: Perform fit and plot energy dependant alpha plots
     // and fit result to new tabs!
-    if (!WriteResult(set.GetNumAnalysis()))
+    if (!WriteResult(plist, set.GetNumAnalysis()))
         return kFALSE;
 
Index: trunk/MagicSoft/Mars/mjobs/MJCut.h
===================================================================
--- trunk/MagicSoft/Mars/mjobs/MJCut.h	(revision 6941)
+++ trunk/MagicSoft/Mars/mjobs/MJCut.h	(revision 6948)
@@ -8,4 +8,5 @@
 class MTask;
 class MDataSet;
+class MParList;
 class MWriteRootFile;
 
@@ -18,4 +19,5 @@
     Bool_t  fIsWobble;
     Bool_t  fFullDisplay;
+    //Bool_t  fSubstraction;
 
     TString fNameSummary;
@@ -30,5 +32,6 @@
     void    SetupWriter(MWriteRootFile *write, const char *name) const;
     Bool_t  WriteTasks(UInt_t num, TObjArray &cont) const;
-    Bool_t  WriteResult(UInt_t num) const;
+    Bool_t  WriteResult(const MParList &plist, UInt_t num) const;
+    void    DisplayResult(const MParList &plist) const;
 
     Bool_t  CanStoreSummary() const { return !fPathOut.IsNull() && fStoreSummary; }
@@ -46,4 +49,5 @@
     void EnableWobbleMode(Bool_t b=kTRUE)        { fIsWobble     = b; }
     void EnableFullDisplay(Bool_t b=kTRUE)       { fFullDisplay  = b; }
+    //void EnableSubstraction(Bool_t b=kTRUE)      { fSubstraction = b; }
 
     void SetNameSummaryFile(const char *name="");
Index: trunk/MagicSoft/Mars/mjobs/MJOptimize.cc
===================================================================
--- trunk/MagicSoft/Mars/mjobs/MJOptimize.cc	(revision 6941)
+++ trunk/MagicSoft/Mars/mjobs/MJOptimize.cc	(revision 6948)
@@ -228,5 +228,5 @@
 }
 
-MJOptimize::MJOptimize() : fDebug(-1), fNumEvents(0), fType(kSimplex), fNumMaxCalls(0), fTolerance(0), fTestTrain(kFALSE)
+MJOptimize::MJOptimize() : fDebug(-1), fNumEvents(0), fType(kSimplex), fNumMaxCalls(0), fTolerance(0), fTestTrain(0)
 {
     fRules.SetOwner();
@@ -661,5 +661,5 @@
     case kMigrad:    txt += "Migrad";    break;
     case kMinimize:  txt += "Minimize";  break;
-    case kMinos:     txt += "Minot";     break;
+    case kMinos:     txt += "Minos";     break;
     case kImprove:   txt += "Improve";   break;
     case kSimplex:   txt += "Simplex";   break;
@@ -682,6 +682,6 @@
     // In case the reader is the matrix loop and testrain is enabled
     // switch on even mode...
-    if (loop && fTestTrain)
-        loop->SetOperationMode(MMatrixLoop::kEven);
+    if (loop && TMath::Abs(fTestTrain)>0)
+        loop->SetOperationMode(fTestTrain>0?MMatrixLoop::kEven:MMatrixLoop::kOdd);
 
     if (!Optimize(evtloop))
@@ -696,8 +696,8 @@
     // In case the reader is the matrix loop and testrain is enabled
     // switch on odd mode...
-    if (!loop || !fTestTrain)
+    if (!loop || fTestTrain==0)
         return kTRUE;
 
-    loop->SetOperationMode(MMatrixLoop::kOdd);
+    loop->SetOperationMode(fTestTrain<0?MMatrixLoop::kEven:MMatrixLoop::kOdd);
 
     // Done already in Fcn
Index: trunk/MagicSoft/Mars/mjobs/MJOptimize.h
===================================================================
--- trunk/MagicSoft/Mars/mjobs/MJOptimize.h	(revision 6941)
+++ trunk/MagicSoft/Mars/mjobs/MJOptimize.h	(revision 6948)
@@ -84,5 +84,5 @@
     UInt_t  fNumMaxCalls;
     Float_t fTolerance;
-    Bool_t  fTestTrain;
+    Int_t   fTestTrain;
 
     Bool_t Optimize(MEvtLoop &evtloop);
@@ -110,5 +110,5 @@
     void SetNumMaxCalls(UInt_t num=0) { fNumMaxCalls=num; }
     void SetTolerance(Float_t tol=0)  { fTolerance=tol; }
-    void EnableTestTrain(Bool_t b=kTRUE) { fTestTrain=b; }
+    void EnableTestTrain(Int_t b=2)   { fTestTrain=b; }
 
     // Parameter access
