Compression of arrays

Hi,

I would like to ask you if there is any tool in root to compress arrays of shorts and integers, or objects from TArrayS or TArrayI. Any advice on how to do that? Thanks in advance.

Hermes

Hi,

What do you mean by ‘compress’? When you create a TFile object you can select the compression level with which the data will be compressed on disk. In a ROOT file you can store any objects (for which a dictionary has been generated and loaded). std::vector, std::vector, TArrayS and TArrayI, all have pre-generated dictionary.

Cheers,
Philippe.

Hi Philippe,

Thanks for the answer. What I want is to compress an array of floats before using the root compression. The thing is that I’m working inside a framework where I am not allowed to modify the compression level of the .root files, and then I need to compress my own data with the hope of reducing the file size of the final .root files.
I am trying to find open source compression algorithms that I can use, but thought that maybe there is a root tool that I could use instead.

By the way, I understand that it is a strange question, taking into account that the simplest solution is just increase the compression level, but unfortunately I can’t do that.

Cheers,
Hermes

Hi,

Alternatively you can also consider using Float16_t and Double32_t which let you select which precision is to be conserved on the file.

Cheers,
Philippe.