Index: trunk/MagicSoft/Mars/macros/estfit.C
===================================================================
--- trunk/MagicSoft/Mars/macros/estfit.C	(revision 2116)
+++ trunk/MagicSoft/Mars/macros/estfit.C	(revision 2124)
@@ -33,6 +33,10 @@
 
 // --------------------------------------------------------------------------
-
-void estfit(Bool_t evalenergy=kFALSE)
+//
+//  0: fit impact parameter only
+//  1: fit energy only
+//  2: fit all parameters with respect to the energy resolution
+//
+void estfit(Int_t evalenergy=0)
 {
     //
@@ -48,5 +52,5 @@
     eest.InitMapping(&matrix);
 
-    MReadTree read("Events", "~/ct1/MC_ON2.root");
+    MReadTree read("Events", "MC_ON2_short.root");
     read.DisableAutoScheme();
 
@@ -92,19 +96,48 @@
     //
     TArrayD fA(5);
-    fA[0] = -3907.74; //4916.4;    //-2414.75;
-    fA[1] = 1162.3;   //149.549;   // 1134.28;
-    fA[2] = 199.351;  //-558.209;  // 132.932;
-    fA[3] = 0.403192; //0.270725;  //0.292845;
-    fA[4] = 121.921;  //107.001;   // 107.001;
-
     TArrayD fB(7);
-    fB[0] = -100;
-    fB[1] = 10;
-    fB[2] = 0.1;
-    fB[3] = 10;
-    fB[4] = -1;
-    fB[5] = -0.1;
-    fB[6] = -0.1;
-
+    fA[0] =  392957;
+    fA[1] =  135;
+    fA[2] =  -37449;
+    fA[3] =  0.3464;
+    fA[4] =  1;
+    fB[0] =  1;
+    fB[1] =  1;
+    fB[2] =  1;
+    fB[3] =  1;
+    fB[4] =  1;
+    fB[5] =  1;
+    fB[6] =  1;
+     /*
+     fA[0] = 6122.97;
+     fA[1] = 144.889;
+     fA[2] = -601.256;
+     fA[3] = 0.00171985;
+     fA[4] = 116.451;
+     fB[0] =  -2368.21;
+     fB[1] =  1186.26;
+     fB[2] =  0.147235;
+     fB[3] =  144.49;
+     fB[4] =  42.7681;
+     fB[5] = -0.757817;
+     fB[6] =  0.182482;
+     */
+    /*
+     TArrayD fA(5);
+    fA[0] = 6122.97;
+    fA[1] = 144.889;
+    fA[2] = -601.256;
+    fA[3] = 0.00171985;
+    fA[4] = 116.451;
+
+    TArrayD fB(7);
+    fB[0] =  -10445.5;
+    fB[1] =  2172.05;
+    fB[2] =  0.69;
+    fB[3] =  491.2;
+    fB[4] =  4.71444;
+    fB[5] = -0.0331926;
+    fB[6] = -0.014833;
+    */
     // Set starting values and step sizes for parameters
     for (Int_t i=0; i<fA.GetSize(); i++)
@@ -120,6 +153,9 @@
 
         Bool_t rc = minuit.DefineParameter(i, name, vinit, step, limlo, limup);
-        if (evalenergy)
+        if (evalenergy==1)
+        {
             minuit.FixParameter(i);
+            cout << "Fixed Parameter #" << i << endl;
+        }
 
         if (!rc)
@@ -142,6 +178,9 @@
 
         Bool_t rc = minuit.DefineParameter(i+fA.GetSize(), name, vinit, step, limlo, limup);
-        if (!evalenergy)
+        if (evalenergy==0)
+        {
             minuit.FixParameter(i+fA.GetSize());
+            cout << "Fixed Parameter #" << i+fA.GetSize() << endl;
+        }
 
         if (!rc)
@@ -156,4 +195,6 @@
     //
     minuit.SetObjectFit(&evtloop);
+
+    cout << endl << "Fitting procedure running..." << endl;
 
     TStopwatch clock;
@@ -164,5 +205,4 @@
     Bool_t rc = minuit.Migrad();
     gLog.SetNullOutput(kFALSE);
-
     if (rc)
     {
@@ -176,5 +216,6 @@
     cout << endl;
 
-    for (Int_t i=(evalenergy?fA.GetSize():0); i<(evalenergy?fA.GetSize()+fB.GetSize():fA.GetSize()); i++)
+    for (Int_t i=(evalenergy==1?fA.GetSize():0); i<(evalenergy>0?fA.GetSize()+fB.GetSize():fA.GetSize()); i++)
+    //for (Int_t i=0; i<fA.GetSize()+fB.GetSize(); i++)
     {
         Double_t val;
@@ -182,8 +223,5 @@
 
         if (!minuit.GetParameter(i, val, er))
-        {
             cout << "Error getting parameter #" << i << endl;
-            return;
-        }
 
         cout << i << ":  " << val << "  +-  " << er << endl;
Index: trunk/MagicSoft/Mars/macros/multidimdist2.C
===================================================================
--- trunk/MagicSoft/Mars/macros/multidimdist2.C	(revision 2116)
+++ trunk/MagicSoft/Mars/macros/multidimdist2.C	(revision 2124)
@@ -66,6 +66,8 @@
     //   Here you give the trainings sample(s) for
     //                 the gammas
+    //      If you have only _one_ single Theta
+    //            remove MMcEvt.fTheta!
     // ---------------------------------------------
-    MReadMarsFile readg("Events", "star_gammas.root");
+    MReadMarsFile readg("Events", "star_gammas0.root");
     readg.DisableAutoScheme();
     tlistg.AddToList(&readg);
@@ -95,11 +97,11 @@
     // --- Create and set up the eventloop (gammas) ---
     //
-    MEvtLoop evtloop;
-    evtloop.SetParList(&plist);
+    MEvtLoop evtloop1;
+    evtloop1.SetParList(&plist);
 
     //
     // --- Execute matrix buildup (gammas) ---
     //
-    if (!evtloop.Eventloop())
+    if (!evtloop1.Eventloop())
         return;
 
@@ -119,5 +121,5 @@
     //                 the hadrons
     // ---------------------------------------------
-    MReadMarsFile  readh("Events", "star_protons.root");
+    MReadMarsFile  readh("Events", "star_protons0.root");
     readh.DisableAutoScheme();
     tlisth.AddToList(&readh);
@@ -135,15 +137,15 @@
     // Create and set up the eventloop (protons)
     //
-    MEvtLoop evtloop;
-    evtloop.SetParList(&plist);
+    MEvtLoop evtloop2;
+    evtloop2.SetParList(&plist);
 
     //
     // Execute matrix buildup (hadrons)
     //
-    if (!evtloop.Eventloop())
+    if (!evtloop2.Eventloop())
         return;
 
     //  sum up in log
-    tlistg.PrintStatistics();
+    tlisth.PrintStatistics();
 
     matrix.Print("size");
@@ -165,6 +167,6 @@
     //          and one gamma file available
     // ----------------------------------------------------
-    MReadMarsFile read2("Events", "star_protons.root");
-    read2.AddFile("star_gammas.root");
+    MReadMarsFile read2("Events", "star_gammas0.root");
+    read2.AddFile("star_protons0.root");
     read2.DisableAutoScheme();
     tlist2.AddToList(&read2);
@@ -190,9 +192,9 @@
     //
     MProgressBar bar;
-    MEvtLoop evtloop;
-    evtloop.SetProgressBar(&bar);
-    evtloop.SetParList(&plist);
-
-    if (!evtloop.Eventloop())
+    MEvtLoop evtloop3;
+    evtloop3.SetProgressBar(&bar);
+    evtloop3.SetParList(&plist);
+
+    if (!evtloop3.Eventloop())
         return;
 
Index: trunk/MagicSoft/Mars/macros/star.C
===================================================================
--- trunk/MagicSoft/Mars/macros/star.C	(revision 2116)
+++ trunk/MagicSoft/Mars/macros/star.C	(revision 2124)
@@ -16,7 +16,7 @@
 !
 !
-!   Author(s): Thomas Bretz  5/2002 <mailto:tbretz@astro.uni-wuerzburg.de>
+!   Author(s): Thomas Bretz, 5/2002 <mailto:tbretz@astro.uni-wuerzburg.de>
 !
-!   Copyright: MAGIC Software Development, 2000-2002
+!   Copyright: MAGIC Software Development, 2000-2003
 !
 !
@@ -66,6 +66,5 @@
 
     // ------------- user change -----------------
-    read.AddFile("data/Gamma_z*.root");
-    //read.AddFile("Gam*.root");
+    read.AddFile("magictest/test/Gamma_z*.root");
 
     MMcPedestalCopy   pcopy;
@@ -76,4 +75,5 @@
     blind.SetUseInterpolation();
 
+    MSigmabarCalc     sgcal;
     MImgCleanStd      clean;
     MHillasCalc       hcalc;
@@ -81,10 +81,11 @@
 
     // ------------- user change -----------------
-    MWriteRootFile write("data/star_protons.root");
+    MWriteRootFile write("starfile.root");
+    write.AddContainer("MMcEvt",        "Events");
+    write.AddContainer("MSigmabar",     "Events");
     write.AddContainer("MHillas",       "Events");
     write.AddContainer("MHillasExt",    "Events");
+    write.AddContainer("MHillasSrc",    "Events");
     write.AddContainer("MNewImagePar",  "Events");
-    write.AddContainer("MMcEvt",        "Events");
-    write.AddContainer("MHillasSrc",    "Events");
     write.AddContainer("MRawRunHeader", "RunHeaders");
     write.AddContainer("MMcRunHeader",  "RunHeaders");
@@ -96,4 +97,5 @@
     tlist.AddToList(&ncalc);
     tlist.AddToList(&blind);
+    tlist.AddToList(&sgcal);
     tlist.AddToList(&clean);
     tlist.AddToList(&hcalc);
Index: trunk/MagicSoft/Mars/macros/status.C
===================================================================
--- trunk/MagicSoft/Mars/macros/status.C	(revision 2116)
+++ trunk/MagicSoft/Mars/macros/status.C	(revision 2124)
@@ -16,5 +16,5 @@
 !
 !
-!   Author(s): Thomas Bretz  4/2003 <mailto:tbretz@astro.uni-wuerzburg.de>
+!   Author(s): Thomas Bretz, 4/2003 <mailto:tbretz@astro.uni-wuerzburg.de>
 !
 !   Copyright: MAGIC Software Development, 2000-2003
@@ -61,8 +61,4 @@
     plist.AddToList(&src);
 
-    // Use MHillasExt instead of MHillas
-    MHillasExt hext;
-    plist.AddToList(&hext);
-
     //
     // The geometry container must be created by yourself to make sure
@@ -80,6 +76,5 @@
 
     // ------------- user change -----------------
-    read.AddFile("data/Pro*.root");
-    read.AddFile("data/Gam*.root");
+    read.AddFile("magictest/test/Gamma_z*.root");
 
     MMcPedestalCopy   pcopy;
@@ -90,4 +85,5 @@
     blind.SetUseInterpolation();
 
+    MSigmabarCalc     sgcal;
     MImgCleanStd      clean;
     MHillasCalc       hcalc;
@@ -97,6 +93,6 @@
     // -------------------------------------------
     MFillH hfill1("MHHillas", "MHillas");
-    MFillH hfill2("MHHillasExt [MHHillasExt]");
-    MFillH hfill3("MHHillasExtSrc [MHHillasExt]");
+    MFillH hfill2("MHHillasExt");
+    MFillH hfill3("MHHillasExtSrc [MHHillasExt]", "MHillasSrc");
     MFillH hfill4("MHHillasSrc","MHillasSrc");
     MFillH hfill4("MHNewImagePar","MNewImagePar");
@@ -104,16 +100,16 @@
     MFillH hfill6("MHCerPhotEvt", "MCerPhotEvt");
     MFillH hfill7("MHHadronness", "MHadronness");
+    MFillH hfill8("MHSigmaTheta");
 
     tlist.AddToList(&read);
     tlist.AddToList(&pcopy);
     tlist.AddToList(&pnsb);
-
     tlist.AddToList(&ncalc);
     tlist.AddToList(&blind);
+    tlist.AddToList(&sgcal);
     tlist.AddToList(&clean);
     tlist.AddToList(&hcalc);
     tlist.AddToList(&scalc);
     tlist.AddToList(&calc1);
-    tlist.AddToList(&hfill7);
     tlist.AddToList(&hfill1);
     tlist.AddToList(&hfill2);
@@ -122,4 +118,6 @@
     tlist.AddToList(&hfill5);
     tlist.AddToList(&hfill6);
+    tlist.AddToList(&hfill7);
+    tlist.AddToList(&hfill8);
 
     MEvtLoop evtloop;
@@ -142,5 +140,5 @@
     {
         // Save data in a postscriptfile (status.ps)
-       // d->SaveAsPS();
+        d->SaveAsPS();
         /*
          * ----------- Write status to a root file ------------
