Re: [ROOT] Selective filling of part of a branch

From: Rene Brun (Rene.Brun@cern.ch)
Date: Sat Feb 24 2001 - 21:36:51 MET


Hi Christian,

Root Trees are designed to work essentially on write once/read many times
data. You can add new entries to a Tree, but Trees do not accept
the modification of one entry. This would be very innefficient.
However, your problem is trivial to solve by creating new Trees
for all the new variables you want to create or modify.
You can have as many Trees as you like in parallel. You can read
several trees in parallel. Using the result of tree1.GetEntry(i),
you can call tree2.GetEntry(variable read from tree1).
Currently TTree::Draw is limited to queries on variables from the
same Tree. Soon, we will introduce the possibility to have parallel Trees
and the above limitation will be removed.

Rene Brun

cstrato@EUnet.at wrote:
> 
> Dear Rooters
> 
> When I have a class:
> class ClassA: public TNamed{
>    private:
>    TString Name1;
>    TString Name2;
>    TString Name3;
> }
> and a tree with one branch:
> tree->Branch("br","ClassA",&classA,64000,0);
> 
> Initially, I can fill the tree only with Name1 and Name2, but not with
> Name3.
> However, at a later time, I want to fill selective entries with Name3.
> 
> How can I fill a selected entry of the tree with Name3?
> How can I replace one member variable of ClassA for a selected entry
> only?
> 
> Thank you in advance for your help
> Christian



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:37 MET