Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 6953)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 6954)
@@ -111,4 +111,17 @@
      - changed RunEnergy such, that it can correctly treat
        MC files written by ganymed using wobble-mode
+
+   * mbase/MStatusDisplay.cc:
+     - fixed a possible crash in GetFullPad
+
+   * mhbase/MBinning.[h,cc]:
+     - implemented Copy Constructor
+
+   * mhflux/MHCollectionArea.h:
+     - call CalcEfficiency in Finalize
+
+   * mhflux/MHEnergyEst.[h,cc]:
+     - implemented GetWeights
+
 
 
Index: /trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc	(revision 6953)
+++ /trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc	(revision 6954)
@@ -766,15 +766,20 @@
 TVirtualPad *MStatusDisplay::GetFullPad(const Int_t i, const Int_t j)
 {
-  
-  TVirtualPad *vpad = GetCanvas(i)->GetPad(j);
-  if (vpad)
+    if (!GetCanvas(i))
+    {
+        *fLog << warn << "MStatusDisplay::GetFullPad: i-th canvas not dound." << endl;
+        return NULL;
+    }
+
+    TVirtualPad *vpad = GetCanvas(i)->GetPad(j);
+    if (!vpad)
+    {
+        *fLog << warn << "MStatusDisplay::GetFullPad: Pad is out of range." << endl;
+        return NULL;
+    }
+
     vpad->SetPad(0.,0.,1.,1.);
-  else
-    *fLog << warn << "MStatusDisplay::GetFullPad: Pad is out of range." << endl;
-
-  return vpad;
-}
-
-
+    return vpad;
+}
 
 // --------------------------------------------------------------------------
Index: /trunk/MagicSoft/Mars/mhbase/MBinning.cc
===================================================================
--- /trunk/MagicSoft/Mars/mhbase/MBinning.cc	(revision 6953)
+++ /trunk/MagicSoft/Mars/mhbase/MBinning.cc	(revision 6954)
@@ -78,4 +78,16 @@
 // --------------------------------------------------------------------------
 //
+// Copy Constructor. If necessary give also name and title.
+//
+MBinning::MBinning(const MBinning &bins, const char *name, const char *title)
+{
+    fName  = name  ? name  : gsDefName.Data();
+    fTitle = title ? title : gsDefTitle.Data();
+
+    SetEdges(bins);
+}
+
+// --------------------------------------------------------------------------
+//
 // Instantiate MBinning with nbins number of bins between lo (lower edge)
 // and hi (upper edge), name name and title title.
Index: /trunk/MagicSoft/Mars/mhbase/MBinning.h
===================================================================
--- /trunk/MagicSoft/Mars/mhbase/MBinning.h	(revision 6953)
+++ /trunk/MagicSoft/Mars/mhbase/MBinning.h	(revision 6954)
@@ -40,5 +40,5 @@
     MBinning(const char *name=NULL, const char *title=NULL);
     MBinning(Int_t nbins, Axis_t lo, Axis_t hi, const char *name=0, const char *opt="", const char *title=NULL);
-    MBinning(const MBinning &bins) { SetEdges(bins); }
+    MBinning(const MBinning &bins, const char *name=NULL, const char *title=NULL);
     MBinning(const TH1 &h, const Char_t axis='x', const char *name=0, const char *title=0);
     MBinning(const TAxis &a, const char *name=0, const char *title=0);
Index: /trunk/MagicSoft/Mars/mhflux/MHCollectionArea.h
===================================================================
--- /trunk/MagicSoft/Mars/mhflux/MHCollectionArea.h	(revision 6953)
+++ /trunk/MagicSoft/Mars/mhflux/MHCollectionArea.h	(revision 6954)
@@ -36,4 +36,5 @@
 
     void Calc(TH2D &hsel, TH2D &hall);
+    void CalcEfficiency();
 
 public:
@@ -43,9 +44,8 @@
     Bool_t ReInit(MParList *pList);
     Bool_t Fill(const MParContainer *par, const Stat_t weight=1);
+    Bool_t Finalize() { CalcEfficiency(); return kTRUE; }
 
     void Draw(Option_t *option="");
     void Paint(Option_t *option="");
-
-    void CalcEfficiency();
 
     void SetHistAll(const TH2D &h) { h.Copy(fHistAll); fIsExtern=kTRUE; }
@@ -53,4 +53,5 @@
     TH2D &GetHistAll()             { return fHistAll; }
     const TH2D &GetHistAll() const { return fHistAll; }
+    const TH1D &GetHEnergy() const { return fHEnergy; }
 
 /*
Index: /trunk/MagicSoft/Mars/mhflux/MHEnergyEst.cc
===================================================================
--- /trunk/MagicSoft/Mars/mhflux/MHEnergyEst.cc	(revision 6953)
+++ /trunk/MagicSoft/Mars/mhflux/MHEnergyEst.cc	(revision 6954)
@@ -219,4 +219,22 @@
 }
 
+void MHEnergyEst::GetWeights(TH1D &hist) const
+{
+    // Project into EnergyEst_ey
+    TH1D *h1 = (TH1D*)fHEnergy.Project3D("rtlprmft_ex");
+    TH1D *h2 = (TH1D*)fHEnergy.Project3D("rtlprmft_ey");
+
+    h1->Copy(hist);
+    hist.Divide(h2);
+
+    delete h1;
+    delete h2;
+
+    hist.SetNameTitle("EnergyRatio", "Ratio between estimated and monte carlo energy");
+    hist.SetXTitle("E [GeV]");
+    hist.SetYTitle("N_{est}/N_{mc} [1]");
+    hist.SetDirectory(0);
+}
+
 void MHEnergyEst::Paint(Option_t *opt)
 {
Index: /trunk/MagicSoft/Mars/mhflux/MHEnergyEst.h
===================================================================
--- /trunk/MagicSoft/Mars/mhflux/MHEnergyEst.h	(revision 6953)
+++ /trunk/MagicSoft/Mars/mhflux/MHEnergyEst.h	(revision 6954)
@@ -49,4 +49,5 @@
 
     const TH3D &GetHEnergy() const { return fHEnergy; }
+    void GetWeights(TH1D &hist) const;
 
     void InitMapping(MHMatrix *mat);
Index: /trunk/MagicSoft/Mars/mjobs/MJCut.cc
===================================================================
--- /trunk/MagicSoft/Mars/mjobs/MJCut.cc	(revision 6953)
+++ /trunk/MagicSoft/Mars/mjobs/MJCut.cc	(revision 6954)
@@ -214,5 +214,5 @@
 
     TFile *file = 0;
-    if (fNameResult.IsNull())
+    if (fNameResult.IsNull() && fStoreResult)
     {
         file = (TFile*)gROOT->GetListOfFiles()->FindObject(oname);
