Index: trunk/MagicSoft/Mars/mfileio/MWriteRootFile.cc
===================================================================
--- trunk/MagicSoft/Mars/mfileio/MWriteRootFile.cc	(revision 9318)
+++ trunk/MagicSoft/Mars/mfileio/MWriteRootFile.cc	(revision 9328)
@@ -192,5 +192,5 @@
 //
 // comp:        Compression Level (see TFile, TBranch)
-// rule:        Rule to create output file name (see GetNewFileName())
+// rule:        Rule to create output file name (see SubstituteName())
 // overwrite:   Allow newly created file to overwrite old files ("RECREATE")
 // ftitle:      File title stored in the file (see TFile)
@@ -849,5 +849,6 @@
 //   "s/source/destination/"
 //
-// For more details on regular expression see a proper documentation.
+// For more details on regular expression see a proper documentation,
+// for example, "man 7 regex" if installed, or TPRegexp.
 //
 // Here is an example:
@@ -862,8 +863,10 @@
 // your set in your program it must look \\/.
 //
-TString MWriteRootFile::GetNewFileName(const char *inname) const
+// Note, that this function has been made static to allow your to
+// test your split rules, i.e. regular expressions.
+//
+TString MWriteRootFile::SubstituteName(const char *regexp, TString fname)
 {
     // Remove the path from the filename
-    TString fname(inname);
     if (fname.Last('/')>=0)
         fname.Remove(0, fname.Last('/')+1);
@@ -873,8 +876,8 @@
 
     // Do splitting
-    TObjArray *subStrL = TPRegexp(sed).MatchS(fSplitRule);
+    TObjArray *subStrL = TPRegexp(sed).MatchS(regexp);
     if (subStrL->GetEntries()!=6)
     {
-        *fLog << err << "ERROR - GetNewFileName: Evaluating split rule " << fSplitRule << " failed." << endl;
+        gLog << err << "ERROR - SubstituteName: Evaluating regexp " << regexp << " failed." << endl;
         subStrL->Print();
         delete subStrL;
@@ -1045,5 +1048,5 @@
 
     const TString oldname = read->GetFullFileName();
-    const TString newname = GetNewFileName(oldname);
+    const TString newname = SubstituteName(fSplitRule, oldname);
     if (!ChangeFile(newname))
         return kFALSE;
Index: trunk/MagicSoft/Mars/mfileio/MWriteRootFile.h
===================================================================
--- trunk/MagicSoft/Mars/mfileio/MWriteRootFile.h	(revision 9318)
+++ trunk/MagicSoft/Mars/mfileio/MWriteRootFile.h	(revision 9328)
@@ -94,5 +94,4 @@
     // File handling
     void    Close();
-    TString GetNewFileName(const char *inname) const;
     Bool_t  ChangeFile(const char *fname);
     TFile  *OpenFile(const char *name, Option_t *option, const char *title, Int_t comp);
@@ -145,4 +144,6 @@
     void RecursiveRemove(TObject *obj);
 
+    static TString SubstituteName(const char *regexp, TString fname);
+
     ClassDef(MWriteRootFile, 1)	// Task to write data into a root file
 };
