31 #ifndef ROOT_TObjArray 39 #ifndef ROOT_TDataType 117 void Init(
const char *
name,
const char *leaflist,
Int_t compress);
132 TBranch(
TBranch *parent,
const char *name,
void *address,
const char *leaflist,
Int_t basketsize=32000,
Int_t compress=-1);
213 virtual void SetFile(
const char *filename);
virtual void UpdateAddress()
void Init(const char *name, const char *leaflist, Int_t compress)
Int_t fNBaskets
! Number of baskets in memory
virtual const char * GetClassName() const
Return the name of the user class whose content is stored in this branch, if any. ...
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
virtual void SetBufferAddress(TBuffer *entryBuffer)
Set address of this branch directly from a TBuffer to avoid streaming.
Long64_t * GetBasketEntry() const
virtual void UpdateFile()
Refresh the value of fDirectory (i.e.
virtual void SetAddress(void *add)
Set address of this branch.
Int_t GetSplitLevel() const
Int_t fOffset
Offset of this branch.
virtual Int_t GetBasketSize() const
TObjArray * GetListOfBaskets()
virtual ~TBranch()
Destructor.
Long64_t fEntries
Number of entries.
Int_t FlushOneBasket(UInt_t which)
If we have a write basket in memory and it contains some entries and has not yet been written to disk...
virtual Int_t GetExpectedType(TClass *&clptr, EDataType &type)
Fill expectedClass and expectedType with information on the data type of the object/values contained ...
Int_t GetCompressionLevel() const
Long64_t GetZipBytes(Option_t *option="") const
Return total number of zip bytes in the branch if option ="*" includes all sub-branches of this branc...
Long64_t fZipBytes
Total number of bytes in all leaves after compression.
ReadLeaves_t fReadLeaves
! Pointer to the ReadLeaves implementation to use.
Int_t FillEntryBuffer(TBasket *basket, TBuffer *buf, Int_t &lnew)
Copy the data from fEntryBuffer into the current basket.
TBranch * GetSubBranch(const TBranch *br) const
Find the parent branch of child.
void SetCompressionAlgorithm(Int_t algorithm=0)
Set compression algorithm.
virtual void DropBaskets(Option_t *option="")
Loop on all branch baskets.
virtual void SetStatus(Bool_t status=1)
Set branch status to Process or DoNotProcess.
void ReadLeaves2Impl(TBuffer &b)
Read two leaves without the overhead of a loop.
virtual void SetFirstEntry(Long64_t entry)
set the first entry number (case of TBranchSTL)
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
void SetCompressionLevel(Int_t level=1)
Set compression level.
virtual TLeaf * FindLeaf(const char *name)
Find the leaf corresponding to the name 'searchname'.
Buffer base class used for serializing objects.
Bool_t IsFolder() const
Return kTRUE if more than one leaf or browsables, kFALSE otherwise.
TBasket * fCurrentBasket
! Pointer to the current basket.
const Int_t kBranchObject
TDirectory * GetDirectory() const
TObjArray fBaskets
-> List of baskets of this branch
Int_t fNleaves
! Number of leaves
Int_t GetCompressionAlgorithm() const
TString GetRealFileName() const
Get real file name.
TObjArray fLeaves
-> List of leaves of this branch
Long64_t * fBasketSeek
[fMaxBaskets] Addresses of baskets on file
virtual void DeleteBaskets(Option_t *option="")
Loop on all branch baskets.
Int_t GetEntryOffsetLen() const
virtual Int_t GetRow(Int_t row)
Return all elements of one row unpacked in internal array fValues [Actually just returns 1 (...
void SetSkipZip(Bool_t skip=kTRUE)
TBasket * GetFreshBasket()
Return a fresh basket by either resusing an existing basket that needs to be drop (according to TTree...
virtual void SetupAddresses()
If the branch address is not set, we set all addresses starting with the top level parent branch...
Long64_t fFirstBasketEntry
! First entry in the current basket.
Int_t * fBasketBytes
[fMaxBaskets] Length of baskets on file
virtual TList * GetBrowsables()
Returns (and, if 0, creates) browsable objects for this branch See TVirtualBranchBrowsable::FillListO...
Long64_t fEntryNumber
Current entry number (last one filled in this branch)
virtual void SetTree(TTree *tree)
Long64_t GetTotBytes(Option_t *option="") const
Return total number of bytes in the branch (excluding current buffer) if option ="*" includes all sub...
Int_t fWriteBasket
Last basket number written.
Long64_t fTotBytes
Total number of bytes in all leaves before compression.
Fill Area Attributes class.
Int_t * GetBasketBytes() const
#define ClassDef(name, id)
The TNamed class is the base class for all named ROOT classes.
virtual void Browse(TBrowser *b)
Browser interface.
virtual TLeaf * GetLeaf(const char *name) const
Return pointer to the 1st Leaf named name in thisBranch.
void ReadLeavesImpl(TBuffer &b)
Loop on all leaves of this branch to read Basket buffer.
virtual Bool_t SetMakeClass(Bool_t decomposeObj=kTRUE)
Set the branch in a mode where the object are decomposed (Also known as MakeClass mode)...
virtual TBranch * FindBranch(const char *name)
Find the immediate sub-branch with passed name.
Bool_t IsAutoDelete() const
Return kTRUE if an existing object in a TBranchObject must be deleted.
const Int_t kDoNotProcess
TObjArray * GetListOfBranches()
TBasket * GetBasket(Int_t basket)
Return pointer to basket basketnumber in this Branch.
Int_t fMaxBaskets
Maximum number of Baskets so far.
Long64_t GetEntryNumber() const
Int_t fSplitLevel
Branch split level.
TBranch()
Default constructor. Used for I/O by default.
virtual void ResetAfterMerge(TFileMergeInfo *)
Reset a Branch.
virtual Int_t Fill()
Loop on all leaves of this branch to fill Basket buffer.
const char * GetIconName() const
Return icon name depending on type of branch.
Int_t GetEvent(Long64_t entry=0)
Int_t GetCompressionSettings() const
Using a TBrowser one can browse all ROOT objects.
void(TBranch::* ReadLeaves_t)(TBuffer &b)
virtual void AddLastBasket(Long64_t startEntry)
Add the start entry of the write basket (not yet created)
Int_t WriteBasket(TBasket *basket, Int_t where)
Write the current basket to disk and return the number of bytes written to the file.
TBuffer * fEntryBuffer
! Buffer used to directly pass the content without streaming
Int_t GetReadBasket() const
static Int_t fgCount
! branch counter
void FillLeavesImpl(TBuffer &b)
Loop on all leaves of this branch to fill Basket buffer.
virtual Int_t GetEntryExport(Long64_t entry, Int_t getall, TClonesArray *list, Int_t n)
Read all leaves of an entry and export buffers to real objects in a TClonesArray list.
virtual void SetOffset(Int_t offset=0)
Int_t fBasketSize
Initial Size of Basket Buffer.
void SetCompressionSettings(Int_t settings=1)
Set compression settings.
virtual void SetEntries(Long64_t entries)
Set the number of entries in this branch.
TList * fBrowsables
! List of TVirtualBranchBrowsables used for Browse()
Long64_t GetFirstEntry() const
Int_t GetWriteBasket() const
FillLeaves_t fFillLeaves
! Pointer to the FillLeaves implementation to use.
Long64_t fNextBasketEntry
! Next entry that will requires us to go to the next basket
Manages buffers for branches of a Tree.
Int_t GetMaxBaskets() const
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0)
Read all leaves of entry and return total number of bytes read.
The ROOT global object gROOT contains a list of all defined classes.
const char * GetFileName() const
TBuffer * GetTransientBuffer(Int_t size)
Returns the transient buffer currently used by this TBranch for reading/writing baskets.
virtual void KeepCircular(Long64_t maxEntries)
keep a maximum of fMaxEntries in memory
virtual Long64_t GetBasketSeek(Int_t basket) const
Return address of basket in the file.
virtual void SetBasketSize(Int_t buffsize)
Set the basket size The function makes sure that the basket size is greater than fEntryOffsetlen.
Bool_t fSkipZip
! After being read, the buffer will not be unzipped.
Int_t fReadBasket
! Current basket number when reading
virtual void ResetAddress()
Reset the address of the branch.
Describe directory structure in memory.
TTree * fTree
! Pointer to Tree header
TObjArray * GetListOfLeaves()
TDirectory * fDirectory
! Pointer to directory where this branch buffers are stored
Long64_t GetTotalSize(Option_t *option="") const
Return total number of bytes in the branch (including current buffer)
virtual void SetEntryOffsetLen(Int_t len, Bool_t updateSubBranches=kFALSE)
Update the default value for the branch's fEntryOffsetLen if and only if it was already non zero (and...
typedef void((*Func_t)())
virtual void SetFile(TFile *file=0)
Set file where this branch writes/reads its buffers.
virtual void Refresh(TBranch *b)
Refresh this branch using new information in b This function is called by TTree::Refresh.
Long64_t GetEntries() const
An array of clone (identical) objects.
void ReadLeaves0Impl(TBuffer &b)
Read zero leaves without the overhead of a loop.
Class implementing or helping the various TTree cloning method.
Long64_t * fBasketEntry
[fMaxBaskets] Table of first entry in each basket
virtual void Reset(Option_t *option="")
Reset a Branch.
void(TBranch::* FillLeaves_t)(TBuffer &b)
Long64_t fReadEntry
! Current entry number when reading
Long64_t GetReadEntry() const
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
virtual void AddBasket(TBasket &b, Bool_t ondisk, Long64_t startEntry)
Add the basket to this branch.
TBranch * fMother
! Pointer to top-level parent branch in the tree.
virtual Int_t LoadBaskets()
Baskets associated to this branch are forced to be in memory.
virtual Bool_t GetMakeClass() const
Return whether this branch is in a mode where the object are decomposed or not (Also known as MakeCla...
virtual char * GetAddress() const
A TTree object has a header with a name and a title.
Int_t fEntryOffsetLen
Initial Length of fEntryOffset table in the basket buffers.
virtual void ReadBasket(TBuffer &b)
Loop on all leaves of this branch to read Basket buffer.
Int_t FlushBaskets()
Flush to disk all the baskets of this branch and any of subbranches.
TObjArray fBranches
-> List of Branches of this branch
virtual void ResetReadEntry()
virtual TFile * GetFile(Int_t mode=0)
Return pointer to the file where branch buffers reside, returns 0 in case branch buffers reside in th...
A TTree is a list of TBranches.
TBuffer * fTransientBuffer
! Pointer to the current transient buffer.
Int_t fCompress
Compression level and algorithm.
virtual void Print(Option_t *option="") const
Print TBranch parameters.
TString fFileName
Name of file where buffers are stored ("" if in same file as Tree header)
TBranch * fParent
! Pointer to parent branch.
static char * skip(char **buf, const char *delimiters)
Long64_t fFirstEntry
Number of the first entry in this branch.
TBranch * GetMother() const
Get our top-level parent branch in the tree.
TBranch & operator=(const TBranch &)
void ExpandBasketArrays()
Increase BasketEntry buffer of a minimum of 10 locations and a maximum of 50 per cent of current size...
virtual void SetObject(void *objadd)
Set object this branch is pointing to.
void ReadLeaves1Impl(TBuffer &b)
Read one leaf without the overhead of a loop.
static void ResetCount()
Static function resetting fgCount.
const char * Data() const
virtual void SetAutoDelete(Bool_t autodel=kTRUE)
Set the automatic delete bit.
char * fAddress
! Address of 1st leaf (variable or object)