SFrame 3.6
|
Helper class for merging the TTree contents of ROOT files. More...
#include <core/include/SFileMerger.h>
Public Member Functions | |
SFileMerger () | |
Default constructor. | |
~SFileMerger () | |
Destructor. | |
Bool_t | AddFile (const TString &fileName) throw ( SError ) |
Add an input file that should be processed. | |
Bool_t | OutputFile (const TString &fileName, const TString &mode="UPDATE") throw ( SError ) |
Specify the output of the merging. | |
Bool_t | Merge () throw ( SError ) |
Execute the merging itself. |
Helper class for merging the TTree contents of ROOT files.
This is a dumbed-down version of the TFileMerger class written for PROOF. Unfortunately TFileMerger has some weird behaviour, otherwise I would've just used that class.
The class loops over all input files specified with AddInput(), and copies the TTree-s from them into the output file.
Note that the output can be an existing file. In this case the TTrees from the input files are merged into the TTrees already existing in the output file.
Definition at line 46 of file SFileMerger.h.
SFileMerger::SFileMerger | ( | ) |
Default constructor.
Definition at line 30 of file SFileMerger.cxx.
SFileMerger::~SFileMerger | ( | ) |
Destructor.
Definition at line 35 of file SFileMerger.cxx.
Bool_t SFileMerger::AddFile | ( | const TString & | fileName | ) | throw ( SError ) |
Add an input file that should be processed.
This function adds a new file as input for the merging.
fileName | The name of the input file |
kTRUE
if everything went correctly, kFALSE
otherwise Definition at line 48 of file SFileMerger.cxx.
References REPORT_ERROR, REPORT_VERBOSE, and SError::SkipCycle.
Bool_t SFileMerger::Merge | ( | ) | throw ( SError ) |
Execute the merging itself.
This is the main function of this class. It was heavily inspired by the TFileMerger::MergeRecursive function, which in turn is basically a copy of the MergeRootfile function of the hadd executable.
kTRUE
if the merge was successful, kFALSE
otherwise Definition at line 121 of file SFileMerger.cxx.
References DEBUG, SLogger::endmsg(), REPORT_ERROR, REPORT_VERBOSE, and WARNING.
Bool_t SFileMerger::OutputFile | ( | const TString & | fileName, |
const TString & | mode = "UPDATE" |
||
) | throw ( SError ) |
Specify the output of the merging.
This function specifies the name of the output file.
fileName | The name of the output file to be created |
mode | Mode to open the output file in |
kTRUE
if everything went correctly, kFALSE
otherwise Definition at line 91 of file SFileMerger.cxx.
References REPORT_ERROR, REPORT_VERBOSE, and SError::SkipCycle.