class THbookFile: public TNamed

  This class is an interface to the Hbook objects in Hbook files
  Any Hbook object (1-D, 2-D, Profile, RWN or CWN can be read
  NB: a THbookFile can only be used in READ mode
      Use the utility in $ROOTSYS/bin/h2root to convert Hbook to Root

 Example of use:
  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

  THbookFile can be browsed via TBrowser.


Function Members (Methods)

public:
THbookFile()
THbookFile(const THbookFile&)
THbookFile(const char* fname, Int_t lrecl = 1024)
virtual~THbookFile()
voidTObject::AbstractMethod(const char* method) const
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidBrowse(TBrowser* b)
virtual Bool_tcd(const char* dirname = "")
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTNamed::Clear(Option_t* option = "")
virtual TObject*TNamed::Clone(const char* newname = "") const
virtual voidClose(Option_t* option = "")
virtual Int_tTNamed::Compare(const TObject* obj) const
virtual TObject*Convert1D(Int_t id)
virtual TObject*Convert2D(Int_t id)
virtual TFile*Convert2root(const char* rootname = "", Int_t lrecl = 0, Option_t* option = "")MENU
virtual TObject*ConvertCWN(Int_t id)
virtual TObject*ConvertProfile(Int_t id)
virtual TObject*ConvertRWN(Int_t id)
virtual voidTNamed::Copy(TObject& named) const
virtual voidTObject::Delete(Option_t* option = "")MENU
voidDeleteID(Int_t id)
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidTObject::Dump() constMENU
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual voidTNamed::FillBuffer(char*& buffer)
virtual TObject*FindObject(const char* name) const
virtual TObject*FindObject(const TObject* obj) const
TObject*Get(Int_t id)
const char*GetCurDir() const
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
Int_tGetEntry(Int_t entry, Int_t id, Int_t atype, Float_t* x)
Int_tGetEntryBranch(Int_t entry, Int_t id)
virtual const char*TObject::GetIconName() const
TList*GetList() const
TList*GetListOfKeys() const
virtual const char*TNamed::GetName() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
Long64_tGetSize() const
virtual const char*TNamed::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTNamed::Hash() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
voidInitLeaves(Int_t id, Int_t var, TTreeFormula* formula)
virtual voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tIsFolder() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tIsOpen() const
virtual Bool_tTNamed::IsSortable() const
Bool_tTObject::IsZombie() const
virtual voidls(const char* path = "") const
voidTObject::MayNotUse(const char* method) const
virtual Bool_tTObject::Notify()
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
THbookFile&operator=(const THbookFile&)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidTNamed::Print(Option_t* option = "") const
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(basic_ostream<char,char_traits<char> >& out, Option_t* option = "")
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
virtual voidSetBranchAddress(Int_t id, const char* bname, void* add)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
virtual voidTNamed::SetName(const char* name)MENU
virtual voidTNamed::SetNameTitle(const char* name, const char* title)
static voidTObject::SetObjectStat(Bool_t stat)
virtual voidTNamed::SetTitle(const char* title = "")MENU
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidShowMembers(TMemberInspector& insp, char* parent)
virtual Int_tTNamed::Sizeof() const
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
protected:
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidTObject::MakeZombie()

Data Members

public:
enum TObject::EStatusBits { kCanDelete
kMustCleanup
kObjInCanvas
kIsReferenced
kHasUUID
kCannotPick
kNoContextMenu
kInvalidObject
};
enum TObject::[unnamed] { kIsOnHeap
kNotDeleted
kZombie
kBitMask
kSingleKey
kOverwrite
kWriteDelete
};
protected:
TStringfCurDirname of current directory
TList*fKeyslist of Hbook keys (Ids) on disk
TList*fListlist of objects in memory
Int_tfLreclRecord length in Hbook machine words
Int_tfLunFortran logical unit for this file
TStringTNamed::fNameobject identifier
TStringTNamed::fTitleobject title
static Int_t*fgLuns
static Bool_tfgPawInit

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

THbookFile(const THbookFile& )
the constructor
THbookFile(const char* fname, Int_t lrecl = 1024)
  Constructor for an HBook file object
~THbookFile()
destructor
void Browse(TBrowser* b)
 to be implemented
Bool_t cd(const char* dirname = "")
 change directory to dirname
void Close(Option_t* option = "")
 Close the Hbook file
void DeleteID(Int_t id)
remove id from file and memory
TObject * FindObject(const char *name)
 return object with name in fList in memory
TObject * FindObject(const TObject *obj)
 return object with pointer obj in fList in memory
TObject * Get(Int_t id)
 import Hbook object with identifier idd in memory
Int_t GetEntry(Int_t entry, Int_t id, Int_t atype, Float_t* x)
 Read in memory all columns of entry number of ntuple id from the Hbook file
Int_t GetEntryBranch(Int_t entry, Int_t id)
 Read in memory only the branch bname
void InitLeaves(Int_t id, Int_t var, TTreeFormula* formula)
 This function is called from the first entry in TTreePlayer::InitLoop
 It analyzes the list of variables involved in the current query
 and pre-process the internal Hbook tables to speed-up the search
 at the next entries.
Bool_t IsOpen()
 Returns kTRUE in case file is open and kFALSE if file is not open.
void SetBranchAddress(Int_t id, const char* bname, void* add)
Set branch address
TFile * Convert2root(const char* rootname = "", Int_t lrecl = 0, Option_t* option = "")
 Convert this Hbook file to a Root file with name rootname.
 if rootname="', rootname = hbook file name with .root instead of .hbook
 By default, the Root file is connected and returned
 option:
       - "NO" do not connect the Root file
       - "C"  do not compress file (default is to compress)
       - "L"  do not convert names to lower case (default is to convert)
TObject * ConvertCWN(Int_t id)
 Convert the Column-Wise-Ntuple id to a Root Tree
TObject * ConvertRWN(Int_t id)
 Convert the Row-Wise-Ntuple id to a Root Tree
TObject * ConvertProfile(Int_t id)
 Convert an Hbook profile histogram into a Root TProfile

 the following structure is used in Hbook
    lcid points to the profile in array iq
    lcont = lq(lcid-1)
    lw    = lq(lcont)
    ln    = lq(lw)
      if option S jbyt(iq(lw),1,2) = 1
      if option I jbyt(iq(lw),1,2) = 2
TObject * Convert1D(Int_t id)
 Convert an Hbook 1-d histogram into a Root TH1F
TObject * Convert2D(Int_t id)
 Convert an Hbook 2-d histogram into a Root TH2F
void ls(const char* path = "") const
 List contents of Hbook directory
THbookFile(const THbookFile& )
const char * GetCurDir()
{return fCurDir.Data();}
Long64_t GetSize()
{return 0;}
TList * GetList()
{return fList;}
TList * GetListOfKeys()
{ return fKeys; }
Bool_t IsFolder()
{ return kTRUE; }

Author: Rene Brun 18/02/2002
Last change: root/hbook:$Id: THbookFile.h 20882 2007-11-19 11:31:26Z rdm $
Last generated: 2008-06-25 08:47
Copyright (C) 1995-2002, Rene Brun and Fons Rademakers. *

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.