library: libTree
#include "TBranchElement.h"


class description - header file - source file
viewCVS header - viewCVS source

class TBranchElement: public TBranch

Inheritance Inherited Members Includes Libraries
Class Charts

Function Members (Methods)

Display options:
Show inherited
Show non-public
TBranchElement(const char* name, TClonesArray* clones, Int_t basketsize = 32000, Int_t splitlevel = 0, Int_t compress = -1)
TBranchElement(const char* name, TVirtualCollectionProxy* cont, Int_t basketsize = 32000, Int_t splitlevel = 0, Int_t compress = -1)
TBranchElement(const char* name, TStreamerInfo* sinfo, Int_t id, char* pointer, Int_t basketsize = 32000, Int_t splitlevel = 0, Int_t btype = 0)
voidTObject::AbstractMethod(const char* method) const
virtual voidTBranch::AddBasket(TBasket& b, Bool_t ondisk, Long64_t startEntry)
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidBrowse(TBrowser* b)
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTNamed::Clear(Option_t* option = "")
virtual TObject*TNamed::Clone(const char* newname = "") const
virtual Int_tTNamed::Compare(const TObject* obj) const
virtual voidTNamed::Copy(TObject& named) const
virtual voidTObject::Delete(Option_t* option = "")
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() const
virtual TObject*TObject::DrawClone(Option_t* option = "") const
virtual voidTBranch::DropBaskets(Option_t* option = "")
virtual voidTObject::Dump() const
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual Int_tFill()
virtual voidTNamed::FillBuffer(char*& buffer)
virtual voidFillLeaves(TBuffer& b)
virtual TBranch*TBranch::FindBranch(const char* name)
virtual TLeaf*TBranch::FindLeaf(const char* name)
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
virtual char*GetAddress() const
TBasket*TBranch::GetBasket(Int_t basket)
Int_t*TBranch::GetBasketBytes() const
Long64_t*TBranch::GetBasketEntry() const
virtual Long64_tTBranch::GetBasketSeek(Int_t basket) const
virtual Int_tTBranch::GetBasketSize() const
TBranchElement*GetBranchCount() const
TBranchElement*GetBranchCount2() const
Int_t*GetBranchOffset() const
virtual TList*TBranch::GetBrowsables()
virtual const char*GetClassName() const
virtual const char*GetClonesName() const
virtual Int_tTBranch::GetCompressionLevel() const
TDirectory*TBranch::GetDirectory() const
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
Long64_tTBranch::GetEntries() const
virtual Int_tGetEntry(Long64_t entry = 0, Int_t getall = 0)
virtual Int_tTBranch::GetEntryExport(Long64_t entry, Int_t getall, TClonesArray* list, Int_t n)
Long64_tTBranch::GetEntryNumber() const
Int_tTBranch::GetEntryOffsetLen() const
Int_tTBranch::GetEvent(Long64_t entry = 0)
virtual TFile*TBranch::GetFile(Int_t mode = 0)
const char*TBranch::GetFileName() const
virtual Color_tTAttFill::GetFillColor() const
virtual Style_tTAttFill::GetFillStyle() const
virtual const char*GetIconName() const
Int_tGetID() const
TStreamerInfo*GetInfo() const
virtual TLeaf*TBranch::GetLeaf(const char* name) const
Int_tTBranch::GetMaxBaskets() const
virtual Int_tGetMaximum() const
TBranch*TBranch::GetMother() const
virtual const char*TNamed::GetName() const
Int_tGetNdata() const
Int_tTBranch::GetNleaves() const
char*GetObject() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
Int_tTBranch::GetOffset() const
virtual Option_t*TObject::GetOption() const
virtual const char*GetParentName() const
Int_tTBranch::GetReadBasket() const
Long64_tTBranch::GetReadEntry() const
virtual Int_tTBranch::GetRow(Int_t row)
Int_tTBranch::GetSplitLevel() const
Int_tGetStreamerType() const
TBranch*TBranch::GetSubBranch(const TBranch* br) const
virtual const char*TNamed::GetTitle() const
Long64_tTBranch::GetTotalSize() const
Long64_tTBranch::GetTotBytes() const
TTree*TBranch::GetTree() const
Int_tGetType() const
virtual const char*GetTypeName() const
virtual UInt_tTObject::GetUniqueID() const
Double_tGetValue(Int_t i, Int_t len, Bool_t subarr = kFALSE) const
virtual void*GetValuePointer() const
Int_tTBranch::GetWriteBasket() const
Long64_tTBranch::GetZipBytes() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTNamed::Hash() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidTObject::Inspect() const
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
Bool_tTBranch::IsAutoDelete() const
Bool_tIsBranchFolder() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tIsFolder() const
virtual Bool_tIsObjectOwner() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tTNamed::IsSortable() const
virtual Bool_tTAttFill::IsTransparent() const
Bool_tTObject::IsZombie() const
virtual voidTBranch::KeepCircular(Long64_t maxEntries)
virtual Int_tTBranch::LoadBaskets()
virtual voidTNamed::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
virtual voidTAttFill::Modify()
virtual Bool_tNotify()
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidPrint(Option_t* option = "") const
voidPrintValue(Int_t i) const
virtual Int_tTObject::Read(const char* name)
virtual voidTBranch::ReadBasket(TBuffer& b)
virtual voidReadLeaves(TBuffer& b)
virtual voidTObject::RecursiveRemove(TObject* obj)
virtual voidTBranch::Refresh(TBranch* b)
virtual voidReset(Option_t* option = "")
virtual voidResetAddress()
virtual voidTAttFill::ResetAttFill(Option_t* option = "")
voidTObject::ResetBit(UInt_t f)
static voidTBranch::ResetCount()
virtual voidResetDeleteObject()
virtual voidTBranch::ResetReadEntry()
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") const
virtual voidTAttFill::SaveFillAttributes(ostream& out, const char* name, Int_t coldef = 1, Int_t stydef = 1001)
virtual voidTObject::SavePrimitive(ostream& out, Option_t* option = "")
virtual voidSetAddress(void* addobj)
virtual voidTBranch::SetAutoDelete(Bool_t autodel = kTRUE)
virtual voidSetBasketSize(Int_t buffsize)
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
virtual voidSetBranchFolder()
virtual voidTBranch::SetBufferAddress(TBuffer* entryBuffer)
virtual voidSetClassName(const char* name)
virtual voidTBranch::SetCompressionLevel(Int_t level = 1)
virtual voidTObject::SetDrawOption(Option_t* option = "")
static voidTObject::SetDtorOnly(void* obj)
virtual voidTBranch::SetEntries(Long64_t entries)
virtual voidTBranch::SetEntryOffsetLen(Int_t len)
virtual voidTBranch::SetFile(TFile* file = 0)
virtual voidTBranch::SetFile(const char* filename)
virtual voidTAttFill::SetFillAttributes()
virtual voidTAttFill::SetFillColor(Color_t fcolor)
virtual voidTAttFill::SetFillStyle(Style_t fstyle)
virtual voidTNamed::SetName(const char* name)
virtual voidTNamed::SetNameTitle(const char* name, const char* title)
static voidTObject::SetObjectStat(Bool_t stat)
virtual voidTBranch::SetOffset(Int_t offset = 0)
voidSetParentClass(TClass* clparent)
virtual voidSetParentName(const char* name)
virtual voidTNamed::SetTitle(const char* title = "")
virtual voidTBranch::SetTree(TTree* tree)
virtual voidSetType(Int_t btype)
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidSetupAddresses()
virtual voidShowMembers(TMemberInspector& insp, char* parent)
virtual Int_tTNamed::Sizeof() const
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
virtual voidTBranch::UpdateAddress()
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = "0", Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = "0", Int_t option = 0, Int_t bufsize = 0) const
voidTBranch::WriteBasket(TBasket* basket)
voidBuildTitle(const char* name)
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
virtual voidInitializeOffsets()
Bool_tIsMissingCollection() const
voidSetBranchCount(TBranchElement* bre)
voidSetBranchCount2(TBranchElement* bre)
voidTBranch::SetSkipZip(Bool_t skip = kTRUE)
Int_tUnroll(const char* name, TClass* cltop, TClass* cl, char* ptr, Int_t basketsize, Int_t splitlevel, Int_t btype)
voidValidateAddress() const
TBranchElement(const TBranchElement&)
TBranchElement&operator=(const TBranchElement&)

Data Members

enum { kBranchFolder
enum TBranch::[unnamed] { kAutoDelete
enum TObject::EStatusBits { kCanDelete
enum TObject::[unnamed] { kIsOnHeap
TStringfClassNameClass name of referenced object
TStringfParentNameName of parent class
TStringfClonesNameName of class in TClonesArray (if any)
TVirtualCollectionProxy*fCollProxy! collection interface (if any)
UInt_tfCheckSumCheckSum of class
Int_tfClassVersionVersion number of class
Int_tfIDelement serial number in fInfo
Int_tfTypebranch type
Int_tfStreamerTypebranch streamer type
Int_tfMaximumMaximum entries for a TClonesArray or variable array
Int_tfSTLtype! STL container type
Int_tfNdata! Number of data in this branch
TBranchElement*fBranchCountpointer to primary branchcount branch
TBranchElement*fBranchCount2pointer to secondary branchcount branch
TStreamerInfo*fInfo! Pointer to StreamerInfo
char*fObject! Pointer to object at *fAddress
Bool_tfInit! Initialization flag for branch assignment
Bool_tfInitOffsets! Initialization flag to not endlessly recalculate offsets
TClassReffCurrentClass! Reference to current (transient) class definition
TClassReffParentClass! Reference to class definition in fParentName
TClassReffBranchClass! Reference to class definition in fClassName
Int_t*fBranchOffset! Sub-Branch offsets with respect to current transient class
static Int_tTBranch::fgCount! branch counter
Int_tTBranch::fCompress(=1 branch is compressed, 0 otherwise)
Int_tTBranch::fBasketSizeInitial Size of Basket Buffer
Int_tTBranch::fEntryOffsetLenInitial Length of fEntryOffset table in the basket buffers
Int_tTBranch::fWriteBasketLast basket number written
Long64_tTBranch::fEntryNumberCurrent entry number (last one filled in this branch)
Int_tTBranch::fOffsetOffset of this branch
Int_tTBranch::fMaxBasketsMaximum number of Baskets so far
Int_tTBranch::fSplitLevelBranch split level
Int_tTBranch::fNleaves! Number of leaves
Int_tTBranch::fReadBasket! Current basket number when reading
Long64_tTBranch::fReadEntry! Current entry number when reading
Long64_tTBranch::fEntriesNumber of entries
Long64_tTBranch::fTotBytesTotal number of bytes in all leaves before compression
Long64_tTBranch::fZipBytesTotal number of bytes in all leaves after compression
TObjArrayTBranch::fBranches-> List of Branches of this branch
TObjArrayTBranch::fLeaves-> List of leaves of this branch
TObjArrayTBranch::fBaskets-> List of baskets of this branch
Int_tTBranch::fNBasketRAM! Number of baskets in fBasketRAM
Int_t*TBranch::fBasketRAM! [fNBasketRAM] table of basket numbers in memory
Int_t*TBranch::fBasketBytes[fMaxBaskets] Lenght of baskets on file
Long64_t*TBranch::fBasketEntry[fMaxBaskets] Table of first entry in eack basket
Long64_t*TBranch::fBasketSeek[fMaxBaskets] Addresses of baskets on file
TTree*TBranch::fTree! Pointer to Tree header
char*TBranch::fAddress! Address of 1st leaf (variable or object)
TDirectory*TBranch::fDirectory! Pointer to directory where this branch buffers are stored
TStringTBranch::fFileNameName of file where buffers are stored ("" if in same file as Tree header)
TBuffer*TBranch::fEntryBuffer! Buffer used to directly pass the content without streaming
TList*TBranch::fBrowsables! List of TVirtualBranchBrowsables used for Browse()
Bool_tTBranch::fSkipZip!After being read, the buffer will not be unziped.
TStringTNamed::fNameobject identifier
TStringTNamed::fTitleobject title
Color_tTAttFill::fFillColorfill area color
Style_tTAttFill::fFillStylefill area style

Class Description

 A Branch for the case of an object                                   

 -- Default constructor.
TBranchElement(const char* bname, TStreamerInfo* sinfo, Int_t id, char* pointer, Int_t basketsize, Int_t splitlevel, Int_t btype)
 FIXME: What if the streamer info is optimized here?
 -- Constructor when the branch object is not a TClonesArray nor an STL container.

 If splitlevel > 0 this branch in turn is split into sub-branches.
TBranchElement(const char* bname, TClonesArray* clones, Int_t basketsize, Int_t splitlevel, Int_t compress)
 FIXME: Bad, the streamer info will be optimized here.
 -- Constructor when the branch object is a TClonesArray.

 If splitlevel > 0 this branch in turn is split into sub branches.
TBranchElement(const char* bname, TVirtualCollectionProxy* cont, Int_t basketsize, Int_t splitlevel, Int_t compress)
 -- Constructor when the branch object is an STL collection.

 If splitlevel > 0 this branch in turn is split into sub branches.
 -- Destructor.
TStreamerInfo* GetInfo()
 -- Get streamer info for the branch class.
void Browse(TBrowser* b)
 -- Browse the branch content.
void BuildTitle(const char* name)
 -- Set branch and leaf name and title in the case of a container sub-branch.
Int_t Fill()
 -- Loop on all leaves of this branch to fill the basket buffer.

 The function returns the number of bytes committed to the
 individual branches.  If a write error occurs, the number of
 bytes returned is -1.  If no data are written, because, e.g.,
 the branch is disabled, the number of bytes returned is 0.

 Note: We not not use any member functions from TLeafElement!
void FillLeaves(TBuffer& b)
 -- Fill a buffer from the leaves of this branch.

 Note:  We do not use any member functions from TLeafElement!
        Except in the MakeClass case of a TClonesArray sub-branch.
char* GetAddress()
 -- Get the branch address.

 If we are *not* owned by a MakeClass() tree:

      If we are a top-level branch, return a pointer
      to the pointer to our object.

      If we are *not* a top-level branch, return a pointer
      to our object.

 If we are owned by a MakeClass() tree:

      Return a pointer to our object.

void InitInfo()
 -- Init the streamer info for the branch class, try to compensate for class code unload/reload and schema evolution.
TVirtualCollectionProxy* GetCollectionProxy()
 -- Return the collection proxy describing the branch content, if any.
TClass* GetCurrentClass()
 -- Return a pointer to the current type of the data member corresponding to branch element.
Int_t GetEntry(Long64_t entry, Int_t getall)
 -- Read all branches of a BranchElement and return total number of bytes.

 If entry = 0, then use current entry number + 1.
 If entry < 0, then reset entry number to 0.

 Returns the number of bytes read from the input buffer.
 If entry does not exist, then returns 0.
 If an I/O error occurs, then returns -1.

 See IMPORTANT REMARKS in TTree::GetEntry.

const char* GetIconName()
 -- Return icon name depending on type of branch element.
Int_t GetMaximum()
 -- Return maximum count value of the branchcount if any.
char* GetObject()
 -- Return a pointer to our object.
TClass* GetParentClass()
 -- Return a pointer to the parent class of the branch element.
const char* GetTypeName()
 -- Return type name of element in the branch.
Double_t GetValue(Int_t j, Int_t len, Bool_t subarr)
 -- Returns the branch value.

 If the leaf is an array, j is the index in the array.

 If leaf is an array inside a TClonesArray, len should be the length
 of the array.

 If subarr is true, then len is actually the index within the sub-array.

void* GetValuePointer()
 -- Returns pointer to first data element of this branch.
 Currently used only for members of type character.
void InitializeOffsets()
 -- Initialize the base class subobjects offsets of our sub-branches and set fOffset if we are a container sub-branch.

 Note: The offsets are zero for data members so that when
       SetAddress recursively sets their address, they will get the
       same address as their containing class because i/o is based
       on streamer info offsets from the addresss of the containing

       Offsets are non-zero for base-class sub-branches that are
       not the leftmost direct base class.  They are laid out in
       memory sequentially and only the leftmost direct base class
       has the same address as the derived class.  The streamer
       offsets need to be added to the address of the base class
       subobject which is not the same as the address of the
       derived class for the non-leftmost direct base classes.
Bool_t IsFolder()
 -- Return kTRUE if more than one leaf, kFALSE otherwise.
Bool_t IsMissingCollection()
 -- Detect a collection written using a zero pointer in old versions of root.
 In versions of ROOT older than 4.00/03, if a collection (TClonesArray
 or STL container) was split but the pointer to the collection was zeroed
 out, nothing was saved.  Hence there is no __easy__ way to detect the
 case.  In newer versions, a zero is written so that a 'missing' collection
 appears to be an empty collection.
void Print(Option_t* option)
 -- Print TBranch parameters.
void PrintValue(Int_t lenmax)
 -- Prints values of leaves.
void ReadLeaves(TBuffer& b)
 -- Read leaves into i/o buffers for this branch.
void ReleaseObject()
 -- Delete any object we may have allocated on a previous call to SetAddress.
void Reset(Option_t* option)
 -- Reset a Branch.

 Existing i/o buffers are deleted.
 Entries, max and min are reset.

void ResetAddress()
 -- Reset the branch user i/o buffer address.
void ResetDeleteObject()
 -- Clear the kDeleteObject flag (clones should not delete shared i/o buffers).
void SetAddress(void* add)
 -- Set user i/o buffer address of this branch.
void SetBasketSize(Int_t buffsize)
 -- Reset the basket size for all sub-branches of this branch element.
void SetBranchCount(TBranchElement* brOfCounter)
 -- Set the branch counter for this branch.
void SetupAddresses()
 -- If the branch address is not set,  we set all addresses starting with
 the top level parent branch.  This is required to be done in order for
 GetOffset to be correct and for GetEntry to run.
void Streamer(TBuffer& R__b)
 -- Stream an object of class TBranchElement.
Int_t Unroll(const char* name, TClass* clParent, TClass* cl, char* ptr, Int_t basketsize, Int_t splitlevel, Int_t btype)
 -- Split class cl into sub-branches of this branch.

 Create a sub-branch of this branch for each non-empty,
 non-abstract base class of cl (unless we are a sub-branch
 of a TClonesArray or an STL container, in which case we
 do *not* create a sub-branch), and for each non-split data
 member of cl.

 Note: We do *not* create sub-branches for base classes of cl
       if we are a sub-branch of a TClonesArray or an STL container.

 Note: We do *not* create sub-branches for data members which
       have a class type and which we are splitting.

 Note: The above rules imply that the branch heirarchy increases
       in depth only for base classes of cl (unless we are inside
       of a TClonesArray or STL container, in which case the depth
       does *not* increase, the base class is elided) and for
       TClonesArray or STL container data members (which have one
       additional level of sub-branches).  The only other way the
       depth increases is when the top-level branch has a split
       class data member, in that case the constructor will create
       a sub-branch for it.  In other words, the interior nodes of
       the branch tree are all either: base class nodes; split
       class nodes which are direct sub-branches of top-level nodes
       (created by TClass::Bronch usually); or TClonesArray or STL
       container master nodes.

 Note: The exception to the above is for the top-level branches,
       Tree::Bronch creates nodes for everything in that case,
       except for a TObject base class of a class which has the
       can ignore tobject streamer flag set.
void ValidateAddress()
 -- Check to see if the user changed the object pointer without telling us.
void SetParentClass(TClass* clparent)
TBranchElement(const TBranchElement&)
TBranchElement& operator=(const TBranchElement&)
void SetBranchCount2(TBranchElement* bre)
{ fBranchCount2 = bre; }
TBranchElement * GetBranchCount()
{ return fBranchCount; }
TBranchElement * GetBranchCount2()
{ return fBranchCount2; }
Int_t * GetBranchOffset()
{ return fBranchOffset; }
UInt_t GetCheckSum()
{ return fCheckSum; }
const char * GetClassName()
{ return fClassName.Data(); }
const char * GetClonesName()
{ return fClonesName.Data(); }
Int_t GetID()
{ return fID; }
const char * GetParentName()
{ return fParentName.Data(); }
Int_t GetNdata()
{ return fNdata; }
Int_t GetType()
{ return fType; }
Int_t GetStreamerType()
{ return fStreamerType; }
Bool_t IsBranchFolder()
{ return TestBit(kBranchFolder); }
Bool_t IsObjectOwner()
{ return TestBit(kDeleteObject); }
Bool_t Notify()
void SetBranchFolder()
{ SetBit(kBranchFolder); }
void SetClassName(const char* name)
{ fClassName = name; }
void SetParentName(const char* name)
{ fParentName = name; }
void SetType(Int_t btype)
{ fType = btype; }

Last update: root/tree:$Name: $:$Id: TBranchElement.cxx,v 1.211 2006/12/08 17:33:28 pcanal Exp $
Copyright (C) 1995-2004, Rene Brun and Fons Rademakers. *

ROOT page - Class index - Class Hierarchy - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.