Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
THbookBranch.cxx
Go to the documentation of this file.
1// @(#)root/hbook:$Id$
2// Author: Rene Brun 18/02/2002
3
4/*************************************************************************
5 * Copyright (C) 1995-2002, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#include "THbookBranch.h"
13#include "THbookTree.h"
14
15
16////////////////////////////////////////////////////////////////////////////////
17/** \class THbookBranch
18 \ingroup Hist
19 \brief HBOOK Branch
20*/
21
22////////////////////////////////////////////////////////////////////////////////
23
24THbookBranch::THbookBranch(TTree *tree, const char *name, void *address, const char *leaflist, Int_t basketsize, Int_t compress)
26{
27}
28
29////////////////////////////////////////////////////////////////////////////////
30
35
36////////////////////////////////////////////////////////////////////////////////
37
41
42
43////////////////////////////////////////////////////////////////////////////////
44/// Browser interface.
45
47{
48 THbookTree *tree = (THbookTree*)GetTree();
49 THbookFile *file = tree->GetHbookFile();
50 file->cd();
51
53}
54
55////////////////////////////////////////////////////////////////////////////////
56///get one entry from hbook ntuple
57
59{
60 THbookTree *tree = (THbookTree*)GetTree();
61 THbookFile *file = tree->GetHbookFile();
62 if (tree->GetType() == 0) {
63 return file->GetEntry(entry,tree->GetID(),0,tree->GetX());
64 } else {
65 tree->InitBranches(entry);
66 return file->GetEntryBranch(entry,tree->GetID());
67 }
68}
69
70////////////////////////////////////////////////////////////////////////////////
71/// Set address of this branch
72/// See important remark in the header of THbookTree
73
75{
77
78 if (GetUniqueID() != 0) return; //only for first variable of the block
79 THbookTree *tree = (THbookTree*)GetTree();
80 THbookFile *file = tree->GetHbookFile();
81 if (tree->GetType() != 0) {
82 file->SetBranchAddress(tree->GetID(),GetBlockName(),add);
83 }
84}
#define b(i)
Definition RSha256.hxx:100
long long Long64_t
Portable signed long integer 8 bytes.
Definition RtypesCore.h:83
char name[80]
Definition TGX11.cxx:110
A TTree is a list of TBranches.
Definition TBranch.h:93
TTree * GetTree() const
Definition TBranch.h:252
virtual void SetAddress(void *add)
Set address of this branch.
Definition TBranch.cxx:2694
void Browse(TBrowser *b) override
Browser interface.
Definition TBranch.cxx:698
Using a TBrowser one can browse all ROOT objects.
Definition TBrowser.h:37
Int_t GetEntry(Long64_t entry=0, Int_t getall=0) override
get one entry from hbook ntuple
const char * GetBlockName() const
void SetAddress(void *addobj) override
Set address of this branch See important remark in the header of THbookTree.
~THbookBranch() override
void Browse(TBrowser *b) override
Browser interface.
This class is an interface to the Hbook objects in Hbook files.
Definition THbookFile.h:29
Int_t GetEntryBranch(Int_t entry, Int_t id)
Read in memory only the branch bname.
virtual void SetBranchAddress(Int_t id, const char *bname, void *add)
Set branch address.
virtual Bool_t cd(const char *dirname="")
change directory to dirname
Int_t GetEntry(Int_t entry, Int_t id, Int_t atype, Float_t *x)
Read in memory all columns of entry number of ntuple id from the Hbook file.
A wrapper class supporting Hbook ntuples (CWN and RWN).
Definition THbookTree.h:30
virtual UInt_t GetUniqueID() const
Return the unique object id.
Definition TObject.cxx:475
A TTree represents a columnar dataset.
Definition TTree.h:89