Very basics on a tree storage

Hi all,
maybe it is evident, but (after some searching here and there and trying to understand the class description) I do not see an answer.
Imagine that I have some data like : 32 channels adc, 32 channels scaler, 4byte time for each event.

  • from adc, there is usually single value somewhere or a pair of non-zero data, rarely 16 or more values

  • from scalers - there are always all the channels, but once per 10000 other (adc) events

  • time is recorded for everything : adc/scaler

    In the moment, I have all in one tree, I use three branches, I can very easily plot the different channels and their functions, I use simply a TSelector. But I feel, that there is a lot of wasted space. Compression for scalers is about 10. I have a sense of a possibility to use variable length arrays, but I am afraid of complexity and slow down.

    Are there any general guidlines?
    thank you


Sorry - immediately after I posted I have found that scalers compress even 100-200x. My fault, I looked into a faulty file. It seems that it has half a size than a basic source binary. So, my assumption about waste of space was wrong, as the ttree fixes that by a ‘brute’ compression.


Using a variable size would be more efficiency (slightly faster to read and write, slightly smaller) but your technique will also do.

Using a variable size array is not very difficult. If you use the object based technique to created branches, just use an std::vector. If you use the leaflist technique of branch creation see tree3 tutorials for example at: … iew=markup


Thank you, Philippe.