[ROOT] Question about TChain::Add

From: Thomas Bretz (tbretz@uni-sw.gwdg.de)
Date: Mon Nov 05 2001 - 16:18:04 MET


Hello rooters,

I have to chains, which should contain the same files, I tried:
------
TChain c1("Events"); // Tree containing 1000 Events
c1.Add("file1.root");
c1.Add("file2.root");

TChain c2("RunHeaders"); // Tree containing one event
c2.Add(&c1);
-----
c2.GetEntries() results in 1000 instead of one and reading results in
reading "Events" instead of "RunHeaders".

I tried the following, too, and this worked:
------
TChain chain("RunHeaders");
TObject *obj;
TIter N(c1.GetListOfFiles());
while ((obj=N()))
  c2.Add(obj->GetTitle());
-------

What is the idea of TChain::Add(TChain *) if not to add all files from
one chain to the other chain?

Thanks,
Thomas.



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