Re: Re: loading all chain to the memory

From: Rene Brun <brun_at_pcroot.cern.ch>
Date: Fri, 12 Aug 2005 07:40:49 +0200 (MEST)


Hi Dmitry
see :http://root.cern.ch/root/roottalk/RoottalkRules.html

Rene Brun

On Thu, 11 Aug
2005, bandurin_at_fnal.gov wrote:

>
> In addition to my prev. email below.
> It turned out that, after processing of the first file is finished,
> the cycle starts again from the first event of same (first) file!
> How to make it move to the second file?
>
> thanks a lot,
> Dmitry
>
> ----- Original Message -----
> From: <bandurin_at_fnal.gov>
> Date: Thursday, August 11, 2005 1:50 pm
> Subject: loading all chain to the memory
>
>>
>> Hello,
>>
>> I am using the following code to create the chain of two files:
>> --------------------------------------------------------------------
>> --------------------------------------------
>> TChain * chain = new TChain("TMBTree",""); // do not modify this
>> line // Point here your root-tuples. Wildcards are allowded:
>> TString FilesToRead1 = "./1_new.root";
>> TString FilesToRead2 = "./2_new.root";
>> Int_t fnum1 = chain->Add(FilesToRead1);
>> Int_t fnum2 = chain->Add(FilesToRead2);
>> int nb_read = chain->GetEntry(0);
>> cout << endl << nb_read <<" bytes read" << endl;
>> TTree *tree = (TTree*)chain->GetTree()->CloneTree(0);
>> --------------------------------------------------------------------
>> --------------------------------------------
>>
>> But I have faced with the following problem.
>> When I do a cycle over all entries (250+250 in my case)
>> the program works fast just for 250 entries from the first file.
>> Starting from the second (Event number 251), it seems to load to
>> the memory entry by entry
>> and execution becomes much slower.
>>
>> How to speed up the execution ? Perhaps one needs to load a larger
>> portion of entries
>> (may be equal to the number of entries in each file)?
>>
>> thanks,
>> Dmitry
>>
>>
>>
>
Received on Fri Aug 12 2005 - 07:40:57 MEST

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