Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 6065)
+++ trunk/MagicSoft/Mars/Changelog	(revision 6066)
@@ -20,4 +20,10 @@
 
                                                  -*-*- END OF LINE -*-*-
+ 2005/01/28 Abelardo Moralejo
+
+   * mtemp/mpadova/macros/trainsubsample.C
+     - added # of events to be written in the output (instead of 
+       fraction of total).
+
  2005/01/27 Daniel Mazin and Markus Gaug
 
Index: trunk/MagicSoft/Mars/mtemp/mpadova/macros/trainsubsample.C
===================================================================
--- trunk/MagicSoft/Mars/mtemp/mpadova/macros/trainsubsample.C	(revision 6065)
+++ trunk/MagicSoft/Mars/mtemp/mpadova/macros/trainsubsample.C	(revision 6066)
@@ -42,8 +42,12 @@
   plist.AddToList(&tlist);
 
-  MReadMarsFile  read("Events", "star_20040915_CrabNebulaW1.root");
+  MReadMarsFile  read("Events", "star_20040915_CrabNebulaW2.root");
 
   MFEventSelector evsel;
-  evsel.SetSelectionRatio(0.05); // Fraction of events in output
+
+  Float_t nevents = 50000;   // Number of events to select. 
+  Float_t ratio = nevents / (Float_t) read.GetEntries();
+
+  evsel.SetSelectionRatio(ratio); // Fraction of events in output
 
   read.DisableAutoScheme();
@@ -54,5 +58,5 @@
   plist.AddToList(mcevt);
 
-  MWriteRootFile write("star_train_20040915_CrabNebulaW1.root", "recreate");
+  MWriteRootFile write("star_train_20040915_CrabNebulaW2.root", "recreate");
 
   write.AddContainer("MMcEvt",         "Events", kFALSE);
