Tree

Branch creation enhancement and clarifications

TTreeFormula (TTree::Draw, TTree::Scan)

Splitting STL collections of pointers

STL collection of pointers can now be split by calling
TBranch *branch = tree->Branch( branchname, STLcollection, buffsize, splitlevel )
where STLcollection is the address of a pointer to std::vector, std::list, std::deque, std::set or std::multiset containing pointers to objects.
and where the splitlevel is a value bigger than 100 then the collection will be written in split mode. Ie. if it contains objects of any types deriving from TTrack this function will sort the objects basing on their type and store them in separate branches in split mode.

The ROOT test example in ROOTSYS/test/bench.cxx shows many examples of collections and storage in a TTree when using split mode or not. This program illustrates the important gain in space and time when using this new facility.

Parallel unzipping

Introducing a parallel unzipping algorithm for pre-fetched buffers. Since we already know what buffers are going to be read, we can decompress a few of them in advance in an additional thread and give the impression that the data decompression comes for free (we gain up to 30% in reading intensive jobs).

The size of this unzipping cache is 20% the size of the TTreeCache and can be modified with TTreeCache::SetUnzipBufferSize(Long64_t bufferSize). Theoretically, we only need one buffer in advance but in practice we might fall short if the unzipping cache is too small (synchronization costs).

This experimental feature is disabled by default, to activate it use the static function

TTreeCache::SetParallelUnzip(TTreeCacheUnzip::EParUnzipMode option = TTreeCacheUnzip::kEnable).
The possible values to pass are: The TTreeCacheUnzip is actived only if you have more than one core. To activate it with only one core useTTreeCacheUnzip::kForce option (for example to measure the overhead).

Disk and Memory Space Gain

In ROOT older than v5.20/00, the branches' last basket, also known as the write basket, was always saved in the same "key" as the TTree object and was always present in memory when reading or writing. When reading this write basket was always present in memory even if the branch was never accessed.

Starting in v5.20/00, TTree::Write closes out, compresses (when requested) and writes to disk in their own file record the write baskets of all the branches. (This is implemented via the new function TTree::FlushBaskets, TBranch::FlushBaskets, TBranch::FlushOneBaskets)

TTree::AutoSave supports a new option "FlushBaskets" which will call FlushBaskets before saving the TTree object.

Benefits
Flushing the write baskets has several advantages: Note: Calling FlushBaskets too often (either directly of via AutoSave("FlushBaskets")) can lead to unnecessary fragmentation of the ROOT file, since it write the baskets to disk (and a new basket will be started at the next fill) whether or not the content was close to filling the basket or not.

Others