61 class TBranchIMTHelper;
142 void Init(
const char *
name,
const char *leaflist,
Int_t compress);
250 virtual void SetFile(
const char *filename);
#define ClassDef(name, id)
const Int_t kBranchObject
const Int_t kDoNotProcess
typedef void((*Func_t)())
TIOFeatures provides the end-user with the ability to change the IO behavior of data written via a TT...
Fill Area Attributes class.
Manages buffers for branches of a Tree.
A TTree is a list of TBranches.
virtual TLeaf * GetLeaf(const char *name) const
Return pointer to the 1st Leaf named name in thisBranch.
void SetSkipZip(Bool_t skip=kTRUE)
virtual void SetupAddresses()
If the branch address is not set, we set all addresses starting with the top level parent branch.
virtual void ResetAddress()
Reset the address of the branch.
virtual void SetAutoDelete(Bool_t autodel=kTRUE)
Set the automatic delete bit.
TString fFileName
Name of file where buffers are stored ("" if in same file as Tree header)
virtual const char * GetClassName() const
Return the name of the user class whose content is stored in this branch, if any.
const char * GetIconName() const
Return icon name depending on type of branch.
TBasket * GetFreshBasket(Int_t basketnumber, TBuffer *user_buffer)
Return a fresh basket by either resusing an existing basket that needs to be drop (according to TTree...
TBasket * GetBasketImpl(Int_t basket, TBuffer *user_buffer)
Return pointer to basket basketnumber in this Branch.
Int_t fEntryOffsetLen
Initial Length of fEntryOffset table in the basket buffers.
virtual void DeleteBaskets(Option_t *option="")
Loop on all branch baskets.
virtual Long64_t GetBasketSeek(Int_t basket) const
Return address of basket in the file.
TBranch()
Default constructor. Used for I/O by default.
virtual char * GetAddress() const
Int_t BackFill()
Loop on all leaves of this branch to back fill Basket buffer.
Int_t GetCompressionSettings() const
Int_t GetCompressionLevel() const
Int_t GetCompressionAlgorithm() const
Int_t fMaxBaskets
Maximum number of Baskets so far.
Long64_t fTotBytes
Total number of bytes in all leaves before compression.
TBuffer * fTransientBuffer
! Pointer to the current transient buffer.
virtual void ReadBasket(TBuffer &b)
Loop on all leaves of this branch to read Basket buffer.
FillLeaves_t fFillLeaves
! Pointer to the FillLeaves implementation to use.
Int_t GetWriteBasket() const
void(TBranch::* ReadLeaves_t)(TBuffer &b)
TObjArray fLeaves
-> List of leaves of this branch
Int_t GetBasketAndFirst(TBasket *&basket, Long64_t &first, TBuffer *user_buffer)
A helper function to locate the correct basket - and its first entry.
char * fAddress
! Address of 1st leaf (variable or object)
virtual void DropBaskets(Option_t *option="")
Loop on all branch baskets.
TObjArray * GetListOfBranches()
virtual TList * GetBrowsables()
Returns (and, if 0, creates) browsable objects for this branch See TVirtualBranchBrowsable::FillListO...
TList * fBrowsables
! List of TVirtualBranchBrowsables used for Browse()
void ReadLeavesImpl(TBuffer &b)
Loop on all leaves of this branch to read Basket buffer.
virtual void SetTree(TTree *tree)
Int_t fOffset
Offset of this branch.
Long64_t * fBasketEntry
[fMaxBaskets] Table of first entry in each basket
Int_t GetEntriesSerialized(Long64_t N, TBuffer &user_buf)
ROOT::Experimental::Internal::TBulkBranchRead & GetBulkRead()
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...
void ExpandBasketArrays()
Increase BasketEntry buffer of a minimum of 10 locations and a maximum of 50 per cent of current size...
Int_t GetSplitLevel() const
ROOT::TIOFeatures TIOFeatures
void Init(const char *name, const char *leaflist, Int_t compress)
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0)
Read all leaves of entry and return total number of bytes read.
const char * GetFileName() const
TIOFeatures GetIOFeatures() const
Returns the IO settings currently in use for this branch.
void FillLeavesImpl(TBuffer &b)
Loop on all leaves of this branch to fill Basket buffer.
Long64_t fReadEntry
! Current entry number when reading
virtual void AddBasket(TBasket &b, Bool_t ondisk, Long64_t startEntry)
Add the basket to this branch.
static void ResetCount()
Static function resetting fgCount.
TBranch * GetSubBranch(const TBranch *br) const
Find the parent branch of child.
ReadLeaves_t fReadLeaves
! Pointer to the ReadLeaves implementation to use.
virtual void SetObject(void *objadd)
Set object this branch is pointing to.
Int_t FlushBaskets()
Flush to disk all the baskets of this branch and any of subbranches.
void ReadLeaves2Impl(TBuffer &b)
Read two leaves without the overhead of a loop.
TBasket * GetFreshCluster()
Drops the cluster two behind the current cluster and returns a fresh basket by either reusing or crea...
virtual void SetAddress(void *add)
Set address of this branch.
static Int_t fgCount
! branch counter
void(TBranch::* FillLeaves_t)(TBuffer &b)
Int_t GetEvent(Long64_t entry=0)
virtual void AddLastBasket(Long64_t startEntry)
Add the start entry of the write basket (not yet created)
TBasket * GetBasket(Int_t basket)
Int_t fNBaskets
! Number of baskets in memory
void ReadLeaves1Impl(TBuffer &b)
Read one leaf without the overhead of a loop.
Int_t GetBulkEntries(Long64_t, TBuffer &)
Read as many events as possible into the given buffer, using zero-copy mechanisms.
Bool_t IsFolder() const
Return kTRUE if more than one leaf or browsables, kFALSE otherwise.
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.
Long64_t fZipBytes
Total number of bytes in all leaves after compression.
TIOFeatures fIOFeatures
IO features for newly-created baskets.
void SetCompressionAlgorithm(Int_t algorithm=ROOT::RCompressionSetting::EAlgorithm::kUseGlobal)
Set compression algorithm.
virtual void UpdateAddress()
Bool_t IsAutoDelete() const
Return kTRUE if an existing object in a TBranchObject must be deleted.
virtual TLeaf * FindLeaf(const char *name)
Find the leaf corresponding to the name 'searchname'.
BulkObj fBulk
! Helper for performing bulk IO
Long64_t GetReadEntry() const
CacheInfo_t fCacheInfo
! Hold info about which basket are in the cache and if they have been retrieved from the cache.
TObjArray * GetListOfBaskets()
virtual void SetBufferAddress(TBuffer *entryBuffer)
Set address of this branch directly from a TBuffer to avoid streaming.
Long64_t GetEntries() const
Int_t fNleaves
! Number of leaves
Int_t fSplitLevel
Branch split level.
Int_t WriteBasketImpl(TBasket *basket, Int_t where, ROOT::Internal::TBranchIMTHelper *)
Write the current basket to disk and return the number of bytes written to the file.
virtual void UpdateFile()
Refresh the value of fDirectory (i.e.
void SetCompressionSettings(Int_t settings=ROOT::RCompressionSetting::EDefaults::kUseGeneralPurpose)
Set compression settings.
Int_t GetReadBasket() const
Int_t * fBasketBytes
[fMaxBaskets] Length of baskets on file
virtual void Print(Option_t *option="") const
Print TBranch parameters.
Long64_t fNextBasketEntry
! Next entry that will requires us to go to the next basket
Int_t GetMaxBaskets() const
Int_t * GetBasketBytes() const
TBranch & operator=(const TBranch &)=delete
virtual ~TBranch()
Destructor.
Int_t FillEntryBuffer(TBasket *basket, TBuffer *buf, Int_t &lnew)
Copy the data from fEntryBuffer into the current basket.
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...
virtual void Browse(TBrowser *b)
Browser interface.
TObjArray fBranches
-> List of Branches of this branch
virtual void KeepCircular(Long64_t maxEntries)
keep a maximum of fMaxEntries in memory
virtual void ResetAfterMerge(TFileMergeInfo *)
Reset a Branch.
void ReadLeaves0Impl(TBuffer &b)
Read zero leaves without the overhead of a loop.
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 void ResetReadEntry()
TString GetRealFileName() const
Get real file name.
virtual TBranch * FindBranch(const char *name)
Find the immediate sub-branch with passed name.
TBranch(const TBranch &)=delete
TDirectory * fDirectory
! Pointer to directory where this branch buffers are stored
void PrintCacheInfo() const
Print the information we have about which basket is currently cached and whether they have been 'used...
TObjArray fBaskets
-> List of baskets of this branch
virtual Int_t LoadBaskets()
Baskets associated to this branch are forced to be in memory.
void SetIOFeatures(TIOFeatures &features)
Bool_t fSkipZip
! After being read, the buffer will not be unzipped.
TBranch * fMother
! Pointer to top-level parent branch in the tree.
Long64_t GetTotBytes(Option_t *option="") const
Return total number of bytes in the branch (excluding current buffer) if option ="*" includes all sub...
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 void SetFile(TFile *file=0)
Set file where this branch writes/reads its buffers.
TBranch * fParent
! Pointer to parent branch.
Int_t WriteBasket(TBasket *basket, Int_t where)
virtual void SetOffset(Int_t offset=0)
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 ...
virtual Int_t GetBasketSize() const
virtual void SetFirstEntry(Long64_t entry)
set the first entry number (case of TBranchSTL)
Long64_t GetTotalSize(Option_t *option="") const
Return total number of bytes in the branch (including current buffer)
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...
virtual void SetBasketSize(Int_t buffsize)
Set the basket size The function makes sure that the basket size is greater than fEntryOffsetlen.
virtual void Refresh(TBranch *b)
Refresh this branch using new information in b This function is called by TTree::Refresh.
Int_t fWriteBasket
Last basket number written.
Long64_t * fBasketSeek
[fMaxBaskets] Addresses of baskets on file
Long64_t GetEntryNumber() const
virtual void SetStatus(Bool_t status=1)
Set branch status to Process or DoNotProcess.
TObjArray * GetListOfLeaves()
virtual void SetEntries(Long64_t entries)
Set the number of entries in this branch.
Int_t fReadBasket
! Current basket number when reading
TDirectory * GetDirectory() const
Long64_t fFirstEntry
Number of the first entry in this branch.
TBasket * fExtraBasket
! Allocated basket not currently holding any data.
virtual Int_t GetRow(Int_t row)
Return all elements of one row unpacked in internal array fValues [Actually just returns 1 (?...
Long64_t GetFirstEntry() const
Int_t fBasketSize
Initial Size of Basket Buffer.
virtual void Reset(Option_t *option="")
Reset a Branch.
Long64_t fEntryNumber
Current entry number (last one filled in this branch)
TBranch * GetMother() const
Get our top-level parent branch in the tree.
Int_t fCompress
Compression level and algorithm.
TBuffer * GetTransientBuffer(Int_t size)
Returns the transient buffer currently used by this TBranch for reading/writing baskets.
virtual Int_t FillImpl(ROOT::Internal::TBranchIMTHelper *)
Loop on all leaves of this branch to fill Basket buffer.
TBuffer * fEntryBuffer
! Buffer used to directly pass the content without streaming
TBasket * fCurrentBasket
! Pointer to the current basket.
Long64_t fFirstBasketEntry
! First entry in the current basket.
void SetCompressionLevel(Int_t level=ROOT::RCompressionSetting::ELevel::kUseMin)
Set compression level.
Long64_t * GetBasketEntry() const
Int_t GetEntryOffsetLen() const
Long64_t fEntries
Number of entries.
Bool_t SupportsBulkRead() const
Returns true if this branch supports bulk IO, false otherwise.
TTree * fTree
! Pointer to Tree header
Using a TBrowser one can browse all ROOT objects.
Buffer base class used for serializing objects.
TClass instances represent classes, structs and namespaces in the ROOT type system.
An array of clone (identical) objects.
Describe directory structure in memory.
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
The TNamed class is the base class for all named ROOT classes.
const char * Data() const
A cache to speed-up the reading of ROOT datasets.
Class implementing or helping the various TTree cloning method.
A TTree represents a columnar dataset.
Namespace for new ROOT classes and functions.
@ kUseGlobal
Use the global compression algorithm.
@ kInherit
Some objects use this value to denote that the compression algorithm should be inherited from the par...
@ kUseGeneralPurpose
Use the recommended general-purpose setting; moderate read / write speed and compression ratio.