Hi, I create a CloneTree with the code below (no selection applied) . It seems OK, a new tree is created with the same number of entries as the original file. However, when I re-run the code on the produced CloneTree, the code crash after 18 events with following error message: This file contains 2530 events event number 0 ... event number 18 Error: C++ exception caught FILE:/tmp/7vWjCb_cint LINE:1 *** Interpreter error recovered *** I hardly can understand this, since I am running the same code on (supposed) identical Trees. I am running root 3.05 under fermi-linux 7. Thanks for help! Eric // Code extract if (fChain == 0) return; // Tree of selected events TFile *sel_file = new TFile("sel_tree.root","RECREATE"); sel_file->cd(); TTree *sel_tree = fChain->CloneTree(0); Int_t my_entries = Int_t(fChain->GetEntries()); cout << endl << endl << " This file contains " << my_entries << " events " << endl << endl; Int_t nbytes = 0, nb = 0; for (Int_t jentry=0; jentry<my_entries;jentry++) { Int_t ientry = LoadTree(jentry); cout << "event number " << jentry<< endl; nb = fChain->GetEntry(jentry); nbytes += nb; sel_tree->Fill(); }// jentry sel_file->cd(); sel_file->Write(); sel_file->Close(); delete sel_file;
This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:15 MET