THbookTree.h

Go to the documentation of this file.
00001 // @(#)root/hbook:$Id: THbookTree.h 20882 2007-11-19 11:31:26Z rdm $
00002 // Author: Rene Brun   18/02/2002
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2002, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #ifndef ROOT_THbookTree
00013 #define ROOT_THbookTree
00014 
00015 
00016 //////////////////////////////////////////////////////////////////////////
00017 //                                                                      //
00018 // THbookTree                                                           //
00019 //                                                                      //
00020 // A wrapper class supporting Hbook ntuples (CWN and RWN).              //
00021 // The normal TTree calls can be used, including TTree::Draw().         //
00022 // Data read directly from the Hbook file via THbookFile.               //
00023 //                                                                      //
00024 //////////////////////////////////////////////////////////////////////////
00025 
00026 #ifndef ROOT_TTree
00027 #include "TTree.h"
00028 #endif
00029 #ifndef ROOT_THbookFile
00030 #include "THbookFile.h"
00031 #endif
00032 
00033 
00034 class THbookTree : public TTree {
00035 
00036 protected:
00037    Int_t       fID;         //Hbook identifier
00038    Int_t       fType;       //RWN (0) or CWN (1)
00039    char       *fX;          //storage area for RWN
00040    Bool_t      fInit;       //flag to know if branches computed
00041    THbookFile *fFile;       //pointer to Hbook file
00042 
00043 public:
00044    THbookTree();
00045    THbookTree(const char *name, Int_t id);
00046    virtual ~THbookTree();
00047    virtual Int_t     GetEntry(Long64_t entry=0, Int_t getall=0);
00048    THbookFile       *GetHbookFile() {return fFile;}
00049    virtual Int_t     GetID() {return fID;}
00050    virtual Int_t     GetType() {return fType;}
00051            Float_t  *GetX() {return (Float_t*)fX;}
00052    virtual void      InitBranches(Long64_t entry);
00053            char     *MakeX(Int_t nvars) {fX = new char[nvars]; return fX;}
00054    virtual void      Print(Option_t *option="") const;
00055    virtual Long64_t  SetEntries(Long64_t n=-1);
00056    virtual void      SetHbookFile(THbookFile *file) {fFile = file;}
00057    virtual void      SetType(Int_t atype) {fType = atype;}
00058 
00059    ClassDef(THbookTree,1)  //A wrapper class supporting Hbook ntuples (CWN and RWN)
00060 };
00061 
00062 #endif

Generated on Tue Jul 5 14:22:44 2011 for ROOT_528-00b_version by  doxygen 1.5.1