Index: trunk/MagicSoft/Mars/mhist/MFillHFadc.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MFillHFadc.cc	(revision 853)
+++ trunk/MagicSoft/Mars/mhist/MFillHFadc.cc	(revision 855)
@@ -112,5 +112,5 @@
 Bool_t MFillHFadc::PostProcess()
 {
-    fHistos->SetHasChanged();
+    fHistos->SetReadyToSave();
     return kTRUE;
 }
Index: trunk/MagicSoft/Mars/mhist/MFillHHillas.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MFillHHillas.cc	(revision 853)
+++ trunk/MagicSoft/Mars/mhist/MFillHHillas.cc	(revision 855)
@@ -75,5 +75,5 @@
 Bool_t MFillHHillas::PostProcess()
 {
-    fHistos->SetHasChanged();
+    fHistos->SetReadyToSave();
     return kTRUE;
 }
Index: trunk/MagicSoft/Mars/mhist/MFillHStarMap.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MFillHStarMap.cc	(revision 853)
+++ trunk/MagicSoft/Mars/mhist/MFillHStarMap.cc	(revision 855)
@@ -76,6 +76,5 @@
 Bool_t MFillHStarMap::PostProcess()
 {
-    fHistos->SetHasChanged();
-
+    fHistos->SetReadyToSave();
     return kTRUE;
 } 
Index: trunk/MagicSoft/Mars/mhist/MHMcEnergies.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHMcEnergies.h	(revision 853)
+++ trunk/MagicSoft/Mars/mhist/MHMcEnergies.h	(revision 855)
@@ -30,5 +30,5 @@
     void AddEntriesToList(MParList *plist);
 
-    MHMcEnergy &operator[](UInt_t idx) { return (MHMcEnergy&)fHists[idx]; }
+    MHMcEnergy &operator[](UInt_t idx) { return *(MHMcEnergy*)(*fHists)[idx]; }
 
     ClassDef(MHMcEnergies, 1)  // container to hold several MHMcEnergy histograms
Index: trunk/MagicSoft/Mars/mhist/MHMcEnergy.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHMcEnergy.cc	(revision 853)
+++ trunk/MagicSoft/Mars/mhist/MHMcEnergy.cc	(revision 855)
@@ -29,4 +29,5 @@
 #include <TH1.h> 
 #include <TF1.h> 
+#include <TCanvas.h>
 #include <TPaveLabel.h> 
 
@@ -58,4 +59,6 @@
         sprintf(aux+10, ";%i", idx);
     hLogEner = new TH1F(aux, "", 100, 0.5, 4.5);
+    hLogEner->SetXTitle("log(E) [GeV]");
+    hLogEner->SetYTitle("dN/dE");
     //hLogEner->SetBins(60);
 }
@@ -75,9 +78,12 @@
 {
     //
+    // 0: don't draw the function (it is drawn together with the histogram)
+    // +: add these function to the list of fits. Don't delete the last fit.
+    //
     // FIXME: R means: use the range specified in the function (xxmin, xxmax are ignored!)
     //        Q means: quiet (why?)
     //
     //
-    hLogEner->Fit(fLogEner->GetName(), "RQ", "", xxmin, xxmax);
+    hLogEner->Fit(fLogEner->GetName(), "Q0+", "", xxmin, xxmax);
 }
 
@@ -92,12 +98,15 @@
     const Float_t sum = min+max;
 
+    TCanvas *c=new TCanvas("Energy Distribution","Energy distribution for triggered events");
+
+    hLogEner->Draw(option);
+
     TPaveLabel* label = new TPaveLabel(2.2, 0.75*sum, 4.4, 0.90*sum, text);
-
-    hLogEner->SetYTitle("dN/dE") ;
-    hLogEner->SetXTitle("log(E) [GeV]") ;
-    hLogEner->Draw(option) ;
     label->SetFillColor(10);
     label->SetTextSize(0.3);
     label->Draw();
+
+    c->Modified();
+    c->Update();
 }
 
