Merging root files (not trees)

Hi,

is there a way to merge several root files into one big file? Note, I don’t mean
merging several trees by using TChain but really merging several root files
independent of what content they have.

Thanks,
Frank

hadd result.root file1.root file2.root …filen.root
or with wilcarding
hadd result.root fw*.root

hadd is in $ROOTSYS/bin/hadd

for help about hadd, simply type
hadd

Rene

Hello Rene,

thanks for your help. Is there any limitation of what classes hadd can handle?
I have root files with a RooFitResult in them and it crashes with:

Error in TKey::ReadObj: Unknown class RooFitResult

I use root 4.04-02. Is this expected to work in Root 5.x where RooFit is a part
of root?

Thanks,
Frank

Frank,

Could you tell me where I can pick one of your files that exhibits this problem? With hadd, you do not need the class in principle.

Rene

Hi Rene,

here are two files

slac.stanford.edu/~fwinkl/fit-1.root
slac.stanford.edu/~fwinkl/fit-3.root

Thanks for your help,
Frank

Frank,

Your files contain TKey objects of class RooFitResult.
The system does not know what to do with these objects
-There is no dictionary for RooFitResult in the file
-Assuming that a dictionary exists, what would you expect the system
could do with these objects?

If RooFitResult were in a Tree, the system knows what to do (merging Trees)
and by definition the dictionary for RooFitResult would be in the file

Rene

Hi Rene,

[quote=“brun”]Frank,

Your files contain TKey objects of class RooFitResult.
The system does not know what to do with these objects
-There is no dictionary for RooFitResult in the file
-Assuming that a dictionary exists, what would you expect the system
could do with these objects?
[/quote]

I would have expected that the objects just get copied into one file so that
the final file contains all the individual TKey objects of the source files. So, I am not expecting that the system is doing anything with the RooFitResult class itself (i.e. merging its content like it is doing for histograms). That said, I realize that other people might have different expectations what a merge in this situation should be doing :wink:

Ah, OK. I’ll see if I can get this to work.

Thanks,
Frank