ROOT logo
// @(#)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.             *
 *************************************************************************/

#include "THbookBranch.h"
#include "THbookTree.h"

ClassImp(THbookBranch)


//______________________________________________________________________________
THbookBranch::THbookBranch(TTree *tree, const char *name, void *address, const char *leaflist, Int_t basketsize, Int_t compress)
            :TBranch(tree, name,address,leaflist,basketsize,compress)
{
}

//______________________________________________________________________________
THbookBranch::THbookBranch(TBranch *branch, const char *name, void *address, const char *leaflist, Int_t basketsize, Int_t compress)
            :TBranch(branch,name,address,leaflist,basketsize,compress)
{
}

//______________________________________________________________________________
THbookBranch::~THbookBranch()
{
}


//______________________________________________________________________________
void THbookBranch::Browse(TBrowser *b)
{
   // Browser interface.
   THbookTree *tree = (THbookTree*)GetTree();
   THbookFile *file = tree->GetHbookFile();
   file->cd();

   TBranch::Browse(b);
}

//______________________________________________________________________________
Int_t THbookBranch::GetEntry(Long64_t entry, Int_t /*getall*/)
{
   //get one entry from hbook ntuple
   THbookTree *tree = (THbookTree*)GetTree();
   THbookFile *file = tree->GetHbookFile();
   if (tree->GetType() == 0) {
      return file->GetEntry(entry,tree->GetID(),0,tree->GetX());
   } else {
      tree->InitBranches(entry);
      return file->GetEntryBranch(entry,tree->GetID());
   }
}

//______________________________________________________________________________
void THbookBranch::SetAddress(void *add)
{
// Set address of this branch
// See important remark in the header of THbookTree

   TBranch::SetAddress(add);

   if (GetUniqueID() != 0) return; //only for first variable of the block
   THbookTree *tree = (THbookTree*)GetTree();
   THbookFile *file = tree->GetHbookFile();
   if (tree->GetType() != 0) {
      file->SetBranchAddress(tree->GetID(),GetBlockName(),add);
   }
}
 THbookBranch.cxx:1
 THbookBranch.cxx:2
 THbookBranch.cxx:3
 THbookBranch.cxx:4
 THbookBranch.cxx:5
 THbookBranch.cxx:6
 THbookBranch.cxx:7
 THbookBranch.cxx:8
 THbookBranch.cxx:9
 THbookBranch.cxx:10
 THbookBranch.cxx:11
 THbookBranch.cxx:12
 THbookBranch.cxx:13
 THbookBranch.cxx:14
 THbookBranch.cxx:15
 THbookBranch.cxx:16
 THbookBranch.cxx:17
 THbookBranch.cxx:18
 THbookBranch.cxx:19
 THbookBranch.cxx:20
 THbookBranch.cxx:21
 THbookBranch.cxx:22
 THbookBranch.cxx:23
 THbookBranch.cxx:24
 THbookBranch.cxx:25
 THbookBranch.cxx:26
 THbookBranch.cxx:27
 THbookBranch.cxx:28
 THbookBranch.cxx:29
 THbookBranch.cxx:30
 THbookBranch.cxx:31
 THbookBranch.cxx:32
 THbookBranch.cxx:33
 THbookBranch.cxx:34
 THbookBranch.cxx:35
 THbookBranch.cxx:36
 THbookBranch.cxx:37
 THbookBranch.cxx:38
 THbookBranch.cxx:39
 THbookBranch.cxx:40
 THbookBranch.cxx:41
 THbookBranch.cxx:42
 THbookBranch.cxx:43
 THbookBranch.cxx:44
 THbookBranch.cxx:45
 THbookBranch.cxx:46
 THbookBranch.cxx:47
 THbookBranch.cxx:48
 THbookBranch.cxx:49
 THbookBranch.cxx:50
 THbookBranch.cxx:51
 THbookBranch.cxx:52
 THbookBranch.cxx:53
 THbookBranch.cxx:54
 THbookBranch.cxx:55
 THbookBranch.cxx:56
 THbookBranch.cxx:57
 THbookBranch.cxx:58
 THbookBranch.cxx:59
 THbookBranch.cxx:60
 THbookBranch.cxx:61
 THbookBranch.cxx:62
 THbookBranch.cxx:63
 THbookBranch.cxx:64
 THbookBranch.cxx:65
 THbookBranch.cxx:66
 THbookBranch.cxx:67
 THbookBranch.cxx:68
 THbookBranch.cxx:69
 THbookBranch.cxx:70
 THbookBranch.cxx:71
 THbookBranch.cxx:72
 THbookBranch.cxx:73
 THbookBranch.cxx:74
 THbookBranch.cxx:75