Tree Questions

From: S. P. Wakely (wakely@hep.umn.edu)
Date: Mon Jan 11 1999 - 21:22:06 MET


Hi ROOTers,

I have been trying to grok TTrees a little better the last few days
and I have some questions to put to the experts.

Split vs. Non-Split:

Is there a way to access member functions in a split=1 tree??
Here is an example from ROOT 2.20/06 on an DECUnix Alpha with cxx 6.0:
///////////
CINT/ROOT C/C++ Interpreter version 5.13.83, Dec 2 1998
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.
root [0] gSystem->Load("libEvent.so");
root [1] f = TFile("Event.root");
root [2] T.Draw("fTemperature");        //works Fine
Warning in <MakeDefCanvas>: creating a default canvas with name c1
root [3] T.Draw("event.GetTemperature()");

*** Break *** segmentation violation
Error: No symbol T.Draw("event.GetTemperature()") in current scope
FILE:/tmp/gaaaaDvda LINE:1
*** Interpreter error recovered ***
/////////////

Now, if your Tree is written in split=0 mode, you get just the
opposite behavior.  You have access to methods, but not members.

If there was access in the split=0 mode to the member variables, would
there still be any need for split=1 mode?  We could have arbitrarily
fine granularity via the simple process of accessing member variables:

T.Draw("Run.Event.Hit.GetRMS()")
instead of requiring a vast (by-hand, for more than 1 layer deep)
splitting of the tree into a branch for every variable.  I suspect I
am missing something here.

also....

Terminology:  Leaves, Branches, Superbranches, Events and Entries

In the ROOT I/O overview, TTrees are said to be built of Branches and
Leaves.  Unfortunately, I found little reference to these concepts in
the examples...

For instance, in the 'How to Create and Fill a Tree' doc, we first
make a split=0 Tree with a single branch.  Do I understand correctly,
then, that the N leaves of the branch are each filled with an instance
of the Event class??

And when we use split=1, some of the leaves simply contain Branch
objects, which then have their own leaves, thus giving us the
splitting??

I could find no mention of the concepts "Entry" or "Event" aside from
the autodocs of the TTree class.  Are these definitions correct?

Entry:  The entire chunk of data written to a tree during a single
Fill() call. Could include a single leaf on one branch to single
leaves on many branches...

Event:  The chunk of data read from a Tree during a GetEvent() call.
Includes whatever data have been explicitly 'linked to' via a
SetBranchAddress() call.  Could include all of or only some of the
data written in the corresponding Fill() call.

Is this right?  I found the examples confusing because they mostly use
the sample class "Event".  They they use GetEvent() without clarifying
the two apparently different meaning of the term.


OK.. that is long enough for now, I think.

SP Wakely
U of MN HEP



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:28 MET