[ROOT] how do I load objects from RootFile without searching

From: HP Wei (hp@rentec.com)
Date: Wed Jan 22 2003 - 20:30:23 MET


Question:
   TDirectory::Get("ObjName");
   first searches for the object named "ObjName" in a given RootFile
   and then loads the object into memory.
   
   I want to eliminate the process of searching.
   i.e. I want to find a function that does the second part of Get()
        --> to load the object in memory given an offset.
   
   Since we can get the info of the offset (seekKey) of 
   the object stored in a rootfile and we can know the offset beforehand,
   we could have a function like:
   (TObject *) Load(offset)
   which just goes to the offset in the file and load the object into memory.
   This presumably will be somewhat faster than Get("ObjName").
   
   Is there something in the class library to allow me to do this ???
   
   GetListOfKeys() can provide SeekKey for the object, which we can 
   store in a hash table such as 
   STL::map(string(objName), unsigned_int(offset)).
   But in TDirectory, I could not find any function that does:
   (TObject *) Load(seekKey).

thanks,
HP



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:08 MET