Index: trunk/MagicSoft/Mars/mhist/MFillH.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MFillH.cc	(revision 1965)
+++ trunk/MagicSoft/Mars/mhist/MFillH.cc	(revision 1966)
@@ -469,4 +469,6 @@
         fCanvas->cd();
         fH->DrawClone("nonew");
+        fCanvas->Modified();
+        fCanvas->Update();
     }
 
Index: trunk/MagicSoft/Mars/mhist/MH.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MH.cc	(revision 1965)
+++ trunk/MagicSoft/Mars/mhist/MH.cc	(revision 1966)
@@ -584,7 +584,10 @@
     // Draw first histogram
     //
-    TH1 *h1 = (TH1*)((TH1&)hist1).DrawCopy();
+    TH1 *h1 = ((TH1&)hist1).DrawCopy();
     gPad->SetBorderMode(0);
     gPad->Update();
+
+    h1->SetMaximum(TMath::Max(hist1.GetMaximum(), hist2.GetMaximum()));
+    h1->SetMinimum(TMath::Min(hist1.GetMinimum(), hist2.GetMinimum()));
 
     TPaveText *t = (TPaveText*)gPad->FindObject("title");
@@ -609,35 +612,30 @@
     //
     TPaveStats &s1 = *(TPaveStats*)gPad->FindObject("stats");
-    s1.SetX1NDC(s1.GetX1NDC()-0.01);
-    s1.SetName("MHStat");
+    const Double_t x1 = s1.GetX1NDC()-0.01;
+    s1.SetName((TString)"Stat"+hist1.GetTitle());
+    s1.SetX1NDC(x1-(s1.GetX2NDC()-s1.GetX1NDC()));
+    s1.SetX2NDC(x1);
 
     //
     // Draw second histogram
     //
-    TH1 *h2 = (TH1*)((TH1&)hist2).DrawCopy("sames");
+    ((TH1&)hist2).DrawCopy("sames");
     gPad->Update();
 
     //
-    // Set new position of second statistics box
+    // Draw Legend
     //
     TPaveStats &s2 = *(TPaveStats*)gPad->FindObject("stats");
-    s2.SetX1NDC(s1.GetX1NDC()-(s2.GetX2NDC()-s2.GetX1NDC())-0.01);
-    s2.SetX2NDC(s1.GetX1NDC()-0.01);
-
-    //
-    // Draw Legend
-    //
-    const Int_t    n = s1.GetListOfLines()->GetSize();
-    const Double_t h = s1.GetY2NDC()-s1.GetY1NDC();
-    TLegend &l = *new TLegend(s1.GetX1NDC(), s1.GetY1NDC()-0.015-h*2/n,
-                              s1.GetX2NDC(), s1.GetY1NDC()-0.01
-                            );
-    l.AddEntry(h1, h1->GetTitle());
-    l.AddEntry(h2, h2->GetTitle());
+    TLegend &l = *new TLegend(s2.GetX1NDC(),
+                              s2.GetY1NDC()-0.015-(s2.GetY2NDC()-s2.GetY1NDC())/2,
+                              s2.GetX2NDC(),
+                              s2.GetY1NDC()-0.01
+                             );
+    l.AddEntry((TH1*)&hist1, hist1.GetTitle());
+    l.AddEntry((TH1*)&hist2, hist2.GetTitle());
     l.SetTextSize(s2.GetTextSize());
     l.SetTextFont(s2.GetTextFont());
     l.SetBorderSize(s2.GetBorderSize());
     l.SetBit(kCanDelete);
-
     l.Draw();
 }
@@ -656,4 +654,7 @@
     gPad->SetBorderMode(0);
     gPad->Update();
+
+    hist1.SetMaximum(TMath::Max(hist1.GetMaximum(), hist2.GetMaximum()));
+    hist1.SetMinimum(TMath::Min(hist1.GetMinimum(), hist2.GetMinimum()));
 
     TPaveText *t = (TPaveText*)gPad->FindObject("title");
@@ -678,6 +679,8 @@
     //
     TPaveStats &s1 = *(TPaveStats*)gPad->FindObject("stats");
-    s1.SetX1NDC(s1.GetX1NDC()-0.01);
+    const Double_t x1 = s1.GetX1NDC()-0.01;
     s1.SetName((TString)"Stat"+hist1.GetTitle());
+    s1.SetX1NDC(x1-(s1.GetX2NDC()-s1.GetX1NDC()));
+    s1.SetX2NDC(x1);
 
     //
@@ -685,21 +688,14 @@
     //
     hist2.Draw("sames");
-
     gPad->Update();
 
     //
-    // Set new position of second statistics box
+    // Draw Legend
     //
     TPaveStats &s2 = *(TPaveStats*)gPad->FindObject("stats");
-    s2.SetX1NDC(s1.GetX1NDC()-(s2.GetX2NDC()-s2.GetX1NDC())-0.01);
-    s2.SetX2NDC(s1.GetX1NDC()-0.01);
-
-    //
-    // Draw Legend
-    //
-    TLegend &l = *new TLegend(s1.GetX1NDC(),
-                              s1.GetY1NDC()-0.015-(s1.GetY2NDC()-s1.GetY1NDC())/2,
-                              s1.GetX2NDC(),
-                              s1.GetY1NDC()-0.01
+    TLegend &l = *new TLegend(s2.GetX1NDC(),
+                              s2.GetY1NDC()-0.015-(s2.GetY2NDC()-s2.GetY1NDC())/2,
+                              s2.GetX2NDC(),
+                              s2.GetY1NDC()-0.01
                              );
     l.AddEntry(&hist1, hist1.GetTitle());
Index: trunk/MagicSoft/Mars/mhist/MH3.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MH3.cc	(revision 1965)
+++ trunk/MagicSoft/Mars/mhist/MH3.cc	(revision 1966)
@@ -112,5 +112,6 @@
     fTitle = Form(gsDefTitle.Data(), 1);
 
-    fHist->SetDirectory(NULL);
+    if (fHist)
+        fHist->SetDirectory(NULL);
 
     fScale[0] = 1;
@@ -451,4 +452,5 @@
 // pointer to it from this function
 //
+/*
 TObject *MH3::DrawClone(Option_t *opt) const
 {
@@ -499,4 +501,5 @@
     return c;
 }
+*/
 
 // --------------------------------------------------------------------------
@@ -517,11 +520,16 @@
 void MH3::Draw(Option_t *opt)
 {
-    if (!gPad)
-        MH::MakeDefCanvas(fHist);
+    TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(fHist);
+    pad->SetBorderMode(0);
+
+    AppendPad("");
 
     TString str(opt);
 
+    // FIXME: Do it in Paint()
     if (str.Contains("COL", TString::kIgnoreCase))
         SetColors();
+
+    fHist->SetFillStyle(4000);
 
     Bool_t only = str.Contains("ONLY", TString::kIgnoreCase) && fDimension==2;
@@ -546,10 +554,10 @@
     }
 
-    if (fHist->TestBit(kIsLogx)) gPad->SetLogx();
-    if (fHist->TestBit(kIsLogy)) gPad->SetLogy();
-    if (fHist->TestBit(kIsLogz)) gPad->SetLogz();
-
-    gPad->Modified();
-    gPad->Update();
+    if (fHist->TestBit(kIsLogx)) pad->SetLogx();
+    if (fHist->TestBit(kIsLogy)) pad->SetLogy();
+    if (fHist->TestBit(kIsLogz)) pad->SetLogz();
+
+    pad->Modified();
+    pad->Update();
 }
 
Index: trunk/MagicSoft/Mars/mhist/MHCerPhotEvt.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHCerPhotEvt.cc	(revision 1965)
+++ trunk/MagicSoft/Mars/mhist/MHCerPhotEvt.cc	(revision 1966)
@@ -165,23 +165,5 @@
     pad->SetBorderMode(0);
 
-    //
-    // All this is necessary to get the background in the correct color
-    //
-    pad->Divide(1,1);
-    pad->cd(1);
-
-    gPad->SetBorderMode(0);
-    gPad->SetFillColor(gPad->GetFillColor());
-
-    //
-    // set the color palette for the TBox elements
-    //
     AppendPad("");
-
-    //
-    // Necessary to visualize the background color (FIXME?)
-    //
-    gPad->Modified();
-    gPad->Update();
 }
 
Index: trunk/MagicSoft/Mars/mhist/MHMcIntRate.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHMcIntRate.cc	(revision 1965)
+++ trunk/MagicSoft/Mars/mhist/MHMcIntRate.cc	(revision 1966)
@@ -81,12 +81,4 @@
 }
 
-//-------------------------------------------------------------------------
-//
-//  Defualt Destructor
-//
-MHMcIntRate::~MHMcIntRate()
-{
-}
-
 // ------------------------------------------------------------------------
 // 
@@ -95,32 +87,15 @@
 void MHMcIntRate::Draw(Option_t *option)
 {
-    if (!gPad)
-        MH::MakeDefCanvas(&fHist);
+    TVirtualPad *pad = gPad ? gPad : MH::MakeDefCanvas(this);
+    pad->SetBorderMode(0);
 
-    gPad->SetLogx();
+    AppendPad("");
+
+    pad->SetLogx();
 
     fHist.Draw(option);
 
-    gPad->Modified();
-    gPad->Update();
-}
-
-TObject *MHMcIntRate::DrawClone(Option_t *option) const
-{
-    TCanvas *c = MH::MakeDefCanvas(&fHist);
-
-    c->SetLogx();
-
-    //
-    // This is necessary to get the expected bahviour of DrawClone
-    //
-    gROOT->SetSelectedPad(NULL);
-
-    ((TH1D&)fHist).DrawCopy(option);
-
-    c->Modified();
-    c->Update();
-
-    return c;
+    pad->Modified();
+    pad->Update();
 }
 
Index: trunk/MagicSoft/Mars/mhist/MHMcIntRate.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHMcIntRate.h	(revision 1965)
+++ trunk/MagicSoft/Mars/mhist/MHMcIntRate.h	(revision 1966)
@@ -21,5 +21,4 @@
 public:
     MHMcIntRate(const char *name=NULL, const char *title=NULL);
-    ~MHMcIntRate();
 
     void SetName(const char *name);
@@ -32,5 +31,4 @@
 
     void Draw(Option_t* option = "");
-    TObject *DrawClone(Option_t* option = "") const;
 
     void Calc(const MHMcDifRate &rate);
Index: trunk/MagicSoft/Mars/mhist/MHRanForest.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHRanForest.cc	(revision 1965)
+++ trunk/MagicSoft/Mars/mhist/MHRanForest.cc	(revision 1966)
@@ -67,4 +67,5 @@
     fGraphSigma->SetTitle("Evolution of Standard deviation of estimated hadronness in tree combination");
     fGraphSigma->SetMaximum(1);
+    fGraphSigma->SetMarkerStyle(kFullDotSmall);
 }
 
@@ -157,36 +158,4 @@
 // --------------------------------------------------------------------------
 //
-// Draw clone of histogram
-//
-TObject *MHRanForest::DrawClone(Option_t *opt) const
-{
-    if (fGraphSigma->GetN()==0)
-        return NULL;
-
-    TCanvas &c = *MakeDefCanvas("RanForest", fTitle);
-    gROOT->SetSelectedPad(NULL);
-
-    //gStyle->SetOptStat(10);
-    TGraph &g = (TGraph&)*fGraphSigma->DrawClone("AL");
-    g.SetBit(kCanDelete);
-    gPad->Modified();
-    gPad->Update();
-    if (g.GetHistogram())
-    {
-        g.GetXaxis()->SetRangeUser(0, fNumEvent);
-        g.GetXaxis()->SetTitle("Number of Trees");
-        g.GetYaxis()->SetTitle("Standard deviation of estimated hadronness");
-        g.SetMarkerStyle(kFullDotMedium);
-        gPad->Modified();
-        gPad->Update();
-        //g.Draw("P");
-    }
-    gPad->SetGrid();
-
-    return &c;
-}
-
-// --------------------------------------------------------------------------
-//
 // Draw histogram. (For the Meaning see class description)
 //
@@ -196,21 +165,22 @@
         return;
 
-   if (!gPad)
-        MakeDefCanvas("RanForest", fTitle);
+    TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this);
+    pad->SetBorderMode(0);
 
-    //gStyle->SetOptStat(10);
+    AppendPad("");
+
     fGraphSigma->Draw("ALP");
-    gPad->Modified();
-    gPad->Update();
-    if (fGraphSigma->GetHistogram())
-    {
-        fGraphSigma->GetXaxis()->SetRangeUser(0, 1);
-        fGraphSigma->GetXaxis()->SetTitle("Number of Trees");
-        fGraphSigma->GetYaxis()->SetTitle("Standard deviation of estimated hadronness");
+    pad->Modified();
+    pad->Update();
 
-        fGraphSigma->SetMarkerStyle(kFullDotSmall);
-        //fGraphSigma->Draw("P");
-        gPad->Modified();
-        gPad->Update();
-    }    
+    TH1 *h=fGraphSigma->GetHistogram();
+    if (!h)
+        return;
+
+    h->GetXaxis()->SetRangeUser(0, 1);
+    h->SetXTitle("No.of Trees");
+    h->SetYTitle("\\sigma of est.hadronness");
+
+    pad->Modified();
+    pad->Update();
 }
Index: trunk/MagicSoft/Mars/mhist/MHRanForest.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHRanForest.h	(revision 1965)
+++ trunk/MagicSoft/Mars/mhist/MHRanForest.h	(revision 1966)
@@ -37,5 +37,4 @@
 
     void Draw(Option_t *opt="");
-    TObject *DrawClone(Option_t *opt="") const;
 
     ClassDef(MHRanForest, 1) // Histogram showing variance of estimated Hadronness
Index: trunk/MagicSoft/Mars/mhist/MHRanForestGini.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHRanForestGini.cc	(revision 1965)
+++ trunk/MagicSoft/Mars/mhist/MHRanForestGini.cc	(revision 1966)
@@ -65,4 +65,5 @@
     fGraphGini->SetTitle("Importance of RF-input parameters measured by mean Gini decrease");
     fGraphGini->SetMaximum(1);
+    fGraphGini->SetMarkerStyle(kFullDotSmall);
 }
 
@@ -140,60 +141,29 @@
 // --------------------------------------------------------------------------
 //
-// Draw clone of histogram (For the Meaning see class description)
-//
-TObject *MHRanForestGini::DrawClone(Option_t *opt) const
-{
-    if (fGraphGini->GetN()==0)
-        return NULL;
-
-    TCanvas &c = *MakeDefCanvas("RanForestGini", fTitle);
-    gROOT->SetSelectedPad(NULL);
-
-    //gStyle->SetOptStat(10);
-    TGraph &g = (TGraph&)*fGraphGini->DrawClone("AL");
-    g.SetBit(kCanDelete);
-    gPad->Modified();
-    gPad->Update();
-    if (g.GetHistogram())
-    {
-        g.GetXaxis()->SetRangeUser(0, fRanForest->GetNumTrees());
-        g.GetXaxis()->SetTitle("No. of RF-input parameter");
-        g.GetYaxis()->SetTitle("Mean decrease in Gini-index [a.u.]");
-        g.SetMarkerStyle(kFullDotMedium);
-        //g.Draw("P");
-        gPad->Modified();
-        gPad->Update();
-    }
-    gPad->SetGrid();
-
-    return &c;
-}
-
-// --------------------------------------------------------------------------
-//
 // Draw histogram. (For the Meaning see class description)
 //
 void MHRanForestGini::Draw(Option_t *)
 {
-   if (fGraphGini->GetN()==0)
+    if (fGraphGini->GetN()==0)
         return;
 
-   if (!gPad)
-        MakeDefCanvas("RanForest", fTitle);
+    TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this);
+    pad->SetBorderMode(0);
 
-    //gStyle->SetOptStat(10);
+    AppendPad("");
+
     fGraphGini->Draw("ALP");
-    gPad->Modified();
-    gPad->Update();
-    if (fGraphGini->GetHistogram())
-    {
-        fGraphGini->GetXaxis()->SetRangeUser(0, 1);
-        fGraphGini->GetXaxis()->SetTitle("No. of RF-input parameter");
-        fGraphGini->GetYaxis()->SetTitle("Mean decrease in Gini-index [a.u.]");
+    pad->Modified();
+    pad->Update();
 
-        fGraphGini->SetMarkerStyle(kFullDotSmall);
-        //fGraphGini->Draw("P");
-        gPad->Modified();
-        gPad->Update();
-    }
+    TH1 *h = fGraphGini->GetHistogram();
+    if (!h)
+        return;
+
+    h->GetXaxis()->SetRangeUser(0, 1);
+    h->SetXTitle("No.of RF-input parameter");
+    h->SetYTitle("Mean decrease in Gini-index [a.u.]");
+
+    pad->Modified();
+    pad->Update();
 }
Index: trunk/MagicSoft/Mars/mhist/MHRanForestGini.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHRanForestGini.h	(revision 1965)
+++ trunk/MagicSoft/Mars/mhist/MHRanForestGini.h	(revision 1966)
@@ -35,5 +35,4 @@
 
     void Draw(Option_t *opt="");
-    TObject *DrawClone(Option_t *opt="") const;
 
     ClassDef(MHRanForestGini, 1)
Index: trunk/MagicSoft/Mars/mhist/MHSigmaPixel.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHSigmaPixel.cc	(revision 1965)
+++ trunk/MagicSoft/Mars/mhist/MHSigmaPixel.cc	(revision 1966)
@@ -124,29 +124,13 @@
 void MHSigmaPixel::Draw(Option_t *opt)
 {
-  //gStyle->SetOptStat(1000);
-  if (!gPad)
-    MakeDefCanvas("SigmaPixel", fTitle);
-  
-  fHist.Draw(opt);
-  
-  gPad->Modified();
-  gPad->Update();
+    TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this);
+    pad->SetBorderMode(0);
+
+    AppendPad("");
+
+    fHist.Draw(opt);
+
+    gPad->Modified();
+    gPad->Update();
 }
 
-// --------------------------------------------------------------------------
-//
-// Draw copies of the histogram
-// 
-TObject *MHSigmaPixel::DrawClone(Option_t *opt) const
-{
-  //gStyle->SetOptStat(1000);
-  TCanvas &c = *MakeDefCanvas("SigmaPixel", fTitle);
-  
-  ((TH2&)fHist).DrawCopy(opt);
-  
-  c.Modified();
-  c.Update();
-  
-  return &c;
-}
-
Index: trunk/MagicSoft/Mars/mhist/MHSigmaPixel.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHSigmaPixel.h	(revision 1965)
+++ trunk/MagicSoft/Mars/mhist/MHSigmaPixel.h	(revision 1966)
@@ -35,5 +35,4 @@
 
     void Draw(Option_t *option="");
-    TObject *DrawClone(Option_t *option="") const;
 
     ClassDef(MHSigmaPixel, 1) //2D-histogram in Sigma and Pixel number
Index: trunk/MagicSoft/Mars/mhist/MHSigmaTheta.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHSigmaTheta.cc	(revision 1965)
+++ trunk/MagicSoft/Mars/mhist/MHSigmaTheta.cc	(revision 1966)
@@ -249,149 +249,84 @@
 TObject *MHSigmaTheta::DrawClone(Option_t *opt) 
 {
-    TCanvas &c = *MakeDefCanvas("SigmaThetaPlot", "Sigmabar vs. Theta",
-                                 900, 900);
-    c.Divide(3, 3);
-
-    gROOT->SetSelectedPad(NULL);
-
-    //--------------------------------------------------------------------
+    return MH::DrawClone(opt, 900, 900);
+}
+
+// --------------------------------------------------------------------------
+//
+// Draw the histogram
+//
+void MHSigmaTheta::Draw(Option_t *opt)
+{
+    TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this, 900, 900);
+    pad->SetBorderMode(0);
+
+    AppendPad("");
+
+    pad->Divide(3, 3);
+
     // draw the 2D histogram Sigmabar versus Theta
-    TH1D *h;
-
-    c.cd(1);
-    h = ((TH2*)&fSigmaTheta)->ProjectionX("ProjX-Theta", -1, 9999, "E");
+    TH1 *h;
+
+    pad->cd(1);
+    gPad->SetLogy();
+    h = fSigmaTheta.ProjectionX("ProjX-Theta", -1, 9999, "E");
     h->SetDirectory(NULL);
     h->SetTitle("Distribution of \\Theta");
     h->SetXTitle("\\Theta [\\circ]");
     h->SetYTitle("No.of events");
-
-    h->DrawCopy(opt);
-    h->SetBit(kCanDelete);;
-    gPad->SetLogy();
-
-    c.cd(4);
-    h = ((TH2*)&fSigmaTheta)->ProjectionY("ProjY-sigma", -1, 9999, "E");
-    h->SetDirectory(NULL);
-    h->SetTitle("Distribution of Sigmabar");
-    h->SetXTitle("Sigmabar");
+    h->Draw("box");
+    h->SetBit(kCanDelete);
+
+    pad->cd(2);
+    h = fDiffPixTheta.Project3D("zx");
+    h->SetDirectory(NULL);
+    h->SetTitle("\\sigma_{ped}^{2}-\\bar{\\sigma}_{ped}^{2} vs. \\Theta (all pixels)");
+    h->SetXTitle("\\Theta [\\circ]");
+    h->SetYTitle("\\sigma_{ped}^2-\\bar{\\sigma}_{ped}^{2}");
+    h->SetBit(kCanDelete);
+
+    pad->cd(3);
+    h = fSigmaPixTheta.Project3D("zx");
+    h->SetDirectory(NULL);
+    h->SetTitle("\\sigma_{ped} vs. \\Theta (all pixels)");
+    h->SetXTitle("\\Theta [\\circ]");
+    h->SetYTitle("\\sigma_{ped}");
+    h->Draw("box");
+    h->SetBit(kCanDelete);
+
+    pad->cd(4);
+    h = fSigmaTheta.ProjectionY("ProjY-sigma", -1, 9999, "E");
+    h->SetDirectory(NULL);
+    h->SetTitle("Distribution of \\bar{\\sigma}_{ped}");
+    h->SetXTitle("\\bar{\\sigma}_{ped}");
     h->SetYTitle("No.of events");
-
-    h->DrawCopy(opt);
-    h->SetBit(kCanDelete);;
-
-    c.cd(7);
-    ((TH2*)&fSigmaTheta)->DrawCopy(opt);
-
-    //--------------------------------------------------------------------
-    // draw the 3D histogram : Theta, pixel, Sigma^2-Sigmabar^2
-
-    TH2D *l;
-
-    c.cd(2);
-    l = (TH2D*) ((TH3*)&fDiffPixTheta)->Project3D("zx");
-    l->SetDirectory(NULL);
-    l->SetTitle("Sigma^2-Sigmabar^2 vs. \\Theta (all pixels)");
-    l->SetXTitle("\\Theta [\\circ]");
-    l->SetYTitle("Sigma^2-Sigmabar^2");
-
-    l->DrawCopy("box");
-    l->SetBit(kCanDelete);;
-
-    c.cd(5);
-    l = (TH2D*) ((TH3*)&fDiffPixTheta)->Project3D("zy");
-    l->SetDirectory(NULL);
-    l->SetTitle("Sigma^2-Sigmabar^2 vs. pixel number (all \\Theta)");
-    l->SetXTitle("pixel");
-    l->SetYTitle("Sigma^2-Sigmabar^2");
-
-    l->DrawCopy("box");
-    l->SetBit(kCanDelete);;
-
-    //c.cd(8);
-    //((TH2*)&fDiffPixTheta)->DrawCopy(opt);
-
-    c.cd(8);
-    ((TH1*)&fBlindId)->DrawCopy(opt);
-
-
-    //--------------------------------------------------------------------
-    // draw the 3D histogram : Theta, pixel, Sigma
-
-    TH2D *k;
-
-    c.cd(3);
-    k = (TH2D*) ((TH3*)&fSigmaPixTheta)->Project3D("zx");
-    k->SetDirectory(NULL);
-    k->SetTitle("Sigma vs. \\Theta (all pixels)");
-    k->SetXTitle("\\Theta [\\circ]");
-    k->SetYTitle("Sigma");
-
-    k->DrawCopy("box");
-    k->SetBit(kCanDelete);;
-
-    c.cd(6);
-    k = (TH2D*) ((TH3*)&fSigmaPixTheta)->Project3D("zy");
-    k->SetDirectory(NULL);
-    k->SetTitle("Sigma vs. pixel number (all \\Theta)");
-    k->SetXTitle("pixel");
-    k->SetYTitle("Sigma");
-
-    k->DrawCopy("box");
-    k->SetBit(kCanDelete);;
-
-    //c.cd(9);
-    //((TH2*)&fSigmaPixTheta)->DrawCopy(opt);
-
-    c.cd(9);
-    ((TH1*)&fNpix)->DrawCopy(opt);
-
-    //--------------------------------------------------------------------
-    c.Modified();
-    c.Update();
-
-    return &c;
-}
-
-// --------------------------------------------------------------------------
-//
-// Draw the histogram
-//
-void MHSigmaTheta::Draw(Option_t *opt)
-{
-    if (!gPad)
-        MakeDefCanvas("SigmaTheta", "Sigmabar vs. Theta", 600, 600);
-
-    TH1D *h;
-
-    gPad->Divide(2,2);
-
-    gPad->cd(1);
-    h = ((TH2*)&fSigmaTheta)->ProjectionX("ProjX-Theta", -1, 9999, "E");
-    h->SetTitle("Distribution of \\Theta");
-    h->SetXTitle("\\Theta [\\circ]");
-    h->SetYTitle("No.of events");
-
     h->Draw(opt);
-    h->SetBit(kCanDelete);;
-    gPad->SetLogy();
-
-    gPad->cd(2);
-    h = ((TH2*)&fSigmaTheta)->ProjectionY("ProjY-sigma", -1, 9999, "E");
-    h->SetTitle("Distribution of Sigmabar");
-    h->SetXTitle("Sigmabar");
-    h->SetYTitle("No.of events");
-
-    h->Draw(opt);
-    h->SetBit(kCanDelete);;
-
-    gPad->cd(3);
-    fSigmaTheta.DrawCopy(opt);
-
-    gPad->Modified();
-    gPad->Update();
-}
-// --------------------------------------------------------------------------
-
-
-
-
+    h->SetBit(kCanDelete);
+
+    pad->cd(5);
+    h = fDiffPixTheta.Project3D("zy");
+    h->SetDirectory(NULL);
+    h->SetTitle("\\sigma_{ped}^{2}-\\bar{\\sigma}_{ped}^{2} vs. pixel Id (all \\Theta)");
+    h->SetXTitle("Id");
+    h->SetYTitle("\\sigma_{ped}^{2}-\\bar{\\sigma}_{ped}^{2}");
+    h->Draw("box");
+    h->SetBit(kCanDelete);
+
+    pad->cd(6);
+    h = fSigmaPixTheta.Project3D("zy");
+    h->SetDirectory(NULL);
+    h->SetTitle("\\sigma_{ped} vs. pixel Id (all \\Theta)");
+    h->SetXTitle("Id");
+    h->SetYTitle("\\sigma_{ped}");
+    h->Draw("box");
+    h->SetBit(kCanDelete);
+
+    pad->cd(7);
+    fSigmaTheta.Draw(opt);
+
+    pad->cd(8);
+    fDiffPixTheta.Draw(opt);
+
+    pad->cd(9);
+    fSigmaPixTheta.Draw(opt);
+}
Index: trunk/MagicSoft/Mars/mhist/MHSigmabarTheta.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHSigmabarTheta.cc	(revision 1965)
+++ trunk/MagicSoft/Mars/mhist/MHSigmabarTheta.cc	(revision 1966)
@@ -63,5 +63,5 @@
     fHist.SetTitle("3D-plot of sigmabar and theta");
     fHist.SetXTitle("\\theta [\\circ]");
-    fHist.SetYTitle("\\overline{\\sigma}");
+    fHist.SetYTitle("\\bar{\\sigma}");
     fHist.SetZTitle("N");
 }
@@ -123,27 +123,13 @@
 void MHSigmabarTheta::Draw(Option_t *opt)
 {
-    if (!gPad)
-        MakeDefCanvas("SigmabarTheta", fTitle);
-   
+    TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this);
+    pad->SetBorderMode(0);
+
+    AppendPad("");
+
     fHist.Draw(opt);
     
-    gPad->Modified();
-    gPad->Update();
+    pad->Modified();
+    pad->Update();
 }
 
-// --------------------------------------------------------------------------
-//
-// Draw copies of the histogram
-// 
-TObject *MHSigmabarTheta::DrawClone(Option_t *opt) const
-{
-    TCanvas &c = *MakeDefCanvas("SigmabarTheta", fTitle);
-    
-    ((TH2&)fHist).DrawCopy(opt);
-
-    c.Modified();
-    c.Update();
-
-    return &c;
-}
-
Index: trunk/MagicSoft/Mars/mhist/MHSigmabarTheta.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHSigmabarTheta.h	(revision 1965)
+++ trunk/MagicSoft/Mars/mhist/MHSigmabarTheta.h	(revision 1966)
@@ -36,5 +36,4 @@
 
     void Draw(Option_t *option="");
-    TObject *DrawClone(Option_t *option="") const;
 
     ClassDef(MHSigmabarTheta, 1) //3D-histogram in alpha, Energy and theta
Index: trunk/MagicSoft/Mars/mhist/MHThetabarTheta.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHThetabarTheta.cc	(revision 1965)
+++ trunk/MagicSoft/Mars/mhist/MHThetabarTheta.cc	(revision 1966)
@@ -61,5 +61,5 @@
 
     fHist.SetXTitle("\\Theta [\\circ]");
-    fHist.SetYTitle("Theta-bar [ \\circ]");
+    fHist.SetYTitle("\\bar{\\Theta} [ \\circ]");
 }
 
@@ -91,33 +91,17 @@
 // --------------------------------------------------------------------------
 //
-// Draw a copy of the histogram
-//
-TObject *MHThetabarTheta::DrawClone(Option_t *opt) const
-{
-    TCanvas &c = *MakeDefCanvas("ThetabarTheta", "Thetabar vs. Theta");
-
-    gROOT->SetSelectedPad(NULL);
-
-    ((TProfile)fHist).DrawCopy(opt);
-
-    c.Modified();
-    c.Update();
-
-    return &c;
-}
-
-// --------------------------------------------------------------------------
-//
 // Draw the histogram
 //
 void MHThetabarTheta::Draw(Option_t *opt)
 {
-    if (!gPad)
-        MakeDefCanvas("ThetabarTheta", "Thetabar vs. Theta");
+    TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this);
+    pad->SetBorderMode(0);
 
-    fHist.DrawCopy(opt);
+    AppendPad("");
 
-    gPad->Modified();
-    gPad->Update();
+    fHist.Draw(opt);
+
+    pad->Modified();
+    pad->Update();
 }
 
Index: trunk/MagicSoft/Mars/mhist/MHThetabarTheta.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHThetabarTheta.h	(revision 1965)
+++ trunk/MagicSoft/Mars/mhist/MHThetabarTheta.h	(revision 1966)
@@ -34,5 +34,4 @@
 
     void Draw(Option_t *option="");
-    TObject *DrawClone(Option_t *option="") const;
 
     ClassDef(MHThetabarTheta, 0) //Profile histogram Thetabar vs. time
Index: trunk/MagicSoft/Mars/mhist/MHThetabarTime.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHThetabarTime.cc	(revision 1965)
+++ trunk/MagicSoft/Mars/mhist/MHThetabarTime.cc	(revision 1966)
@@ -63,5 +63,5 @@
 
     fHist.SetXTitle("time [s]");
-    fHist.SetYTitle("Theta-bar [ \\circ]");
+    fHist.SetYTitle("\\bar{\\Theta} [ \\circ]");
 }
 
@@ -100,33 +100,17 @@
 // --------------------------------------------------------------------------
 //
-// Draw a copy of the histogram
-//
-TObject *MHThetabarTime::DrawClone(Option_t *opt) const
-{
-    TCanvas &c = *MakeDefCanvas("ThetabarTime", "Thetabar vs. time");
-
-    gROOT->SetSelectedPad(NULL);
-
-    ((TProfile*)&fHist)->DrawCopy(opt);
-
-    c.Modified();
-    c.Update();
-
-    return &c;
-}
-
-// --------------------------------------------------------------------------
-//
 // Draw the histogram
 //
 void MHThetabarTime::Draw(Option_t *opt)
 {
-    if (!gPad)
-        MakeDefCanvas("ThetabarTime", "Thetabar vs. time");
+    TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this);
+    pad->SetBorderMode(0);
 
-    fHist.DrawCopy(opt);
+    AppendPad("");
 
-    gPad->Modified();
-    gPad->Update();
+    fHist.Draw(opt);
+
+    pad->Modified();
+    pad->Update();
 }
 
Index: trunk/MagicSoft/Mars/mhist/MHThetabarTime.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHThetabarTime.h	(revision 1965)
+++ trunk/MagicSoft/Mars/mhist/MHThetabarTime.h	(revision 1966)
@@ -37,5 +37,4 @@
 
     void Draw(Option_t *option="");
-    TObject *DrawClone(Option_t *option="") const;
 
     ClassDef(MHThetabarTime, 0) //Profile histogram Thetabar vs. time
Index: trunk/MagicSoft/Mars/mhist/MHTimeDiffTheta.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHTimeDiffTheta.cc	(revision 1965)
+++ trunk/MagicSoft/Mars/mhist/MHTimeDiffTheta.cc	(revision 1966)
@@ -102,89 +102,39 @@
 // --------------------------------------------------------------------------
 //
-// Draw a copy of the histogram
-//
-TObject *MHTimeDiffTheta::DrawClone(Option_t *opt) const
-{
-    TCanvas &c = *MakeDefCanvas("DiffTimeTheta", "Distrib of \\Delta t, Theta");
-
-    c.Divide(2, 2);
-
-    gROOT->SetSelectedPad(NULL);
-
-    //
-    // FIXME: ProjectionX,Y is not const within root
-    //
-
-    TH1D *h;
-
-    c.cd(1);
-    h = ((TH2*)&fHist)->ProjectionX("ProjX-Theta", -1, 9999, "E");
-
-    h->SetTitle("Distribution of \\Delta t [s]");
-    h->SetXTitle("\\Delta t [s]");
-    h->SetYTitle("Counts");
-
-    h->Draw(opt);
-    h->SetBit(kCanDelete);;
-    gPad->SetLogy();
-
-    c.cd(2);
-    h = ((TH2*)&fHist)->ProjectionY("ProjY-timediff", -1, 9999, "E");
-
-    h->SetTitle("Distribution of \\Theta [\\circ]");
-    h->SetXTitle("\\Theta [\\circ]");
-    h->SetYTitle("Counts");
-
-    h->Draw(opt);
-    h->SetBit(kCanDelete);;
-
-    c.cd(3);
-    ((TH2*)&fHist)->DrawCopy(opt);
-
-    c.Modified();
-    c.Update();
-
-    return &c;
-}
-
-// --------------------------------------------------------------------------
-//
 // Draw the histogram
 //
 void MHTimeDiffTheta::Draw(Option_t *opt)
 {
-    if (!gPad)
-        MakeDefCanvas("DiffTimeTheta", "Distrib of Delta t, Theta");
+    TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this);
+    pad->SetBorderMode(0);
 
-    TH1D *h;
+    AppendPad("");
 
-    gPad->Divide(2,2);
+    TH1 *h;
 
-    gPad->cd(1);
+    pad->Divide(2,2);
+
+    pad->cd(1);
+    gPad->SetLogy();
     h = fHist.ProjectionX("ProjX_Theta", -1, 9999, "E");
-
     h->SetTitle("Distribution of \\Delta t [s]");
     h->SetXTitle("\\Delta t [s]");
     h->SetYTitle("Counts");
-
     h->Draw(opt);
     h->SetBit(kCanDelete);;
-    gPad->SetLogy();
 
-    gPad->cd(2);
+    pad->cd(2);
     h = fHist.ProjectionY("ProjY_timediff", -1, 9999, "E");
-
     h->SetTitle("Distribution of \\Theta [\\circ]");
     h->SetXTitle("\\Theta [\\circ]");
     h->SetYTitle("Counts");
-
     h->Draw(opt);
     h->SetBit(kCanDelete);;
 
-    gPad->cd(3);
-    fHist.DrawCopy(opt);
+    pad->cd(3);
+    fHist.Draw(opt);
 
-    gPad->Modified();
-    gPad->Update();
+    pad->Modified();
+    pad->Update();
 }
 
Index: trunk/MagicSoft/Mars/mhist/MHTimeDiffTheta.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHTimeDiffTheta.h	(revision 1965)
+++ trunk/MagicSoft/Mars/mhist/MHTimeDiffTheta.h	(revision 1966)
@@ -35,5 +35,4 @@
 
     void Draw(Option_t *option="");
-    TObject *DrawClone(Option_t *option="") const;
 
     ClassDef(MHTimeDiffTheta, 0) //2D-histogram  time-diff vs. Theta
Index: trunk/MagicSoft/Mars/mhist/MHTimeDiffTime.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHTimeDiffTime.cc	(revision 1965)
+++ trunk/MagicSoft/Mars/mhist/MHTimeDiffTime.cc	(revision 1966)
@@ -95,87 +95,39 @@
 // --------------------------------------------------------------------------
 //
-// Draw a copy of the histogram
-//
-TObject *MHTimeDiffTime::DrawClone(Option_t *opt) const
-{
-
-    TCanvas &c = *MakeDefCanvas("DiffTimeTime", "Distrib of dt and t");
-
-    c.Divide(2, 2);
-
-    gROOT->SetSelectedPad(NULL);
-
-    TH1D *h;
-
-    c.cd(1);
-    h = ((TH2*)&fHist)->ProjectionX("ProjX-sumtime", -1, 9999, "E");
-
-    h->SetTitle("Distribution of \\Delta t [s]");
-    h->SetXTitle("\\Delta t [s]");
-    h->SetYTitle("Counts");
-
-    h->Draw(opt);
-    h->SetBit(kCanDelete);
-    gPad->SetLogy();
-
-    c.cd(2);
-    h = ((TH2*)&fHist)->ProjectionY("ProjY-sumtimediff", -1, 9999, "E");
-
-    h->SetTitle("Distribution of time [s]");
-    h->SetXTitle("time [s]");
-    h->SetYTitle("Counts");
-
-    h->Draw(opt);
-    h->SetBit(kCanDelete);
-
-    c.cd(3);
-    ((TH2*)&fHist)->DrawCopy(opt);
-
-    c.Modified();
-    c.Update();
-
-    return &c;
-}
-
-// --------------------------------------------------------------------------
-//
 // Draw the histogram
 //
 void MHTimeDiffTime::Draw(Option_t *opt)
 {
-    if (!gPad)
-        MakeDefCanvas("DiffTimeTime", "Distrib of \\Delta t, time");
+    TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this);
+    pad->SetBorderMode(0);
 
-    gPad->Divide(2,2);
+    AppendPad("");
+
+    pad->Divide(2,2);
 
     TH1D *h;
 
-    gPad->cd(1);
+    pad->cd(1);
+    gPad->SetLogy();
     h = fHist.ProjectionX("ProjX_sumtime", -1, 9999, "E");
-
     h->SetTitle("Distribution of \\Delta t [s]");
     h->SetXTitle("\\Delta t [s]");
     h->SetYTitle("Counts");
-
     h->Draw(opt);
     h->SetBit(kCanDelete);
-    gPad->SetLogy();
 
-    gPad->cd(2);
+    pad->cd(2);
     h = fHist.ProjectionY("ProjY_sumtimediff", -1, 9999, "E");
-
     h->SetTitle("Distribution of time [s]");
     h->SetXTitle("time [s]");
     h->SetYTitle("Counts");
-
     h->Draw(opt);
     h->SetBit(kCanDelete);
 
-    gPad->cd(3);
+    pad->cd(3);
     fHist.DrawCopy(opt);
 
-    gPad->Modified();
-    gPad->Update();
-
+    pad->Modified();
+    pad->Update();
 }
 
Index: trunk/MagicSoft/Mars/mhist/MHTimeDiffTime.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHTimeDiffTime.h	(revision 1965)
+++ trunk/MagicSoft/Mars/mhist/MHTimeDiffTime.h	(revision 1966)
@@ -33,5 +33,4 @@
 
     void Draw(Option_t *option="");
-    TObject *DrawClone(Option_t *option="") const;
 
     ClassDef(MHTimeDiffTime, 0) //2D-histogram  time-diff vs. time
