Chain merging empty trees

Hi,

I’m using the TChain::Merge() function to merge trees. I have problems when all the trees in the chain are empty. After merging I’d like to end up with an empty tree. Instead of this I get an empty file.
How do I get to save the merged tree even if it is empty?
Thank you

Here is a basic example of my problem:

[code]{
TTree *mytree = new TTree(“mytree”,“mytree”);
TFile f(“test.root”,“recreate”);
mytree->Write();
f.Close();
delete mytree;

TChain *mychain = new TChain(“mychain”,“mychain”);
mychain->AddFile(“test.root”,0,“mytree”);
mychain->Merge(“newfile.root”);
delete mychain;
}[/code]
mytree is not saved in newfile.root