Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:12:09

0001 // @(#)root/hbook:$Id$
0002 // Author: Rene Brun   18/02/2002
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2002, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_THbookTree
0013 #define ROOT_THbookTree
0014 
0015 
0016 //////////////////////////////////////////////////////////////////////////
0017 //                                                                      //
0018 // THbookTree                                                           //
0019 //                                                                      //
0020 // A wrapper class supporting Hbook ntuples (CWN and RWN).              //
0021 // The normal TTree calls can be used, including TTree::Draw().         //
0022 // Data read directly from the Hbook file via THbookFile.               //
0023 //                                                                      //
0024 //////////////////////////////////////////////////////////////////////////
0025 
0026 #include "TTree.h"
0027 #include "THbookFile.h"
0028 
0029 
0030 class THbookTree : public TTree {
0031 
0032 protected:
0033    Int_t       fID;         //Hbook identifier
0034    Int_t       fType;       //RWN (0) or CWN (1)
0035    char       *fX;          //storage area for RWN
0036    Bool_t      fInit;       //flag to know if branches computed
0037    THbookFile *fFile;       //pointer to Hbook file
0038 
0039 public:
0040    THbookTree();
0041    THbookTree(const char *name, Int_t id);
0042    ~THbookTree() override;
0043    Int_t     GetEntry(Long64_t entry=0, Int_t getall=0) override;
0044    THbookFile       *GetHbookFile() {return fFile;}
0045    virtual Int_t     GetID() {return fID;}
0046    virtual Int_t     GetType() {return fType;}
0047            Float_t  *GetX() {return (Float_t*)fX;}
0048    virtual void      InitBranches(Long64_t entry);
0049            char     *MakeX(Int_t nvars) {fX = new char[nvars]; return fX;}
0050    void      Print(Option_t *option="") const override;
0051    Long64_t  SetEntries(Long64_t n=-1) override;
0052    virtual void      SetHbookFile(THbookFile *file) {fFile = file;}
0053    virtual void      SetType(Int_t atype) {fType = atype;}
0054 
0055    ClassDefOverride(THbookTree,1)  //A wrapper class supporting Hbook ntuples (CWN and RWN)
0056 };
0057 
0058 #endif