00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include "THbookBranch.h"
00013 #include "THbookTree.h"
00014
00015 ClassImp(THbookBranch)
00016
00017
00018
00019 THbookBranch::THbookBranch(TTree *tree, const char *name, void *address, const char *leaflist, Int_t basketsize, Int_t compress)
00020 :TBranch(tree, name,address,leaflist,basketsize,compress)
00021 {
00022 }
00023
00024
00025 THbookBranch::THbookBranch(TBranch *branch, const char *name, void *address, const char *leaflist, Int_t basketsize, Int_t compress)
00026 :TBranch(branch,name,address,leaflist,basketsize,compress)
00027 {
00028 }
00029
00030
00031 THbookBranch::~THbookBranch()
00032 {
00033 }
00034
00035
00036
00037 void THbookBranch::Browse(TBrowser *b)
00038 {
00039
00040 THbookTree *tree = (THbookTree*)GetTree();
00041 THbookFile *file = tree->GetHbookFile();
00042 file->cd();
00043
00044 TBranch::Browse(b);
00045 }
00046
00047
00048 Int_t THbookBranch::GetEntry(Long64_t entry, Int_t )
00049 {
00050
00051 THbookTree *tree = (THbookTree*)GetTree();
00052 THbookFile *file = tree->GetHbookFile();
00053 if (tree->GetType() == 0) {
00054 return file->GetEntry(entry,tree->GetID(),0,tree->GetX());
00055 } else {
00056 tree->InitBranches(entry);
00057 return file->GetEntryBranch(entry,tree->GetID());
00058 }
00059 }
00060
00061
00062 void THbookBranch::SetAddress(void *add)
00063 {
00064
00065
00066
00067 TBranch::SetAddress(add);
00068
00069 if (GetUniqueID() != 0) return;
00070 THbookTree *tree = (THbookTree*)GetTree();
00071 THbookFile *file = tree->GetHbookFile();
00072 if (tree->GetType() != 0) {
00073 file->SetBranchAddress(tree->GetID(),GetBlockName(),add);
00074 }
00075 }