// @(#)root/io:$Id$ // Author: Andreas Peters + Fons Rademakers 26/5/2005 /************************************************************************* * Copyright (C) 1995-2005, Rene Brun and Fons Rademakers. * * All rights reserved. * * * * For the licensing terms see $ROOTSYS/LICENSE. * * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ #ifndef ROOT_TFileMerger #define ROOT_TFileMerger #include "TObject.h" #include "TList.h" #include "TString.h" #include "TStopwatch.h" #include class TFile; class TDirectory; class THashList; class TKey; namespace ROOT { class TIOFeatures; } // namespace ROOT class TFileMerger : public TObject { private: using TIOFeatures = ROOT::TIOFeatures; TFileMerger(const TFileMerger&) = delete; TFileMerger& operator=(const TFileMerger&) = delete; protected: TStopwatch fWatch; ///< Stop watch to measure file copy speed TList fFileList; ///< A list the file (TFile*) which shall be merged TFile *fOutputFile{nullptr}; ///< The outputfile for merging TString fOutputFilename; ///< The name of the outputfile for merging Bool_t fFastMethod{kTRUE}; ///< True if using Fast merging algorithm (default) Bool_t fNoTrees{kFALSE}; ///< True if Trees should not be merged (default is kFALSE) Bool_t fExplicitCompLevel{kFALSE}; ///< True if the user explicitly requested a compression level change (default kFALSE) Bool_t fCompressionChange{kFALSE}; ///< True if the output and input have different compression level (default kFALSE) Int_t fPrintLevel{0}; ///< How much information to print out at run time TString fMergeOptions; ///< Options (in string format) to be passed down to the Merge functions TIOFeatures *fIOFeatures{nullptr}; ///< IO features to use in the output file. TString fMsgPrefix{"TFileMerger"}; ///< Prefix to be used when printing informational message (default TFileMerger) Int_t fMaxOpenedFiles; ///< Maximum number of files opened at the same time by the TFileMerger Bool_t fLocal; ///< Makes local copies of merging files if True (default is kTRUE) Bool_t fHistoOneGo; ///< Merger histos in one go (default is kTRUE) TString fObjectNames; ///< List of object names to be either merged exclusively or skipped TList fMergeList; ///< list of TObjString containing the name of the files need to be merged TList fExcessFiles; /// file); virtual void PrintFiles(Option_t *options); 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;} void RecursiveRemove(TObject *obj) override; ClassDefOverride(TFileMerger, 6) // File copying and merging services }; #endif