Re: [ROOT] Hbook/PAW files now readable from ROOT

From: Valeri Fine (fine@bnl.gov)
Date: Wed Feb 20 2002 - 22:29:28 MET


> Hi Valery,
> 
> The new optional library libHbook uses the same technique
> that I used in h2root. The class THbookFile is the only class
> depending directly from the Hbook/Zebra routines from CERNLIB.

> The link procedure to build the library uses the same
> libraries than h2root (libPacklib,libKernlib). These libraries
> can be 3 years old libs or the latest libs from CERNLIB.
> THbookFile uses directly calls to the original Hbook/Zebra
> libraries. You should not see any side-effects with this.
> libHbook.so is prelinked with CERNLIB.

> If you do not have CERNLIB, it does not matter. 

  We do have CERNLIB (statically linked of course) and the second copy
  of the ZEBRA common blocks and CERNLIB library entries could cause some 
  mess. Therefor for our environment we have to create another copy of that 
  share library with no CERNLIB linked.

  It is not a  complain or a bug report. It is just a reminder to people 
  who have  been using CERNLIB on its own. May be you should make 
  some remark in that class documentation as well.
   
> You should be able to use the new classes without linking yourself with 
>  CERNLIB if you use the binary distributions.

> I did not test yet these new classes on Windows, but I do not
> expect any problems on this platform.

  I am afraid it will crush ( time by time )

  Thank you.
                                   Valeri

> 
> I expect that most people will use this new library by
> dynamic linking with:
>    gSystem->Load("libHbook");
> 
> Rene Brun
>  
> 
> On Wed, 20 Feb 2002, Valeri Fine wrote:
> 
> > Hello Rene,
> > 
> > Can you elaborate whether a new share library is linked against of any 
> > CERNLIB libraries Since many ROOT-based our application need CERNLIB as well
> > including a share library that is linked with CERNLIB may cause some "side effect"
> > we would like to avoid.
> > 
> >   Thank you, Valeri
> > -----
> > Dr.Valeri Fine
> > STAR/US Atlas                                    E-mail: fine@bnl.gov
> > Brookhaven National Lab                Phone: +1 631 344 7806
> > Upton, NY 11973-5000                       FAX:     +1 631 344 4206
> > USA
> > 
> > 
> > 
> > ----- Original Message ----- 
> > From: "Rene Brun" <Rene.Brun@cern.ch>
> > To: <roottalk@pcroot.cern.ch>; <pclark@SLAC.stanford.edu>
> > Sent: Wednesday, February 20, 2002 12:58 PM
> > Subject: [ROOT] Hbook/PAW files now readable from ROOT
> > 
> > 
> > > Dear Rooters,
> > > 
> > > A set of classes allowing to read directly Hbook files in ROOT
> > > are now available in the CVS development version. The classes are:
> > >   -THbookFile:   an Hbook file object
> > >   -THbookTree:   an Hbook Ntuple (Row or Column-Wise)
> > >   -THbookBranch: an ntuple column
> > >   -THbookKey:    service class to browse Hbook directories
> > > The new classes are in a separate optional shared lib libHbook.so
> > > 
> > > With these classes, one can:
> > > - import automatically any 1-d, 2-d or profile histograms. The Hbook types
> > > are converted on the fly to Root types TH1F, TH2F and TProfile.
> > > 
> > > - import ntuple headers (Row or Column-Wise).
> > > A new data type THbookTree (deriving from TTree) with functions like
> > > hbookTree.Draw("x","selection") like for a normal TTree. The ntuple data
> > > are read directly from the Hbook file.
> > > 
> > > - The Tree viewer can be used directly: hbookTree.StartViewer();
> > > 
> > > - Browse the THbookFile via TBrowser. Clicking on a Hbook ID in a file
> > > draws the histogram.
> > > 
> > > - When in the browser, the context menu item "Convert2root" can be selected
> > > to convert a THbookFile into a normal TFile (via h2root). The converted file
> > > is by default connected to the browser.
> > > 
> > > Example:
> > >   gSystem->Load("libHbook");
> > >   THbookFile f("myfile.hbook");
> > >   f.ls();
> > >   TH1F *h1 = (TH1F*)f.Get(1);  //import histogram ID=1 in h1
> > >   h1->Fit("gaus");
> > >   THbookTree *T = (THbookTree*)f.Get(111); //import ntuple header
> > >   T->Print();  //show the Hbook ntuple variables
> > >   T->Draw("x","y<0"); // as in normal TTree::Draw
> > >   T->StartViewer();
> > > 
> > > I have tested these classes on several Hbook files containing histograms
> > > and ntuples of various complexity.
> > > 
> > > Note that a THbookFile is a read only file.
> > > 
> > > I would appreciate feedback on these classes.
> > > 
> > > Rene Brun
> > > 
> > 
> 



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:42 MET