Re: [ROOT] TTree::MakeClass and 2D arrays

From: Rene Brun (Rene.Brun@cern.ch)
Date: Fri Oct 17 2003 - 19:20:34 MEST


Hi Julien,

I cannot reproduce this problem. Unfortunately, you do not indicate
which version of ROOT and which machine.

Rene Brun


On Fri, 
17 Oct 2003, Julien Bolmont wrote:

> 
> 
> Hello rooters,
> 
> I used TTree::MakeClass to generate a skeleton class for my tree.
> This tree contains simple variables, some 1D arrays and some 2D arrays.
> 
> All works well when I try to use simple variables or 1D arrays, ie I get 
> the right numbers.
> 
> But it doesn't work with 2D arrays. For example, I got a table:
>    Float_t         dir[100][3];
> which coresponds to the branch
>    TBranch        *b_dir;
> 
> In Init(..) we have :
>    fChain->SetBranchAddress("dir", dir);
> 
> In Notify() :
>    b_dir = fChain->GetBranch("dir");
> 
> 
> And now, if I have a Loop function with
> 
>    for (Int_t jentry = 0 ; jentry < nentries ; jentry++) {
> 
>       Int_t ientry = LoadTree(jentry);
>       if (ientry < 0) break;
> 
> 		nb1 += b_dir->GetEntry(ientry);
> 		
> 		
> 		cout << dir[0][2] << endl;
> 		
>    }
> 
> All I got is a lot's of 0.
> 
> 
> I think it's probably a problem of adress, but how to solve it ??
> 
> Thanks for your help !
> 
> JB.
> 
> 
> 
> 



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:16 MET