Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 6964)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 6965)
@@ -37,4 +37,11 @@
      - use the sequence number'd directories in case of calibrated data
        and image files instead of the date.
+
+   * mhflux/MAlphaFitter.cc:
+     - copy also results in Copy()
+
+   * mjobs/MJOptimize.cc:
+     - print result of optimization in case MAlphaFitter is used
+     - store results back in initial MAlphaFitter
 
 
Index: /trunk/MagicSoft/Mars/mhflux/MAlphaFitter.cc
===================================================================
--- /trunk/MagicSoft/Mars/mhflux/MAlphaFitter.cc	(revision 6964)
+++ /trunk/MagicSoft/Mars/mhflux/MAlphaFitter.cc	(revision 6965)
@@ -306,4 +306,5 @@
     MAlphaFitter &f = static_cast<MAlphaFitter&>(o);
 
+    // Setup
     f.fSigInt       = fSigInt;
     f.fSigMax       = fSigMax;
@@ -319,4 +320,15 @@
     f.fCoefficients.Reset();
 
+    // Result
+    f.fSignificance     = fSignificance;
+    f.fEventsExcess     = fEventsExcess;
+    f.fEventsSignal     = fEventsSignal;
+    f.fEventsBackground = fEventsBackground;
+    f.fChiSqSignal      = fChiSqSignal;
+    f.fChiSqBg          = fChiSqBg;
+    f.fIntegralMax      = fIntegralMax;
+    f.fScaleFactor      = fScaleFactor;
+
+    // Function
     TF1 *fcn = f.fFunc;
     f.fFunc = new TF1(*fFunc);
Index: /trunk/MagicSoft/Mars/mjobs/MJOptimize.cc
===================================================================
--- /trunk/MagicSoft/Mars/mjobs/MJOptimize.cc	(revision 6964)
+++ /trunk/MagicSoft/Mars/mjobs/MJOptimize.cc	(revision 6965)
@@ -866,7 +866,15 @@
     tasklist.AddToList(&fill);
 
+    // Optimize with the tasklist in this parameterlist
     if (!Optimize(parlist))
         return kFALSE;
 
+    // Copy the result back to be accessible by the user
+    if (fit)
+        hist.GetAlphaFitter().Copy(*fit);
+    // Print the result
+    hist.GetAlphaFitter().Print("result");
+
+    // Store result if requested
     TObjArray cont;
     cont.Add(&contin);
@@ -956,6 +964,6 @@
     parlist.AddToList(&list);
 
+    MFillH fillof(&histof, "", "FillHistOff");
     MFillH fillon(&histon, "", "FillHistOn");
-    MFillH fillof(&histof, "", "FillHistOff");
 
     MF f0(Form("M[%d]<0.5", idxdatatype), "FilterOffData");
@@ -975,7 +983,15 @@
     tasklist.AddToList(&fillon);
 
+    // Optimize with the tasklist in this parameterlist
     if (!Optimize(parlist))
         return kFALSE;
 
+    // Copy the result back to be accessible by the user
+    if (fit)
+        histon.GetAlphaFitter().Copy(*fit);
+    // Print the result
+    histon.GetAlphaFitter().Print("result");
+
+    // Store result if requested
     TObjArray cont;
     cont.Add(&contin);
@@ -1044,9 +1060,12 @@
     tasklist.AddToList(&fill);
 
+    // Optimize with the tasklist in this parameterlist
     if (!Optimize(parlist))
         return kFALSE;
 
+    // Print the result
     hist.Print();
 
+    // Store result if requested
     TObjArray cont;
     cont.Add(&est);
