You are here

How to Merge Custom Objects?

There are some areas in ROOT where merging of objects is important, for example in parallel applications or for simple concatenating of rootfiles via the hadd utility. The requirement the classes need to satisfy in order to let ROOT manage their merging is the implementation of a Mege method with this signature:

Long64_t MyClass::Merge(TCollection*)

The TCollection * is a pointer to a collection of MyClass objects that will be merged into the actual object. Widely used ROOT objects such as histograms provide already the necessary method for merging.