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