ROOT  6.06/09
Reference Guide
THbookTree.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_THbookTree
13 #define ROOT_THbookTree
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // THbookTree //
19 // //
20 // A wrapper class supporting Hbook ntuples (CWN and RWN). //
21 // The normal TTree calls can be used, including TTree::Draw(). //
22 // Data read directly from the Hbook file via THbookFile. //
23 // //
24 //////////////////////////////////////////////////////////////////////////
25 
26 #ifndef ROOT_TTree
27 #include "TTree.h"
28 #endif
29 #ifndef ROOT_THbookFile
30 #include "THbookFile.h"
31 #endif
32 
33 
34 class THbookTree : public TTree {
35 
36 protected:
37  Int_t fID; //Hbook identifier
38  Int_t fType; //RWN (0) or CWN (1)
39  char *fX; //storage area for RWN
40  Bool_t fInit; //flag to know if branches computed
41  THbookFile *fFile; //pointer to Hbook file
42 
43 public:
44  THbookTree();
45  THbookTree(const char *name, Int_t id);
46  virtual ~THbookTree();
47  virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0);
49  virtual Int_t GetID() {return fID;}
50  virtual Int_t GetType() {return fType;}
51  Float_t *GetX() {return (Float_t*)fX;}
52  virtual void InitBranches(Long64_t entry);
53  char *MakeX(Int_t nvars) {fX = new char[nvars]; return fX;}
54  virtual void Print(Option_t *option="") const;
55  virtual Long64_t SetEntries(Long64_t n=-1);
56  virtual void SetHbookFile(THbookFile *file) {fFile = file;}
57  virtual void SetType(Int_t atype) {fType = atype;}
58 
59  ClassDef(THbookTree,1) //A wrapper class supporting Hbook ntuples (CWN and RWN)
60 };
61 
62 #endif
virtual void Print(Option_t *option="") const
Print an overview of the hbook ntuple.
Definition: THbookTree.cxx:127
long long Long64_t
Definition: RtypesCore.h:69
THbookFile * GetHbookFile()
Definition: THbookTree.h:48
float Float_t
Definition: RtypesCore.h:53
const char Option_t
Definition: RtypesCore.h:62
virtual Int_t GetType()
Definition: THbookTree.h:50
Bool_t fInit
Definition: THbookTree.h:40
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
Int_t fID
Definition: THbookTree.h:37
ClassDef(TAttLine, 2)
char * fX
Definition: THbookTree.h:39
Int_t fType
Definition: THbookTree.h:38
virtual Int_t GetID()
Definition: THbookTree.h:49
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0)
get one entry from the hbook ntuple
Definition: THbookTree.cxx:97
virtual void InitBranches(Long64_t entry)
Initialize the branch addresses.
Definition: THbookTree.cxx:107
THbookFile * fFile
Definition: THbookTree.h:41
char * MakeX(Int_t nvars)
Definition: THbookTree.h:53
Long64_t entry
virtual void SetType(Int_t atype)
Definition: THbookTree.h:57
virtual Long64_t SetEntries(Long64_t n=-1)
Set the number of entries in the tree header and its branches.
Definition: THbookTree.cxx:135
virtual void SetHbookFile(THbookFile *file)
Definition: THbookTree.h:56
A wrapper class supporting Hbook ntuples (CWN and RWN).
Definition: THbookTree.h:34
virtual ~THbookTree()
destructor
Definition: THbookTree.cxx:87
#define name(a, b)
Definition: linkTestLib0.cpp:5
Float_t * GetX()
Definition: THbookTree.h:51
This class is an interface to the Hbook objects in Hbook files.
Definition: THbookFile.h:31
A TTree object has a header with a name and a title.
Definition: TTree.h:94
const Int_t n
Definition: legend1.C:16