Re: trees of variable structure?

From: Rene Brun <Rene.Brun_at_cern.ch>
Date: Fri, 07 Jan 2005 09:38:29 +0100


Hi Troy,

The solution to your problem is to use Tree friends and a Tree Index.   -Build an index for T_b using major_name = "eventnumber"

     T_b->BuildIndex("eventnumber","");
  -Declare T_b a friend of T_a

for more info, see:
http://root.cern.ch/root/htmldoc/TTreeIndex.html  (you must use 4.02 or newer)

Rene Brun

  Declare T_b as a friend a T_a
"troy d. straszheim" wrote:
>
> Hi,
>
> I've been reading through the manuals, I think I understand the
> problem differently now. Here is the use case: on a series of events,
> trees T_1 ... T_n are created. Some trees may contain an entry for
> every event, others will contain fewer than that.
>
> The problem is to later re-align, event-wise, the entries in some
> subset of the trees. If trees T_a and T_b each contain a leaf L, I
> would like to histogram "T_a.L-T_b.L" such that one sees a histogram
> of the differences between the two L's that are properly matched up by
> event. If both trees T_a and T_b contain and entry for event N, that
> should appear in the histogram. Otherwise it should not. The types
> of the classes in the trees are unknown. Each tree could contain an
> "event number" leaf, if necessary, for matching. I have the feeling
> this is easy to do in some subtle way that I'm missing...
>
> Thanks,
>
> troy d. straszheim
>
> Rene Brun writes:
> > 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
> >
Received on Fri Jan 07 2005 - 09:37:20 MET

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