I’m trying to copy a TTree from a TFile to another.
First I extract the TTree “TTreeTest” from the original TFile (with Get()), then I write it in a new TFile:
[size=85]root  GFile = new TFile("./test.root",“read”)
root  TTree tt_tmp;
root  tt_tmp=(TTree)GFile->Get(“TTreeTest”)
root  TFile *tfile = new TFile("./test.new.root", “recreate”);
root  tfile->cd();
root  tt_tmp->Write();
root  tfile->Close();[/size]
This seems to work but when I read the TTree in the new TFile I get errors like:
[size=85]root  Error in TFile::ReadBuffer: error reading all requested bytes from file test.new.root, got 0 of 162[/size]
I did the same procedure with histograms and it worked. What did I do wrong?
Thanks for your help.