Hi Thomas, By default TTree::Branch uses the split mode. With your class you are hitting one of the current limitations of the split mode that we hope to remove in a near future. For the time being, replace the line TBranch *B = tree->Branch("data", "A", &test); by TBranch *B = tree->Branch("data", "A", &test,32000,0); Rene Brun On Wed, 18 Oct 2000, Thomas Bretz wrote: > Hello, > > let's assume I have a simple class which contains a TArray-Object like > class A : public TObject > { > private: > Int_t n; > TArrayC arr; > [...] > } > > Now I tried to write it to a RootFile. It is no problem to write the > Object and retriev it, but it seems, that only the Int_t is written to > the file. > > I do something like: > ---- > TFile file("test.root", "RECREATE", "test"); > TTree *tree = new TTree("T", "title"); > A *test = new A; > TBranch *B = tree->Branch("data", "A", &test); > for (int i=0; i<11; i++) > { > [Here I fill some data in the TArray] > tree->Fill(); > } > file.Write(); > file.Close(); > ---- > > What's going wrong? What am I doing wrong? > > Regards, > Thomas. >
This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:35 MET