void Tree() { const char *descrip="branch of TObjArray of 2 TClonesArray of TVector3"; const char *filename="~/kir.root"; const char *treename="Tree"; const char *branchname="Branch"; TFile *pFile=TFile::Open(filename,"RECREATE"); TTree *pTr=new TTree(treename,descrip); TObjArray *pLstAll=new TObjArray(2); pLstAll->SetOwner(); pTr->Branch(branchname,&pLstAll,32000,0); //here set split to 1 TClonesArray *pLst[2]; for(Int_t i=0;i<2;i++) pLstAll->AddAt(pLst[i]=new TClonesArray("TVector3"),i); for(Int_t iEvt=0;iEvt<3;iEvt++){ for(Int_t iHit=0;iHitFill(); pLst[0]->Clear(); pLst[1]->Clear(); } pTr->Write(); delete pFile; pLstAll->Delete(); pFile=TFile::Open(filename); pTr=(TTree*)pFile->Get(treename); pTr->SetBranchAddress(branchname,&pLstAll); for(Int_t i=0;iGetEntries();i++){ pTr->GetEntry(i); pLst[0]=(TClonesArray*)pLstAll->At(0); pLst[1]=(TClonesArray*)pLstAll->At(1); Printf("Event %i first list:",i);pLst[0]->Print(); Printf("Event %i second list:",i);pLst[1]->Print(); } }//Tree()