TFileMerger with TNtuples

Hello,

When I use the TFileMerger class for files that contains TNtuples, I get two identical copies of each Ntuple in the merged file. Is there a reason for this? A way to avoid it?
I am using root 5.18 and here is the main part of the macro I use to merge the files:

TFileMerger m;
if (outfile) m.OutputFile(outfile);
Int_t i=0;
TString fName = 0x0;
while (result->GetKey(i,“turl”)) {
fName = result->GetKey(i,“turl”);
fName += file;
m.AddFile(fName);
i++;
}
if (i) m.Merge();

Thanks a lot,
Mercedes

Mercedes,

Could you post the real RUNNING script that you use for the merge and also the data files.
In case the data file(s) is big, put them somewhere in a public area (eg AFS).

Also note that we provide a utility to merge ROOT files automatically in $ROOTSYS/bin/hadd

hadd -f result.root file1.root file2.root .. fileN.root
Rene

Rene,

Attached is the macro I use.
The files are on the grid. Is that good enough or you prefer them on AFS?
I will try what you suggest.

Thanks,
Mercedes
mergeFiles.C (688 Bytes)

Mercedes,

This problem should now be fixed in the SVN trunk. Could you try and let me know?

Rene

The problem is solved.

Thanks a lot,
Mercedes