https://github.com/root-project/root
Tip revision: fb0b3e46e0a124f1b64c83fc05d902b7c081ad90 authored by Unknown Author on 30 July 2004, 11:09:46 UTC
This commit was manufactured by cvs2svn to create tag 'v4-00-08a'.
This commit was manufactured by cvs2svn to create tag 'v4-00-08a'.
Tip revision: fb0b3e4
THbookBranch.cxx
// @(#)root/hbook:$Name: $:$Id: THbookBranch.cxx,v 1.5 2002/08/13 13:44:33 brun Exp $
// 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(const char *name, void *address, const char *leaflist, Int_t basketsize, Int_t compress)
:TBranch(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(Int_t entry, Int_t /*getall*/)
{
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);
}
}