Index: trunk/Mars/Changelog
===================================================================
--- trunk/Mars/Changelog	(revision 9847)
+++ trunk/Mars/Changelog	(revision 9848)
@@ -41,4 +41,8 @@
      - added SetTrainExpSize member function
 
+   * mjtrain/MJTrainDisp.cc:
+     - made the display of the cut-lines a bit more flexible
+     - slightly changed the meaning of the plots
+
 
 
Index: trunk/Mars/mjtrain/MJTrainDisp.cc
===================================================================
--- trunk/Mars/mjtrain/MJTrainDisp.cc	(revision 9847)
+++ trunk/Mars/mjtrain/MJTrainDisp.cc	(revision 9848)
@@ -132,5 +132,6 @@
     //gPad->SetRightMargin(0.12);
 
-    const Float_t cutval = hist.GetYaxis()->GetBinLowEdge(4);
+    const Int_t bin = 3;
+    const Float_t cutval = hist.GetYaxis()->GetBinUpEdge(bin);
 
     TH1D heff;
@@ -143,10 +144,9 @@
     MH::SetBinning(&heff, hist.GetXaxis());
 
-
     for (int x=0; x<=hist.GetNbinsX()+1; x++)
     {
         const Double_t n0 = hist.Integral(x, x, -1, -1);
         if (n0>0)
-            heff.SetBinContent(x, hist.Integral(x, x, -1, 3)/n0);
+            heff.SetBinContent(x, hist.Integral(x, x, -1, bin)/n0);
     }
 
@@ -155,5 +155,6 @@
     heff.DrawCopy();
 
-    line.DrawLine(10, 0.5, 31623, 0.5);
+    line.DrawLine(hist.GetXaxis()->GetXmin(), 0.5,
+                  hist.GetXaxis()->GetXmax(), 0.5);
 
     c.cd(i+0);
@@ -169,13 +170,10 @@
     for (int x=0; x<=hist.GetNbinsX(); x++)
     {
-        Float_t n = 0;
-        for (int y=1; y<=2; y++)
-            n += hist.GetBinContent(x,y);
-
+        const Float_t n = hist.GetBinContent(1); // + hist.GetBinContent(2)
         if (n==0)
             continue;
 
         for (int y=0; y<=hist.GetNbinsY(); y++)
-            hist.SetBinContent(x, y, 200*hist.GetBinContent(x,y)/n);
+            hist.SetBinContent(x, y, 100*hist.GetBinContent(x,y)/n);
     }
 
@@ -183,5 +181,6 @@
     hist.DrawCopy("colz");
 
-    line.DrawLine(10, 0.04, 31623, 0.04);
+    line.DrawLine(hist.GetXaxis()->GetXmin(), cutval,
+                  hist.GetXaxis()->GetXmax(), cutval);
 
     c.cd(i+2);
@@ -197,8 +196,5 @@
     for (int x=0; x<=hist.GetNbinsX(); x++)
     {
-        Float_t n = 0;
-        for (int y=0; y<=hist.GetNbinsY(); y++)
-            n += hist.GetBinContent(x,y);
-
+        const Float_t n = hist.Integral(x, x, -1, 9999);
         if (n==0)
             continue;
@@ -211,5 +207,6 @@
     hist.DrawCopy("colz");
 
-    line.DrawLine(10, 0.04, 31623, 0.04);
+    line.DrawLine(hist.GetXaxis()->GetXmin(), cutval,
+                  hist.GetXaxis()->GetXmax(), cutval);
 }
 
