Re: Using TSelector with split branches

From: Philippe Canal <pcanal_at_fnal.gov>
Date: Wed, 15 Apr 2009 16:53:55 -0500


Hi Eduard,

In both split and non-split case, you can always retrieve the original object.

What is _explicitly_ not possible it to see the data members directly from a non-split branch
from MakeSelector. This is because MakeSelector, explicitly, list only branches and sub-branches.

On the other hand, MakeProxy will allow to dig through a non split branch.

Cheers,
Philippe.

Eduard.Avetisyan_at_desy.de wrote:
> Hi rooters,
>
> I've hit a problem which is probably related to poor my knowledge of
> root/C++.
>
> I use the $ROOTSYS/tree/tutorials/tree4.C to demonstrate the problem.
> Let's create a tree with the tree4w() function, then open the newly
> created tree and call the MakeSelector() method.
>
> The new TSelector file will have differently arranged branched for the
> split and non-split Event members, namely a branch per data member for the
> split, and a single branch for the non-split. So far everything fine. If
> one would try to "cheat" the system and treat the split event as if it was
> non-split, root will crash.
>
> I thought this is a limitation of the way root handles the trees. But now,
> if I try to use the "eventa.cxx" file from the $ROOTSYS/test directory and
> make slight modifications in it (see below) things work fine! Namely I can
> treat the split and non-split branches similarly:
>
> Event *event = new Event();
> Event *event_not_split=new Event();
> T->SetBranchAddress("event_split", &event);
> T->SetBranchAddress("event_not_split", &event_not_split);
>
> I would (naturally) prefer to use this simple class-based access method
> also from a TSelector. Any help ?
>
> Thanks!
> Eduard
>
>
Received on Wed Apr 15 2009 - 23:53:59 CEST

This archive was generated by hypermail 2.2.0 : Thu Apr 16 2009 - 11:50:02 CEST