Hadd and TProccessID

Hello,

I have several .root files with TProccessID object (created since trees in these files contain referenced objects). I wonder if it is safe to merge these files using the hadd utility. I do not completely understand the interface between TProccessID and the TRef objects. For instance, one of my hadd-produced files has several TProccessID objects with the same name and (of course) different keys:

So, since the TKey number was changed in the hadd-produced file, does the new TProcessID object can still be used by TRef correctly?

My second question is the following: is it possible to use hadd to merge trees with user’s own class (of course, derived from TObject)?
When I am trying to merge files with these trees, I get the following warning message:

Does it mean I need to load the Event class in the memory before merging files? (for instance, I could modify hadd.cxx source file…)

Hi,

[quote=“kbat”]So, since the TKey number was changed in the hadd-produced file, does the new TProcessID object can still be used by TRef correctly?[/quote]Yes, this works because new TProcessID keys are created.

[quote=“kbat”]My second question is the following: is it possible to use hadd to merge trees with user’s own class (of course, derived from TObject)?[/quote]You could use rlibmap, so ROOT knows what library to load when encountering the unknown class Event:

[quote]The library name association can be set up using the rootmap facility. For the library in the example above, which contains a dictionary generated from the linkdef MyLinkdef.h, the command to generate the rootmap file is

$ rlibmap -f -r rootmap -l mylib/libMyLib.so -d libCore.so -c MyLinkdef.h

Here, -r specifies that the entries for libMyLib should be updated, -l specifies the library we’re dealing with, -d its dependencies, and -c its linkdef. The rootmap file must be within one of the LD_LIBRARY_PATH (or PATH for Windows) directories when ROOT is started, otherwise ROOT will not use it.[/quote]Of course you’ll only need this if your class (Event) has a special Merge implementation; e.g. if it’s part of the tree it will “just work” even without the class definition.

Cheers, Axel.