I’m trying to write a script to merge only a specific sub directory of a number of identically structured root files.
I am basically trying to reproduce this example ROOT: tutorials/io/mergeSelective.C File Reference in python, but whatever I do the entire files get merged and not just the specified sub directory.
A small update:
While writing a test for this case, I discovered that if you wrote objects into these directories, only the ones you select get merged:
$ rootls -r selectiveMerge_output.root
A
Histo_A
B
There used to be a Histo_B in the input file. So you are not really wasting space. Nevertheless, I’ll see to removing the empty directory.
Hello @StephanH,
sorry to bother you again.
I tried the script on my data and it seems that the only thing that is being copied (apart from the directory structure) are TTrees, but not histograms.
I thought I might be doing something wrong, so I ran the tutorial example from my original post and it turned out that it has the same problem…
You seem to have been successful in merging histograms, do you have an idea what might be the issue?