Re: Reading and Writing Trees with the same names and different structures

From: Philippe Canal <pcanal_at_fnal.gov>
Date: Thu, 28 Apr 2011 09:00:01 -0500


Hi Kris,

Since the 2 classes have the same name, you will (of course) not be able to load both libA.so and libB.so. However if you set the Class version (i.e. the number in ClassDef) for the class that are both in libA and in libB and have a different set of data member to be different, you will then be able to read the file created by one of the 2 libraries, using either one of them or none.

Cheers,
Philippe.

PS. If the class version are the same and can _not_ be changed, then you will need to read each file in different process, create intermediary results and later merge the result.

On 4/26/11 6:40 PM, Kris Hagel wrote:
> Hello,
> I have two root files (file A, file B) with tree data which was generated using different libraries, say libA.so and libB.so. The
> structure of each tree is of the same philosophy as the classic event examples (Event.cxx, Event.h in the test directory) with
> some global data as well as the static TClonesArrays for the individual particles. However, the individual event structure is
> slightly different in each file, but is called the same, both the Event and the structure (ie Track) in the TClonesArray.
>
> Now, I have a third user who would like to read both file A and file B and output a fraction of the events (after some cuts) to
> the event structure in file A. Doing this for file A is, of course, trivial.
>
> How would one read file B (which has Event and Track) and output it to the Event, Track structure of file A? Again, they are both
> called Event,Track, but have slightly different data members.
>
> Thank you.
>
> Kris Hagel
>
Received on Thu Apr 28 2011 - 16:00:06 CEST

This archive was generated by hypermail 2.2.0 : Fri Apr 29 2011 - 17:50:01 CEST