Using TSelector with split branches

From: <Eduard.Avetisyan_at_desy.de>
Date: Wed, 15 Apr 2009 22:23:03 +0200

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 - 22:23:07 CEST

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