Problem with TTree::MakeCode

Rene Brun (Rene.Brun@cern.ch)
Tue, 10 Feb 1998 12:52:59 +0100


I forward to the list a mail by Axel Schwank that is of general
interest:

Axel Schwank wrote:
>
> Dear ROOT team,
> please have a look to the attached ROOT file (sorry, not a very meaningful
> name, probably any ROOT file generated for solving problems is called
> "Test.root")
>
> Two odd things can be seen:
>
> 1.
> If you examine the contained TTree named "T" with T.Print(), the
> listing reports size 0 for each branch, though definetely there are
> entries, as correctly indicated. If you have a look with T.Scan() or
> T.Draw("..."), all the data appears correctly.
> The file was written with CompressionLevel 1.
>

This is OK. You have specified large branch buffers (64K).
The data for all your branches fit in memory. The "misleading"
file size reports only about data writing to the. No compression
at this point.
The Total file size however is correct.

file at thsi point.
> 2.
> More severely, the code for an event loop skeleton generated with
> T.MakeCode("...") doesn't work right. Try T.MakeCode("test.C") and then
> gROOT->Reset()
> .x test.C
> This causes an error message "Array index out of range DMIS_fKtel0[6]+108
> valid upto DMIS_fKtel0[5][2][5] FILE:...... LINE:... "
> Quite strange.
>
> I use ROOT version 1.03/09 on IRIX 6.2.

While investigating, I have found a problem in
TTree::MakeCode in case a data member of a class is an array.
The code generated repeats the first dimension of the array
in the last position also. I have fixed this problem in our dev version.
For the time being, you have to modify by hand the result
of MakeCode to remove the last dimension in the array declaration
and also correct the SetBranchAddress by removing the dimension
declaration in the second argument giving the array address.
The information in the Tree, however, should be correct.
And if you work with the original class definition, results
should be correct as well.
Thanks for having reported this problem.

Rene Brun