Logo ROOT  
Reference Guide
THbookFile.h
Go to the documentation of this file.
1 // @(#)root/hbook:$Id$
2 // Author: Rene Brun 18/02/2002
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2002, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_THbookFile
13 #define ROOT_THbookFile
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // THbookFile //
19 // //
20 // ROOT interface to Hbook/PAW files //
21 // //
22 //////////////////////////////////////////////////////////////////////////
23 
24 #include "TFile.h"
25 
26 
27 class TTreeFormula;
28 
29 class THbookFile : public TNamed {
30 
31 protected:
32  Int_t fLun; //Fortran logical unit for this file
33  Int_t fLrecl; //Record length in Hbook machine words
34  TList *fList; //list of objects in memory
35  TList *fKeys; //list of Hbook keys (Ids) on disk
36  TString fCurDir; //name of current directory
37 
38  static Bool_t fgPawInit;
39  static Int_t *fgLuns;
40 
41 public:
42 
43  THbookFile();
44  THbookFile(const char *fname, Int_t lrecl=1024);
45  virtual ~THbookFile();
46  virtual void Browse(TBrowser *b);
47  virtual Bool_t cd(const char *dirname="");
48  virtual void Close(Option_t *option="");
49  virtual TFile *Convert2root(const char *rootname="", Int_t lrecl=0, Option_t *option=""); // *MENU*
50  virtual TObject *ConvertCWN(Int_t id);
51  virtual TObject *ConvertRWN(Int_t id);
52  virtual TObject *ConvertProfile(Int_t id);
53  virtual TObject *Convert1D(Int_t id);
54  virtual TObject *Convert2D(Int_t id);
55  void DeleteID(Int_t id);
56  virtual TObject *FindObject(const char *name) const;
57  virtual TObject *FindObject(const TObject *obj) const;
58  TObject *Get(Int_t id);
59  const char *GetCurDir() const {return fCurDir.Data();}
60  Int_t GetEntry(Int_t entry,Int_t id, Int_t atype, Float_t *x);
61  Int_t GetEntryBranch(Int_t entry,Int_t id);
62  Long64_t GetSize() const {return 0;}
63  TList *GetList() const {return fList;}
64  TList *GetListOfKeys() const { return fKeys; }
65  void InitLeaves(Int_t id, Int_t var, TTreeFormula *formula);
66  Bool_t IsFolder() const { return kTRUE; }
67  virtual Bool_t IsOpen() const;
68  virtual void ls(const char *path="") const;
69  virtual void SetBranchAddress(Int_t id, const char *bname, void *add);
70 
71  ClassDef(THbookFile,1) //ROOT interface to Hbook/PAW files
72 };
73 
74 #endif
THbookFile::GetCurDir
const char * GetCurDir() const
Definition: THbookFile.h:59
THbookFile::fgPawInit
static Bool_t fgPawInit
Definition: THbookFile.h:38
THbookFile::DeleteID
void DeleteID(Int_t id)
remove id from file and memory
Definition: THbookFile.cxx:421
TBrowser
Definition: TBrowser.h:37
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
THbookFile::FindObject
virtual TObject * FindObject(const char *name) const
return object with name in fList in memory
Definition: THbookFile.cxx:429
THbookFile::THbookFile
THbookFile()
the constructor
Definition: THbookFile.cxx:255
THbookFile::GetEntryBranch
Int_t GetEntryBranch(Int_t entry, Int_t id)
Read in memory only the branch bname.
Definition: THbookFile.cxx:531
THbookFile::GetSize
Long64_t GetSize() const
Definition: THbookFile.h:62
TString::Data
const char * Data() const
Definition: TString.h:369
THbookFile::GetList
TList * GetList() const
Definition: THbookFile.h:63
Long64_t
long long Long64_t
Definition: RtypesCore.h:73
THbookFile::InitLeaves
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 variabl...
Definition: THbookFile.cxx:554
THbookFile::GetListOfKeys
TList * GetListOfKeys() const
Definition: THbookFile.h:64
Float_t
float Float_t
Definition: RtypesCore.h:57
THbookFile::SetBranchAddress
virtual void SetBranchAddress(Int_t id, const char *bname, void *add)
Set branch address.
Definition: THbookFile.cxx:587
Int_t
int Int_t
Definition: RtypesCore.h:45
THbookFile::fKeys
TList * fKeys
Definition: THbookFile.h:35
x
Double_t x[n]
Definition: legend1.C:17
THbookFile::cd
virtual Bool_t cd(const char *dirname="")
change directory to dirname
Definition: THbookFile.cxx:362
THbookFile::ls
virtual void ls(const char *path="") const
List contents of Hbook directory.
Definition: THbookFile.cxx:1008
TString
Definition: TString.h:136
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
THbookFile::fgLuns
static Int_t * fgLuns
Definition: THbookFile.h:39
THbookFile::Convert1D
virtual TObject * Convert1D(Int_t id)
Convert an Hbook 1-d histogram into a Root TH1F.
Definition: THbookFile.cxx:921
b
#define b(i)
Definition: RSha256.hxx:118
THbookFile
Definition: THbookFile.h:29
TFile.h
THbookFile::fCurDir
TString fCurDir
Definition: THbookFile.h:36
bool
THbookFile::IsFolder
Bool_t IsFolder() const
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects).
Definition: THbookFile.h:66
THbookFile::Convert2D
virtual TObject * Convert2D(Int_t id)
Convert an Hbook 2-d histogram into a Root TH2F.
Definition: THbookFile.cxx:973
Option_t
const typedef char Option_t
Definition: RtypesCore.h:66
TNamed
Definition: TNamed.h:29
TTreeFormula
Definition: TTreeFormula.h:58
THbookFile::fLun
Int_t fLun
Definition: THbookFile.h:32
TFile
Definition: TFile.h:54
THbookFile::IsOpen
virtual Bool_t IsOpen() const
Returns kTRUE in case file is open and kFALSE if file is not open.
Definition: THbookFile.cxx:578
THbookFile::ConvertCWN
virtual TObject * ConvertCWN(Int_t id)
Convert the Column-Wise-Ntuple id to a Root Tree.
Definition: THbookFile.cxx:647
THbookFile::ConvertProfile
virtual TObject * ConvertProfile(Int_t id)
Convert an Hbook profile histogram into a Root TProfile.
Definition: THbookFile.cxx:880
THbookFile::ConvertRWN
virtual TObject * ConvertRWN(Int_t id)
Convert the Row-Wise-Ntuple id to a Root Tree.
Definition: THbookFile.cxx:800
THbookFile::Convert2root
virtual TFile * Convert2root(const char *rootname="", Int_t lrecl=0, Option_t *option="")
Convert this Hbook file to a Root file with name rootname.
Definition: THbookFile.cxx:607
THbookFile::Browse
virtual void Browse(TBrowser *b)
to be implemented
Definition: THbookFile.cxx:350
TObject
Definition: TObject.h:37
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
name
char name[80]
Definition: TGX11.cxx:110
THbookFile::Get
TObject * Get(Int_t id)
import Hbook object with identifier idd in memory
Definition: THbookFile.cxx:445
THbookFile::Close
virtual void Close(Option_t *option="")
Close the Hbook file.
Definition: THbookFile.cxx:398
THbookFile::GetEntry
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.
Definition: THbookFile.cxx:517
THbookFile::~THbookFile
virtual ~THbookFile()
destructor
Definition: THbookFile.cxx:339
THbookFile::fList
TList * fList
Definition: THbookFile.h:34
THbookFile::fLrecl
Int_t fLrecl
Definition: THbookFile.h:33
TList
Definition: TList.h:44
int