Re: [ROOT] TNamed and TTree splitting

From: Rene Brun (Rene.Brun@cern.ch)
Date: Sat Oct 19 2002 - 14:05:33 MEST


Hi Sue,

Splitting classes with members being a TString is supported since 3.03.
You can use it without problems.

In case you do not want to split a member of a class, you can use the "||"
in the member comment field:

class something {
  int a;
  myclass b;  /|| please do not split this member
}

Rene Brun

On Tue, 15 Oct 2002, Susan Kasahara wrote:

> Hi roottalk,
> I have a class:
>   class Record : public TNamed {
>      ...
>   };
> (There are also subclasses of the Record class that contain specialized data members
> according to different types of record data.)
> I create a TTree with one main branch to hold objects of type Record:
>   Record* record = 0;
>   tree -> Branch("record","Record",&record,16000,99);
> and the main branch is split with level = 99.  This splits the data members
> of the TNamed class onto 2 separate branches: fName and fTitle.
>    My experience with the i/o of objects of this Record class to a TTree split
> in this manner is that it works and I can retrieve the data stored in fName correctly.
> But while researching a problem in a new record package design, related to the storage and retrieval
> of TNamed data, I came upon the  following roottalk digest discussion:
>   http://root.cern.ch/root/roottalk/roottalk00/1216.html
> which indicates that splitting the TNamed data members shouldn't work.  Was I just lucky when splitting
> the TNamed data members in the past, or is this splitting somehow supported with
> newer versions of ROOT (I'm using cvs ROOT updated last Friday)?
>   If the answer is that splitting of TNamed objects is not allowed, is there a way to
> tell the tree->Branch method to not split the TNamed object, while still avoiding
> customizing the splitlevel for the various subclasses of class Record?
> Thanks for your help,
> -Sue Kasahara
> 



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:51:15 MET