Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 7714)
+++ trunk/MagicSoft/Mars/Changelog	(revision 7715)
@@ -39,4 +39,8 @@
    * callisto.cc:
      - fixed typo in output
+
+   * mhflux/MHThreshold.cc:
+     - enabled grids
+     - slightly improved calculation of shown threshold
 
 
Index: trunk/MagicSoft/Mars/mhflux/MHThreshold.cc
===================================================================
--- trunk/MagicSoft/Mars/mhflux/MHThreshold.cc	(revision 7714)
+++ trunk/MagicSoft/Mars/mhflux/MHThreshold.cc	(revision 7715)
@@ -74,5 +74,5 @@
 
     fHEnergy.SetName("Threshold");
-    fHEnergy.SetTitle("Energy Thrshold");
+    fHEnergy.SetTitle("Energy Threshold");
     fHEnergy.SetXTitle("E [GeV]");
     fHEnergy.SetYTitle("dN/dE [GeV^{-1}]");
@@ -81,5 +81,5 @@
     fHEnergy.Sumw2();
 
-    MBinning binse(80, 10, 1000000, "", "log");
+    MBinning binse(50, 20, 50000, "", "log");
     binse.Apply(fHEnergy);
 }
@@ -108,12 +108,30 @@
 void MHThreshold::Paint(Option_t *option)
 {
-    const TAxis &axe = *fHEnergy.GetXaxis();
+    if (fHEnergy.GetEntries()==0)
+        return;
 
-    const Int_t  bin  = fHEnergy.GetMaximumBin();
+    TH1D h(fHEnergy);
+
+    Int_t min=1;
+    while (min<h.GetNbinsX() && h.GetBinContent(min)==0)
+        min++;
+    Int_t max=h.GetNbinsX();
+    while (max>min && h.GetBinContent(max)==0)
+        max--;
+
+    if (max-min<5)
+        return;
+
+    h.Smooth(1, min, max);
+
+    const Int_t bin  =  h.GetMaximumBin();
+    const TAxis &axe = *h.GetXaxis();
 
     // Assume that the energy binning is logarithmic
     const Axis_t maxe = TMath::Sqrt(axe.GetBinLowEdge(bin)*axe.GetBinUpEdge(bin));
 
-    TLatex text(0.30, 0.95, Form("E_{max}=%dGeV", TMath::Nint(maxe)));
+    TLatex text(0.30, 0.95, Form("E_{max}=%dGeV (%dGeV,%dGeV)", TMath::Nint(maxe),
+                                 TMath::Nint(axe.GetBinLowEdge(bin)),
+                                 TMath::Nint(axe.GetBinUpEdge(bin))));
     text.SetBit(TLatex::kTextNDC);
     text.SetTextSize(0.04);
@@ -131,4 +149,6 @@
     gPad->SetLogx();
     gPad->SetLogy();
+    gPad->SetGridx();
+    gPad->SetGridy();
 
     fHEnergy.Draw();
