Re: non split mode for a TClonesArrai in a TBranch

From: Christian Holm Christensen (cholm@hehi03.nbi.dk)
Date: Mon Mar 20 2000 - 21:54:45 MET


Hi Yves, 

On Mon, 20 Mar 2000 18:27:12 +0100 Yves SCHUTZ <schutz@in2p3.fr> wrote:
> Hi,
> 
> How can I write a TClonesArray in NON SPLIT
> MODE to a branc in tree. Doing
> 
>     TClonesArray * list = new TClonesArray( ...
>    T->Branch(branchname, "TClonesArray" &list,
> fBufferSize,0) ;

When writting a branch of "TClonesArray" objects, you shouldn't use
the method

    TTree::Branch(const char* name, 
		  const char* classname, 
		  void* addobj, 
		  Int_t bufsize = 32000, 
		  Int_t splitlevel = 1)

Rather, you should use

   TTree::Branch(const char* name, 
		 void* clonesaddress, 
                 Int_t bufsize = 32000, 
                 Int_t splitlevel = 1)
                

So that your example will be: 

  Int_t FOO_Split = 0;
  TClonesArray *FOO_list = new TClonesArray("FOO_Class");
  FOO_Tree->Branch("FOO_Branch", &FOO_list, FOO_BufferSize,FOO_Split);

I should think that would help you out. Otherwise, try a TObjArray,
like 

  Int_t BAR_Split = 0;
  TObjArray *BAR_list = 0;
  BAR_Tree->Branch("BAR_Branch", "TObjArray", &BAR_list, 
                   BAR_BufferSize,BAR_Split);

Hope that was of some help. 

Cheers, 

Christian  -----------------------------------------------------------
Holm Christensen                             Phone:  (+45) 35 35 96 91 
  Sankt Hansgade 23, 1. th.                  Office: (+45) 353  25 305 
  DK-2200 Copenhagen N                       Web:    www.nbi.dk/~cholm    
  Denmark                                    Email:       cholm@nbi.dk



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:21 MET