(no subject)

Pasha Murat (murat@cdfsga.fnal.gov)
Sat, 2 May 1998 20:45:04 -0500 (CDT)


Wei Xie writes:
>
> Dear ROOTer's
>
> I'v two files: "tree1.root" and "tree2.root", which contain TTree object
> "T" with varible "aa1" and "aa2", respectively. When typing:
>
> ** TChain chain("T");
> ** chain.Add("tree1.root");
> ** chain.Add("tree2.root");
> ** chain.Draw("aa1");
> ** chain.Draw("aa2");
>
> It will draw varible "aa1" successfully but shows the
> following messages:
>
> ** *ERROR 26 :
> ** Unknown name : "aa2"
>
> If I change the sequence of adding "tree1.root" and "tree2.root", i.e.
>
> ** ...........
> ** chain.Add("tree2.root");
> ** chain.Add("tree1.root");
> ** chain.Draw("aa1");
> ** chain.Draw("aa2");
>
> It'll shows:
>
> ** *ERROR 26 :
> ** Unknown name : "aa1"
>
> As I understand the TChain should deal with the variable from all the
> files in the chain.

No it should not. Chain is intended for concatenating several
pieces of the same tree residing in several files. In this case
TChain object takes the definition of the tree from the first file
in the chain. Chains are necessary when one deals with the large
data volumes.

In your case chain doesn't seem to be necessary, you could
use a tree with 2 branches instead.

Regards, Pasha.