Re: Getting all the objects in a TMapFile

From: Otto Schaile (Otto.Schaile@Physik.uni-muenchen.de)
Date: Mon Feb 15 1999 - 16:58:09 MET


Hi Alberto,
I guess currently the only way is like you indicated:
extract a suitable  TMapRec.h from the source file (BASE_MapFile.cxx)

--
#include "TMapRec.h"

TMapFile *mfile = TMapFile::Create(fname);
TMapRec *mr = mfile->GetFirst();
while (mfile->OrgAddress(mr)) {
   TString name=mr->GetName();
   if(!name.Contains("IlikeIt")) break;
   TObject * obj =0;
   obj = (TObject*)mfile->Get(name.Data(),obj);
...
   mr   = mr->GetNext();
}
-----
A more effient way would be to write an Object containing a 
List of Contents with a fixed Name. We store in this list 
the name of histograms + their statitistics which we update
regularly. To produce a list of histograms with Nentries, SumOfW,
, means etc. only this list needs to be streamed in. 

If you want to know more how I implemented this please contact me.

Cheers
Otto
----------------------------------------------------------------------------
Otto Schaile                    Sektion Physik der LMU Muenchen
Phone: (+49 89)289 14070        Am Coulombwall 1, D-85748 Garching, Germany
FAX:   (+49 89)289 14072        EMail: Otto.Schaile@Physik.Uni-Muenchen.DE



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:29 MET