Re: (no subject)

From: Rene Brun <Rene.Brun_at_cern.ch>
Date: Thu, 24 Nov 2005 14:55:18 +0100 (MET)


Dmitry,

Call t->SetEntries(nentries);
where nentries is the number of entries if your branches.

Rene Brun

On Thu, 24 Nov
2005, Dmitry Naumov wrote:

> Dear rooters,
>
> I have a strange problem:
> I create TTree with two branches: fRunPars and fEvent.
> fRunPars is filled only once and it containes simulation settings
> fEvent s filled for each event:
>
> fTree->GetBranch("fEvent")->Fill()
>
> Now I created a set of files with these trees. I want to make a TChain of
> them:
> TChain *t = new TChain("nuclon");
> t->AddFile("t1.root"); // has 1 event
> t->AddFile("t2.root"); // has 1 event
> t->GetEntries(); // gives 0. It is OK because TTree
> // has two branches one of which is
> filled
> // many times, another only once,
> thus Entries probably has no sense
> t->GetBranch("fEvent")->GetEntries(); // gives 1 ?! Why not 2?
>
> If I do
> t->GetBranch("fEvent")->GetEntry(0); // it is OK
> t->GetBranch("fEvent")->GetEntry(1); // this event is empty.
>
>
> Do I misunderstand something? Many thanks in advance, Dmitry
>
Received on Thu Nov 24 2005 - 14:55:27 MET

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:13 MET