Add contents from two ROOT Files

I have the problem that I would like to add contents of two similar root files and save them as a new file. An example of such a file can be found here:

/afs/cern.ch/user/h/heineman/public/RobustAlignConstants_20k_14JUL06_8.root

These files have a quite complex structure due to persistency requirements. I am a mere user of these files.

Here is what I would like to do in more detail:

In POOLContainer_AlignableTransform -> AlignableTransform -> m_vec there is m_vec.m_ident.m_id and m_vec.m_trans.

In m_vec.m_trans there is a transformation (dx, dy, etc) stored for each element in m_vec.m_ident.m_id.

I would like to create a new file which

  • has the same structure everywhere
  • contains new values for dx, dy, etc out of the values from the other two files (let’s say dx(newfile) = (dx(file1) + dx(file2))/2)

Is there any way of doing that? How complicated / impossible is that task?

Thanks for helping,
Florian

Due to the complexity of your files, you need to load the original shared library in order to do the merge and add. You may need to go back to your experiment’s framework (or at least the ‘Lite’ version for CMS).

Cheers,
Philippe