Re: TChain and TEntryList

From: Rene Brun <Rene.Brun_at_cern.ch>
Date: Tue, 26 Oct 2010 10:30:11 +0200


Hi Andrea,

Yes, I agree that the case with one file only breaks the symmetry. The current algorithm is more efficient in the frequent case of only one file. It is hard to modify this behavior, otherwise we will not be back compatible.

Rene Brun

Andrea Massironi wrote:
> Dear Rooters,
> I found a strange behaviour about TChain and TEntryList.
>
> I first create a simple TTree
>
> TFile file("out.root","RECREATE");
> TTree myTree("myTree","myTree");
> int a;
> myTree.Branch("a",&a,"a/I");
> a = 10;
> for (int i=0; i<100; i++) { a = i; myTree.Fill();}
> myTree.Write();
>
>
> In two different files (that is simply changing out.root -> out2.root).
> Then if I read one tree using a TChain
>
> TChain chain("myTree");
> chain.Add("out.root");
> chain.Draw(">>myList","a<10","entrylist");
> TEntryList *myList = (TEntryList*)gDirectory->Get("myList");
> myList->GetLists()
>
>
> The "GetLists()" returns 0x0.
> While if I simply do
>
> TChain chain("myTree");
> chain.Add("out.root");
> chain.Add("out2.root");
> chain.Draw(">>myList","a<10","entrylist");
> TEntryList *myList = (TEntryList*)gDirectory->Get("myList");
> myList->GetLists()
>
> It works well, and I can do, for example
>
> myList->GetLists()->GetEntries()
>
> and I get "2" as expected.
> If this behaviour expected? I would have expected to get one single
> list in case of adding one file, and 2 lists in case of 2.
>
> I'm working with 5.27/07 trunk_at_35856; but I found the very same
> problem with 5.22/00d.
> The problem was triggered by https://savannah.cern.ch/bugs/?60569 and
> the work-around.
>
> Thanks,
> Andrea
>
>
>
>
>
>
Received on Tue Oct 26 2010 - 10:30:15 CEST

This archive was generated by hypermail 2.2.0 : Tue Oct 26 2010 - 23:50:01 CEST