Index: trunk/MagicSoft/Mars/mhist/MFillH.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MFillH.cc	(revision 1003)
+++ trunk/MagicSoft/Mars/mhist/MFillH.cc	(revision 1004)
@@ -60,6 +60,6 @@
 void MFillH::Init(const char *name, const char *title)
 {
-    *fName  = name  ? name  : "MFillH";
-    *fTitle = title ? title : "Task to fill Mars histograms";
+    fName  = name  ? name  : "MFillH";
+    fTitle = title ? title : "Task to fill Mars histograms";
 
     fH            = NULL;
@@ -162,4 +162,11 @@
     }
 
+    if (!fH->InheritsFrom("MH"))
+    {
+        *fLog << dbginf << fH->GetName() << " [" << fH->ClassName();
+        *fLog << "] doesn't inherit from MH - cannot be used for MFillH... aborting." << endl;
+        return kFALSE;
+    }
+
     return kTRUE;
 }
Index: trunk/MagicSoft/Mars/mhist/MH.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MH.h	(revision 1003)
+++ trunk/MagicSoft/Mars/mhist/MH.h	(revision 1004)
@@ -10,10 +10,17 @@
 #endif
 
+class TCanvas;
+
 class MH : public MParContainer
 {
 public:
-     MH(const char *name=NULL, const char *title=NULL);
+    MH(const char *name=NULL, const char *title=NULL);
 
     virtual void Fill(const MParContainer *par) = 0;
+
+    static TCanvas *MakeDefCanvas(const char *name=NULL, const char *title="",
+                                  const UInt_t w=700, const UInt_t h=500);
+    static TCanvas *MakeDefCanvas(const TObject *obj,
+                                  const UInt_t w=700, const UInt_t h=500);
 
     ClassDef(MH, 1) //A histogram base class for Mars histograms
Index: trunk/MagicSoft/Mars/mhist/MHFadcCam.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHFadcCam.cc	(revision 1003)
+++ trunk/MagicSoft/Mars/mhist/MHFadcCam.cc	(revision 1004)
@@ -34,6 +34,4 @@
 #include "MHFadcCam.h"
 
-#include <TH1.h>
-
 #include "MRawEvtData.h"
 #include "MRawEvtPixelIter.h"
@@ -52,6 +50,6 @@
     //
     
-    *fName  = name  ? name  : "MHFadcCam" ;
-    *fTitle = title ? title : "Container for ADC spectra histograms" ;
+    fName  = name  ? name  : "MHFadcCam" ;
+    fTitle = title ? title : "Container for ADC spectra histograms" ;
 
     //
@@ -72,4 +70,5 @@
 }
 
+// --------------------------------------------------------------------------
 void MHFadcCam::Fill(const MParContainer *par)
 {
@@ -113,6 +112,6 @@
     //
 
-    fHistLo->Write() ;
-    fHistHi->Write() ;
+    fHistLo->Write();
+    fHistHi->Write();
 }
 
Index: trunk/MagicSoft/Mars/mhist/MHFadcCam.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHFadcCam.h	(revision 1003)
+++ trunk/MagicSoft/Mars/mhist/MHFadcCam.h	(revision 1004)
@@ -17,5 +17,7 @@
 #endif
 
-class TH1F;
+#ifndef ROOT_TH1
+#include <TH1.h>
+#endif
 
 class MHFadcCam : public MH
Index: trunk/MagicSoft/Mars/mhist/MHFadcPix.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHFadcPix.cc	(revision 1003)
+++ trunk/MagicSoft/Mars/mhist/MHFadcPix.cc	(revision 1004)
@@ -35,5 +35,8 @@
 #include "MHFadcPix.h"
 
+#include <TH1.h>
 #include <TPad.h>
+
+#include "MH.h"
 
 ClassImp(MHFadcPix);
@@ -43,23 +46,29 @@
 // Creates the histograms for lo and hi gain of one pixel
 //
-MHFadcPix::MHFadcPix(UInt_t pixid)
+MHFadcPix::MHFadcPix(UInt_t pixid) : fPixId(pixid)
 {
-    // FIXME! Set the right axis titles and ... and ...
-    Char_t tmp1[40];
-    Char_t tmp2[40];
+    Char_t *name  = StrDup(pixid ? Form("HiGain%03d", pixid) : "HiGain");
+    Char_t *title = StrDup(pixid ? Form("Hi Gain Pixel #%d", pixid) : "Hi Gain Samples");
 
-    //    if (pixid)
-    //    {
-    sprintf(tmp1, "HiGain%03d", pixid);
-    sprintf(tmp2, "Hi Gain Pixel #%d", pixid);
-    //    }
-    fHistHi =  new TH1F(tmp1, tmp2, 256, 0, 255);
+    fHistHi =  new TH1F(name, title, 256, 0, 255);
 
-    //    if (pixid)
-    //    {
-    sprintf(tmp1, "LoGain%03d", pixid);
-    sprintf(tmp2, "Lo Gain Pixel #%d", pixid);
-    //    }
-    fHistLo = new TH1F(tmp2, tmp2, 256, 0, 255);
+    fHistHi->SetDirectory(NULL);
+    fHistHi->SetXTitle("Time/Slices");
+    fHistHi->SetYTitle("Signal");
+
+    delete [] name;
+    delete [] title;
+
+    name  = StrDup(pixid ? Form("LoGain%03d", pixid) : "LoGain");
+    title = StrDup(pixid ? Form("Lo Gain Pixel #%d", pixid) : "Lo Gain Samples");
+
+    fHistLo = new TH1F(name, title, 256, 0, 255);
+
+    fHistLo->SetDirectory(NULL);
+    fHistLo->SetXTitle("Time/Slices");
+    fHistLo->SetYTitle("Signal");
+
+    delete [] name;
+    delete [] title;
 }
 
@@ -72,19 +81,45 @@
 
 // --------------------------------------------------------------------------
+inline void MHFadcPix::FillHi(Byte_t i)
+{
+    fHistHi->Fill(i);
+}
+
+// --------------------------------------------------------------------------
+inline void MHFadcPix::FillLo(Byte_t i)
+{
+    fHistLo->Fill(i);
+}
+
+// --------------------------------------------------------------------------
+inline void MHFadcPix::DrawHi()
+{
+    fHistHi->Draw();
+}
+
+// --------------------------------------------------------------------------
+inline void MHFadcPix::DrawLo()
+{
+    fHistLo->Draw();
+}
+
+// --------------------------------------------------------------------------
 void MHFadcPix::Draw(Option_t *)
 {
     if (!gPad)
     {
-        if (!gROOT->GetMakeDefCanvas())
-            return;
-        (gROOT->GetMakeDefCanvas())();
+        const char *name  = StrDup(fPixId ? Form("Pixel #%d", fPixId) : "Pixel");
+        const char *title = StrDup(fPixId ? Form("%s FADC Samples", name) : "FADC Samples");
+        MH::MakeDefCanvas(name, title);
+        delete [] name;
+        delete [] title;
     }
 
     gPad->Divide(1, 2);
 
-    gPad->cd(0);
+    gPad->cd(1);
     fHistHi->Draw();
 
-    gPad->cd(1);
+    gPad->cd(2);
     fHistLo->Draw();
 }
Index: trunk/MagicSoft/Mars/mhist/MHFadcPix.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHFadcPix.h	(revision 1003)
+++ trunk/MagicSoft/Mars/mhist/MHFadcPix.h	(revision 1004)
@@ -6,7 +6,9 @@
 #endif
 
-#ifndef ROOT_TH1
-#include <TH1.h>
-#endif
+//#ifndef ROOT_TH1
+//#include <TH1.h>
+//#endif
+
+class TH1F;
 
 class MHFadcPix : public TObject
@@ -15,4 +17,6 @@
     TH1F *fHistHi;
     TH1F *fHistLo;
+
+    UInt_t fPixId;
 
 public:
@@ -23,9 +27,9 @@
     TH1F *GetHistLo() { return fHistLo; }
 
-    void FillHi(Byte_t i) { fHistHi->Fill(i); }
-    void FillLo(Byte_t i) { fHistLo->Fill(i); }
+    void FillHi(Byte_t i);
+    void FillLo(Byte_t i);
 
-    void DrawHi() { fHistHi->Draw(); }
-    void DrawLo() { fHistLo->Draw(); }
+    void DrawHi();
+    void DrawLo();
 
     void Draw(Option_t *opt=NULL);
Index: trunk/MagicSoft/Mars/mhist/MHHillas.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHHillas.cc	(revision 1003)
+++ trunk/MagicSoft/Mars/mhist/MHHillas.cc	(revision 1004)
@@ -26,14 +26,8 @@
 {
     //
-    //  default constructor
-    //  creates an a list of histograms for all pixels and both gain channels
-    //
-
-    //
     //   set the name and title of this object
     //
-    
-    *fName  = name  ? name  : "MHHillas" ;
-    *fTitle = title ? title : "Container for Hillas histograms" ;
+    fName  = name  ? name  : "MHHillas" ;
+    fTitle = title ? title : "Container for Hillas histograms" ;
 
     //
@@ -42,11 +36,13 @@
     // connect all the histogram with the container fHist
     //
-    // FIXME! Make the histograms looking that they can be used for
-    //        presentations (axis title, ...)
-    //
     fAlpha  = new TH1F("Alpha [deg]", "Alpha of Hillas",   90, 0,  90);
     fWidth  = new TH1F("Width [mm]",  "Width of Hillas",  100, 0, 300);
     fLength = new TH1F("Length [mm]", "Length of Hillas", 100, 0, 300);
     fDist   = new TH1F("Dist [mm]",   "Dist of Hillas",   100, 0, 300);
+
+    fAlpha->SetDirectory(NULL);
+    fLength->SetDirectory(NULL);
+    fDist->SetDirectory(NULL);
+    fWidth->SetDirectory(NULL);
 
     fAlpha->GetXaxis()->SetTitle("Alpha [deg]");
@@ -98,6 +94,6 @@
 TObject *MHHillas::DrawClone(Option_t *opt) const
 {
-    TCanvas *c = new TCanvas("Hillas", "Histograms of Hillas Parameters");
-    c->Divide(2,2);
+    TCanvas *c = MakeDefCanvas("Hillas", "Histograms of Hillas Parameters");
+    c->Divide(2, 2);
 
     gROOT->SetSelectedPad(NULL);
@@ -107,14 +103,14 @@
     //
     c->cd(1);
-    fAlpha->DrawClone()->SetBit(kCanDelete);
+    fAlpha->DrawCopy();
 
     c->cd(2);
-    fLength->DrawClone()->SetBit(kCanDelete);
+    fLength->DrawCopy();
 
     c->cd(3);
-    fDist->DrawClone()->SetBit(kCanDelete);
+    fDist->DrawCopy();
 
     c->cd(4);
-    fWidth->DrawClone()->SetBit(kCanDelete);
+    fWidth->DrawCopy();
 
     c->Modified();
@@ -133,11 +129,6 @@
 {
     if (!gPad)
-    {
-        if (!gROOT->GetMakeDefCanvas())
-            return;
-        (gROOT->GetMakeDefCanvas())();
-    }
+        MakeDefCanvas("Hillas", "Histograms of Hillas Parameters");
 
-    //TCanvas *c = new TCanvas("Hillas", "Histograms of Hillas Parameters");
     gPad->Divide(2,2);
 
Index: trunk/MagicSoft/Mars/mhist/MHMcCollectionArea.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHMcCollectionArea.cc	(revision 1003)
+++ trunk/MagicSoft/Mars/mhist/MHMcCollectionArea.cc	(revision 1004)
@@ -29,4 +29,6 @@
 #include <TCanvas.h>
 
+#include "MH.h"
+
 ClassImp(MHMcCollectionArea);
 
@@ -48,29 +50,43 @@
 
   
-    *fName  = name  ? name  : "MHMcCollectionArea";
-    *fTitle = title ? title : "Data to Calculate Coll-Area";
-
-
-    fHistAll = new TH2D("AllEvents", "All showers - Radius vs log(E) distribution",
-                        50, 0., 5.,
-                        50, 0., 500.);
-
-    fHistAll->SetXTitle("log(E/GeV)");
-    fHistAll->SetYTitle("r/m");
+    fName  = name  ? name  : "MHMcCollectionArea";
+    fTitle = title ? title : "Data to Calculate Collection Area";
+
+    const Int_t  nbins = 50;
+    const Float_t maxx = 5;
+    const Float_t maxy = 500;
+
+    Float_t *binsx = new Float_t[nbins+1];
+    for (int i=0; i<nbins+1; i++)
+        binsx[i] = pow(10, maxx*i/nbins);
+
+    Float_t *binsy = new Float_t[nbins+1];
+    for (int i=0; i<nbins+1; i++)
+        binsy[i] = maxy*i/nbins;
+
+    fHistAll = new TH2D("AllEvents", "All showers - Radius vs Energy distribution",
+                        nbins, binsx, nbins, binsy);
+    fHistSel = new TH2D("SelectedEvents", "Selected showers - Radius vs Energy distribution",
+                        nbins, binsx, nbins, binsy);
+    fHistCol = new TH1D("CollectionArea", "Collection Area vs. Energy",
+                        nbins, binsx);
+
+    delete binsx;
+    delete binsy;
+
+    fHistAll->SetDirectory(NULL);
+    fHistSel->SetDirectory(NULL);
+    fHistCol->SetDirectory(NULL);
+
+    fHistAll->SetXTitle("E [GeV]");
+    fHistAll->SetYTitle("r [m]");
     fHistAll->SetZTitle("N");
 
-    fHistSel = new TH2D("SelectedEvents", "Selected showers - Radius vs log(E) distribution",
-                        50, 0., 5.,
-                        50, 0., 500.);
-
-    fHistSel->SetXTitle("log(E/GeV)");
-    fHistSel->SetYTitle("r/m");
+    fHistSel->SetXTitle("E [GeV]");
+    fHistSel->SetYTitle("r [m]");
     fHistSel->SetYTitle("N");
 
-    fHistCol = new TH1D("CollectionArea", "Collection Area vs. log(E)",
-                        50, 0., 5.);
-
-    fHistCol->SetXTitle("log(E/GeV)");
-    fHistCol->SetYTitle("A/m^{2}");
+    fHistCol->SetXTitle("E [GeV]");
+    fHistCol->SetYTitle("A [m^{2}]");
 }
 
@@ -90,7 +106,7 @@
 // Fill data into the histogram which contains all showers
 //
-void MHMcCollectionArea::FillAll(Float_t log10E, Float_t radius)
-{
-    fHistAll->Fill(log10E, radius);
+void MHMcCollectionArea::FillAll(Float_t energy, Float_t radius)
+{
+    fHistAll->Fill(energy, radius);
 }
 
@@ -99,7 +115,7 @@
 // Fill data into the histogram which contains the selected showers
 //
-void MHMcCollectionArea::FillSel(Float_t log10E, Float_t radius)
-{
-    fHistSel->Fill(log10E, radius);
+void MHMcCollectionArea::FillSel(Float_t energy, Float_t radius)
+{
+    fHistSel->Fill(energy, radius);
 }
 
@@ -111,13 +127,9 @@
 {
     if (!gPad)
-    {
-        if (!gROOT->GetMakeDefCanvas())
-            return;
-        (gROOT->GetMakeDefCanvas())();
-    }
-
-    //TCanvas *c=new TCanvas(fHistAll->GetName(), fHistAll->GetTitle());
+        MH::MakeDefCanvas(fHistAll);
 
     fHistAll->Draw(option);
+
+    gPad->SetLogx();
 
     gPad->Modified();
@@ -132,13 +144,9 @@
 {
     if (!gPad)
-    {
-        if (!gROOT->GetMakeDefCanvas())
-            return;
-        (gROOT->GetMakeDefCanvas())();
-    }
-
-    //TCanvas *c=new TCanvas(fHistSel->GetName(), fHistSel->GetTitle());
+        MH::MakeDefCanvas(fHistSel);
 
     fHistSel->Draw(option);
+
+    gPad->SetLogx();
 
     gPad->Modified();
@@ -154,5 +162,5 @@
 TObject *MHMcCollectionArea::DrawClone(Option_t* option) const
 {
-    TCanvas *c=new TCanvas(fHistCol->GetName(), fHistCol->GetTitle());
+    TCanvas *c = MH::MakeDefCanvas(fHistCol);
 
     //
@@ -161,5 +169,7 @@
     gROOT->SetSelectedPad(NULL);
 
-    fHistCol->DrawClone(option);
+    fHistCol->DrawCopy(option);
+
+    gPad->SetLogx();
 
     c->Modified();
@@ -172,12 +182,9 @@
 {
     if (!gPad)
-    {
-        if (!gROOT->GetMakeDefCanvas())
-            return;
-        (gROOT->GetMakeDefCanvas())();
-    }
-    //   TCanvas *c=new TCanvas(fHistCol->GetName(), fHistCol->GetTitle());
+        MH::MakeDefCanvas(fHistCol);
 
     fHistCol->Draw(option);
+
+    gPad->SetLogx();
 
     gPad->Modified();
Index: trunk/MagicSoft/Mars/mhist/MHMcCollectionArea.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHMcCollectionArea.h	(revision 1003)
+++ trunk/MagicSoft/Mars/mhist/MHMcCollectionArea.h	(revision 1004)
@@ -9,11 +9,5 @@
 #endif
 
-//
-// because of some strange reason this cannot be put into MonteCarloIncl
-//
-#ifndef ROOT_TH1
-#include <TH1.h>
-#endif
-
+class TH1D;
 class TH2D;
 
@@ -31,6 +25,6 @@
     ~MHMcCollectionArea();
 
-    void FillAll(Float_t log10E, Float_t radius);
-    void FillSel(Float_t log10E, Float_t radius);
+    void FillAll(Float_t energy, Float_t radius);
+    void FillSel(Float_t energy, Float_t radius);
 
     void DrawAll(Option_t *option="");
Index: trunk/MagicSoft/Mars/mhist/MHMcEnergy.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHMcEnergy.cc	(revision 1003)
+++ trunk/MagicSoft/Mars/mhist/MHMcEnergy.cc	(revision 1004)
@@ -41,4 +41,6 @@
 #include <TPaveLabel.h> 
 
+#include "MH.h"
+
 ClassImp(MHMcEnergy);
 
@@ -49,5 +51,5 @@
 MHMcEnergy::MHMcEnergy(const char *name, const char *title)
 { 
-    *fTitle = title ? title : "Container for an energy distribution histogram";
+    fTitle = title ? title : "Container for an energy distribution histogram";
 
     //  - we initialize the histogram
@@ -55,5 +57,7 @@
     //    root don't allow us to have diferent histograms with the same name
 
-    fHist = new TH1F("", "", 40, 0.5, 4.5);
+    fHist = new TH1F("", "", 20, 0.5, 4.5);
+
+    fHist->SetDirectory(NULL);
     fHist->SetXTitle("log(E/GeV)");
     fHist->SetYTitle("dN/dE");
@@ -77,5 +81,5 @@
     UInt_t idx = semicolon ? atoi(semicolon+1) : 0;
 
-    *fName = cname;
+    fName = cname;
 
     char text[256];
@@ -86,5 +90,5 @@
 
     char aux[256];
-    strcpy(aux, "log(E)");
+    strcpy(aux, "Threshold");
 
     if (idx>0)
@@ -163,10 +167,5 @@
 {
     if (!gPad)
-    {
-        if (!gROOT->GetMakeDefCanvas())
-            return;
-        (gROOT->GetMakeDefCanvas())();
-    }
-    //TCanvas *c=new TCanvas(fHist->GetName(), fHist->GetTitle());
+        MH::MakeDefCanvas(fHist);
 
     fHist->Draw(option);
@@ -180,5 +179,5 @@
 TObject *MHMcEnergy::DrawClone(Option_t *option) const
 {
-    TCanvas *c=new TCanvas(fHist->GetName(), fHist->GetTitle());
+    TCanvas *c = MH::MakeDefCanvas(fHist);
 
     //
Index: trunk/MagicSoft/Mars/mhist/MHMcRate.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHMcRate.cc	(revision 1003)
+++ trunk/MagicSoft/Mars/mhist/MHMcRate.cc	(revision 1004)
@@ -33,6 +33,6 @@
 void MHMcRate::Init(const char *name, const char *title)
 {
-    *fName  = name  ? name  : "MMcTriggerRate";
-    *fTitle = title ? title : "Task to calc the collection area ";
+    fName  = name  ? name  : "MMcTriggerRate";
+    fTitle = title ? title : "Task to calc the collection area ";
 
     fPartId=0;               // Type of particle
Index: trunk/MagicSoft/Mars/mhist/MHStarMap.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHStarMap.cc	(revision 1003)
+++ trunk/MagicSoft/Mars/mhist/MHStarMap.cc	(revision 1004)
@@ -35,5 +35,4 @@
 #include "MHStarMap.h"
 
-#include <TH2.h>      // TH2F
 #include <TStyle.h>   // gStyle
 #include <TColor.h>   // SetRGB
@@ -59,6 +58,6 @@
     //
     
-    *fName  = name  ? name  : "MHStarMap" ;
-    *fTitle = title ? title : "Container for a Star Map" ;
+    fName  = name  ? name  : "MHStarMap" ;
+    fTitle = title ? title : "Container for a Star Map" ;
 
     //
@@ -67,7 +66,13 @@
     //   connect all the histogram with the container fHist
     //
-    fStarMap = new TH2F("StarMap", "Counts",
+    fStarMap = new TH2F("StarMap", "2D Hillas Star Map",
                         150, -300, 300,
                         150, -300, 300);
+
+    fStarMap->SetDirectory(NULL);
+
+    fStarMap->SetXTitle("x/mm");
+    fStarMap->SetYTitle("y/mm");
+    fStarMap->SetZTitle("Counts");
 }
 
@@ -171,5 +176,5 @@
 TObject *MHStarMap::DrawClone(Option_t *opt) const
 {
-    TCanvas *c = new TCanvas("Star Map", "Star Map created from Hillas Parameters", 500, 500);
+    TCanvas *c=MakeDefCanvas(fStarMap, 500, 500);
 
     //
@@ -180,5 +185,5 @@
     PrepareDrawing();
 
-    fStarMap->DrawClone("colz")->SetBit(kCanDelete);
+    fStarMap->DrawCopy("colz");
 
     c->Modified();
@@ -197,11 +202,5 @@
 {
     if (!gPad)
-    {
-        if (!gROOT->GetMakeDefCanvas())
-            return;
-        (gROOT->GetMakeDefCanvas())();
-    }
-
-    // TCanvas *c = new TCanvas("Star Map", "Star Map created from Hillas Parameters", 500, 500);
+        MakeDefCanvas(fStarMap, 500, 500);
 
     PrepareDrawing();
Index: trunk/MagicSoft/Mars/mhist/MHStarMap.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHStarMap.h	(revision 1003)
+++ trunk/MagicSoft/Mars/mhist/MHStarMap.h	(revision 1004)
@@ -11,6 +11,4 @@
 
 #ifndef ROOT_TH2
-// what's the reason that we need this here? cint complains about it
-// if it is missing...
 #include <TH2.h>
 #endif
