Index: trunk/MagicSoft/Mars/mhist/MHMcCollectionArea.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHMcCollectionArea.cc	(revision 863)
+++ trunk/MagicSoft/Mars/mhist/MHMcCollectionArea.cc	(revision 867)
@@ -26,6 +26,6 @@
 #include "MHMcCollectionArea.h" 
 
-#include <MLog.h>
-#include <TH2.h> 
+#include <TH2.h>
+#include <TCanvas.h>
 
 ClassImp(MHMcCollectionArea);
@@ -49,14 +49,25 @@
 
 
-    fHistAll = new TH2D("collAreaAll", "all showers - Radius vs log(E) distribution",
+    fHistAll = new TH2D("All Events", "All showers - Radius vs log(E) distribution",
                         50, 0., 5.,
                         50, 0., 500.);
 
-    fHistSel = new TH2D("collAreaSel", "selected showers - Radius vs log(E) distribution",
+    fHistAll->SetXTitle("log(E/GeV)");
+    fHistAll->SetYTitle("r/m");
+    fHistAll->SetZTitle("N");
+
+    fHistSel = new TH2D("Selected Events", "Selected showers - Radius vs log(E) distribution",
                         50, 0., 5.,
                         50, 0., 500.);
 
-    fHistCol = new TH1D("collArea", "Collection Area",
+    fHistSel->SetXTitle("log(E/GeV)");
+    fHistSel->SetYTitle("r/m");
+    fHistSel->SetYTitle("N");
+
+    fHistCol = new TH1D("Area", "Collection Area vs. log(E)",
                         50, 0., 5.);
+
+    fHistCol->SetXTitle("log(E/GeV)");
+    fHistCol->SetYTitle("A/m^2");
 }
 
@@ -78,17 +89,32 @@
 }
 
-void MHMcCollectionArea::DrawAll()
+void MHMcCollectionArea::DrawAll(Option_t* option)
 {
-    fHistAll->Draw();
+    TCanvas *c=new TCanvas(fHistAll->GetName(), fHistAll->GetTitle());
+
+    fHistSel->Draw(option);
+
+    c->Modified();
+    c->Update();
 }
 
-void MHMcCollectionArea::DrawSel()
+void MHMcCollectionArea::DrawSel(Option_t* option)
 {
-    fHistSel->Draw();
+    TCanvas *c=new TCanvas(fHistSel->GetName(), fHistSel->GetTitle());
+
+    fHistSel->Draw(option);
+
+    c->Modified();
+    c->Update();
 }
 
 void MHMcCollectionArea::Draw(Option_t* option)
 {
+    TCanvas *c=new TCanvas(fHistCol->GetName(), fHistCol->GetTitle());
+
     fHistCol->Draw(option);
+
+    c->Modified();
+    c->Update();
 }
 
Index: trunk/MagicSoft/Mars/mhist/MHMcCollectionArea.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHMcCollectionArea.h	(revision 863)
+++ trunk/MagicSoft/Mars/mhist/MHMcCollectionArea.h	(revision 867)
@@ -21,19 +21,22 @@
 {
 private:
-    TH2D  *fHistAll ; //! all simulated showers
-    TH2D  *fHistSel ; //! the selected showers
-    TH1D  *fHistCol ; //  the collection area
+    TH2D *fHistAll; //! all simulated showers
+    TH2D *fHistSel; //! the selected showers
+
+    TH1D *fHistCol; //  the collection area
 
 public:
 
-    MHMcCollectionArea(const char *name=NULL, const char *title=NULL) ;
-    ~MHMcCollectionArea() ;
+    MHMcCollectionArea(const char *name=NULL, const char *title=NULL);
+    ~MHMcCollectionArea();
 
-    void FillAll(Float_t log10E, Float_t radius) ;
-    void FillSel(Float_t log10E, Float_t radius) ;
-    void DrawAll() ;
-    void DrawSel() ;
-    void Draw(Option_t* option = "") ;
-    void CalcEfficiency() ;
+    void FillAll(Float_t log10E, Float_t radius);
+    void FillSel(Float_t log10E, Float_t radius);
+
+    void DrawAll(Option_t *option = "");
+    void DrawSel(Option_t *option = "");
+    void Draw   (Option_t *option = "");
+
+    void CalcEfficiency();
 
     ClassDef(MHMcCollectionArea, 1)  //  Data Container to calculate Collection Area
Index: trunk/MagicSoft/Mars/mhist/MHMcEnergies.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHMcEnergies.cc	(revision 863)
+++ trunk/MagicSoft/Mars/mhist/MHMcEnergies.cc	(revision 867)
@@ -66,4 +66,5 @@
     delete fHists;
 }
+
 // --------------------------------------------------------------------------
 //
Index: trunk/MagicSoft/Mars/mhist/MHMcEnergy.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHMcEnergy.cc	(revision 863)
+++ trunk/MagicSoft/Mars/mhist/MHMcEnergy.cc	(revision 867)
@@ -51,23 +51,22 @@
 
     if (idx>0)
-        sprintf(aux+10, ";%i", idx);
+        sprintf(aux+strlen(aux), ";%i", idx);
+
     *fName  = name  ? name  : aux;
-    *fTitle = title ? title : "Container for a MC energy histogram" ;
+    *fTitle = title ? title : "Container for an energy distribution histogram" ;
 
-    //  - we initialize the histogram and the gaus function
+    //  - we initialize the histogram
     //  - we have to give diferent names for the diferent histograms because
     //    root don't allow us to have diferent histograms with the same name
 
-    strcpy(aux, "fLogEnergy");
+    char text[256];
+    sprintf(text, "Energy Distribution for trigger condition #%i", idx);
+
+    strcpy(aux, "log(E)");
     if (idx>0)
-        sprintf(aux+10, ";%i", idx);
-    fLogEner = new TF1(aux, "gaus", 1., 3.);
-
-    strcpy(aux, "hLogEnergy");
-    if (idx>0)
-        sprintf(aux+10, ";%i", idx);
-    hLogEner = new TH1F(aux, "", 40, 0.5, 4.5);
-    hLogEner->SetXTitle("log(E) [GeV]");
-    hLogEner->SetYTitle("dN/dE");
+        sprintf(aux+strlen(aux), " #%i", idx);
+    fHist = new TH1F(aux, text, 40, 0.5, 4.5);
+    fHist->SetXTitle("log(E/GeV)");
+    fHist->SetYTitle("dN/dE");
 }
 
@@ -78,6 +77,5 @@
 MHMcEnergy::~MHMcEnergy()
 {
-    delete hLogEner;
-    delete fLogEner;
+    delete fHist;
 }
 
@@ -88,5 +86,5 @@
 void MHMcEnergy::Fill(Float_t log10E, Float_t w)
 {
-    hLogEner->Fill(log10E, w);
+    fHist->Fill(log10E, w);
 }
 
@@ -101,5 +99,12 @@
     // Q: quiet mode
     //
-    hLogEner->Fit(fLogEner->GetName(), "Q0", "", xxmin, xxmax);
+    fHist->Fit("gaus", "Q0", "", xxmin, xxmax);
+
+    TF1 *result = fHist->GetFunction("gaus");
+
+    fThreshold    = CalcThreshold(result);
+    fThresholdErr = CalcThresholdErr(result);
+    fGaussPeak    = CalcGaussPeak(result);
+    fGaussSigma   = CalcGaussSigma(result);
 }
 
@@ -110,19 +115,21 @@
 void MHMcEnergy::Draw(Option_t *option)
 {
-    char text[50];
-    sprintf(text, "Energy Threshold = %4.1f +- %4.1f GeV",
-            GetThreshold(), GetThresholdErr());
+    char text[256];
 
-    const Float_t min = hLogEner->GetMinimum();
-    const Float_t max = hLogEner->GetMaximum();
+    const Float_t min = fHist->GetMinimum();
+    const Float_t max = fHist->GetMaximum();
     const Float_t sum = min+max;
 
-    TCanvas *c=new TCanvas("Energy Distribution","Energy distribution for triggered events");
+    TCanvas *c=new TCanvas(fHist->GetName(), fHist->GetTitle());
 
-    hLogEner->Draw(option);
+    fHist->Draw(option);
+
+    sprintf(text, "Energy Threshold = %4.1f +- %4.1f GeV",
+            fThreshold, fThresholdErr);
 
     TPaveLabel* label = new TPaveLabel(2.2, 0.75*sum, 4.4, 0.90*sum, text);
     label->SetFillColor(10);
     label->SetTextSize(0.3);
+    label->SetBit(kCanDelete);
     label->Draw();
 
@@ -137,5 +144,5 @@
 void MHMcEnergy::SetNumBins(Int_t nbins)
 {
-    hLogEner->SetBins(nbins, 0.5, 4.5);
+    fHist->SetBins(nbins, 0.5, 4.5);
 }
 // --------------------------------------------------------------------------
@@ -145,5 +152,5 @@
 void MHMcEnergy::Print(Option_t*)
 {
-    cout << "Threshold: " << GetThreshold() << " +- " << GetThresholdErr() << endl;
+    cout << "Threshold: " << fThreshold << " +- " << fThresholdErr << endl;
 }
 
@@ -152,7 +159,7 @@
 //  Return the threshold
 //
-Float_t MHMcEnergy::GetThreshold() const
+Float_t MHMcEnergy::CalcThreshold(TF1 *gauss)
 {
-    const Float_t p1 = fLogEner->GetParameter(1);
+    const Float_t p1 = gauss->GetParameter(1);
 
     return pow(10, p1);
@@ -163,9 +170,9 @@
 // Return the error of the threshold.
 //
-Float_t MHMcEnergy::GetThresholdErr() const
+Float_t MHMcEnergy::CalcThresholdErr(TF1 *gauss)
 {
     const Float_t lg10  = log(10);
-    const Float_t p1    = fLogEner->GetParameter(1);
-    const Float_t p1err = fLogEner->GetParError(1);
+    const Float_t p1    = gauss->GetParameter(1);
+    const Float_t p1err = gauss->GetParError(1);
 
     // The error has into accuont the error in the fit
@@ -177,7 +184,7 @@
 // Return the peak of the fitted gaussan function.
 //
-Float_t MHMcEnergy::GetGaussPeak() const
+Float_t MHMcEnergy::CalcGaussPeak(TF1 *gauss)
 {
-    return fLogEner->GetParameter(1);
+    return gauss->GetParameter(1);
 }
 
@@ -186,7 +193,7 @@
 // Return the sigma of the fitted gaussan function.
 //
-Float_t MHMcEnergy::GetGaussSigma() const
+Float_t MHMcEnergy::CalcGaussSigma(TF1 *gauss)
 {
-    return fLogEner->GetParameter(2);
+    return gauss->GetParameter(2);
 }
 
Index: trunk/MagicSoft/Mars/mhist/MHMcEnergy.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHMcEnergy.h	(revision 863)
+++ trunk/MagicSoft/Mars/mhist/MHMcEnergy.h	(revision 867)
@@ -16,6 +16,16 @@
 private:
 
-    TH1F *hLogEner;  // histogram with the logarith of the energy
-    TF1  *fLogEner;  // gausian function to fit the histogram
+    TH1F *fHist;  // histogram with the logarith of the energy
+
+    Float_t fThreshold;
+    Float_t fThresholdErr;
+    Float_t fGaussPeak;
+    Float_t fGaussSigma;
+
+    Float_t CalcThreshold(TF1 *gauss);
+    Float_t CalcThresholdErr(TF1 *gauss);
+
+    Float_t CalcGaussPeak(TF1 *gauss);
+    Float_t CalcGaussSigma(TF1 *gauss);
 
 public:
@@ -24,9 +34,9 @@
     ~MHMcEnergy();
 
-    Float_t GetThreshold() const;
-    Float_t GetThresholdErr() const;
+    Float_t GetThreshold() const { return fThreshold; }
+    Float_t GetThresholdErr() const { return fThresholdErr; }
 
-    Float_t GetGaussPeak() const;
-    Float_t GetGaussSigma() const;
+    Float_t GetGaussPeak() const { return fGaussPeak; }
+    Float_t GetGaussSigma() const { return fGaussSigma; };
 
     void Fill(Float_t log10E, Float_t w);
