Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 7417)
+++ trunk/MagicSoft/Mars/Changelog	(revision 7418)
@@ -18,4 +18,19 @@
 
                                                  -*-*- END OF LINE -*-*-
+ 2005/11/22 Thomas Bretz
+
+   * macros/train/traindisp.C:
+     - added a comment
+
+   * mdata/MDataFormula.cc:
+     - fixed along outstanding bug. Because TFormula had no name
+       some axis tick marks disappeared randomly
+     - fixed a typo (Add instead of Remove)
+
+   * mfbase/MFEventSelector.cc:
+     - also reset fSelRatio if totalnumber of events from file.
+
+
+
  2005/11/21 Thomas Bretz
 
Index: trunk/MagicSoft/Mars/NEWS
===================================================================
--- trunk/MagicSoft/Mars/NEWS	(revision 7417)
+++ trunk/MagicSoft/Mars/NEWS	(revision 7418)
@@ -2,4 +2,7 @@
 
  *** Version  <cvs>
+
+   - general: Fixed a long outstanding bug which made axis tick marks
+     disappear if MDataFormula was used (eg. abs(x))
 
    - general: Updated MMath with new functions to calculate the results of
Index: trunk/MagicSoft/Mars/macros/train/traindisp.C
===================================================================
--- trunk/MagicSoft/Mars/macros/train/traindisp.C	(revision 7417)
+++ trunk/MagicSoft/Mars/macros/train/traindisp.C	(revision 7418)
@@ -60,4 +60,6 @@
      opt.AddPreCut("MHillasSrc.fDCA*MGeomCam.fConvMm2Deg<0.3");
 
+     // The number is the number of events read from the file
+     // randomly and is the number of events before cuts
      opt.Train("rf-disp.root", set, 30000);
 }
Index: trunk/MagicSoft/Mars/mdata/MDataFormula.cc
===================================================================
--- trunk/MagicSoft/Mars/mdata/MDataFormula.cc	(revision 7417)
+++ trunk/MagicSoft/Mars/mdata/MDataFormula.cc	(revision 7418)
@@ -139,4 +139,8 @@
 
     fFormula = new TFormula;
+
+    //Must have a name otherwise all axis label disappear like a miracle
+    fFormula->SetName(fName);
+
     if (fFormula->Compile(txt))
     {
@@ -172,5 +176,5 @@
 
     fFormula = f ? (TFormula*)f->Clone() : 0;
-    gROOT->GetListOfFunctions()->Add(fFormula);
+    gROOT->GetListOfFunctions()->Remove(fFormula);
 
     fMembers.SetOwner();
Index: trunk/MagicSoft/Mars/mfbase/MFEventSelector.cc
===================================================================
--- trunk/MagicSoft/Mars/mfbase/MFEventSelector.cc	(revision 7417)
+++ trunk/MagicSoft/Mars/mfbase/MFEventSelector.cc	(revision 7418)
@@ -169,8 +169,7 @@
     fResult = gRandom->Uniform() < fSelRatio;
 
-    if (!fResult)
-        return kTRUE;
-
-    fNumSelectedEvts++;
+    if (fResult)
+        fNumSelectedEvts++;
+
     return kTRUE;
 }
@@ -201,5 +200,9 @@
     //---------------------------------
     if (TestBit(kNumTotalFromFile))
+    {
         fNumTotalEvts = -1;
+        if (fNumSelectEvts>0)
+            fSelRatio = -1;
+    }
 
     return kTRUE;
