Strange filenames using TProofOutputFile

Hi all,

I’m trying to create new trees from one old by applying some (100s) of gates. I do this
using a TSelector which I try to keep proof compatible. Trying to do this I create
TProofOutputFiles in the SlaveBegin method and files etc. This seems to work,
expect I get strange names. If I call my file “myfile.root” I get something like
“myfile-fa5dd524-1329-11de-9717-0100007fbeef.root”. This file seems ok. I include
a small example that reproduces the problem. It is not tried running proof. To test

tar jxvf ex.tar.bz2
root> .L MakeFiles.C+
root> MakeFiles();
root> TChain achain(“testtree”);
root> achain.Add(“testfiles_*.root”);
root> achain.Process(“testtree.C++g”);

kind regards

Joa
ex.tar (20 KB)

Hi Joa,

TProofOutputFile is really meant to be run on PROOF.
The strange names are the internal names used to avoid accidental overwrites of existing files. They disappear after merging on the master. If you run locally, merging will never happen and the file names stay the same.

But I agree that this may be misleading for local runs.
I will investigate a solution.

G. Ganis

Hi,

ok. In my code I test if running proof or not (because I use proof variable fInput to send copies of the gates to slaves, and if not running proof, since I use the same code at
different places, sometimes multicpu, multi-machines single cpu etc, fInput is not
created. In this case I create a TList that I use (fInput = new TList). Maybe I can use
similiar solution, i.e. in Terminate I check for proof, and if it is not there I marge “by hand”. How would I do that?

cheers

Joa

Hi Joa,

To merge ROOT files you can use the TFileMerger class.
Here is an example:

         TFileMerger fm;
         TIter nxf(fFilesOut);
         TObjString *os = 0;
         while ((os = (TObjString *)nxf())) {
            fm.AddFile(os->GetName());
         }
         Printf("%d files added to the merger",  fFilesOut->GetSize());
         fm.OutputFile(fFileOut.Data());
         if (!fm.Merge())
            Printf("ERROR: some problems occured during merge");

In the case fFilesOut is a list of TObjStrings with the names of the files to be merged, and fFileOut is a TString with the name of the final file.

Please try and let me know.
Gerri