Skip to content
Snippets Groups Projects
Commit 06f6f863 authored by Philippe Canal's avatar Philippe Canal
Browse files

TBufferMerger: Allow to disable explict call to Flush when no tree in file

parent e23c00a4
No related branches found
No related tags found
No related merge requests found
......@@ -96,6 +96,20 @@ public:
*/
void SetMergeOptions(const TString& options);
/** Indicates that the file will not contain any TTree objects
* and thus that steps that are specific to TTree can be skipped */
void SetNotrees(Bool_t notrees=kFALSE)
{
fMerger.SetNotrees(notrees);
}
/** Returns whether the the file has been marked as not containing any TTree objects
* and thus that steps that are specific to TTree can be skipped */
Bool_t GetNotrees() const
{
return fMerger.GetNotrees();
}
friend class TBufferMergerFile;
private:
......
......@@ -122,6 +122,7 @@ public:
virtual Bool_t Merge(Bool_t = kTRUE);
virtual Bool_t PartialMerge(Int_t type = kAll | kIncremental);
virtual void SetFastMethod(Bool_t fast=kTRUE) {fFastMethod = fast;}
Bool_t GetNotrees() const { return fNoTrees; }
virtual void SetNotrees(Bool_t notrees=kFALSE) {fNoTrees = notrees;}
virtual void RecursiveRemove(TObject *obj);
......
......@@ -31,7 +31,8 @@ Int_t TBufferMergerFile::Write(const char *name, Int_t opt, Int_t bufsize)
{
// Make sure the compression of the basket is done in the unlocked thread and
// not in the locked section.
TMemFile::Write(name, opt | TObject::kOnlyPrepStep, bufsize);
if (!fMerger.GetNotrees())
TMemFile::Write(name, opt | TObject::kOnlyPrepStep, bufsize);
// Instead of Writing the TTree, doing a memcpy, Pushing to the queue
// then Reading and then deleting, let's see if we can just merge using
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment