Strange behavior of TBranch::Fill

From: Antonio Bulgheroni <antonio.bulgheroni_at_gmail.com>
Date: Thu, 19 Jul 2007 08:54:59 +0200


Dear ROOTers,

I would like to report you the strange behavior of the TBranch::Fill compared to the TTree::Fill. In my real life case I have a TTree with several branches; I don't need (and don't want) to fill all branches,but I would like to indivually fill only branches I'm interested in. For this reason, I'm getting from the TTree the branch I need, I'm setting the address of the TBranch to a local variable and finally I call TBranch::Fill(). Everything is working fine but the tree browser, indeed if I browse the TTree and double click on a leaf instead of drawing the leaf content on a canvas, nothing is happening.

I discovered that if I replace the TBranch::Fill call with a TTree::Fill, the tree broswer is working again, but every time I have all branches filled. Here attached a simplified example, calib.h and calib.cxx contain the class defining the branch content, and test.C a simple macro to fill in a tree using in one case TBranch::Fill and in the other TTree::Fill.

Is this the correct behavior? If so, is there any workaround to have branches browsable and individually fillable? I played a bit with the branch status, but unsuccessfully.

Thanks in advance.

Cheers,
Antonio

Tested on the following configurations:

ROOT 5.15/08 + Linux (Fedora 7) +  g++  4.1.2
ROOT 5.13/04 + SLC 4 + g++  3.4.6
ROOT 5.10/00e + SLC 3
-- 
Antonio Bulgheroni, PhD

Computers have a lot in common with air conditioners:
Once you open WINDOWS, they stop working properly.


  • text/x-c++src attachment: test.C
Received on Thu Jul 19 2007 - 08:55:09 CEST

This archive was generated by hypermail 2.2.0 : Thu Jul 19 2007 - 17:50:02 CEST