Re: [ROOT] big files with lot of objects ?

From: Valeri Fine (fine@bnl.gov)
Date: Wed Nov 28 2001 - 16:44:04 MET


> Hi Valerie,
> 
> thanks for your info. Just to be sure which way to go
> these additional questions:
> 
> >    1. Time to read the TList of all TKeys of the
> > current   
> >        TFile at the time the file is open. 
> 
> I guess this is done only ONCE when the file is
> opened, and later the TKeys are in memeory ?

  Yes that's correct.

> 
> >    2. Time to look up the list of TKey (in memory).
> > It is quick 
> >         if the number of key is reasonable. 
> 
> Is that a kind of binary search or everytime a full
> scan trough TKEys ??

The list of TKey's in
http://root.cern.ch/root/html300/TDirectory.html

is a http://root.cern.ch/root/html300/TList.html

So there is no "binary search" this is why I said 
"reasonable". 
See: 
http://root.cern.ch/root/html300/src/TDirectory.cxx.html#TDirectory:Get

To manage this one can use 
http://root.cern.ch/root/html300/TFileIter.html

This class is  good (I hope) to learn how to work with the list of TKey's

> 
> >         objects are huge  <?? how large is your huge
> > ??> as you claimed
> 
> Well I thought again about my application and HUGE was
> maybe the wrong statement. I refered to huge as normal
> macros,c++ files are very tine. BUT in the final app I
> will have A LOT of objects, approx. 2000 in the size
> between 3 and 10 MB each !

  I think 2000 objects is the "reasonable" number.
 
> Of course I do not have that much ram, so another
> question is how to move neede objects between disk and
> memory. As I understand no chnages in a object in
> memory is written to the disk automatically. So
> basically I could open a file and in my loop  (its a
> stock screening app, so I need to do some NN and
> Correlation math on EACH stock), get the object, do
> the math and than DELETE the object and later RETRIEVE
> it again with get. That should work or ??

  Yes it should work for an user's classes "usually".
  However I'd like to call your attention one must be careful with ROOT classes
  like histograms. 
  They are "self-registered" and "self-destroyed".  Look at
   http://root.cern.ch/root/html300/src/TH1.cxx.html#TH1:Build
   to see how it works.


> 
> Thanks for any additonal info.
> 
  You are welcome
                                    Valeri



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