Logo ROOT   6.08/07
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 #ifndef ROOT_TFile
25 #include "TFile.h"
26 #endif
27 
28 
29 class TTreeFormula;
30 
31 class THbookFile : public TNamed {
32 
33 protected:
34  Int_t fLun; //Fortran logical unit for this file
35  Int_t fLrecl; //Record length in Hbook machine words
36  TList *fList; //list of objects in memory
37  TList *fKeys; //list of Hbook keys (Ids) on disk
38  TString fCurDir; //name of current directory
39 
40  static Bool_t fgPawInit;
41  static Int_t *fgLuns;
42 
43 public:
44 
45  THbookFile();
46  THbookFile(const char *fname, Int_t lrecl=1024);
47  virtual ~THbookFile();
48  virtual void Browse(TBrowser *b);
49  virtual Bool_t cd(const char *dirname="");
50  virtual void Close(Option_t *option="");
51  virtual TFile *Convert2root(const char *rootname="", Int_t lrecl=0, Option_t *option=""); // *MENU*
52  virtual TObject *ConvertCWN(Int_t id);
53  virtual TObject *ConvertRWN(Int_t id);
54  virtual TObject *ConvertProfile(Int_t id);
55  virtual TObject *Convert1D(Int_t id);
56  virtual TObject *Convert2D(Int_t id);
57  void DeleteID(Int_t id);
58  virtual TObject *FindObject(const char *name) const;
59  virtual TObject *FindObject(const TObject *obj) const;
60  TObject *Get(Int_t id);
61  const char *GetCurDir() const {return fCurDir.Data();}
62  Int_t GetEntry(Int_t entry,Int_t id, Int_t atype, Float_t *x);
63  Int_t GetEntryBranch(Int_t entry,Int_t id);
64  Long64_t GetSize() const {return 0;}
65  TList *GetList() const {return fList;}
66  TList *GetListOfKeys() const { return fKeys; }
67  void InitLeaves(Int_t id, Int_t var, TTreeFormula *formula);
68  Bool_t IsFolder() const { return kTRUE; }
69  virtual Bool_t IsOpen() const;
70  virtual void ls(const char *path="") const;
71  virtual void SetBranchAddress(Int_t id, const char *bname, void *add);
72 
73  ClassDef(THbookFile,1) //ROOT interface to Hbook/PAW files
74 };
75 
76 #endif
long long Long64_t
Definition: RtypesCore.h:69
Int_t fLun
Definition: THbookFile.h:34
float Float_t
Definition: RtypesCore.h:53
const char Option_t
Definition: RtypesCore.h:62
virtual Bool_t IsOpen() const
Returns kTRUE in case file is open and kFALSE if file is not open.
Definition: THbookFile.cxx:576
virtual TObject * ConvertProfile(Int_t id)
Convert an Hbook profile histogram into a Root TProfile.
Definition: THbookFile.cxx:878
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
Definition: TFile.h:50
virtual TObject * ConvertRWN(Int_t id)
Convert the Row-Wise-Ntuple id to a Root Tree.
Definition: THbookFile.cxx:798
Basic string class.
Definition: TString.h:137
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
virtual TObject * ConvertCWN(Int_t id)
Convert the Column-Wise-Ntuple id to a Root Tree.
Definition: THbookFile.cxx:645
virtual void Browse(TBrowser *b)
to be implemented
Definition: THbookFile.cxx:348
TObject * Get(Int_t id)
import Hbook object with identifier idd in memory
Definition: THbookFile.cxx:443
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:605
Double_t x[n]
Definition: legend1.C:17
#define ClassDef(name, id)
Definition: Rtypes.h:254
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:33
virtual void Close(Option_t *option="")
Close the Hbook file.
Definition: THbookFile.cxx:396
Int_t fLrecl
Definition: THbookFile.h:35
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:515
virtual ~THbookFile()
destructor
Definition: THbookFile.cxx:337
const char * GetCurDir() const
Definition: THbookFile.h:61
Used to pass a selection expression to the Tree drawing routine.
Definition: TTreeFormula.h:64
A doubly linked list.
Definition: TList.h:47
TList * fList
Definition: THbookFile.h:36
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:41
void DeleteID(Int_t id)
remove id from file and memory
Definition: THbookFile.cxx:419
virtual TObject * FindObject(const char *name) const
return object with name in fList in memory
Definition: THbookFile.cxx:427
THbookFile()
the constructor
Definition: THbookFile.cxx:253
Long64_t GetSize() const
Definition: THbookFile.h:64
static Bool_t fgPawInit
Definition: THbookFile.h:40
TList * GetList() const
Definition: THbookFile.h:65
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:552
Int_t GetEntryBranch(Int_t entry, Int_t id)
Read in memory only the branch bname.
Definition: THbookFile.cxx:529
virtual void SetBranchAddress(Int_t id, const char *bname, void *add)
Set branch address.
Definition: THbookFile.cxx:585
virtual void ls(const char *path="") const
List contents of Hbook directory.
TList * GetListOfKeys() const
Definition: THbookFile.h:66
Mother of all ROOT objects.
Definition: TObject.h:37
TList * fKeys
Definition: THbookFile.h:37
virtual Bool_t cd(const char *dirname="")
change directory to dirname
Definition: THbookFile.cxx:360
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
Definition: TRolke.cxx:630
This class is an interface to the Hbook objects in Hbook files.
Definition: THbookFile.h:31
static Int_t * fgLuns
Definition: THbookFile.h:41
virtual TObject * Convert1D(Int_t id)
Convert an Hbook 1-d histogram into a Root TH1F.
Definition: THbookFile.cxx:919
TString fCurDir
Definition: THbookFile.h:38
virtual TObject * Convert2D(Int_t id)
Convert an Hbook 2-d histogram into a Root TH2F.
Definition: THbookFile.cxx:971
const Bool_t kTRUE
Definition: Rtypes.h:91
Bool_t IsFolder() const
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects)...
Definition: THbookFile.h:68
char name[80]
Definition: TGX11.cxx:109
const char * Data() const
Definition: TString.h:349