I have created a binary file consisting of the following data:
Binary File
UChar_t (detector id)
UChar_t (Time-of-flight in tenths of nanoseconds.)
UChar_t ( " )
UChar_t ( " )
UChar_t ( " )
UChar_t (Energy 1)
UChar_t ( " )
UChar_t (Energy 2)
UChar_t ( " )
I have also created an uncompressed ROOT Tree consisting of the same data but using the natural variables rather than breaking the data into UChar_t:
Branch1:
UChar_t (detector id)
Int_t (Time-of-flight in tenths of nanoseconds.)
Branch 2:
Short_t (Energy 1)
Short_t (Energy 2)
In both cases the size of a single event is 9 bytes. For 802212 events written out to the binary file I get a file size of 7219908, which is exactly what I expect. The ROOT tree is almost 4 times the size of the binary file. Why?