Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 3533)
+++ trunk/MagicSoft/Mars/Changelog	(revision 3534)
@@ -18,4 +18,15 @@
 
                                                  -*-*- END OF LINE -*-*-
+
+ 2004/03/17: Abelardo Moralejo
+
+   * manalysis/MSourcePosfromStarPos.cc
+     - added cast fabs((Double_t)ival), line 703. Otherwise it does not
+       compile.
+
+   * macros/starmc.C
+     - added parameter accepted_fraction to select fraction of events 
+       to be processed (useful to make smaller outputs).
+
 
  2004/03/17: Wolfgang Wittek
Index: trunk/MagicSoft/Mars/macros/starmc.C
===================================================================
--- trunk/MagicSoft/Mars/macros/starmc.C	(revision 3533)
+++ trunk/MagicSoft/Mars/macros/starmc.C	(revision 3534)
@@ -52,8 +52,8 @@
   // differences in gain of outer pixels)
   //
-  CalibrationFilename = new TString("nonoise/Gamma_zbin0_90_7_507*.root");
+  CalibrationFilename = new TString("nonoise/Gamma_zbin0_90_*.root");
   // File to be used in the calibration (must be a camera file without added noise)
 
-  Char_t* AnalysisFilename = "Gamma_zbin0*.root";  // File to be analyzed
+  Char_t* AnalysisFilename = "Gamma_zbin*.root";  // File to be analyzed
 
   // ------------- user change -----------------
@@ -63,6 +63,11 @@
 
   OutFilename1 = new TString("star_train.root");   // Output file name 1 (test)
-  //  OutFilename2 = new TString("star_test.root");    // Output file name 2 (train)
-
+  OutFilename2 = new TString("star_test.root");    // Output file name 2 (train)
+  //
+  // Fraction of events (taken at random) which one wants to process from the 
+  // file to be analyzed (useful to make smaller files if starting sample is
+  // too large).
+  //
+  Float_t accepted_fraction = 1.;
 
   Float_t CleanLev[2] = {4., 3.}; // Tail cuts for image analysis
@@ -206,6 +211,15 @@
   read2.AddFile(AnalysisFilename);
   read2.DisableAutoScheme();
-  tlist.AddToListBefore(&read2, &read, "All");
+  tlist.AddToListBefore(&read2, &read);
   tlist.RemoveFromList(&read);
+
+  //
+  // Analyzed only the desired fraction of events, skip the rest:
+  //
+  MFEventSelector eventselector;
+  Float_t rejected_fraction = 1. - accepted_fraction; 
+  eventselector.SetSelectionRatio(rejected_fraction);
+  MContinue skip(&eventselector);
+  tlist.AddToListBefore(&skip, &sigextract);
 
   bar.SetWindowName("Analyzing...");
Index: trunk/MagicSoft/Mars/manalysis/MSourcePosfromStarPos.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MSourcePosfromStarPos.cc	(revision 3533)
+++ trunk/MagicSoft/Mars/manalysis/MSourcePosfromStarPos.cc	(revision 3534)
@@ -701,5 +701,5 @@
 
     // run number must be greater than 10000
-    if (fabs(ival) < 10000)
+    if (fabs((Double_t)ival) < 10000)
     {
       *fLog << err << "===========> Error when reading file with theta and phi <========="
