Re: trees of variable structure?

From: Rene Brun <Rene.Brun_at_cern.ch>
Date: Wed, 05 Jan 2005 15:32:20 +0100


Hi Troy,

Could you clarify what you mean by "Particle"? In your example below, are A, B and C instances of the same class "Particle"? Are they derive from a base class?
In case A,B,C, etc are all instances of the same class with just different attributes, you can create a TClonesArray (test/Event example).

Rene Brun

"troy d. straszheim" wrote:
>
> Hi roottalk, I am wondering how to best provide data to root (create
> TTrees) in the following situation:
>
> I have an analysis chain that produces, from event to event, varying
> numbers of results of various structure. As a simple example, event 1
> might contain particle A and C, event 2 particles A B and C, and event
> 3 particle A and B:
>
> event particles
> ----- ---------
> 1 A C
> 2 A B C
> 3 A B
>
> The processing chain contains a root-tree-module at the end which
> traverses this data structure and fills a tree, creating a
> branch-per-particle.
>
> The set of all possible particles is large and the branch names should
> vary depending on how they were produced. It is not possible to
> determine at the beginning of processing that the tree should have one
> branch for A, one for B, and one for C. Furthermore, if one did
> somehow determine a catchall structure for the tree, it is not clear
> to me how one would indicate, for instance that in event 1 the data
> for particle B is undefined.
>
> The users' goals are to be able to plot the zenith of particles B and
> C against one another, but only in events where both particles B and C
> were produced. Another example would be to plot all the C's that were
> produced.
>
> I'm wondering what other options there might be. Could one, for
> instance, make one tree per particle, adding an eventnumber to each
> tree, make these trees friends of one another, and then plot, somehow?
> Would this introduce an expensive search as the treeplayer matches the
> eventnumbers in the two particles?
>
> Any thoughts would be greatly appreciated,
>
> troy d. straszheim
Received on Wed Jan 05 2005 - 15:43:15 MET

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:04 MET