I have a root tuple that was produced using root v4.04/00 compiled in linux. I am running root v4.04/02g compiled in cigwin using the win32gcc flag. I can display the contents, for example of the variable representing the invariant mass, using TBrowser. However, when I use MakeClass and then add the simple line “cout<<mass<<endl;” to the “Loop” function and compile the class using “.L Data.C+”, when I run the “Loop” function I get first zeros, then crazy numbers of order of 1e-236, etcetera. I believe is a problem with the interaction root<->compiler (g++(GCC) 3.3.3) since when I do not compile the class, I mean, when I use just “.L Data.C”, I do not have that problem. I would like to be able to read the data from this root tuple in a compiled program, since my original problem was with using information from this root tuple in a C++ code using root classes.
Any suggestion is welcome!!! (changing compiler version of course has been one of my first ideas).
I attached my file Data.C created using MakeClass. Also I attached a small root tuple. I tested it before posting it and I have the same problem using this code with this root tuple.
*Entries : 735 : Total Size= 194159 bytes File Size = 29171 *
*Baskets : 5 : Basket Size= 32000 bytes Compression= 5.45 *[/code]Unfortunately, the type of branches is very sensitive to align issue and other weirdness. (i.e. TTree makes some assumptions/guess on how the data is going to be layout in your ‘Data’ class. However these guesses are sometimes unavoidably wrong).
The best/easiest recommendation is, when writing your tree, to:
[ul][color=red]- Use a class and a dictionary to create the TTree[/color]
if this is not possible, have only one variable per branch
if this is not possible, have only one type of variable per branch
if this is not possible, order the variables from large size to smaller.[/ul]
Cheers,
Philippe
Note that the latest combinations of cygwin and gcc are pretty bad.
If you run on Windows, I strongly suggest to use the win32gdk version
instead of win32gcc.