Index: trunk/MagicSoft/Mars/mhflux/MHEnergyEst.cc
===================================================================
--- trunk/MagicSoft/Mars/mhflux/MHEnergyEst.cc	(revision 7690)
+++ trunk/MagicSoft/Mars/mhflux/MHEnergyEst.cc	(revision 7691)
@@ -71,4 +71,7 @@
     fTitle = title ? title : "3-D histogram   E-true E-est Theta";
 
+    fNameEnergy = "MEnergyEst";
+    fNameResult = "MinimizationValue";
+
     fHEnergy.SetDirectory(NULL);
     fHEnergy.SetName("EnergyEst");
@@ -184,4 +187,9 @@
 }
 
+// --------------------------------------------------------------------------
+//
+// Divide chisq and bias by number of executions
+// Print result
+//
 Bool_t MHEnergyEst::Finalize()
 {
@@ -191,4 +199,5 @@
     fResult->SetVal(fChisq);
 
+    *fLog << all << endl;
     Print();
 
@@ -196,9 +205,10 @@
 }
 
+// --------------------------------------------------------------------------
+//
+// Print result
+//
 void MHEnergyEst::Print(Option_t *o) const
 {
-    //    const Double_t resp =   TMath::Power(10,  res)-1;
-    //    const Double_t resm = 1-TMath::Power(10, -res);
-
     const Double_t res = TMath::Sqrt(fChisq-fBias*fBias);
     if (TMath::IsNaN(res))
@@ -209,5 +219,5 @@
 
     TH1D *h = (TH1D*)fHResolution.ProjectionZ("Resolution");
-    h->Fit("gaus", "Q0");
+    h->Fit("gaus", "Q0", "", -1.0, 0.25);
 
     TF1 *f = h->GetFunction("gaus");
@@ -225,4 +235,9 @@
 }
 
+// --------------------------------------------------------------------------
+//
+// Return Correction Coefficients (weights)
+// hist = E_mc/E_est
+//
 void MHEnergyEst::GetWeights(TH1D &hist) const
 {
@@ -301,5 +316,5 @@
             }
 
-            hx->Fit("gaus", "Q");
+            hx->Fit("gaus", "Q", "", -1.0, 0.25);
             gPad=NULL;
             gStyle->SetOptFit(101);
@@ -545,3 +560,2 @@
     fMatrix = NULL; 
 }
-
Index: trunk/MagicSoft/Mars/mhflux/MHEnergyEst.h
===================================================================
--- trunk/MagicSoft/Mars/mhflux/MHEnergyEst.h	(revision 7690)
+++ trunk/MagicSoft/Mars/mhflux/MHEnergyEst.h	(revision 7691)
@@ -22,9 +22,12 @@
 {
 private:
+    TString      fNameEnergy;
+    TString      fNameResult;
+
     MMcEvt      *fMcEvt;  //!
     MParameterD *fEnergy; //!
     MParameterD *fResult; //!
 
-    Int_t     fMap[100]; // FIXME!
+    Int_t        fMap[100]; // FIXME!
     MHMatrix    *fMatrix; //!
 
@@ -40,4 +43,5 @@
 
     Double_t GetVal(Int_t i) const;
+    void     CalcChisq(Double_t &chisq, Double_t &prob) const;
 
     Bool_t SetupFill(const MParList *pList);
@@ -58,5 +62,5 @@
     void Print(Option_t *o="") const;
 
-    ClassDef(MHEnergyEst, 1) //
+    ClassDef(MHEnergyEst, 2) //
 
 };
