diff --git a/io/io/inc/ROOT/TBufferMerger.hxx b/io/io/inc/ROOT/TBufferMerger.hxx index bbd3068656a47939464acb38c0bed65cd9e18bee..dc0672d4e27fc63428c468c36d6ff67055292b05 100644 --- a/io/io/inc/ROOT/TBufferMerger.hxx +++ b/io/io/inc/ROOT/TBufferMerger.hxx @@ -99,7 +99,7 @@ public: */ void SetMergeOptions(const TString& options); - /** Indicates that the file will not contain any TTree objects + /** Indicates that any TTree objects in the file should be skipped * and thus that steps that are specific to TTree can be skipped */ void SetNotrees(Bool_t notrees=kFALSE) { diff --git a/io/io/src/TBufferMerger.cxx b/io/io/src/TBufferMerger.cxx index 7575e45f85df8e09b76273d6c9fe4c5eede0e6c7..74882f67669e3e43fcd46971dacb8536e89affb6 100644 --- a/io/io/src/TBufferMerger.cxx +++ b/io/io/src/TBufferMerger.cxx @@ -50,6 +50,9 @@ TBufferMerger::~TBufferMerger() if (!fQueue.empty()) Merge(); + // Since we support purely incremental merging, Merge does not write the target objects + // that are attached to the file (TTree and histograms) and thus we need to write them + // now. if (TFile *out = fMerger.GetOutputFile()) out->Write("",TObject::kOverwrite); } diff --git a/io/io/src/TFileMerger.cxx b/io/io/src/TFileMerger.cxx index a7e5be06aae88535274fb5afd456ca9b660a669d..d95ba8172a954a193cdfcaf2e5219becc0b96bf2 100644 --- a/io/io/src/TFileMerger.cxx +++ b/io/io/src/TFileMerger.cxx @@ -930,9 +930,18 @@ Bool_t TFileMerger::PartialMerge(Int_t in_type) } else { // Close or write is required so the file is complete. if (in_type & kIncremental) { + // In the case of 'kDelayWrite' the caller want to avoid having to + // write the output objects once for every input file and instead + // write it only once at the end of the process. if (!(in_type & kDelayWrite)) fOutputFile->Write("",TObject::kOverwrite); } else { + // If in_type is not incremental but type is incremental we are now in + // the case where the user "explicitly" request a non-incremental merge + // but we still have internally an incremental merge. Because the user + // did not request the incremental merge they also probably do not to a + // final Write of the file and thus not doing the write here would lead + // to data loss ... if (type & kIncremental) fOutputFile->Write("",TObject::kOverwrite); gROOT->GetListOfFiles()->Remove(fOutputFile); diff --git a/tree/tree/src/TTreeCloner.cxx b/tree/tree/src/TTreeCloner.cxx index a98260612af21aa79fe38271a81d3117e97944dc..974c040fd830fbb19c6ad3af6d43d74a7da38934 100644 --- a/tree/tree/src/TTreeCloner.cxx +++ b/tree/tree/src/TTreeCloner.cxx @@ -110,7 +110,7 @@ TTreeCloner::TTreeCloner(TTree *from, TTree *to, Option_t *method, UInt_t option //////////////////////////////////////////////////////////////////////////////// /// Constructor. In place cloning. //// This object would transfer the data from -/// 'from' the original location to 'to' the new directory +/// 'from' the original location to 'newdirectory' the new directory /// using the sorting method indicated in method. /// It updates the 'from' TTree with the new information. /// See TTreeCloner::TTreeCloner(TTree *from, TTree *to, Option_t *method, UInt_t options)