Logo ROOT  
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 #include "TTree.h"
27 #include "THbookFile.h"
28 
29 
30 class THbookTree : public TTree {
31 
32 protected:
33  Int_t fID; //Hbook identifier
34  Int_t fType; //RWN (0) or CWN (1)
35  char *fX; //storage area for RWN
36  Bool_t fInit; //flag to know if branches computed
37  THbookFile *fFile; //pointer to Hbook file
38 
39 public:
41  THbookTree(const char *name, Int_t id);
42  virtual ~THbookTree();
43  virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0);
44  THbookFile *GetHbookFile() {return fFile;}
45  virtual Int_t GetID() {return fID;}
46  virtual Int_t GetType() {return fType;}
47  Float_t *GetX() {return (Float_t*)fX;}
48  virtual void InitBranches(Long64_t entry);
49  char *MakeX(Int_t nvars) {fX = new char[nvars]; return fX;}
50  virtual void Print(Option_t *option="") const;
52  virtual void SetHbookFile(THbookFile *file) {fFile = file;}
53  virtual void SetType(Int_t atype) {fType = atype;}
54 
55  ClassDef(THbookTree,1) //A wrapper class supporting Hbook ntuples (CWN and RWN)
56 };
57 
58 #endif
THbookTree::fX
char * fX
Definition: THbookTree.h:41
THbookTree::fType
Int_t fType
Definition: THbookTree.h:40
n
const Int_t n
Definition: legend1.C:16
THbookTree::GetEntry
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0)
get one entry from the hbook ntuple
Definition: THbookTree.cxx:97
THbookTree::GetID
virtual Int_t GetID()
Definition: THbookTree.h:51
THbookTree::fFile
THbookFile * fFile
Definition: THbookTree.h:43
THbookTree::InitBranches
virtual void InitBranches(Long64_t entry)
Initialize the branch addresses.
Definition: THbookTree.cxx:107
THbookTree::MakeX
char * MakeX(Int_t nvars)
Definition: THbookTree.h:55
Long64_t
long long Long64_t
Definition: RtypesCore.h:73
TTree
Definition: TTree.h:79
THbookTree::SetType
virtual void SetType(Int_t atype)
Definition: THbookTree.h:59
Float_t
float Float_t
Definition: RtypesCore.h:57
Int_t
int Int_t
Definition: RtypesCore.h:45
THbookTree
Definition: THbookTree.h:30
THbookTree::SetEntries
virtual Long64_t SetEntries(Long64_t n=-1)
Set the number of entries in the tree header and its branches.
Definition: THbookTree.cxx:135
THbookTree::SetHbookFile
virtual void SetHbookFile(THbookFile *file)
Definition: THbookTree.h:58
THbookTree::GetX
Float_t * GetX()
Definition: THbookTree.h:53
TTree.h
THbookTree::~THbookTree
virtual ~THbookTree()
destructor
Definition: THbookTree.cxx:87
THbookFile
Definition: THbookFile.h:29
bool
THbookFile.h
THbookTree::THbookTree
THbookTree()
default constructor
Definition: THbookTree.cxx:61
Option_t
const typedef char Option_t
Definition: RtypesCore.h:66
THbookTree::Print
virtual void Print(Option_t *option="") const
Print an overview of the hbook ntuple.
Definition: THbookTree.cxx:127
THbookTree::GetHbookFile
THbookFile * GetHbookFile()
Definition: THbookTree.h:50
THbookTree::GetType
virtual Int_t GetType()
Definition: THbookTree.h:52
THbookTree::fInit
Bool_t fInit
Definition: THbookTree.h:42
file
Definition: file.py:1
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
name
char name[80]
Definition: TGX11.cxx:110
THbookTree::fID
Int_t fID
Definition: THbookTree.h:39
int