Re: [ROOT] Nestes arrays in trees

From: Hamlet (_hamlet@libero.it)
Date: Wed Sep 03 2003 - 20:29:10 MEST


(sorry for breaking thread)


> In your case you should use a TClonesArray but make sure that the
> TClonesArray is at the top level of your hierarchy of classes (i.e. only
> have one TClonesArray).
> For example the following set of classes should be split as you expect:
[...]

Now the branches are the right ones, but I've not gone much farther.
I've not clear in mind what those int fields are supposed to do (or how
they are supposed to be filled, and if they are mandatory).
Furthermore, it seems to me something is wrong.

I've attached the test code I'm using (MakeTestObj.sh is the command to
compile under Linux, kernel 2.4.9-21, gcc 2.96).

Then a short run in root.exe :

gSystem->Load("TestObj.so")
AllReconstructions* pRec = new AllReconstructions
TTree Tree("TestTree","Test"); Tree.Branch("Main", "AllReconstructions", 
&pRec)
pRec->Init()

Then, I can't access to fields, like:

[] pRec->r.UncheckedAt(5)
(const class TObject*)0x899a5c8
[] pRec->r.UncheckedAt(5)->np
Error: Symbol pRec is not defined in current scope  FILE:(tmpfile) LINE:1
Error: Failed to evaluate pRec->rError: Failed to evaluate pRec->r- 
>UncheckedAt(5) [...]
Error: Failed to evaluate pRec->r->UncheckedAt(5)->np [...]

and tree filling is strange as well (there should be 6 np, 12 nt and 24 
t[]):

[] for (int i = 0; i < 10; ++i) { Tree.Fill(); }
[] Tree.GetEntry(2)
(Int_t)148
[] Tree.Show()
======> EVENT:2
 Main            = NULL
 r               = 6
 r.fUniqueID     = 0, 0, 0, 0, 0, 0
 r.fBits         = 50331648, 50331648, 50331648, 50331648, 50331648, 
50331648
 r.p[2].t[2]     = 1 1 , 1 1 , 1 1 , 1 1 , 1 1 , 1 1
 r.p[2].nt       = 2, 2, 2, 2, 2, 2
 r.np            = 2, 2, 2, 2, 2, 2

Tree.Draw() behaves strange as well.
Where is my mistake?

-- 
Hamlet








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