Index: trunk/MagicSoft/Mars/NEWS
===================================================================
--- trunk/MagicSoft/Mars/NEWS	(revision 2014)
+++ trunk/MagicSoft/Mars/NEWS	(revision 2015)
@@ -45,4 +45,5 @@
 
    - made compatible with the latest PRO version of root (3.04/02)
+     (this means, that it is compiling, but not yet fully tested)
 
    - added a new status display which can show the present status
Index: trunk/MagicSoft/Mars/manalysis/MBlindPixelCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MBlindPixelCalc.cc	(revision 2014)
+++ trunk/MagicSoft/Mars/manalysis/MBlindPixelCalc.cc	(revision 2015)
@@ -185,4 +185,8 @@
         nphot[i] = TESTBIT(fFlags, kUseCentralPixel) ? pix.GetNumPhotons() : 0;
         perr[i]  = TESTBIT(fFlags, kUseCentralPixel) ? pix.GetErrorPhot()  : 0;
+
+        nphot[i] *= fGeomCam->GetPixRatio(id);
+        // FIXME: perr[i] ???
+
         for (int j=0; j<n; j++)
         {
@@ -195,12 +199,13 @@
             if (evtpix)
             {
-                nphot[i] += evtpix->GetNumPhotons();
+                nphot[i] += evtpix->GetNumPhotons()*fGeomCam->GetPixRatio(nid);
                 perr[i]  += evtpix->GetErrorPhot();
+                // FIXME: perr[i] ???
             }
             num++;
         }
 
-        nphot[i] /= num;
-        perr[i]  /= num;
+        nphot[i] /= num*fGeomCam->GetPixRatio(id);
+        perr[i]  /= num/*FIXME:???*/;
     }
 
Index: trunk/MagicSoft/Mars/mbase/MEvtLoop.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MEvtLoop.cc	(revision 2014)
+++ trunk/MagicSoft/Mars/mbase/MEvtLoop.cc	(revision 2015)
@@ -251,11 +251,35 @@
     // Check System time (don't loose too much time by updates)
     //
-    static TTime t0 = gSystem->Now();
-
-    const TTime t1 = gSystem->Now();
-    if (t1-t0 < (TTime)20)
+
+    // FIXME: Not thread safe
+    static Int_t start = num;
+    static TTime t1 = gSystem->Now();
+    static TTime t2 = t1;
+
+    //
+    // No update < 20ms
+    //
+    const TTime t0 = gSystem->Now();
+    if (t0-t1 < (TTime)20)
         return rc;
-
-    t0 = t1;
+    t1 = t0;
+
+    //
+    // Update current speed each second
+    //
+    if (t0-t2 > (TTime)1000)
+    {
+        const Int_t speed = 1000*(num-start)/(long int)(t0-t2);
+        TString txt = "Processing...";
+        if (speed>0)
+        {
+            txt += " (";
+            txt += speed;
+            txt += "Evts/s)";
+        }
+        fDisplay->SetStatusLine1(txt);
+        start = num;
+        t2 = t1;
+    }
 
     //
Index: trunk/MagicSoft/Mars/mbase/MGGroupFrame.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MGGroupFrame.h	(revision 2014)
+++ trunk/MagicSoft/Mars/mbase/MGGroupFrame.h	(revision 2015)
@@ -37,5 +37,5 @@
     virtual Bool_t ProcessMessage(Long_t msg, Long_t param1, Long_t param2);
 
-    ClassDef(MGGroupFrame, 0) // A interface to widgets in a group frame (makes live easier)
+    ClassDef(MGGroupFrame, 0) // An interface to widgets in a group frame (makes live easier)
 };
 
Index: trunk/MagicSoft/Mars/mbase/MTask.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTask.cc	(revision 2014)
+++ trunk/MagicSoft/Mars/mbase/MTask.cc	(revision 2015)
@@ -69,4 +69,5 @@
 
 #include <fstream.h>
+#include <TBaseClass.h>
 
 #include "MLog.h"
@@ -317,2 +318,39 @@
      out << "   " << GetUniqueName() << ".SetFilter(&" << fFilter->GetUniqueName() <<");" << endl;
 }
+
+// --------------------------------------------------------------------------
+//
+// Check whether the class given in the argument overwrites MTask::Process.
+// This function calls itself recursively. If you want to call it,
+// leave out the argument.
+//
+Bool_t MTask::OverwritesProcess(TClass *cls) const
+{
+    if (!cls)
+        cls = IsA();
+
+    //
+    // Check whether we reached the base class MTask
+    //
+    if (TString(cls->GetName())=="MTask")
+        return kFALSE;
+
+    //
+    // Check whether the class cls overwrites Process
+    //
+    if (cls->GetMethodAny("Process"))
+        return kTRUE;
+
+    //
+    // If the class itself doesn't overload it check all it's base classes
+    //
+    TBaseClass *base=NULL;
+    TIter NextBase(cls->GetListOfBases());
+    while ((base=(TBaseClass*)NextBase()))
+    {
+        if (OverwritesProcess(base->GetClassPointer()))
+            return kTRUE;
+    }
+
+    return kFALSE;
+}
Index: trunk/MagicSoft/Mars/mbase/MTask.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTask.h	(revision 2014)
+++ trunk/MagicSoft/Mars/mbase/MTask.h	(revision 2015)
@@ -80,4 +80,6 @@
     const TList *GetListOfBranches() const { return fListOfBranches; }
 
+    Bool_t OverwritesProcess(TClass *cls=NULL) const;
+
     void SavePrimitive(ofstream &out, Option_t *o="");
 
Index: trunk/MagicSoft/Mars/mbase/MTaskList.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTaskList.cc	(revision 2014)
+++ trunk/MagicSoft/Mars/mbase/MTaskList.cc	(revision 2015)
@@ -60,5 +60,4 @@
 
 #include <TClass.h>
-#include <TBaseClass.h>
 #include <TOrdCollection.h>
 
@@ -322,38 +321,9 @@
 // --------------------------------------------------------------------------
 //
-// Check whether this task (or one of it's base classes) overloads
-// MTask::Process. Only if this function is overloaded this task is
-// added to the fTaskProcess-List. This makes the execution of the
-// tasklist a little bit (only a little bit) faster, bacause tasks
-// doing no Processing are not Processed.
-//
-Bool_t MTaskList::CheckClassForProcess(TClass *cls)
-{
-    //
-    // Check whether the class itself overloads the Process function
-    //
-    if (cls->GetName()=="MTask")
-        return kFALSE;
-
-    if (cls->GetMethodAny("Process"))
-        return kTRUE;
-
-    //
-    // If the class itself doesn't overload it check all it's base classes
-    //
-    TBaseClass *base=NULL;
-    TIter NextBase(cls->GetListOfBases());
-    while ((base=(TBaseClass*)NextBase()))
-    {
-        if (CheckClassForProcess(base->GetClassPointer()))
-            return kTRUE;
-    }
-
-    return kFALSE;
-}
-
-// --------------------------------------------------------------------------
-//
 //  do pre processing (before eventloop) of all tasks in the task-list
+//  Only if a task overwrites the Process function the task is
+//  added to the fTaskProcess-List. This makes the execution of the
+//  tasklist a little bit (only a little bit) faster, bacause tasks
+//  doing no Processing are not Processed.
 //
 Bool_t MTaskList::PreProcess(MParList *pList)
@@ -410,5 +380,5 @@
     //
     while ((task=(MTask*)Next()))
-        if (CheckClassForProcess(task->IsA()))
+        if (task->OverwritesProcess())
             fTasksProcess.Add(task);
 
Index: trunk/MagicSoft/Mars/mbase/MTaskList.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTaskList.h	(revision 2014)
+++ trunk/MagicSoft/Mars/mbase/MTaskList.h	(revision 2015)
@@ -31,8 +31,5 @@
 
     void   Remove(MTask *task);
-    Bool_t CheckClassForProcess(TClass *cls);
-
-    void StreamPrimitive(ofstream &out) const;
-
+    void   StreamPrimitive(ofstream &out) const;
     Bool_t CheckAddToList(MTask *task, const char *tType, const MTask *where=NULL) const;
 
Index: trunk/MagicSoft/Mars/mhist/MFillH.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MFillH.cc	(revision 2014)
+++ trunk/MagicSoft/Mars/mhist/MFillH.cc	(revision 2015)
@@ -326,7 +326,17 @@
 }
 
+// --------------------------------------------------------------------------
+//
+// Creates a new tab in a status display with the name of the MH class,
+// if fDisplay is set and the MH-class overwrites the Draw function
+//
 Bool_t MFillH::DrawToDisplay()
 {
+    fCanvas = NULL;
+
     if (!fDisplay)
+        return kTRUE;
+
+    if (!fH->OverwritesDraw())
         return kTRUE;
 
@@ -485,5 +495,9 @@
     fH->SetReadyToSave();
 
-    if (fDisplay)
+    //
+    // Check whether fDisplay has previously been used (fCanvas)
+    // and fDisplay is still open.
+    //
+    if (fCanvas && fDisplay)
     {
         fCanvas->cd();
Index: trunk/MagicSoft/Mars/mhist/MH.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MH.cc	(revision 2014)
+++ trunk/MagicSoft/Mars/mhist/MH.cc	(revision 2015)
@@ -59,4 +59,5 @@
 #include <TLegend.h>
 #include <TPaveStats.h>
+#include <TBaseClass.h>
 #if ROOT_VERSION_CODE > ROOT_VERSION(3,04,01)
 #include <THLimitsFinder.h>
@@ -589,8 +590,14 @@
 
     // FIXME: Also align max/min with set Maximum/Minimum
-     const Double_t max = TMath::Max(hist1.GetBinContent(hist1.GetMaximumBin()), hist2.GetBinContent(hist2.GetMaximumBin()));
-     const Double_t min = TMath::Min(hist1.GetBinContent(hist1.GetMinimumBin()), hist2.GetBinContent(hist2.GetMinimumBin()));
-     h1->SetMaximum(max);
-     h1->SetMinimum(min);
+    const Double_t maxbin1 = hist1.GetBinContent(hist1.GetMaximumBin());
+    const Double_t maxbin2 = hist2.GetBinContent(hist2.GetMaximumBin());
+    const Double_t minbin1 = hist1.GetBinContent(hist1.GetMinimumBin());
+    const Double_t minbin2 = hist2.GetBinContent(hist2.GetMinimumBin());
+
+    const Double_t max = TMath::Max(maxbin1, maxbin2);
+    const Double_t min = TMath::Min(minbin1, minbin2);
+
+    h1->SetMaximum(max>0?max*1.05:max*0.95);
+    h1->SetMinimum(max>0?min*0.95:min*1.05);
 
     TPaveText *t = (TPaveText*)gPad->FindObject("title");
@@ -658,10 +665,15 @@
     gPad->Update();
 
-    // FIXME: Also align max/min with set Maximum/Minimum
     /*
-     const Double_t max = TMath::Max(hist1.GetBinContent(hist1.GetMaximumBin()), hist2.GetBinContent(hist2.GetMaximumBin()));
-     const Double_t min = TMath::Min(hist1.GetBinContent(hist1.GetMinimumBin()), hist2.GetBinContent(hist2.GetMinimumBin()));
-     hist1.SetMaximum(max);
-     hist1.SetMinimum(min);
+     const Double_t maxbin1 = hist1.GetBinContent(hist1.GetMaximumBin());
+     const Double_t maxbin2 = hist2.GetBinContent(hist2.GetMaximumBin());
+     const Double_t minbin1 = hist1.GetBinContent(hist1.GetMinimumBin());
+     const Double_t minbin2 = hist2.GetBinContent(hist2.GetMinimumBin());
+
+     const Double_t max = TMath::Max(maxbin1, maxbin2);
+     const Double_t min = TMath::Min(minbin1, minbin2);
+
+     hist1.SetMaximum(max>0?max*1.05:max*0.95);
+     hist1.SetMinimum(max>0?min*0.95:min*1.05);
      */
 
@@ -751,2 +763,40 @@
     return o;
 }
+
+// --------------------------------------------------------------------------
+//
+// Check whether a class inheriting from MH overwrites the Draw function
+//
+Bool_t MH::OverwritesDraw(TClass *cls) const
+{
+    if (!cls)
+        cls = IsA();
+
+    //
+    // Check whether we reached the base class MTask
+    //
+    if (TString(cls->GetName())=="MH")
+        return kFALSE;
+
+    //
+    // Check whether the class cls overwrites Draw
+    //
+    if (cls->GetMethodAny("Draw"))
+    {
+        *fLog << all << "FOUND: " << cls->GetName() << " " << (cls->GetName()=="MH") << endl;
+        return kTRUE;
+    }
+
+    //
+    // If the class itself doesn't overload it check all it's base classes
+    //
+    TBaseClass *base=NULL;
+    TIter NextBase(cls->GetListOfBases());
+    while ((base=(TBaseClass*)NextBase()))
+    {
+        if (OverwritesDraw(base->GetClassPointer()))
+            return kTRUE;
+    }
+
+    return kFALSE;
+}
Index: trunk/MagicSoft/Mars/mhist/MH.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MH.h	(revision 2014)
+++ trunk/MagicSoft/Mars/mhist/MH.h	(revision 2015)
@@ -21,4 +21,6 @@
     MH(const char *name=NULL, const char *title=NULL);
 
+    Bool_t OverwritesDraw(TClass *cls=NULL) const;
+
     virtual Bool_t SetupFill(const MParList *pList) { return kTRUE; }
     virtual Bool_t Fill(const MParContainer *par, Double_t weight=1);
@@ -30,7 +32,7 @@
 
     static TCanvas *MakeDefCanvas(TString name="", const char *title="",
-                                  const UInt_t w=580, const UInt_t h=435);
+                                  const UInt_t w=625, const UInt_t h=440);
     static TCanvas *MakeDefCanvas(const TObject *obj,
-                                  const UInt_t w=580, const UInt_t h=435);
+                                  const UInt_t w=625, const UInt_t h=440);
 
     static void SetBinning(TH1 *h, const MBinning *binsx);
@@ -63,5 +65,5 @@
     TObject *DrawClone(Option_t *opt="") const
     {
-        return MH::DrawClone(opt, 580, 435);
+        return MH::DrawClone(opt, 625, 440);
     }
 
Index: trunk/MagicSoft/Mars/mhist/MHAlphaEnergyTheta.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHAlphaEnergyTheta.cc	(revision 2014)
+++ trunk/MagicSoft/Mars/mhist/MHAlphaEnergyTheta.cc	(revision 2015)
@@ -126,100 +126,46 @@
 void MHAlphaEnergyTheta::Draw(Option_t *opt)
 {
-    if (!gPad)
-        MakeDefCanvas("AlphaEnergyTheta", fTitle);
+    TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this);
+    pad->SetBorderMode(0);
 
-    gPad->Divide(2,2);
+    AppendPad("");
+
+    pad->Divide(2,2);
 
     TH1 *h;
 
-    gPad->cd(1);
+    pad->cd(1);
+    gPad->SetBorderMode(0);
     h = fHist.Project3D("expro");
-
     h->SetTitle("Distribution of \\alpha [\\circ]");
     h->SetXTitle("\\alpha [\\circ]");
     h->SetYTitle("Counts");
-
     h->Draw(opt);
     h->SetBit(kCanDelete);
 
-    gPad->cd(2);
+    pad->cd(2);
+    gPad->SetBorderMode(0);
+    gPad->SetLogx();
     h = fHist.Project3D("eypro");
-
     h->SetTitle("Distribution of E-est [GeV]");
     h->SetXTitle("E_{est} [GeV]");
     h->SetYTitle("Counts");
-
     h->Draw(opt);
     h->SetBit(kCanDelete);
-    gPad->SetLogx();
 
-    gPad->cd(3);
+    pad->cd(3);
+    gPad->SetBorderMode(0);
     h = fHist.Project3D("ezpro");
-
     h->SetTitle("Distribution of \\Theta [\\circ]");
     h->SetXTitle("\\Theta [\\circ]");
     h->SetYTitle("Counts");
-
     h->Draw(opt);
     h->SetBit(kCanDelete);
 
-    gPad->cd(4);
+    pad->cd(4);
+    gPad->SetBorderMode(0);
     fHist.Draw(opt);
 
-    gPad->Modified();
-    gPad->Update();
+    pad->Modified();
+    pad->Update();
 }
-
-// --------------------------------------------------------------------------
-//
-// Draw copies of the histogram
-// 
-TObject *MHAlphaEnergyTheta::DrawClone(Option_t *opt) const
-{
-    TCanvas &c = *MakeDefCanvas("AlphaEnergyTheta", fTitle);
-    c.Divide(2, 2);
-
-    gROOT->SetSelectedPad(NULL);
-
-    TH1 *h;
-
-    c.cd(1);
-    h = ((TH3*)(&fHist))->Project3D(fName+"_expro");
-
-    h->SetTitle("Distribution of \\alpha [\\circ]");
-    h->SetXTitle("\\alpha [\\circ]");
-    h->SetYTitle("Counts");
-
-    h->Draw(opt);
-    h->SetBit(kCanDelete);
-
-    c.cd(2);
-    h = ((TH3*)(&fHist))->Project3D(fName+"_eypro");
-
-    h->SetTitle("Distribution of E-est [GeV]");
-    h->SetXTitle("E_{est} [GeV]");
-    h->SetYTitle("Counts");
-
-    h->Draw(opt);
-    h->SetBit(kCanDelete);
-    gPad->SetLogx();
-
-    c.cd(3);
-    h = ((TH3*)(&fHist))->Project3D(fName+"_ezpro");
-
-    h->SetTitle("Distribution of \\Theta [\\circ]");
-    h->SetXTitle("\\Theta [\\circ]");
-    h->SetYTitle("Counts");
-
-    h->Draw(opt);
-    h->SetBit(kCanDelete);
-
-    c.cd(4);
-    ((TH3&)fHist).DrawCopy(opt);
-
-    c.Modified();
-    c.Update();
-
-    return &c;
-}
-
Index: trunk/MagicSoft/Mars/mhist/MHAlphaEnergyTheta.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHAlphaEnergyTheta.h	(revision 2014)
+++ trunk/MagicSoft/Mars/mhist/MHAlphaEnergyTheta.h	(revision 2015)
@@ -42,5 +42,4 @@
 
     void Draw(Option_t *option="");
-    TObject *DrawClone(Option_t *option="") const;
 
     ClassDef(MHAlphaEnergyTheta, 0) //3D-histogram in alpha, Energy and theta
Index: trunk/MagicSoft/Mars/mhist/MHAlphaEnergyTime.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHAlphaEnergyTime.cc	(revision 2014)
+++ trunk/MagicSoft/Mars/mhist/MHAlphaEnergyTime.cc	(revision 2015)
@@ -126,104 +126,47 @@
 void MHAlphaEnergyTime::Draw(Option_t *opt)
 {
-    if (!gPad)
-        MakeDefCanvas("AlphaEnergyTime", fTitle);
-
-    gPad->Divide(2,2);
+    TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this);
+    pad->SetBorderMode(0);
+
+    pad->Divide(2,2);
 
     TH1 *h;
 
-    gPad->cd(1);
+    pad->cd(1);
+    gPad->SetBorderMode(0);
     h = fHist.Project3D("ex");
-
     h->SetTitle("Distribution of \\alpha [\\circ]");
     h->SetXTitle("\\alpha [\\circ]");
     h->SetYTitle("Counts");
-
     h->Draw(opt);
     h->SetBit(kCanDelete);
 
-    gPad->cd(2);
+    pad->cd(2);
+    gPad->SetBorderMode(0);
+    gPad->SetLogx();
     h = fHist.Project3D("ey");
-
     h->SetTitle("Distribution of E-est [GeV]");
     h->SetXTitle("E-est [GeV]            ");
     h->SetYTitle("Counts");
-
     h->Draw(opt);
     h->SetBit(kCanDelete);
-    gPad->SetLogx();
-
-    gPad->cd(3);
+
+    pad->cd(3);
+    gPad->SetBorderMode(0);
     h = fHist.Project3D("ez");
-
     h->SetTitle("Distribution of time [s]");
     h->SetXTitle("time [s]");
     h->SetYTitle("Counts");
-
     h->Draw(opt);
     h->SetBit(kCanDelete);
 
-    gPad->cd(4);
+    pad->cd(4);
+    gPad->SetBorderMode(0);
     fHist.Draw(opt);
 
-    gPad->Modified();
-    gPad->Update();
-
-}
-
-// --------------------------------------------------------------------------
-//
-// Draw copies of the histogram
-// 
-TObject *MHAlphaEnergyTime::DrawClone(Option_t *opt) const
-{
-    TCanvas &c = *MakeDefCanvas("AlphaEnergyTime", fTitle);
-
-    c.Divide(2, 2);
-
-    gROOT->SetSelectedPad(NULL);
-
-    TH1 *h;
-
-    c.cd(1);
-    h = ((TH3D*)(&fHist))->Project3D("ex");
-
-    h->SetTitle("Distribution of \\alpha [\\circ]");
-    h->SetXTitle("\\alpha [\\circ]");
-    h->SetYTitle("Counts");
-
-    h->Draw(opt);
-    h->SetBit(kCanDelete);
-
-    c.cd(2);
-    h = ((TH3D*)(&fHist))->Project3D("ey");
-
-    h->SetTitle("Distribution of E-est [GeV]");
-    h->SetXTitle("E-est [GeV]            ");
-    h->SetYTitle("Counts");
-
-    h->Draw(opt);
-    h->SetBit(kCanDelete);
-    gPad->SetLogx();
-
-    c.cd(3);
-    h = ((TH3D*)(&fHist))->Project3D("ez");
-
-    h->SetTitle("Distribution of time [s]");
-    h->SetXTitle("time [s]");
-    h->SetYTitle("Counts");
-
-    h->Draw(opt);
-    h->SetBit(kCanDelete);
-
-    c.cd(4);
-    ((TH3D&)fHist).DrawCopy(opt);
-
-    c.Modified();
-    c.Update();
-
-    return &c;
-}
-
+    pad->Modified();
+    pad->Update();
+
+}
 
 // --------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mhist/MHAlphaEnergyTime.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHAlphaEnergyTime.h	(revision 2014)
+++ trunk/MagicSoft/Mars/mhist/MHAlphaEnergyTime.h	(revision 2015)
@@ -41,5 +41,4 @@
 
     void Draw(Option_t *option="");
-    TObject *DrawClone(Option_t *option="") const;
 
     TH2D *IntegrateTime    (const char *title, Bool_t Draw);
Index: trunk/MagicSoft/Mars/mhist/MHCerPhotEvt.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHCerPhotEvt.cc	(revision 2014)
+++ trunk/MagicSoft/Mars/mhist/MHCerPhotEvt.cc	(revision 2015)
@@ -152,13 +152,4 @@
 // --------------------------------------------------------------------------
 //
-// Draw clone
-//
-TObject *MHCerPhotEvt::DrawClone(Option_t *opt) const
-{
-    return MH::DrawClone(opt, 750, 600);
-}
-
-// --------------------------------------------------------------------------
-//
 // Draw the present 'fill status'
 //
Index: trunk/MagicSoft/Mars/mhist/MHCerPhotEvt.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHCerPhotEvt.h	(revision 2014)
+++ trunk/MagicSoft/Mars/mhist/MHCerPhotEvt.h	(revision 2015)
@@ -37,6 +37,5 @@
     const MCerPhotEvt &GetSum() const { return fSum; }
 
-    TObject *DrawClone(Option_t *opt) const;
-    void Draw(Option_t *);
+    void Draw(Option_t *opt="");
     void Paint(Option_t *option="");
 
Index: trunk/MagicSoft/Mars/mhist/MHEffOnTime.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHEffOnTime.cc	(revision 2014)
+++ trunk/MagicSoft/Mars/mhist/MHEffOnTime.cc	(revision 2015)
@@ -361,58 +361,31 @@
 // -------------------------------------------------------------------------
 //
-// Draw a copy of the histogram
-//
-TObject *MHEffOnTime::DrawClone(Option_t *opt) const
-{
-    TCanvas &c = *MakeDefCanvas(TString("EffOnTime")+fVarname,
-                                TString("Results from on time fit vs. ")+fVarname);
-    c.Divide(2, 2);
-
-    gROOT->SetSelectedPad(NULL);
-
-    c.cd(1);
-    ((TH2*)&fHEffOn)->DrawCopy(opt);
-
-    c.cd(2);
-    ((TH2*)&fHProb)->DrawCopy(opt);
-
-    c.cd(3);
-    ((TH2*)&fHLambda)->DrawCopy(opt);
-
-    c.cd(4);
-    ((TH2*)&fHRdead)->DrawCopy(opt);
-
-    c.Modified();
-    c.Update();
-
-    return &c;
-}
-
-// -------------------------------------------------------------------------
-//
 // Draw the histogram
 //
 void MHEffOnTime::Draw(Option_t *opt) 
 {
-    if (!gPad)
-        MakeDefCanvas(TString("EffOnTime")+fVarname,
-                      TString("Results from on time fit vs. ")+fVarname);
-
-    gPad->Divide(2,2);
-
-    gPad->cd(1);
+    TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this);
+    pad->SetBorderMode(0);
+
+    pad->Divide(2,2);
+
+    pad->cd(1);
+    gPad->SetBorderMode(0);
     fHEffOn.Draw(opt);
 
-    gPad->cd(2);
+    pad->cd(2);
+    gPad->SetBorderMode(0);
     fHProb.Draw(opt);
 
-    gPad->cd(3);
+    pad->cd(3);
+    gPad->SetBorderMode(0);
     fHLambda.Draw(opt);
 
-    gPad->cd(4);
+    pad->cd(4);
+    gPad->SetBorderMode(0);
     fHRdead.Draw(opt);
 
-    gPad->Modified();
-    gPad->Update();
+    pad->Modified();
+    pad->Update();
 }
 
Index: trunk/MagicSoft/Mars/mhist/MHEffOnTime.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHEffOnTime.h	(revision 2014)
+++ trunk/MagicSoft/Mars/mhist/MHEffOnTime.h	(revision 2015)
@@ -41,5 +41,4 @@
 
     void Draw(Option_t *option="");
-    TObject *DrawClone(Option_t *option="") const;
 
     ClassDef(MHEffOnTime, 0) //1D-plot of Delta t vs. Var
Index: trunk/MagicSoft/Mars/mhist/MHEffOnTimeTheta.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHEffOnTimeTheta.cc	(revision 2014)
+++ trunk/MagicSoft/Mars/mhist/MHEffOnTimeTheta.cc	(revision 2015)
@@ -257,56 +257,30 @@
 // -------------------------------------------------------------------------
 //
-// Draw a copy of the histogram
-//
-TObject *MHEffOnTimeTheta::DrawClone(Option_t *opt) const
-{
-    TCanvas &c = *MakeDefCanvas("EffOnTimeTheta", "Results from on time fit vs. Theta");
-
-    c.Divide(2, 2);
-
-    gROOT->SetSelectedPad(NULL);
-
-    c.cd(1);
-    ((TH2*)&fHEffOn)->DrawCopy(opt);
-
-    c.cd(2);
-    ((TH2*)&fHChi2)->DrawCopy(opt);
-
-    c.cd(3);
-    ((TH2*)&fHLambda)->DrawCopy(opt);
-
-    c.cd(4);
-    ((TH2*)&fHN0del)->DrawCopy(opt);
-
-    c.Modified();
-    c.Update();
-
-    return &c;
-}
-
-// -------------------------------------------------------------------------
-//
 // Draw the histogram
 //
 void MHEffOnTimeTheta::Draw(Option_t *opt)
 {
-    if (!gPad)
-        MakeDefCanvas("EffOnTimeTheta", "Results from on time fit vs. Theta");
-
-    gPad->Divide(2,2);
-
-    gPad->cd(1);
+    TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this);
+    pad->SetBorderMode(0);
+
+    pad->Divide(2,2);
+
+    pad->cd(1);
+    gPad->SetBorderMode(0);
     fHEffOn.Draw(opt);
 
-    gPad->cd(2);
+    pad->cd(2);
+    gPad->SetBorderMode(0);
     fHChi2.Draw(opt);
 
-    gPad->cd(3);
+    pad->cd(3);
+    gPad->SetBorderMode(0);
     fHLambda.Draw(opt);
 
-    gPad->cd(4);
+    pad->cd(4);
+    gPad->SetBorderMode(0);
     fHN0del.Draw(opt);
 
-    gPad->Modified();
-    gPad->Update();
-}
+    pad->Modified();
+    pad->Update();
+}
Index: trunk/MagicSoft/Mars/mhist/MHEffOnTimeTheta.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHEffOnTimeTheta.h	(revision 2014)
+++ trunk/MagicSoft/Mars/mhist/MHEffOnTimeTheta.h	(revision 2015)
@@ -32,5 +32,4 @@
 
     void Draw(Option_t *option="");
-    TObject *DrawClone(Option_t *option="") const;
 
     ClassDef(MHEffOnTimeTheta, 0) //1D-plot of Delta t vs. Theta
Index: trunk/MagicSoft/Mars/mhist/MHEffOnTimeTime.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHEffOnTimeTime.cc	(revision 2014)
+++ trunk/MagicSoft/Mars/mhist/MHEffOnTimeTime.cc	(revision 2015)
@@ -264,60 +264,35 @@
 // -------------------------------------------------------------------------
 //
-// Draw a copy of the histogram
-//
-TObject *MHEffOnTimeTime::DrawClone(Option_t *opt) const
-{
-    TCanvas &c = *MakeDefCanvas("EffOnTimeTime", "Results from on time fit vs. time");
-    c.Divide(2, 2);
-
-    gROOT->SetSelectedPad(NULL);
-
-    c.cd(1);
-    ((TH2*)&fHEffOn)->DrawCopy(opt);
-
-    c.cd(2);
-    ((TH2*)&fHChi2)->DrawCopy(opt);
-
-    c.cd(3);
-    ((TH2*)&fHLambda)->DrawCopy(opt);
-
-    c.cd(4);
-    ((TH2*)&fHN0del)->DrawCopy(opt);
-
-    c.Modified();
-    c.Update();
-
-    return &c;
-}
-
-// -------------------------------------------------------------------------
-//
 // Draw the histogram
 //
 void MHEffOnTimeTime::Draw(Option_t *opt)
 {
-    if (!gPad)
-        MakeDefCanvas("EffOnTimeTime", "Results from on time fit vs. time");
-
-    gPad->Divide(2,2);
-
-    gPad->cd(1);
+    TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this);
+    pad->SetBorderMode(0);
+
+    pad->Divide(2,2);
+
+    pad->cd(1);
+    gPad->SetBorderMode(0);
     fHEffOn.Draw(opt);
 
-    gPad->cd(2);
+    pad->cd(2);
+    gPad->SetBorderMode(0);
     fHChi2.Draw(opt);
 
-    gPad->cd(3);
+    pad->cd(3);
+    gPad->SetBorderMode(0);
     fHLambda.Draw(opt);
 
-    gPad->cd(4);
+    pad->cd(4);
+    gPad->SetBorderMode(0);
     fHN0del.Draw(opt);
 
-    gPad->Modified();
-    gPad->Update();
-}
-
-
-
-
-
+    pad->Modified();
+    pad->Update();
+}
+
+
+
+
+
Index: trunk/MagicSoft/Mars/mhist/MHEffOnTimeTime.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHEffOnTimeTime.h	(revision 2014)
+++ trunk/MagicSoft/Mars/mhist/MHEffOnTimeTime.h	(revision 2015)
@@ -32,5 +32,4 @@
 
     void Draw(Option_t *option="");
-    TObject *DrawClone(Option_t *option="") const;
 
     ClassDef(MHEffOnTimeTime, 0) //1D-plot of Delta t vs. time
Index: trunk/MagicSoft/Mars/mhist/MHEnergyTheta.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHEnergyTheta.cc	(revision 2014)
+++ trunk/MagicSoft/Mars/mhist/MHEnergyTheta.cc	(revision 2015)
@@ -89,12 +89,4 @@
 // --------------------------------------------------------------------------
 //
-// Delete the three histograms
-//
-MHEnergyTheta::~MHEnergyTheta()
-{
-}
-
-// --------------------------------------------------------------------------
-//
 // Fill data into the histogram which contains all showers
 //
@@ -114,36 +106,12 @@
 void MHEnergyTheta::Draw(Option_t* option)
 {
-    if (!gPad)
-        MakeDefCanvas(&fHist);
+    TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this);
+    pad->SetBorderMode(0);
+    pad->SetLogy();
 
-    fHist.DrawCopy(option);
-    gPad->SetLogy();
+    fHist.Draw(option);
 
-    gPad->Modified();
-    gPad->Update();
-}
-
-// --------------------------------------------------------------------------
-//
-// Creates a new canvas and draws the histogram into it.
-// Be careful: The histogram belongs to this object and won't get deleted
-// together with the canvas.
-//
-TObject *MHEnergyTheta::DrawClone(Option_t* option) const
-{
-    TCanvas *c = MakeDefCanvas(&fHist);
-
-    //
-    // This is necessary to get the expected bahviour of DrawClone
-    //
-    gROOT->SetSelectedPad(NULL);
-
-    ((TH2D&)fHist).DrawCopy(option);
-    gPad->SetLogy();
-
-    c->Modified();
-    c->Update();
-
-    return c;
+    pad->Modified();
+    pad->Update();
 }
 
Index: trunk/MagicSoft/Mars/mhist/MHEnergyTheta.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHEnergyTheta.h	(revision 2014)
+++ trunk/MagicSoft/Mars/mhist/MHEnergyTheta.h	(revision 2015)
@@ -18,12 +18,9 @@
 
 public:
-
     MHEnergyTheta(const char *name=NULL, const char *title=NULL);
-    ~MHEnergyTheta();
 
     Bool_t Fill(const MParContainer *cont, Double_t w=1);
 
     void Draw(Option_t *option="");
-    TObject *DrawClone(Option_t *option="") const;
 
     Bool_t SetupFill(const MParList *plist);
Index: trunk/MagicSoft/Mars/mhist/MHEnergyTime.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHEnergyTime.cc	(revision 2014)
+++ trunk/MagicSoft/Mars/mhist/MHEnergyTime.cc	(revision 2015)
@@ -62,5 +62,4 @@
     //   we set the radius range from 0 m to 500 m with 10 m bin --> 50 ybins
 
-  
     fName  = name  ? name  : "MHEnergyTime";
     fTitle = title ? title : "Data to Calculate Collection Area";
@@ -97,12 +96,4 @@
 // --------------------------------------------------------------------------
 //
-// Delete the three histograms
-//
-MHEnergyTime::~MHEnergyTime()
-{
-}
-
-// --------------------------------------------------------------------------
-//
 // Fill data into the histogram which contains all showers
 //
@@ -122,36 +113,14 @@
 void MHEnergyTime::Draw(Option_t* option)
 {
-    if (!gPad)
-        MakeDefCanvas(&fHist);
+    TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(fHist);
+    pad->SetBorderMode(0);
 
+    AppendPad("");
+
+    pad->SetLogy();
     fHist.DrawCopy(option);
-    gPad->SetLogy();
 
-    gPad->Modified();
-    gPad->Update();
-}
-
-// --------------------------------------------------------------------------
-//
-// Creates a new canvas and draws the histogram into it.
-// Be careful: The histogram belongs to this object and won't get deleted
-// together with the canvas.
-//
-TObject *MHEnergyTime::DrawClone(Option_t* option) const
-{
-    TCanvas *c = MakeDefCanvas(&fHist);
-
-    //
-    // This is necessary to get the expected bahviour of DrawClone
-    //
-    gROOT->SetSelectedPad(NULL);
-
-    ((TH2D&)fHist).DrawCopy(option);
-    gPad->SetLogy();
-
-    c->Modified();
-    c->Update();
-
-    return c;
+    pad->Modified();
+    pad->Update();
 }
 
Index: trunk/MagicSoft/Mars/mhist/MHEnergyTime.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHEnergyTime.h	(revision 2014)
+++ trunk/MagicSoft/Mars/mhist/MHEnergyTime.h	(revision 2015)
@@ -19,12 +19,9 @@
 
 public:
-
     MHEnergyTime(const char *name=NULL, const char *title=NULL);
-    ~MHEnergyTime();
 
     Bool_t Fill(const MParContainer *cont);
 
     void Draw(Option_t *option="");
-    TObject *DrawClone(Option_t *option="") const;
 
     Bool_t SetupFill(const MParList *plist);
Index: trunk/MagicSoft/Mars/mhist/MHFlux.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHFlux.cc	(revision 2014)
+++ trunk/MagicSoft/Mars/mhist/MHFlux.cc	(revision 2015)
@@ -503,53 +503,29 @@
 // -------------------------------------------------------------------------
 //
-//  Draw copies of the histograms
-//
-TObject *MHFlux::DrawClone(Option_t *opt) const
-{
-    TCanvas &c = *MakeDefCanvas("flux", "Orig - Unfold - Flux plots");
-    c.Divide(2, 2);
-
-    gROOT->SetSelectedPad(NULL);
-
-    c.cd(1);
-    ((TH2*)&fHOrig)->DrawCopy("");
-    gPad->SetLogx();
-
-    c.cd(2);
-    ((TH2*)&fHUnfold)->DrawCopy("");
-    gPad->SetLogx();
-
-    c.cd(3);
-    ((TH2*)&fHFlux)->DrawCopy("");
-    gPad->SetLogx();
-
-    c.Modified();
-    c.Update();
-
-    return &c;
-}
-
-// -------------------------------------------------------------------------
-//
 //  Draw the histograms
 //
 void MHFlux::Draw(Option_t *opt)
 {
-    if (!gPad)
-        MakeDefCanvas("flux", "orig-unfold-flux plots");
-
-    gPad->Divide(2,2);
-
-    gPad->cd(1);
+    TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(fHist);
+    pad->SetBorderMode(0);
+
+    AppendPad("");
+
+    pad->Divide(2,2);
+
+    pad->cd(1);
+    gPad->SetBorderMode(0);
     fHOrig.Draw(opt);
 
-    gPad->cd(2);
+    pad->cd(2);
+    gPad->SetBorderMode(0);
     fHUnfold.Draw(opt);
 
-    gPad->cd(3);
+    pad->cd(3);
+    gPad->SetBorderMode(0);
     fHFlux.Draw(opt);
 
-    gPad->Modified();
-    gPad->Update();
+    pad->Modified();
+    pad->Update();
 }
 
Index: trunk/MagicSoft/Mars/mhist/MHFlux.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHFlux.h	(revision 2014)
+++ trunk/MagicSoft/Mars/mhist/MHFlux.h	(revision 2015)
@@ -59,5 +59,5 @@
 
     void Draw(Option_t *option="");
-    TObject *DrawClone(Option_t *option="") const;
+
     void DrawFluxProjectionX(Option_t *opt="") const;
     void DrawOrigProjectionX(Option_t *opt="") const;
Index: trunk/MagicSoft/Mars/mhist/MHMatrix.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHMatrix.cc	(revision 2014)
+++ trunk/MagicSoft/Mars/mhist/MHMatrix.cc	(revision 2015)
@@ -880,8 +880,6 @@
         DrawDefRefInfo(hth, hthd, thsh, refcolumn);
 
-    if (!rest)
-        return kTRUE;
-
-    CopyCrop(*rest, mrest, evtcount2);
+    if (rest)
+        CopyCrop(*rest, mrest, evtcount2);
 
     return kTRUE;
Index: trunk/MagicSoft/Mars/mhist/MHSigmaTheta.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHSigmaTheta.cc	(revision 2014)
+++ trunk/MagicSoft/Mars/mhist/MHSigmaTheta.cc	(revision 2015)
@@ -180,7 +180,7 @@
 {
     Double_t theta = fMcEvt->GetTelescopeTheta()*kRad2Deg;
-    Double_t mySig = fSigmabar->Calc(*fCam, *fPed, *fEvt);
-
-    fSigmaTheta.Fill(theta, mySig);
+    Double_t mysig = fSigmabar->Calc(*fCam, *fPed, *fEvt);
+
+    fSigmaTheta.Fill(theta, mysig);
 
     const UInt_t npix = fEvt->GetNumPixels();
@@ -188,31 +188,21 @@
     for (UInt_t i=0; i<npix; i++)
     {
-      MCerPhotPix cerpix = (*fEvt)[i];
-      if (!cerpix.IsPixelUsed())
-          continue;
-
-      const Int_t id = cerpix.GetPixId();
-      const MPedestalPix &pix = (*fPed)[id];
-
-      const Double_t sigma = pix.GetMeanRms();
-      const Double_t area  = fCam->GetPixRatio(id);
-
-
-      fSigmaPixTheta.Fill(theta, (Double_t)id, sigma);
-
-      const Double_t diff = sigma*sigma/area - mySig*mySig;
-      fDiffPixTheta.Fill(theta, (Double_t)id, diff);
+        MCerPhotPix cerpix = (*fEvt)[i];
+        if (!cerpix.IsPixelUsed())
+            continue;
+
+        const Int_t id = cerpix.GetPixId();
+        const MPedestalPix &pix = (*fPed)[id];
+
+        const Double_t sigma = pix.GetMeanRms();
+        const Double_t area  = fCam->GetPixRatio(id);
+
+        fSigmaPixTheta.Fill(theta, (Double_t)id, sigma);
+
+        const Double_t diff = sigma*sigma/area - mysig*mysig;
+        fDiffPixTheta.Fill(theta, (Double_t)id, diff);
     }
 
     return kTRUE;
-}
-
-// --------------------------------------------------------------------------
-//
-// Draw a copy of the histogram
-//
-TObject *MHSigmaTheta::DrawClone(Option_t *opt) 
-{
-    return MH::DrawClone(opt, 900, 900);
 }
 
Index: trunk/MagicSoft/Mars/mhist/MHSigmaTheta.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHSigmaTheta.h	(revision 2014)
+++ trunk/MagicSoft/Mars/mhist/MHSigmaTheta.h	(revision 2015)
@@ -32,6 +32,4 @@
     MMcEvt         *fMcEvt;      //!
  
-    TH1D fNpix;          // 1D-distribution no.of pixels in MCerPhotEvt; 
-    TH1D fBlindId;       // 1D-distribution Id of blind pixel; 
     TH2D fSigmaTheta;    // 2D-distribution sigmabar versus Theta; 
                          // sigmabar is the average pedestasl sigma in an event
@@ -48,16 +46,12 @@
     const TH2D *GetSigmaTheta() { return &fSigmaTheta; }
     const TH2D *GetSigmaTheta() const { return &fSigmaTheta; }
-    TH2D *GetSigmaThetaByName(const TString name) { return &fSigmaTheta; }
 
     const TH3D *GetSigmaPixTheta() { return &fSigmaPixTheta; }
     const TH3D *GetSigmaPixTheta() const { return &fSigmaPixTheta; }
-    TH3D *GetSigmaPixThetaByName(const TString name) { return &fSigmaPixTheta; }
 
     const TH3D *GetDiffPixTheta() { return &fDiffPixTheta; }
     const TH3D *GetDiffPixTheta() const { return &fDiffPixTheta; }
-    TH3D *GetDiffPixThetaByName(const TString name) { return &fDiffPixTheta; }
 
     void Draw(Option_t *option="");
-    TObject *DrawClone(Option_t *option="");
 
     ClassDef(MHSigmaTheta, 0) //2D-histogram  sigmabar vs. Theta
Index: trunk/MagicSoft/Mars/mhistmc/MHMcCollectionArea.cc
===================================================================
--- trunk/MagicSoft/Mars/mhistmc/MHMcCollectionArea.cc	(revision 2014)
+++ trunk/MagicSoft/Mars/mhistmc/MHMcCollectionArea.cc	(revision 2015)
@@ -160,37 +160,8 @@
 }
 
-// --------------------------------------------------------------------------
-//
-// Creates a new canvas and draws the histogram into it.
-// Be careful: The histogram belongs to this object and won't get deleted
-// together with the canvas.
-//
-TObject *MHMcCollectionArea::DrawClone(Option_t* opt) const
-{
-    return MH::DrawClone(opt);
-/*
-    TCanvas *c = MH::MakeDefCanvas(fHistCol);
-
-    //
-    // This is necessary to get the expected bahviour of DrawClone
-    //
-    gROOT->SetSelectedPad(NULL);
-
-    fHistCol->DrawCopy(option);
-
-    gPad->SetLogx();
-
-    c->Modified();
-    c->Update();
-
-    return c;*/
-}
-
 void MHMcCollectionArea::Draw(Option_t* option)
 {
     TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this);
     pad->SetBorderMode(0);
-    //    if (!gPad)
-    //        MH::MakeDefCanvas(fHistCol);
 
     fHistCol->Draw(option);
Index: trunk/MagicSoft/Mars/mhistmc/MHMcCollectionArea.h
===================================================================
--- trunk/MagicSoft/Mars/mhistmc/MHMcCollectionArea.h	(revision 2014)
+++ trunk/MagicSoft/Mars/mhistmc/MHMcCollectionArea.h	(revision 2015)
@@ -36,5 +36,4 @@
 
     void Draw(Option_t *option="");
-    TObject *DrawClone(Option_t *option="") const;
 
     void CalcEfficiency();
Index: trunk/MagicSoft/Mars/mhistmc/MHMcDifRate.cc
===================================================================
--- trunk/MagicSoft/Mars/mhistmc/MHMcDifRate.cc	(revision 2014)
+++ trunk/MagicSoft/Mars/mhistmc/MHMcDifRate.cc	(revision 2015)
@@ -82,12 +82,4 @@
 }
 
-//-------------------------------------------------------------------------
-//
-//  Defualt Destructor
-//
-MHMcDifRate::~MHMcDifRate()
-{
-}
-
 // ------------------------------------------------------------------------
 // 
@@ -96,32 +88,15 @@
 void MHMcDifRate::Draw(Option_t *option)
 {
-    if (!gPad)
-        MH::MakeDefCanvas(&fHist);
+    TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(fHist);
+    pad->SetBorderMode(0);
 
-    gPad->SetLogx();
+    AppendPad("");
+
+    pad->SetLogx();
 
     fHist.Draw(option);
 
-    gPad->Modified();
-    gPad->Update();
-}
-
-TObject *MHMcDifRate::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/mhistmc/MHMcDifRate.h
===================================================================
--- trunk/MagicSoft/Mars/mhistmc/MHMcDifRate.h	(revision 2014)
+++ trunk/MagicSoft/Mars/mhistmc/MHMcDifRate.h	(revision 2015)
@@ -23,5 +23,4 @@
 public:
     MHMcDifRate(const char *name=NULL, const char *title=NULL);
-    ~MHMcDifRate();
 
     void SetName(const char *name);
@@ -34,5 +33,4 @@
 
     void Draw(Option_t* option = "");
-    TObject *DrawClone(Option_t* option = "") const;
 
 //    void Calc(const TH2D &hsel, const TH2D &hall);
Index: trunk/MagicSoft/Mars/mhistmc/MHMcEfficiency.cc
===================================================================
--- trunk/MagicSoft/Mars/mhistmc/MHMcEfficiency.cc	(revision 2014)
+++ trunk/MagicSoft/Mars/mhistmc/MHMcEfficiency.cc	(revision 2015)
@@ -91,12 +91,4 @@
 }
 
-//-------------------------------------------------------------------------
-//
-//  Defualt Destructor
-//
-MHMcEfficiency::~MHMcEfficiency()
-{
-}
-
 // ------------------------------------------------------------------------
 // 
@@ -105,32 +97,15 @@
 void MHMcEfficiency::Draw(Option_t *option)
 {
-    if (!gPad)
-        MH::MakeDefCanvas(&fHist);
+    TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(fHist);
+    pad->SetBorderMode(0);
 
-    gPad->SetLogx();
+    AppendPad("");
+
+    pad->SetLogx();
 
     fHist.Draw(option);
 
-    gPad->Modified();
-    gPad->Update();
-}
-
-TObject *MHMcEfficiency::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);
-
-    ((TH2D&)fHist).DrawCopy(option);
-
-    c->Modified();
-    c->Update();
-
-    return c;
+    pad->Modified();
+    pad->Update();
 }
 
Index: trunk/MagicSoft/Mars/mhistmc/MHMcEfficiency.h
===================================================================
--- trunk/MagicSoft/Mars/mhistmc/MHMcEfficiency.h	(revision 2014)
+++ trunk/MagicSoft/Mars/mhistmc/MHMcEfficiency.h	(revision 2015)
@@ -22,5 +22,4 @@
 public:
     MHMcEfficiency(const char *name=NULL, const char *title=NULL);
-    ~MHMcEfficiency();
 
     void SetName(const char *name);
@@ -33,5 +32,4 @@
 
     void Draw(Option_t* option = "");
-    TObject *DrawClone(Option_t* option = "") const;
 
     void Calc(const TH2D &hsel, const TH2D &hall);
Index: trunk/MagicSoft/Mars/mhistmc/MHMcEfficiencyEnergy.cc
===================================================================
--- trunk/MagicSoft/Mars/mhistmc/MHMcEfficiencyEnergy.cc	(revision 2014)
+++ trunk/MagicSoft/Mars/mhistmc/MHMcEfficiencyEnergy.cc	(revision 2015)
@@ -86,12 +86,4 @@
 }
 
-//-------------------------------------------------------------------------
-//
-//  Defualt Destructor
-//
-MHMcEfficiencyEnergy::~MHMcEfficiencyEnergy()
-{
-}
-
 // ------------------------------------------------------------------------
 // 
@@ -100,32 +92,15 @@
 void MHMcEfficiencyEnergy::Draw(Option_t *option)
 {
-    if (!gPad)
-        MH::MakeDefCanvas(&fHist);
+    TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(fHist);
+    pad->SetBorderMode(0);
 
-    gPad->SetLogx();
+    AppendPad("");
+
+    pad->SetLogx();
 
     fHist.Draw(option);
 
-    gPad->Modified();
-    gPad->Update();
-}
-
-TObject *MHMcEfficiencyEnergy::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/mhistmc/MHMcEfficiencyEnergy.h
===================================================================
--- trunk/MagicSoft/Mars/mhistmc/MHMcEfficiencyEnergy.h	(revision 2014)
+++ trunk/MagicSoft/Mars/mhistmc/MHMcEfficiencyEnergy.h	(revision 2015)
@@ -22,5 +22,4 @@
 public:
     MHMcEfficiencyEnergy(const char *name=NULL, const char *title=NULL);
-    ~MHMcEfficiencyEnergy();
 
     void SetName(const char *name);
@@ -33,5 +32,4 @@
 
     void Draw(Option_t* option = "");
-    TObject *DrawClone(Option_t* option = "") const;
 
     void Calc(const TH2D &hsel, const TH2D &hall);
Index: trunk/MagicSoft/Mars/mhistmc/MHMcEfficiencyImpact.cc
===================================================================
--- trunk/MagicSoft/Mars/mhistmc/MHMcEfficiencyImpact.cc	(revision 2014)
+++ trunk/MagicSoft/Mars/mhistmc/MHMcEfficiencyImpact.cc	(revision 2015)
@@ -86,12 +86,4 @@
 }
 
-//-------------------------------------------------------------------------
-//
-//  Defualt Destructor
-//
-MHMcEfficiencyImpact::~MHMcEfficiencyImpact()
-{
-}
-
 // ------------------------------------------------------------------------
 // 
@@ -100,13 +92,15 @@
 void MHMcEfficiencyImpact::Draw(Option_t *option)
 {
-    if (!gPad)
-        MH::MakeDefCanvas(&fHist);
+    TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(fHist);
+    pad->SetBorderMode(0);
 
-    gPad->SetLogx();
+    AppendPad("");
+
+    pad->SetLogx();
 
     fHist.Draw(option);
 
-    gPad->Modified();
-    gPad->Update();
+    pad->Modified();
+    pad->Update();
 }
 
Index: trunk/MagicSoft/Mars/mhistmc/MHMcEfficiencyImpact.h
===================================================================
--- trunk/MagicSoft/Mars/mhistmc/MHMcEfficiencyImpact.h	(revision 2014)
+++ trunk/MagicSoft/Mars/mhistmc/MHMcEfficiencyImpact.h	(revision 2015)
@@ -22,5 +22,4 @@
 public:
     MHMcEfficiencyImpact(const char *name=NULL, const char *title=NULL);
-    ~MHMcEfficiencyImpact();
 
     void SetName(const char *name);
@@ -33,5 +32,4 @@
 
     void Draw(Option_t* option = "");
-    TObject *DrawClone(Option_t* option = "") const;
 
     void Calc(const TH2D &hsel, const TH2D &hall);
Index: trunk/MagicSoft/Mars/mhistmc/MHMcEnergy.cc
===================================================================
--- trunk/MagicSoft/Mars/mhistmc/MHMcEnergy.cc	(revision 2014)
+++ trunk/MagicSoft/Mars/mhistmc/MHMcEnergy.cc	(revision 2015)
@@ -170,6 +170,8 @@
 void MHMcEnergy::Draw(Option_t *option)
 {
-    if (!gPad)
-        MH::MakeDefCanvas(fHist);
+    TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(fHist);
+    pad->SetBorderMode(0);
+
+    AppendPad("");
 
     fHist->Draw(option);
@@ -177,25 +179,6 @@
     DrawLegend();
 
-    gPad->Modified();
-    gPad->Update();
-}
-
-TObject *MHMcEnergy::DrawClone(Option_t *option) const
-{
-    TCanvas *c = MH::MakeDefCanvas(fHist);
-
-    //
-    // This is necessary to get the expected bahviour of DrawClone
-    //
-    gROOT->SetSelectedPad(NULL);
-
-    fHist->DrawClone(option);
-
-    DrawLegend();
-
-    c->Modified();
-    c->Update();
-
-    return c;
+    pad->Modified();
+    pad->Update();
 }
 
Index: trunk/MagicSoft/Mars/mhistmc/MHMcEnergy.h
===================================================================
--- trunk/MagicSoft/Mars/mhistmc/MHMcEnergy.h	(revision 2014)
+++ trunk/MagicSoft/Mars/mhistmc/MHMcEnergy.h	(revision 2015)
@@ -49,5 +49,4 @@
 
     void Draw(Option_t* option = "");
-    TObject *DrawClone(Option_t* option = "") const;
 
     void Print(Option_t* option = NULL) const;
Index: trunk/MagicSoft/Mars/mhistmc/MHMcEnergyImpact.cc
===================================================================
--- trunk/MagicSoft/Mars/mhistmc/MHMcEnergyImpact.cc	(revision 2014)
+++ trunk/MagicSoft/Mars/mhistmc/MHMcEnergyImpact.cc	(revision 2015)
@@ -93,13 +93,4 @@
 }
 
-//-------------------------------------------------------------------------
-//
-//  Defualt Destructor
-//
-MHMcEnergyImpact::~MHMcEnergyImpact()
-{
-}
-
-
 Bool_t MHMcEnergyImpact::SetupFill(const MParList *pList)
 {
@@ -137,32 +128,14 @@
 void MHMcEnergyImpact::Draw(Option_t *option)
 {
-    if (!gPad)
-        MH::MakeDefCanvas(&fHist);
+    TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(fHist);
+    pad->SetBorderMode(0);
 
-    gPad->SetLogx();
+    AppendPad("");
+
+    pad->SetLogx();
 
     fHist.Draw(option);
 
-    gPad->Modified();
-    gPad->Update();
+    pad->Modified();
+    pad->Update();
 }
-
-TObject *MHMcEnergyImpact::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);
-
-    ((TH2D&)fHist).DrawCopy(option);
-
-    c->Modified();
-    c->Update();
-
-    return c;
-}
-
Index: trunk/MagicSoft/Mars/mhistmc/MHMcEnergyImpact.h
===================================================================
--- trunk/MagicSoft/Mars/mhistmc/MHMcEnergyImpact.h	(revision 2014)
+++ trunk/MagicSoft/Mars/mhistmc/MHMcEnergyImpact.h	(revision 2015)
@@ -18,5 +18,4 @@
 public:
     MHMcEnergyImpact(const char *name=NULL, const char *title=NULL);
-    ~MHMcEnergyImpact();
 
     void SetName(const char *name);
@@ -32,5 +31,4 @@
 
     void Draw(Option_t* option = "");
-    TObject *DrawClone(Option_t* option = "") const;
 
     ClassDef(MHMcEnergyImpact, 1)  // Histogram container for 2D histogram in Energy and Impact
Index: trunk/MagicSoft/Mars/mhistmc/MHMcEnergyMigration.cc
===================================================================
--- trunk/MagicSoft/Mars/mhistmc/MHMcEnergyMigration.cc	(revision 2014)
+++ trunk/MagicSoft/Mars/mhistmc/MHMcEnergyMigration.cc	(revision 2015)
@@ -107,106 +107,49 @@
 // --------------------------------------------------------------------------
 //
-// Draw a copy of the histogram
-//
-TObject *MHMcEnergyMigration::DrawClone(Option_t *opt) const
-{
-    TCanvas &c = *MakeDefCanvas("EnergyMigration", "E-est vs. E-true");
-
-    c.Divide(2, 2);
-
-    gROOT->SetSelectedPad(NULL);
-
-    TH1 *h;
-
-    c.cd(1);
-    h = ((TH3*)(&fHist))->Project3D("expro");
-
-    h->SetTitle("Distribution of E-true");
-    h->SetXTitle("E_{true} [GeV]");
-    h->SetYTitle("Counts");
-
-    h->Draw(opt);
-    h->SetBit(kCanDelete);
-    gPad->SetLogx();
-
-
-    c.cd(2);
-    h = ((TH3*)(&fHist))->Project3D("eypro");
-
-    h->SetTitle("Distribution of E-est");
-    h->SetXTitle("E_{est} [GeV]");
-    h->SetYTitle("Counts");
-
-    h->Draw(opt);
-    h->SetBit(kCanDelete);
-    gPad->SetLogx();
-
-    c.cd(3);
-    h = ((TH3*)(&fHist))->Project3D("ezpro");
-
-    h->SetTitle("Distribution of Theta");
-    h->SetXTitle("\\Theta [\\circ]");
-    h->SetYTitle("Counts");
-
-    h->Draw(opt);
-    h->SetBit(kCanDelete);
-
-
-    c.cd(4);
-    ((TH3*)(&fHist))->DrawCopy(opt);
-
-    c.Modified();
-    c.Update();
-
-    return &c;
-}
-
-// --------------------------------------------------------------------------
-//
 // Draw the histogram
 //
 void MHMcEnergyMigration::Draw(Option_t *opt)
 {
-    if (!gPad)
-        MakeDefCanvas("EnergyMigration", "E-est vs. E-true");
+    TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(fHist);
+    pad->SetBorderMode(0);
 
-    gPad->Divide(2,2);
+    AppendPad("");
+
+    pad->Divide(2,2);
     
     TH1 *h;
 
-    gPad->cd(1);
+    pad->cd(1);
+    gPad->SetBorderMode(0);
+    gPad->SetLogx();
     h = fHist.Project3D("ex_pro");
-
-    h->SetTitle("Distribution of E-true");
+    h->SetTitle("Distribution of E_{true}");
     h->SetXTitle("E_{true} [GeV]");
-
     h->Draw(opt);
     h->SetBit(kCanDelete);
+
+    pad->cd(2);
+    gPad->SetBorderMode(0);
     gPad->SetLogx();
-
-
-    gPad->cd(2);
     h = fHist.Project3D("ey_pro");
-
-    h->SetTitle("Distribution of E-est");
+    h->SetTitle("Distribution of E_{est}");
     h->SetXTitle("E_{est} [GeV]");
     h->Draw(opt);
     h->SetBit(kCanDelete);
-    gPad->SetLogx();
 
-    gPad->cd(3);
+    pad->cd(3);
+    gPad->SetBorderMode(0);
     h = fHist.Project3D("ez_pro");
-
-    h->SetTitle("Distribution of Theta");
+    h->SetTitle("Distribution of \\Theta");
     h->SetXTitle("\\Theta [\\circ]");
     h->Draw(opt);
     h->SetBit(kCanDelete);
 
+    pad->cd(4);
+    gPad->SetBorderMode(0);
+    fHist.Draw(opt);
 
-    gPad->cd(4);
-    fHist.DrawCopy(opt);
-
-    gPad->Modified();
-    gPad->Update();
+    pad->Modified();
+    pad->Update();
 }
 
Index: trunk/MagicSoft/Mars/mhistmc/MHMcEnergyMigration.h
===================================================================
--- trunk/MagicSoft/Mars/mhistmc/MHMcEnergyMigration.h	(revision 2014)
+++ trunk/MagicSoft/Mars/mhistmc/MHMcEnergyMigration.h	(revision 2015)
@@ -34,5 +34,4 @@
 
     void Draw(Option_t *option="");
-    TObject *DrawClone(Option_t *option="") const;
 
     ClassDef(MHMcEnergyMigration, 1) //3D-histogram   E-true E-est Theta
Index: trunk/MagicSoft/Mars/mhistmc/MHMcRate.cc
===================================================================
--- trunk/MagicSoft/Mars/mhistmc/MHMcRate.cc	(revision 2014)
+++ trunk/MagicSoft/Mars/mhistmc/MHMcRate.cc	(revision 2015)
@@ -20,12 +20,16 @@
 !   Author(s): Abelardo Moralejo 2/2003
 !
-!   Explanations on the rate calculation can be found in 
-!   chapter 7 of the following diploma thesis: 
-!   http://www.pd.infn.it/magic/tesi2.ps.gz (in Italian)
-!
 !   Copyright: MAGIC Software Development, 2000-2001
 !
 !
 \* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//
+//   Explanations on the rate calculation can be found in
+//   chapter 7 of the following diploma thesis:
+//   http://www.pd.infn.it/magic/tesi2.ps.gz (in Italian)
+//
+////////////////////////////////////////////////////////////////////////////
 
 #include "MHMcRate.h" 
@@ -251,7 +255,3 @@
 }
 
-TObject *MHMcRate::DrawClone(Option_t *) const
-{
-    *fLog << all << dbginf << " - MHMcRate::DrawClone: To be iplemented" << endl;
-    return NULL;
-} 
+q
Index: trunk/MagicSoft/Mars/mhistmc/MHMcRate.h
===================================================================
--- trunk/MagicSoft/Mars/mhistmc/MHMcRate.h	(revision 2014)
+++ trunk/MagicSoft/Mars/mhistmc/MHMcRate.h	(revision 2015)
@@ -12,17 +12,16 @@
     UShort_t fPartId;           // Type of particle
 
-    Float_t fEnergyMax;         // Maximum Energy in TeV
-    Float_t fEnergyMin;         // Minimum Energy in TeV
+    Float_t fEnergyMax;         // Maximum Energy [TeV]
+    Float_t fEnergyMin;         // Minimum Energy [TeV]
 
-    Float_t fThetaMax;          // Maximum theta angle of run
-    Float_t fThetaMin;          // Minimum theta angle of run
-    Float_t fPhiMax;            // Maximum phi angle of run
-    Float_t fPhiMin;            // Minimum phi angle of run
+    Float_t fThetaMax;          // Maximum theta angle of run [?]
+    Float_t fThetaMin;          // Minimum theta angle of run [?]
+    Float_t fPhiMax;            // Maximum phi angle of run [?]
+    Float_t fPhiMin;            // Minimum phi angle of run [?]
 
-    Float_t fSolidAngle;        // Solid angle within which incident directions
-                                // are distributed (sr)
+    Float_t fSolidAngle;        // Solid angle within which incident directions are distributed [sr]
 
-    Float_t fImpactMax;         // Maximum impact parameter (cm)
-    Float_t fImpactMin;         // Minimum impact parameter (cm)
+    Float_t fImpactMax;         //[cm] Maximum impact parameter [cm]
+    Float_t fImpactMin;         //[cm] Minimum impact parameter [cm]
 
     Float_t fBackTrig;          // Number of triggers from background
@@ -38,11 +37,9 @@
     Float_t fTriggerRateError;  // Estimated error for the trigger rate in Hz
 
-    Float_t fMeanThreshold;     // Mean discriminator threshold (mV) of trigger
-                                // pixels.
+    Float_t fMeanThreshold;     // Mean discriminator threshold of trigger pixels [mV]
 
     Short_t fMultiplicity;      // L1 trigger multiplicity.
 
-    Short_t fTriggerCondNum;    // Trigger condition number, for the case of
-                                // running over camra files containing several.
+    Short_t fTriggerCondNum;    // Trigger condition number, for the case of running over camra files containing several.
 
     void Init(const char *name, const char *title);
@@ -93,5 +90,4 @@
 
     void Draw(Option_t *o=NULL);
-    TObject *DrawClone(Option_t *o=NULL) const;
 
     ClassDef(MHMcRate, 1)  // Data Container to calculate trigger rate
Index: trunk/MagicSoft/Mars/mmain/MStatusDisplay.cc
===================================================================
--- trunk/MagicSoft/Mars/mmain/MStatusDisplay.cc	(revision 2014)
+++ trunk/MagicSoft/Mars/mmain/MStatusDisplay.cc	(revision 2015)
@@ -226,5 +226,8 @@
 // To disable redirction call SetLogStream(NULL)
 //
-void MStatusDisplay::SetLogStream(MLog *log)
+// if enable==kFALSE the stdout is disabled/enabled. Otherwise stdout
+// is ignored.
+//
+void MStatusDisplay::SetLogStream(MLog *log, Bool_t enable)
 {
     if (log && fLogBox==NULL)
@@ -256,6 +259,7 @@
 
         log->SetOutputGui(fLogBox, kTRUE);
-        log->DisableOutputDevice(MLog::eStdout);
         log->EnableOutputDevice(MLog::eGui);
+        if (!enable)
+            log->DisableOutputDevice(MLog::eStdout);
 
         fLogTimer.Start();
@@ -266,6 +270,7 @@
 
         fLog->DisableOutputDevice(MLog::eGui);
-        fLog->EnableOutputDevice(MLog::eStdout);
         fLog->SetOutputGui(NULL);
+        if (!enable)
+            fLog->EnableOutputDevice(MLog::eStdout);
 
         fLog = &gLog;
@@ -1134,5 +1139,5 @@
         if (num<0)
             *fLog << inf << " - ";
-        *fLog << "Writing Tab #" << i << ": " << c->GetName() << " (" << n << ") ";
+        *fLog << inf << "Writing Tab #" << i << ": " << c->GetName() << " (" << n << ") ";
         if (num>0)
             *fLog << "to " << name;
Index: trunk/MagicSoft/Mars/mmain/MStatusDisplay.h
===================================================================
--- trunk/MagicSoft/Mars/mmain/MStatusDisplay.h	(revision 2014)
+++ trunk/MagicSoft/Mars/mmain/MStatusDisplay.h	(revision 2015)
@@ -105,5 +105,5 @@
      virtual ~MStatusDisplay();
 
-     void SetLogStream(MLog *log);
+     void SetLogStream(MLog *log, Bool_t enable=kFALSE);
 
      void StartUpdate(Int_t millisec=-1);
