File/tree size significant increasement

I have a file containing a regular tree. The tree has 4 leaves and the number of total entries is around 1.3x10^7. The file size is ~8 MB. Now, I created another tree in a new file. The new tree has 8 leaves that are created in the same way as in the former tree. The number of total entries for the new file is same as the former tree. But, the new file size is significantly increased to 278 MB! Simply speaking, the file with 4 leaves is only 8 MB, and the file with 8 leaves is 278 MB, which totally does not make sense to me.

The code is attached. The small root file was created in the similar way.

convert_carv_to_polar.C (1.45 KB)

Could you send the result of

mytree.Print(); for each case


For the small file with a tree with 4 leaves:

For the large-size file:

It seems that 3 leaves: theta, phi and r cannot be compressed too much unlike other leaves.

OK this was my suspicion. Simply look at the branch compression factors to understand your problem.


Then why is this happened and how to solve it?

When you see compression factors like 143 for drho, it means that you store always the same value in the branch.


Oh, I see.

You are right. My data: x, y, z, rho and drho are indeed compressible (since many of them are same). For theta and phi derived from x, y and z, there is no too much room to compress. This phenomenon that I observed is due to my data sample, nothing with ROOT.