### Tree

- Introduce `TBranch::Set/GetMakeClass` to independently set each branch in `MakeClass` mode and to have a good place to switch the `ReadLeaves` function appropriately (to and from the `MakeClass mode` (also known as the decomposed object mode)). This can also be used to reset the mode of some branch with a `MakeClass/MakeSelector` file.
- Dramatically reduce the amount of memory allocation induces by the management of the `TBasket` and `TBuffer` for each branch. Instead of creating one `TBasket` object and one `TBuffer` object and its associated memory buffer for each onfile basket of each branch, we now create only one `TBasket` and one `TBuffer` object for the lifetime of each branch. The memory buffer associated with the `TBuffer` object is also created once and rarely reallocated; it is reallocated only when the buffer size is reset (for example by the AutoFlush mechanism) and when the user object do not fit in the currently allocated memory (but we do not shrink it after that. The same minization is applied to the scratch area used to read the compressed version of a basket from the file.
- In `TTree` and `TChain`'s `LoadTree` `fReadEntry` is now set to -1 in case of failure to find the proper row.
- In `TTree::CloneTree`, `TChain::Merge` and `TTree::CopyEntries` introduces more flexibility in the handling of the case where a `TTreeIndex` is 'missing' in one or more of the `TTree` objects being collated. If the tree or any of the underlying tree of the chain has an index, that index and any index in the subsequent underlying `TTree` objects will be merged. There are currently three 'options' to control this merging:
  - NoIndex : all the `TTreeIndex` object are dropped.
  - DropIndexOnError : if any of the underlying `TTree` object do no have a `TTreeIndex`, they are all dropped.
  - AsIsIndexOnError [default]: In case of missing `TTreeIndex`, the resulting `TTree` index has gaps.
  - BuildIndexOnError : If any of the underlying `TTree` object do no have a `TTreeIndex`, all `TTreeIndex` are 'ignored' and the mising piece are rebuilt.
  Previously the index were kept only if the first files had an index and if there was any missing index, the resulting index had gaps (the default was similar to AsIsIndexOnError). The new default is BuildIndexOnError ; i.e. we now attempt by default to build the missing indices.
- In `TBranch CopyAddress` (and hence indirectly in the fast cloning) avoid having to read the first entry just to get the address set and do the address setting directly.
- In `TTree::CopyAddress` when copying the addresses of a branch created by a leaflist and where the memory buffer was allocated automatically (as opposed to set by the user) avoid deleting the memory allocated by the tree each time `CopyAddress` is called. (This effectively prevented cloning more than once a TTree with a branch created by a leaflist.)
- Warning: The `TTreeCache` is no longer enabled by default in a `TChain` to align the behavior with a `TTree`. You need to call `TTree::SetCacheSize` to enable the `TTreeCache`.
- Correct and clarify the relationship between AutoFlush and AutoSave:
  - Both the `AutoFlush` and `AutoSave` interval can be specified in terms of bytes (a negative value for `fAutoFlush` or `fAutoSave`) or in terms of the number of entries (positive values).
  - An `AutoFlush` is always done with an `AutoSave`.
  - If the interval specified for `AutoSave` is less than that for `AutoFlush`, the `AutoSave` interval is used for both.
  - If the `AutoFlush` interval is less than the `AutoSave` interval, the `AutoSave` interval is adjusted to the largest integer multiple of the `AutoFlush` interval that is less than or equal to the original value of the `AutoSave` interval.
- Update `MakeProxy` so that the resulting skeleton is useable with Proof.
- Update `MakeProxy`, `MakeClass` and `MakeSelector` to support more cases of branches names (that includes characters illegal in a C++ symbol)
- Replace the `ReadLeaves` virtual function by a `fReadLeaves` pointer to member function, this allows the customization of the `ReadLeaves` function at run-time depending on the underlying user class layout in `TBranchElement`. This removes many if statements whose 'answer' is known at initialization time.
- Add support for 'array' formula in `TTree::Query`.
- Set the initial value of `fCacheSize` to zero to indicate clearly that the `TreeCache` is disabled.
- In `TChain::SetEntryList` use only the treename to lookup the (sub)entryList (instead subdir/treename).
- Add support for the branch creation syntax:

         TString rootString;
         t->Branch("rootString","TString",&rootString, 1600, 0);

  which is 'natural' as it uses the legacy syntax (branch_name,class_name, user_data) but did not work because 'rootString' is an object rather than a pointer to an object. (However the simplier form:

         t->Branch("rootString",&rootString, 1600, 0);

  works/worked fine).
- Add type information to the result of `TTree::Print` in the case of `TBranchElement`:

      *Br   17 :fH        : TH1F*                                                  *
      *Entries :       20 : Total  Size=      19334 bytes  File Size  =       1671 *
      *Baskets :        2 : Basket Size=      16000 bytes  Compression=  11.29     *
      *............................................................................*
      *Br   18 :fTriggerBits : TBits                                               *
      *Entries :       20 : Total  Size=       1398 bytes  File Size  =        400 *
      *Baskets :        1 : Basket Size=      16000 bytes  Compression=   2.23     *
      *............................................................................*
      *Br   19 :fIsValid  : Bool_t                                                 *
      *Entries :       20 : Total  Size=        582 bytes  File Size  =         92 *
      *Baskets :        1 : Basket Size=      16000 bytes  Compression=   1.00     *

- Add a new function `TBranch::SetStatus` It is much faster to call this function in case of a `Tree` with many branches instead of calling `TTree::SetBranchStatus`.
- Implement `TTreeCache::Print` that shows information like:

         //   ******TreeCache statistics for file: cms2.root ******
         //   Number of branches in the cache ...: 1093
         //   Cache Efficiency ..................: 0.997372
         //   Cache Efficiency Rel...............: 1.000000
         //   Learn entries......................: 100
         //   Reading............................: 72761843 bytes in 7 transactions
         //   Readahead..........................: 256000 bytes with overhead = 0 bytes
         //   Average transaction................: 10394.549000 Kbytes
         //   Number of blocks in current cache..: 210, total size: 6280352

  This function can be called directly from `TTree`: `T->PrintCacheStats();`
- Add support for variable size array of object in a `TTree` (when the owner of the array is split.)
- And many other bug fixes, security fixes, thread safety and performance improvements ; see the svn log for details.

#### TTree Scan and Draw

- Insured that the generated histogram as an integral bin width when plotting a string or integer.
- Improved the output of `TTree::Scan` by inserting a blank space whenever a value is not available because there is no proper row in a friend. (Previously it was re-printing the previous value). This required changes in
- When the draw option to TTree::Draw contains "norm" the output histogram is normalized to 1.
- Improve the selection of the leaf used for size of an array in a leaflist by giving preference for the leaf inside the same branch and by adding support for explicit full path name. For example the following now works properly:

      tree->Branch("JET1", &JET1, "njets/I:et[njets]/F:pt[njets]/F");
      tree->BranchBranch("JET2", &JET2, "njets/I:et[njets]/F:pt[njets]/F");
      ...
      tree->Scan("njets/I:et[JETS1.njets]/F:pt[JETS1.njets]");