Revision 5d3037c7f727c290629f70b382cdb650d8e23c3f authored by Rene Brun on 17 August 2002, 21:38:19 UTC, committed by Rene Brun on 17 August 2002, 21:38:19 UTC
New data member fFileNumber containing the current file number (default=0). New static member Int_t fgMaxTreeSize (default value 1.9 Gbytes). New functions ; Int_t GetFileNumber() Int_t GetmaxTreeSize() void setMaxTreeSize(Int_t maxsize) The automatic file overflow is called by TTree::Fill and implemented in the new function ChangeFile: TFile *TTree::ChangeFile(TFile *file) { // called by TTree::Fill when file has reached its maximum fgMaxTreeSize. // Create a new file. If the original file is named "myfile.root", // subsequent files are named "myfile_1.root", "myfile_2.root", etc. // // Return pointer to new file // Currently, the automatic change of file is restricted // to the case where the Tree is in the top level directory. // The file should not contain sub-directories. // // Before switching to a new file, the Tree header is written // to the current file, then the current file is closed. // // To process the multiple files created by ChangeFile, one must use // a TChain. // // fgMaxTreeSize can be set via the static function TTree::SetMaxTreeSize. // The default value of fgMaxTreeSize is 1.9 Gigabytes. // // If the current file contains other objects like TH1 and TTree, // these objects are automatically moved to the new file. // // IMPORTANT NOTE: // Be careful when writing the final Tree header to the file! // Don't do: // TFile *file = new TFile("myfile.root","recreate"); // TTree *T = new TTree("T","title"); // T->Fill(); //loop // file->Write(); // file->Close(); // but do the following: // TFile *file = new TFile("myfile.root","recreate"); // TTree *T = new TTree("T","title"); // T->Fill(); //loop // file = T->GetCurrentFile(); //to get the pointer to the current file // file->Write(); // file->Close(); git-svn-id: http://root.cern.ch/svn/root/trunk@5143 27541ba8-7e3a-0410-8455-c3a389f83636
1 parent a41dc49
Computing file changes ...