// @(#)root/hbook:$Id$
// Author: Rene Brun   18/02/2002

/*************************************************************************
 * Copyright (C) 1995-2002, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_THbookTree
#define ROOT_THbookTree


//////////////////////////////////////////////////////////////////////////
//                                                                      //
// THbookTree                                                           //
//                                                                      //
// A wrapper class supporting Hbook ntuples (CWN and RWN).              //
// The normal TTree calls can be used, including TTree::Draw().         //
// Data read directly from the Hbook file via THbookFile.               //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#ifndef ROOT_TTree
#include "TTree.h"
#endif
#ifndef ROOT_THbookFile
#include "THbookFile.h"
#endif


class THbookTree : public TTree {

protected:
   Int_t       fID;         //Hbook identifier
   Int_t       fType;       //RWN (0) or CWN (1)
   char       *fX;          //storage area for RWN
   Bool_t      fInit;       //flag to know if branches computed
   THbookFile *fFile;       //pointer to Hbook file

public:
   THbookTree();
   THbookTree(const char *name, Int_t id);
   virtual ~THbookTree();
   virtual Int_t     GetEntry(Long64_t entry=0, Int_t getall=0);
   THbookFile       *GetHbookFile() {return fFile;}
   virtual Int_t     GetID() {return fID;}
   virtual Int_t     GetType() {return fType;}
           Float_t  *GetX() {return (Float_t*)fX;}
   virtual void      InitBranches(Long64_t entry);
           char     *MakeX(Int_t nvars) {fX = new char[nvars]; return fX;}
   virtual void      Print(Option_t *option="") const;
   virtual Long64_t  SetEntries(Long64_t n=-1);
   virtual void      SetHbookFile(THbookFile *file) {fFile = file;}
   virtual void      SetType(Int_t atype) {fType = atype;}

   ClassDef(THbookTree,1)  //A wrapper class supporting Hbook ntuples (CWN and RWN)
};

#endif
 THbookTree.h:1
 THbookTree.h:2
 THbookTree.h:3
 THbookTree.h:4
 THbookTree.h:5
 THbookTree.h:6
 THbookTree.h:7
 THbookTree.h:8
 THbookTree.h:9
 THbookTree.h:10
 THbookTree.h:11
 THbookTree.h:12
 THbookTree.h:13
 THbookTree.h:14
 THbookTree.h:15
 THbookTree.h:16
 THbookTree.h:17
 THbookTree.h:18
 THbookTree.h:19
 THbookTree.h:20
 THbookTree.h:21
 THbookTree.h:22
 THbookTree.h:23
 THbookTree.h:24
 THbookTree.h:25
 THbookTree.h:26
 THbookTree.h:27
 THbookTree.h:28
 THbookTree.h:29
 THbookTree.h:30
 THbookTree.h:31
 THbookTree.h:32
 THbookTree.h:33
 THbookTree.h:34
 THbookTree.h:35
 THbookTree.h:36
 THbookTree.h:37
 THbookTree.h:38
 THbookTree.h:39
 THbookTree.h:40
 THbookTree.h:41
 THbookTree.h:42
 THbookTree.h:43
 THbookTree.h:44
 THbookTree.h:45
 THbookTree.h:46
 THbookTree.h:47
 THbookTree.h:48
 THbookTree.h:49
 THbookTree.h:50
 THbookTree.h:51
 THbookTree.h:52
 THbookTree.h:53
 THbookTree.h:54
 THbookTree.h:55
 THbookTree.h:56
 THbookTree.h:57
 THbookTree.h:58
 THbookTree.h:59
 THbookTree.h:60
 THbookTree.h:61
 THbookTree.h:62