Logo ROOT   6.18/05
Reference Guide
TBranch.h
Go to the documentation of this file.
1// @(#)root/tree:$Id$
2// Author: Rene Brun 12/01/96
3
4/*************************************************************************
5 * Copyright (C) 1995-2000, 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#ifndef ROOT_TBranch
13#define ROOT_TBranch
14
15
16//////////////////////////////////////////////////////////////////////////
17// //
18// TBranch //
19// //
20// A TTree object is a list of TBranchs. //
21// A TBranch describes the branch data structure and supports : //
22// the list of TBaskets (branch buffers) associated to this branch. //
23// the list of TLeaves (branch description) //
24//////////////////////////////////////////////////////////////////////////
25
26#include <memory>
27
28#include "Compression.h"
29
30#include "TNamed.h"
31
32#include "TObjArray.h"
33
34#include "TAttFill.h"
35
36#include "TDataType.h"
37
38#include "ROOT/TIOFeatures.hxx"
39#include "ROOT/TBulkBranchRead.hxx" ///< A helper class for bulk IO (multiple events per call) operations.
40
41#include "TBranchCacheInfo.h"
42
43class TTree;
44class TBasket;
45class TLeaf;
46class TBrowser;
47class TDirectory;
48class TFile;
49class TClonesArray;
50class TTreeCloner;
51class TTreeCache;
52
53 const Int_t kDoNotProcess = BIT(10); // Active bit for branches
54 const Int_t kIsClone = BIT(11); // to indicate a TBranchClones
55 const Int_t kBranchObject = BIT(12); // branch is a TObject*
56 const Int_t kBranchAny = BIT(17); // branch is an object*
58
59namespace ROOT {
60 namespace Internal {
61 class TBranchIMTHelper; ///< A helper class for managing IMT work during TTree:Fill operations.
62 }
63}
64
65class TBranch : public TNamed , public TAttFill {
67
68protected:
69 friend class TTreeCache;
70 friend class TTreeCloner;
71 friend class TTree;
73
74 // TBranch status bits
76 kDoNotProcess = ::kDoNotProcess, // Active bit for branches
77 kIsClone = ::kIsClone, // to indicate a TBranchClones
78 kBranchObject = ::kBranchObject, // branch is a TObject*
79 kBranchAny = ::kBranchAny, // branch is an object*
80 // kMapObject = kBranchObject | kBranchAny;
82
83 kDoNotUseBufferMap = BIT(22) // If set, at least one of the entry in the branch will use the buffer's map of classname and objects.
84 };
85
87 static Int_t fgCount; ///<! branch counter
88 Int_t fCompress; ///< Compression level and algorithm
89 Int_t fBasketSize; ///< Initial Size of Basket Buffer
90 Int_t fEntryOffsetLen; ///< Initial Length of fEntryOffset table in the basket buffers
91 Int_t fWriteBasket; ///< Last basket number written
92 Long64_t fEntryNumber; ///< Current entry number (last one filled in this branch)
93 TBasket *fExtraBasket; ///<! Allocated basket not currently holding any data.
94 TIOFeatures fIOFeatures; ///< IO features for newly-created baskets.
95 Int_t fOffset; ///< Offset of this branch
96 Int_t fMaxBaskets; ///< Maximum number of Baskets so far
97 Int_t fNBaskets; ///<! Number of baskets in memory
98 Int_t fSplitLevel; ///< Branch split level
99 Int_t fNleaves; ///<! Number of leaves
100 Int_t fReadBasket; ///<! Current basket number when reading
101 Long64_t fReadEntry; ///<! Current entry number when reading
102 Long64_t fFirstBasketEntry; ///<! First entry in the current basket.
103 Long64_t fNextBasketEntry; ///<! Next entry that will requires us to go to the next basket
104 TBasket *fCurrentBasket; ///<! Pointer to the current basket.
105 Long64_t fEntries; ///< Number of entries
106 Long64_t fFirstEntry; ///< Number of the first entry in this branch
107 Long64_t fTotBytes; ///< Total number of bytes in all leaves before compression
108 Long64_t fZipBytes; ///< Total number of bytes in all leaves after compression
109 TObjArray fBranches; ///< -> List of Branches of this branch
110 TObjArray fLeaves; ///< -> List of leaves of this branch
111 TObjArray fBaskets; ///< -> List of baskets of this branch
112 Int_t *fBasketBytes; ///<[fMaxBaskets] Length of baskets on file
113 Long64_t *fBasketEntry; ///<[fMaxBaskets] Table of first entry in each basket
114 Long64_t *fBasketSeek; ///<[fMaxBaskets] Addresses of baskets on file
115 TTree *fTree; ///<! Pointer to Tree header
116 TBranch *fMother; ///<! Pointer to top-level parent branch in the tree.
117 TBranch *fParent; ///<! Pointer to parent branch.
118 char *fAddress; ///<! Address of 1st leaf (variable or object)
119 TDirectory *fDirectory; ///<! Pointer to directory where this branch buffers are stored
120 TString fFileName; ///< Name of file where buffers are stored ("" if in same file as Tree header)
121 TBuffer *fEntryBuffer; ///<! Buffer used to directly pass the content without streaming
122 TBuffer *fTransientBuffer; ///<! Pointer to the current transient buffer.
123 TList *fBrowsables; ///<! List of TVirtualBranchBrowsables used for Browse()
124 BulkObj fBulk; ///<! Helper for performing bulk IO
125
126 Bool_t fSkipZip; ///<! After being read, the buffer will not be unzipped.
127
129 CacheInfo_t fCacheInfo; ///<! Hold info about which basket are in the cache and if they have been retrieved from the cache.
130
132 ReadLeaves_t fReadLeaves; ///<! Pointer to the ReadLeaves implementation to use.
134 FillLeaves_t fFillLeaves; ///<! Pointer to the FillLeaves implementation to use.
135 void ReadLeavesImpl(TBuffer &b);
139 void FillLeavesImpl(TBuffer &b);
140
141 void SetSkipZip(Bool_t skip = kTRUE) { fSkipZip = skip; }
142 void Init(const char *name, const char *leaflist, Int_t compress);
143
144 TBasket *GetFreshBasket(Int_t basketnumber, TBuffer *user_buffer);
146 Int_t WriteBasket(TBasket* basket, Int_t where) { return WriteBasketImpl(basket, where, nullptr); }
147
148 TString GetRealFileName() const;
149
150private:
151 Int_t GetBasketAndFirst(TBasket*& basket, Long64_t& first, TBuffer* user_buffer);
152 TBasket *GetBasketImpl(Int_t basket, TBuffer* user_buffer);
154 Int_t GetEntriesSerialized(Long64_t N, TBuffer& user_buf) {return GetEntriesSerialized(N, user_buf, nullptr);}
156 Int_t FillEntryBuffer(TBasket* basket,TBuffer* buf, Int_t& lnew);
158 TBranch(const TBranch&) = delete; // not implemented
159 TBranch& operator=(const TBranch&) = delete; // not implemented
160
161public:
162 TBranch();
163 TBranch(TTree *tree, const char *name, void *address, const char *leaflist, Int_t basketsize=32000, Int_t compress = ROOT::RCompressionSetting::EAlgorithm::kInherit);
164 TBranch(TBranch *parent, const char *name, void *address, const char *leaflist, Int_t basketsize=32000, Int_t compress = ROOT::RCompressionSetting::EAlgorithm::kInherit);
165 virtual ~TBranch();
166
167 virtual void AddBasket(TBasket &b, Bool_t ondisk, Long64_t startEntry);
168 virtual void AddLastBasket(Long64_t startEntry);
169 Int_t BackFill();
170 virtual void Browse(TBrowser *b);
171 virtual void DeleteBaskets(Option_t* option="");
172 virtual void DropBaskets(Option_t *option = "");
173 void ExpandBasketArrays();
174 Int_t Fill() { return FillImpl(nullptr); }
176 virtual TBranch *FindBranch(const char *name);
177 virtual TLeaf *FindLeaf(const char *name);
180
181 virtual char *GetAddress() const {return fAddress;}
182 TBasket *GetBasket(Int_t basket) {return GetBasketImpl(basket, nullptr);}
185 virtual Long64_t GetBasketSeek(Int_t basket) const;
186 virtual Int_t GetBasketSize() const {return fBasketSize;}
188 virtual TList *GetBrowsables();
189 virtual const char* GetClassName() const;
194 virtual Int_t GetEntry(Long64_t entry=0, Int_t getall = 0);
195 virtual Int_t GetEntryExport(Long64_t entry, Int_t getall, TClonesArray *list, Int_t n);
197 Int_t GetEvent(Long64_t entry=0) {return GetEntry(entry);}
198 const char *GetIconName() const;
199 virtual Int_t GetExpectedType(TClass *&clptr,EDataType &type);
200 virtual TLeaf *GetLeaf(const char *name) const;
201 virtual TFile *GetFile(Int_t mode=0);
202 const char *GetFileName() const {return fFileName.Data();}
203 Int_t GetOffset() const {return fOffset;}
207 Long64_t GetTotalSize(Option_t *option="") const;
208 Long64_t GetTotBytes(Option_t *option="") const;
209 Long64_t GetZipBytes(Option_t *option="") const;
217 Int_t GetNleaves() const {return fNleaves;}
219 Long64_t GetEntries() const {return fEntries;}
220 TTree *GetTree() const {return fTree;}
221 virtual Int_t GetRow(Int_t row);
222 virtual Bool_t GetMakeClass() const;
223 TBranch *GetMother() const;
224 TBranch *GetSubBranch(const TBranch *br) const;
226 Bool_t IsAutoDelete() const;
227 Bool_t IsFolder() const;
228 virtual void KeepCircular(Long64_t maxEntries);
229 virtual Int_t LoadBaskets();
230 virtual void Print(Option_t *option="") const;
231 void PrintCacheInfo() const;
232 virtual void ReadBasket(TBuffer &b);
233 virtual void Refresh(TBranch *b);
234 virtual void Reset(Option_t *option="");
235 virtual void ResetAfterMerge(TFileMergeInfo *);
236 virtual void ResetAddress();
237 virtual void ResetReadEntry() {fReadEntry = -1;}
238 virtual void SetAddress(void *add);
239 virtual void SetObject(void *objadd);
240 virtual void SetAutoDelete(Bool_t autodel=kTRUE);
241 virtual void SetBasketSize(Int_t buffsize);
242 virtual void SetBufferAddress(TBuffer *entryBuffer);
246 virtual void SetEntries(Long64_t entries);
247 virtual void SetEntryOffsetLen(Int_t len, Bool_t updateSubBranches = kFALSE);
248 virtual void SetFirstEntry( Long64_t entry );
249 virtual void SetFile(TFile *file=0);
250 virtual void SetFile(const char *filename);
251 void SetIOFeatures(TIOFeatures &features) {fIOFeatures = features;}
252 virtual Bool_t SetMakeClass(Bool_t decomposeObj = kTRUE);
253 virtual void SetOffset(Int_t offset=0) {fOffset=offset;}
254 virtual void SetStatus(Bool_t status=1);
255 virtual void SetTree(TTree *tree) { fTree = tree;}
256 virtual void SetupAddresses();
257 Bool_t SupportsBulkRead() const;
258 virtual void UpdateAddress() {;}
259 virtual void UpdateFile();
260
261 static void ResetCount();
262
263 ClassDef(TBranch, 13); // Branch descriptor
264};
265
266//______________________________________________________________________________
268{
269 return (fCompress < 0) ? -1 : fCompress / 100;
270}
271
272//______________________________________________________________________________
274{
275 return (fCompress < 0) ? -1 : fCompress % 100;
276}
277
278//______________________________________________________________________________
280{
281 return (fCompress < 0) ? -1 : fCompress;
282}
283
285
286#endif
#define b(i)
Definition: RSha256.hxx:100
int Int_t
Definition: RtypesCore.h:41
unsigned int UInt_t
Definition: RtypesCore.h:42
const Bool_t kFALSE
Definition: RtypesCore.h:88
bool Bool_t
Definition: RtypesCore.h:59
long long Long64_t
Definition: RtypesCore.h:69
const Bool_t kTRUE
Definition: RtypesCore.h:87
const char Option_t
Definition: RtypesCore.h:62
#define ClassDef(name, id)
Definition: Rtypes.h:326
#define BIT(n)
Definition: Rtypes.h:83
const Int_t kBranchAny
Definition: TBranch.h:56
const Int_t kMapObject
Definition: TBranch.h:57
const Int_t kBranchObject
Definition: TBranch.h:55
const Int_t kDoNotProcess
Definition: TBranch.h:53
const Int_t kIsClone
Definition: TBranch.h:54
EDataType
Definition: TDataType.h:28
#define N
char name[80]
Definition: TGX11.cxx:109
int type
Definition: TGX11.cxx:120
typedef void((*Func_t)())
TIOFeatures provides the end-user with the ability to change the IO behavior of data written via a TT...
Definition: TIOFeatures.hxx:62
Fill Area Attributes class.
Definition: TAttFill.h:19
Manages buffers for branches of a Tree.
Definition: TBasket.h:34
A TTree is a list of TBranches.
Definition: TBranch.h:65
virtual TLeaf * GetLeaf(const char *name) const
Return pointer to the 1st Leaf named name in thisBranch.
Definition: TBranch.cxx:1892
void SetSkipZip(Bool_t skip=kTRUE)
Definition: TBranch.h:141
virtual void SetupAddresses()
If the branch address is not set, we set all addresses starting with the top level parent branch.
Definition: TBranch.cxx:3112
virtual void ResetAddress()
Reset the address of the branch.
Definition: TBranch.cxx:2473
virtual void SetAutoDelete(Bool_t autodel=kTRUE)
Set the automatic delete bit.
Definition: TBranch.cxx:2538
TString fFileName
Name of file where buffers are stored ("" if in same file as Tree header)
Definition: TBranch.h:120
virtual const char * GetClassName() const
Return the name of the user class whose content is stored in this branch, if any.
Definition: TBranch.cxx:1301
const char * GetIconName() const
Return icon name depending on type of branch.
Definition: TBranch.cxx:1309
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...
Definition: TBranch.cxx:1768
TBasket * GetBasketImpl(Int_t basket, TBuffer *user_buffer)
Return pointer to basket basketnumber in this Branch.
Definition: TBranch.cxx:1203
Int_t fEntryOffsetLen
Initial Length of fEntryOffset table in the basket buffers.
Definition: TBranch.h:90
virtual void DeleteBaskets(Option_t *option="")
Loop on all branch baskets.
Definition: TBranch.cxx:704
virtual Long64_t GetBasketSeek(Int_t basket) const
Return address of basket in the file.
Definition: TBranch.cxx:1279
TBranch()
Default constructor. Used for I/O by default.
Definition: TBranch.cxx:85
virtual char * GetAddress() const
Definition: TBranch.h:181
Int_t BackFill()
Loop on all leaves of this branch to back fill Basket buffer.
Definition: TBranch.cxx:658
Int_t GetCompressionSettings() const
Definition: TBranch.h:279
Int_t GetCompressionLevel() const
Definition: TBranch.h:273
Int_t GetCompressionAlgorithm() const
Definition: TBranch.h:267
Int_t fMaxBaskets
Maximum number of Baskets so far.
Definition: TBranch.h:96
Long64_t fTotBytes
Total number of bytes in all leaves before compression.
Definition: TBranch.h:107
TBuffer * fTransientBuffer
! Pointer to the current transient buffer.
Definition: TBranch.h:122
virtual void ReadBasket(TBuffer &b)
Loop on all leaves of this branch to read Basket buffer.
Definition: TBranch.cxx:2275
TTree * GetTree() const
Definition: TBranch.h:220
FillLeaves_t fFillLeaves
! Pointer to the FillLeaves implementation to use.
Definition: TBranch.h:134
Int_t GetWriteBasket() const
Definition: TBranch.h:206
void(TBranch::* ReadLeaves_t)(TBuffer &b)
Definition: TBranch.h:131
@ kAutoDelete
Definition: TBranch.h:81
@ kDoNotUseBufferMap
Definition: TBranch.h:83
@ kBranchAny
Definition: TBranch.h:79
@ kIsClone
Definition: TBranch.h:77
@ kBranchObject
Definition: TBranch.h:78
@ kDoNotProcess
Definition: TBranch.h:76
TObjArray fLeaves
-> List of leaves of this branch
Definition: TBranch.h:110
Int_t GetBasketAndFirst(TBasket *&basket, Long64_t &first, TBuffer *user_buffer)
A helper function to locate the correct basket - and its first entry.
Definition: TBranch.cxx:1326
char * fAddress
! Address of 1st leaf (variable or object)
Definition: TBranch.h:118
virtual void DropBaskets(Option_t *option="")
Loop on all branch baskets.
Definition: TBranch.cxx:735
TObjArray * GetListOfBranches()
Definition: TBranch.h:214
virtual TList * GetBrowsables()
Returns (and, if 0, creates) browsable objects for this branch See TVirtualBranchBrowsable::FillListO...
Definition: TBranch.cxx:1289
TList * fBrowsables
! List of TVirtualBranchBrowsables used for Browse()
Definition: TBranch.h:123
void ReadLeavesImpl(TBuffer &b)
Loop on all leaves of this branch to read Basket buffer.
Definition: TBranch.cxx:2283
virtual void SetTree(TTree *tree)
Definition: TBranch.h:255
Int_t fOffset
Offset of this branch.
Definition: TBranch.h:95
Long64_t * fBasketEntry
[fMaxBaskets] Table of first entry in each basket
Definition: TBranch.h:113
Int_t GetEntriesSerialized(Long64_t N, TBuffer &user_buf)
Definition: TBranch.h:154
ROOT::Experimental::Internal::TBulkBranchRead & GetBulkRead()
Definition: TBranch.h:187
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...
Definition: TBranch.cxx:2643
void ExpandBasketArrays()
Increase BasketEntry buffer of a minimum of 10 locations and a maximum of 50 per cent of current size...
Definition: TBranch.cxx:803
Int_t GetSplitLevel() const
Definition: TBranch.h:218
ROOT::TIOFeatures TIOFeatures
Definition: TBranch.h:66
void Init(const char *name, const char *leaflist, Int_t compress)
Definition: TBranch.cxx:296
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0)
Read all leaves of entry and return total number of bytes read.
Definition: TBranch.cxx:1580
const char * GetFileName() const
Definition: TBranch.h:202
TIOFeatures GetIOFeatures() const
Returns the IO settings currently in use for this branch.
Definition: TBranch.cxx:2077
void FillLeavesImpl(TBuffer &b)
Loop on all leaves of this branch to fill Basket buffer.
Definition: TBranch.cxx:2318
Long64_t fReadEntry
! Current entry number when reading
Definition: TBranch.h:101
virtual void AddBasket(TBasket &b, Bool_t ondisk, Long64_t startEntry)
Add the basket to this branch.
Definition: TBranch.cxx:534
static void ResetCount()
Static function resetting fgCount.
Definition: TBranch.cxx:2496
TBranch * GetSubBranch(const TBranch *br) const
Find the parent branch of child.
Definition: TBranch.cxx:1985
ReadLeaves_t fReadLeaves
! Pointer to the ReadLeaves implementation to use.
Definition: TBranch.h:132
virtual void SetObject(void *objadd)
Set object this branch is pointing to.
Definition: TBranch.cxx:2758
Int_t FlushBaskets()
Flush to disk all the baskets of this branch and any of subbranches.
Definition: TBranch.cxx:1113
void ReadLeaves2Impl(TBuffer &b)
Read two leaves without the overhead of a loop.
Definition: TBranch.cxx:2309
TBasket * GetFreshCluster()
Drops the cluster two behind the current cluster and returns a fresh basket by either reusing or crea...
Definition: TBranch.cxx:1827
virtual void SetAddress(void *add)
Set address of this branch.
Definition: TBranch.cxx:2504
static Int_t fgCount
! branch counter
Definition: TBranch.h:87
void(TBranch::* FillLeaves_t)(TBuffer &b)
Definition: TBranch.h:133
Int_t GetEvent(Long64_t entry=0)
Definition: TBranch.h:197
virtual void AddLastBasket(Long64_t startEntry)
Add the start entry of the write basket (not yet created)
Definition: TBranch.cxx:600
TBasket * GetBasket(Int_t basket)
Definition: TBranch.h:182
Int_t fNBaskets
! Number of baskets in memory
Definition: TBranch.h:97
void ReadLeaves1Impl(TBuffer &b)
Read one leaf without the overhead of a loop.
Definition: TBranch.cxx:2301
Int_t GetNleaves() const
Definition: TBranch.h:217
Int_t GetBulkEntries(Long64_t, TBuffer &)
Read as many events as possible into the given buffer, using zero-copy mechanisms.
Definition: TBranch.cxx:1426
Bool_t IsFolder() const
Return kTRUE if more than one leaf or browsables, kFALSE otherwise.
Definition: TBranch.cxx:2093
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.
Definition: TBranch.cxx:1636
Long64_t fZipBytes
Total number of bytes in all leaves after compression.
Definition: TBranch.h:108
TIOFeatures fIOFeatures
IO features for newly-created baskets.
Definition: TBranch.h:94
void SetCompressionAlgorithm(Int_t algorithm=ROOT::RCompressionSetting::EAlgorithm::kUseGlobal)
Set compression algorithm.
Definition: TBranch.cxx:2585
virtual void UpdateAddress()
Definition: TBranch.h:258
Bool_t IsAutoDelete() const
Return kTRUE if an existing object in a TBranchObject must be deleted.
Definition: TBranch.cxx:2085
Int_t GetOffset() const
Definition: TBranch.h:203
virtual TLeaf * FindLeaf(const char *name)
Find the leaf corresponding to the name 'searchname'.
Definition: TBranch.cxx:1058
BulkObj fBulk
! Helper for performing bulk IO
Definition: TBranch.h:124
Long64_t GetReadEntry() const
Definition: TBranch.h:205
CacheInfo_t fCacheInfo
! Hold info about which basket are in the cache and if they have been retrieved from the cache.
Definition: TBranch.h:129
TObjArray * GetListOfBaskets()
Definition: TBranch.h:213
virtual void SetBufferAddress(TBuffer *entryBuffer)
Set address of this branch directly from a TBuffer to avoid streaming.
Definition: TBranch.cxx:2567
Long64_t GetEntries() const
Definition: TBranch.h:219
Int_t fNleaves
! Number of leaves
Definition: TBranch.h:99
Int_t fSplitLevel
Branch split level.
Definition: TBranch.h:98
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.
Definition: TBranch.cxx:3021
virtual void UpdateFile()
Refresh the value of fDirectory (i.e.
Definition: TBranch.cxx:3122
void SetCompressionSettings(Int_t settings=ROOT::RCompressionSetting::EDefaults::kUseGeneralPurpose)
Set compression settings.
Definition: TBranch.cxx:2627
Int_t GetReadBasket() const
Definition: TBranch.h:204
Int_t * fBasketBytes
[fMaxBaskets] Length of baskets on file
Definition: TBranch.h:112
virtual void Print(Option_t *option="") const
Print TBranch parameters.
Definition: TBranch.cxx:2163
Long64_t fNextBasketEntry
! Next entry that will requires us to go to the next basket
Definition: TBranch.h:103
Int_t GetMaxBaskets() const
Definition: TBranch.h:216
Int_t * GetBasketBytes() const
Definition: TBranch.h:183
TBranch & operator=(const TBranch &)=delete
virtual ~TBranch()
Destructor.
Definition: TBranch.cxx:441
Int_t FillEntryBuffer(TBasket *basket, TBuffer *buf, Int_t &lnew)
Copy the data from fEntryBuffer into the current basket.
Definition: TBranch.cxx:913
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...
Definition: TBranch.cxx:1727
virtual void Browse(TBrowser *b)
Browser interface.
Definition: TBranch.cxx:677
TObjArray fBranches
-> List of Branches of this branch
Definition: TBranch.h:109
virtual void KeepCircular(Long64_t maxEntries)
keep a maximum of fMaxEntries in memory
Definition: TBranch.cxx:2105
virtual void ResetAfterMerge(TFileMergeInfo *)
Reset a Branch.
Definition: TBranch.cxx:2420
void ReadLeaves0Impl(TBuffer &b)
Read zero leaves without the overhead of a loop.
Definition: TBranch.cxx:2294
virtual Bool_t GetMakeClass() const
Return whether this branch is in a mode where the object are decomposed or not (Also known as MakeCla...
Definition: TBranch.cxx:1954
virtual void ResetReadEntry()
Definition: TBranch.h:237
TString GetRealFileName() const
Get real file name.
Definition: TBranch.cxx:1905
virtual TBranch * FindBranch(const char *name)
Find the immediate sub-branch with passed name.
Definition: TBranch.cxx:1012
TBranch(const TBranch &)=delete
TDirectory * fDirectory
! Pointer to directory where this branch buffers are stored
Definition: TBranch.h:119
void PrintCacheInfo() const
Print the information we have about which basket is currently cached and whether they have been 'used...
Definition: TBranch.cxx:2267
TObjArray fBaskets
-> List of baskets of this branch
Definition: TBranch.h:111
virtual Int_t LoadBaskets()
Baskets associated to this branch are forced to be in memory.
Definition: TBranch.cxx:2131
void SetIOFeatures(TIOFeatures &features)
Definition: TBranch.h:251
Bool_t fSkipZip
! After being read, the buffer will not be unzipped.
Definition: TBranch.h:126
TBranch * fMother
! Pointer to top-level parent branch in the tree.
Definition: TBranch.h:116
Long64_t GetTotBytes(Option_t *option="") const
Return total number of bytes in the branch (excluding current buffer) if option ="*" includes all sub...
Definition: TBranch.cxx:2042
virtual Bool_t SetMakeClass(Bool_t decomposeObj=kTRUE)
Set the branch in a mode where the object are decomposed (Also known as MakeClass mode).
Definition: TBranch.cxx:2749
virtual void SetFile(TFile *file=0)
Set file where this branch writes/reads its buffers.
Definition: TBranch.cxx:2685
TBranch * fParent
! Pointer to parent branch.
Definition: TBranch.h:117
Int_t WriteBasket(TBasket *basket, Int_t where)
Definition: TBranch.h:146
virtual void SetOffset(Int_t offset=0)
Definition: TBranch.h:253
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...
Definition: TBranch.cxx:1159
virtual Int_t GetExpectedType(TClass *&clptr, EDataType &type)
Fill expectedClass and expectedType with information on the data type of the object/values contained ...
Definition: TBranch.cxx:1708
virtual Int_t GetBasketSize() const
Definition: TBranch.h:186
virtual void SetFirstEntry(Long64_t entry)
set the first entry number (case of TBranchSTL)
Definition: TBranch.cxx:3097
Long64_t GetTotalSize(Option_t *option="") const
Return total number of bytes in the branch (including current buffer)
Definition: TBranch.cxx:2023
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...
Definition: TBranch.cxx:2060
virtual void SetBasketSize(Int_t buffsize)
Set the basket size The function makes sure that the basket size is greater than fEntryOffsetlen.
Definition: TBranch.cxx:2551
virtual void Refresh(TBranch *b)
Refresh this branch using new information in b This function is called by TTree::Refresh.
Definition: TBranch.cxx:2330
Int_t fWriteBasket
Last basket number written.
Definition: TBranch.h:91
Long64_t * fBasketSeek
[fMaxBaskets] Addresses of baskets on file
Definition: TBranch.h:114
Long64_t GetEntryNumber() const
Definition: TBranch.h:210
virtual void SetStatus(Bool_t status=1)
Set branch status to Process or DoNotProcess.
Definition: TBranch.cxx:2769
TObjArray * GetListOfLeaves()
Definition: TBranch.h:215
virtual void SetEntries(Long64_t entries)
Set the number of entries in this branch.
Definition: TBranch.cxx:2660
Int_t fReadBasket
! Current basket number when reading
Definition: TBranch.h:100
TDirectory * GetDirectory() const
Definition: TBranch.h:193
Long64_t fFirstEntry
Number of the first entry in this branch.
Definition: TBranch.h:106
TBasket * fExtraBasket
! Allocated basket not currently holding any data.
Definition: TBranch.h:93
virtual Int_t GetRow(Int_t row)
Return all elements of one row unpacked in internal array fValues [Actually just returns 1 (?...
Definition: TBranch.cxx:1945
Long64_t GetFirstEntry() const
Definition: TBranch.h:211
Int_t fBasketSize
Initial Size of Basket Buffer.
Definition: TBranch.h:89
Int_t Fill()
Definition: TBranch.h:174
virtual void Reset(Option_t *option="")
Reset a Branch.
Definition: TBranch.cxx:2379
Long64_t fEntryNumber
Current entry number (last one filled in this branch)
Definition: TBranch.h:92
TBranch * GetMother() const
Get our top-level parent branch in the tree.
Definition: TBranch.cxx:1964
Int_t fCompress
Compression level and algorithm.
Definition: TBranch.h:88
TBuffer * GetTransientBuffer(Int_t size)
Returns the transient buffer currently used by this TBranch for reading/writing baskets.
Definition: TBranch.cxx:512
virtual Int_t FillImpl(ROOT::Internal::TBranchIMTHelper *)
Loop on all leaves of this branch to fill Basket buffer.
Definition: TBranch.cxx:834
TBuffer * fEntryBuffer
! Buffer used to directly pass the content without streaming
Definition: TBranch.h:121
TBasket * fCurrentBasket
! Pointer to the current basket.
Definition: TBranch.h:104
Long64_t fFirstBasketEntry
! First entry in the current basket.
Definition: TBranch.h:102
void SetCompressionLevel(Int_t level=ROOT::RCompressionSetting::ELevel::kUseMin)
Set compression level.
Definition: TBranch.cxx:2605
Long64_t * GetBasketEntry() const
Definition: TBranch.h:184
Int_t GetEntryOffsetLen() const
Definition: TBranch.h:196
Long64_t fEntries
Number of entries.
Definition: TBranch.h:105
Bool_t SupportsBulkRead() const
Returns true if this branch supports bulk IO, false otherwise.
Definition: TBranch.cxx:1401
TTree * fTree
! Pointer to Tree header
Definition: TBranch.h:115
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:37
Buffer base class used for serializing objects.
Definition: TBuffer.h:42
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition: TClass.h:75
An array of clone (identical) objects.
Definition: TClonesArray.h:32
Describe directory structure in memory.
Definition: TDirectory.h:34
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
Definition: TFile.h:48
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
Definition: TLeaf.h:49
A doubly linked list.
Definition: TList.h:44
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
An array of TObjects.
Definition: TObjArray.h:37
EStatusBits
Definition: TObject.h:57
Basic string class.
Definition: TString.h:131
const char * Data() const
Definition: TString.h:364
A cache to speed-up the reading of ROOT datasets.
Definition: TTreeCache.h:35
Class implementing or helping the various TTree cloning method.
Definition: TTreeCloner.h:38
A TTree represents a columnar dataset.
Definition: TTree.h:71
const Int_t n
Definition: legend1.C:16
Namespace for new ROOT classes and functions.
Definition: StringConv.hxx:21
Definition: file.py:1
Definition: first.py:1
Definition: tree.py:1
@ kUseGlobal
Use the global compression algorithm.
Definition: Compression.h:81
@ kInherit
Some objects use this value to denote that the compression algorithm should be inherited from the par...
Definition: Compression.h:79
@ kUseGeneralPurpose
Use the recommended general-purpose setting; moderate read / write speed and compression ratio.
Definition: Compression.h:53