Index: trunk/MagicSoft/Mars/mhist/MH.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MH.cc	(revision 2179)
+++ trunk/MagicSoft/Mars/mhist/MH.cc	(revision 2180)
@@ -733,9 +733,17 @@
     // Rename first statistics box
     //
-    TPaveStats &s1 = *(TPaveStats*)gPad->FindObject("stats");
-    const Double_t x1 = s1.GetX1NDC()-0.01;
-    s1.SetName((TString)"Stat"+hist1.GetTitle());
-    s1.SetX1NDC(x1-(s1.GetX2NDC()-s1.GetX1NDC()));
-    s1.SetX2NDC(x1);
+    // Where to get the TPaveStats depends on the root version
+    TPaveStats *s1 = (TPaveStats*)gPad->FindObject("stats");
+    if (!s1)
+        s1 = (TPaveStats*)hist1.GetListOfFunctions()->FindObject("stats");
+    else
+        s1->SetName((TString)"Stat"+hist1.GetTitle());
+
+    if (s1)
+    {
+        const Double_t x1 = s1->GetX1NDC()-0.01;
+        s1->SetX1NDC(x1-(s1->GetX2NDC()-s1->GetX1NDC()));
+        s1->SetX2NDC(x1);
+    }
 
     //
@@ -748,17 +756,24 @@
     // Draw Legend
     //
-    TPaveStats &s2 = *(TPaveStats*)gPad->FindObject("stats");
-    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());
-    l.AddEntry(&hist2, hist2.GetTitle());
-    l.SetTextSize(s2.GetTextSize());
-    l.SetTextFont(s2.GetTextFont());
-    l.SetBorderSize(s2.GetBorderSize());
-    l.SetBit(kCanDelete);
-    l.Draw();
+    // Where to get the TPaveStats depends on the root version
+    TPaveStats *s2 = (TPaveStats*)gPad->FindObject("stats");
+    if (!s2)
+        s2 = (TPaveStats*)hist2.GetListOfFunctions()->FindObject("stats");
+
+    if (s2)
+    {
+        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());
+        l.AddEntry(&hist2, hist2.GetTitle());
+        l.SetTextSize(s2->GetTextSize());
+        l.SetTextFont(s2->GetTextFont());
+        l.SetBorderSize(s2->GetBorderSize());
+        l.SetBit(kCanDelete);
+        l.Draw();
+    }
 }
 
Index: trunk/MagicSoft/Mars/mhist/MHHadronness.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHHadronness.cc	(revision 2179)
+++ trunk/MagicSoft/Mars/mhist/MHHadronness.cc	(revision 2180)
@@ -93,5 +93,4 @@
     fGraph = new TGraph;
     fGraph->SetTitle("Acceptance Gammas vs. Hadrons");
-    fGraph->SetMaximum(1);
     fGraph->SetMarkerStyle(kFullDotSmall);
 
@@ -474,4 +473,5 @@
         h->SetXTitle("Acceptance Hadrons");
         h->SetYTitle("Acceptance Gammas");
+        fGraph->SetMaximum(1);
         fGraph->Draw("P");
         gPad->Modified();
