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