Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 1264)
+++ trunk/MagicSoft/Mars/Changelog	(revision 1265)
@@ -1,3 +1,16 @@
                                                                   -*-*- END -*-*-
+
+ 2002/03/21: Thomas Bretz
+
+   * mhists/MH.cc:
+     - TAxis::Set resets the axis title so I implemented a workaround
+       in SetBinning so that the axis title survives.
+
+   * mhists/MHEffOnTimeTheta.cc, MHEffOnTimeTime.cc:
+     - replaced Get*axis()->SetTitle() by Set*Title()
+     - corrected the Name in MakeDefCanvas
+
+
+
  2002/03/20: Thomas Bretz
 
Index: trunk/MagicSoft/Mars/mhist/MH.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MH.cc	(revision 1264)
+++ trunk/MagicSoft/Mars/mhist/MH.cc	(revision 1265)
@@ -117,4 +117,11 @@
 {
     //
+    // Another strange behaviour: TAxis::Set deletes the axis title!
+    //
+    TAxis &x = *h->GetXaxis();
+
+    TString xtitle = x.GetTitle();
+
+    //
     // This is a necessary workaround if one wants to set
     // non-equidistant bins after the initialization
@@ -127,9 +134,19 @@
     // in one of the two given histograms
     //
-    h->GetXaxis()->Set(binsx->GetNumBins(), binsx->GetEdges());
+    x.Set(binsx->GetNumBins(), binsx->GetEdges());
+    x.SetTitle(xtitle);
 }
 
 void MH::SetBinning(TH1 *h, const MBinning *binsx, const MBinning *binsy)
 {
+    TAxis &x = *h->GetXaxis();
+    TAxis &y = *h->GetYaxis();
+
+    //
+    // Another strange behaviour: TAxis::Set deletes the axis title!
+    //
+    TString xtitle = x.GetTitle();
+    TString ytitle = y.GetTitle();
+
     //
     // This is a necessary workaround if one wants to set
@@ -144,10 +161,23 @@
     // in one of the two given histograms
     //
-    h->GetXaxis()->Set(binsx->GetNumBins(), binsx->GetEdges());
-    h->GetYaxis()->Set(binsy->GetNumBins(), binsy->GetEdges());
+    x.Set(binsx->GetNumBins(), binsx->GetEdges());
+    y.Set(binsy->GetNumBins(), binsy->GetEdges());
+    x.SetTitle(xtitle);
+    y.SetTitle(ytitle);
 }
 
 void MH::SetBinning(TH1 *h, const MBinning *binsx, const MBinning *binsy, const MBinning *binsz)
 {
+    //
+    // Another strange behaviour: TAxis::Set deletes the axis title!
+    //
+    TAxis &x = *h->GetXaxis();
+    TAxis &y = *h->GetYaxis();
+    TAxis &z = *h->GetZaxis();
+
+    TString xtitle = x.GetTitle();
+    TString ytitle = y.GetTitle();
+    TString ztitle = z.GetTitle();
+
     //
     // This is a necessary workaround if one wants to set
@@ -163,7 +193,10 @@
     // in one of the two given histograms
     //
-    h->GetXaxis()->Set(binsx->GetNumBins(), binsx->GetEdges());
-    h->GetYaxis()->Set(binsy->GetNumBins(), binsy->GetEdges());
-    h->GetZaxis()->Set(binsz->GetNumBins(), binsz->GetEdges());
+    x.Set(binsx->GetNumBins(), binsx->GetEdges());
+    y.Set(binsy->GetNumBins(), binsy->GetEdges());
+    z.Set(binsz->GetNumBins(), binsz->GetEdges());
+    x.SetTitle(xtitle);
+    y.SetTitle(ytitle);
+    z.SetTitle(ztitle);
 }
 
Index: trunk/MagicSoft/Mars/mhist/MHEffOnTimeTheta.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHEffOnTimeTheta.cc	(revision 1264)
+++ trunk/MagicSoft/Mars/mhist/MHEffOnTimeTheta.cc	(revision 1265)
@@ -67,6 +67,6 @@
     fHist.SetDirectory(NULL);
 
-    fHist.GetXaxis()->SetTitle("t_{eff} [s]");
-    fHist.GetYaxis()->SetTitle("\\Theta [\\circ]");
+    fHist.SetXTitle("t_{eff} [s]");
+    fHist.SetYTitle("\\Theta [\\circ]");
 }
 
Index: trunk/MagicSoft/Mars/mhist/MHEffOnTimeTime.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHEffOnTimeTime.cc	(revision 1264)
+++ trunk/MagicSoft/Mars/mhist/MHEffOnTimeTime.cc	(revision 1265)
@@ -68,11 +68,11 @@
     fHist.SetDirectory(NULL);
 
-    fHist.GetXaxis()->SetTitle("t_{eff} [s]");
-    fHist.GetYaxis()->SetTitle("t [s]");
+    fHist.SetXTitle("t_{eff} [s]");
+    fHist.SetYTitle("t [s]");
 }
 
 TObject *MHEffOnTimeTime::DrawClone(Option_t *opt) const
 {
-    TCanvas *c = MakeDefCanvas("EffOnTimeTheta", "t_eff vs. t");
+    TCanvas *c = MakeDefCanvas("EffOnTimeTime", "t_eff vs. t");
 
     gROOT->SetSelectedPad(NULL);
@@ -89,5 +89,5 @@
 {
     if (!gPad)
-        MakeDefCanvas("EffOnTimeTheta", "t_eff vs. t");
+        MakeDefCanvas("EffOnTimeTime", "t_eff vs. t");
 
     fHist.Draw(opt);
Index: trunk/MagicSoft/Mars/mhist/MHTimeDiffTime.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHTimeDiffTime.cc	(revision 1264)
+++ trunk/MagicSoft/Mars/mhist/MHTimeDiffTime.cc	(revision 1265)
@@ -90,5 +90,5 @@
 TObject *MHTimeDiffTime::DrawClone(Option_t *opt) const
 {
-    TCanvas *c = MakeDefCanvas("DiffTimeTime", "Distrib of \\Delta t, t");
+    TCanvas *c = MakeDefCanvas("DiffTimeTime", "Distrib of dt, t");
     c->Divide(2, 2);
 
@@ -123,5 +123,5 @@
 {
     if (!gPad)
-        MakeDefCanvas("DiffTimeTime", "Distrib of \\Delta t, t");
+        MakeDefCanvas("DiffTimeTime", "Distrib of dt, t");
 
     gPad->Divide(2,2);
