Re: Using TSelector with split branches

From: Philippe Canal <pcanal_at_fnal.gov>
Date: Fri, 17 Apr 2009 13:23:04 -0500


Hi Eduard,

When using MakeSelector, in order to allow access of the inner content of the object via simple
variable, mytree->SetMakeClass(1) is called.

This explicit __disable__ the ability to read the information via objects (i.e. the information is
_only_ available via the simple variables).

If you need access to both the split and non-split object, please use MakeProxy rather than
MakeSelector.

Cheers,
Philippe.

Eduard.Avetisyan_at_desy.de wrote:
> Dear Philippe,
>
> On Wed, 15 Apr 2009, Philippe Canal wrote:
>
>
>> 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.
>>
>
> My problem is exactly the opposite! I'm not able to retrieve the original
> object if it's split. If you (or anyone) need a working example of the
> failing piece you may use the tree4.C from the tutorials, call tree4w() to
> generate the tree and then edit the generated TSelector header file such
> that the non-split object is retrieved in a way identical to the split
> one. Then call event_non_split->Dump() for any selected entry and watch
> the crash dump.
>
> Hope someone knows the solution! Thanks!
> Eduard
>
> P.S. Used the linux versions of root 5.20 and 5.23
>
>
>> 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 Fri Apr 17 2009 - 20:29:25 CEST

This archive was generated by hypermail 2.2.0 : Fri Apr 17 2009 - 23:50:01 CEST