ROOT 6.12/07 Reference Guide |
Merge only part of the content of a set of files.
This macro demonstrates how to merge only a part of the content of a set of input files, specified via the interface.
The method can be called several times to add object names, or using a single string with names separated by a blank. Directory names contained in the files to be merged are accepted.
Two modes are supported:
TFileMerger::PartialMerge(kOnlyListed)
This will merge only the objects in the files having the names in the specified list. If a folder is specified, its whole content will be mergedTFileMerger::PartialMerge(kSkipListed)
This will skip merging of specified objects. If a folder is specified, its whole content will be skipped.Important note: the kOnlyListed and kSkipListed flags have to be bitwise OR-ed on top of the merging defaults: kAll | kIncremental (as in the example)
The files to be merged have the following structure:
The example first merges exclusively hprof and the content of "folder", producing the file exclusive.root, then merges all content but skipping hprof and the content of "folder". The result can be inspected in the browser.
Definition in file mergeSelective.C.