Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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 "TNamed.h"
27#include "TAttFill.h"
28#include "TObjArray.h"
29#include "TBranchCacheInfo.h"
30#include "TDataType.h"
31#include "Compression.h"
32#include "ROOT/TIOFeatures.hxx"
33
34class TTree;
35class TBasket;
36class TBranchElement;
37class TLeaf;
38class TBrowser;
39class TDirectory;
40class TFile;
41class TClonesArray;
42class TTreeCloner;
43class TTreeCache;
44
45namespace ROOT {
46namespace Experimental {
47namespace Internal {
48class TBulkBranchRead;
49}
50}
51namespace Internal {
52class TBranchIMTHelper; ///< A helper class for managing IMT work during TTree:Fill operations.
53}
54}
55
56const Int_t kDoNotProcess = BIT(10); // Active bit for branches
57const Int_t kIsClone = BIT(11); // to indicate a TBranchClones
58const Int_t kBranchObject = BIT(12); // branch is a TObject*
59const Int_t kBranchAny = BIT(17); // branch is an object*
61
62namespace ROOT {
63namespace Experimental {
64namespace Internal {
65
66///\class TBulkBranchRead
67/// Helper class for reading many branch entries at once to optimize throughput.
69
70 friend class ::TBranch;
71
72public:
73 /// See TBranch::GetBulkEntries(Long64_t evt, TBuffer &user_buf);
75 /// See TBranch::GetEntriesSerialized(Long64_t evt, TBuffer &user_buf);
77 /// See TBranch::GetEntriesSerialized(Long64_t evt, TBuffer &user_buf, TBuffer *count_buf);
79 /// Return true if the branch can be read through the bulk interfaces.
80 bool SupportsBulkRead() const;
81
82private:
84 : fParent(parent)
85 {}
86
88};
89}
90}
91}
92
93class TBranch : public TNamed, public TAttFill {
94public:
96
97protected:
98 friend class TTreeCache;
99 friend class TTreeCloner;
100 friend class TTree;
101 friend class TBranchElement;
103
104 /// TBranch status bits
106// clang++ <v20 (-Wshadow) does not like this shadowing of global variables in this header. Let's silence warning:
107#if defined(__clang__) && __clang_major__ < 20
108#pragma clang diagnostic push
109#pragma clang diagnostic ignored "-Wshadow"
110#endif
111 kDoNotProcess = ::kDoNotProcess, ///< Active bit for branches
112 kIsClone = ::kIsClone, ///< To indicate a TBranchClones
113 kBranchObject = ::kBranchObject, ///< Branch is a TObject*
114 kBranchAny = ::kBranchAny, ///< Branch is an object*
115 // kMapObject = ::kMapObject; ///< kBranchObject | kBranchAny;
116#if defined(__clang__) && __clang_major__ < 20
117#pragma clang diagnostic pop
118#endif
120
121 kDoNotUseBufferMap = BIT(22) ///< If set, at least one of the entry in the branch will use the buffer's map of classname and objects.
122 };
123
125 static Int_t fgCount; ///<! branch counter
126 Int_t fCompress; ///< Compression level and algorithm
127 Int_t fBasketSize; ///< Initial Size of Basket Buffer
128 Int_t fEntryOffsetLen; ///< Initial Length of fEntryOffset table in the basket buffers
129 Int_t fWriteBasket; ///< Last basket number written
130 Long64_t fEntryNumber; ///< Current entry number (last one filled in this branch)
131 TBasket *fExtraBasket; ///<! Allocated basket not currently holding any data.
132 TIOFeatures fIOFeatures; ///< IO features for newly-created baskets.
133 Int_t fOffset; ///< Offset of this branch
134 Int_t fMaxBaskets; ///< Maximum number of Baskets so far
135 Int_t fNBaskets; ///<! Number of baskets in memory
136 Int_t fSplitLevel; ///< Branch split level
137 Int_t fNleaves; ///<! Number of leaves
138 Int_t fReadBasket; ///<! Current basket number when reading
139 Long64_t fReadEntry; ///<! Current entry number when reading
140 Long64_t fFirstBasketEntry; ///<! First entry in the current basket.
141 Long64_t fNextBasketEntry; ///<! Next entry that will requires us to go to the next basket
142 TBasket *fCurrentBasket; ///<! Pointer to the current basket.
143 Long64_t fEntries; ///< Number of entries
144 Long64_t fFirstEntry; ///< Number of the first entry in this branch
145 Long64_t fTotBytes; ///< Total number of bytes in all leaves before compression
146 Long64_t fZipBytes; ///< Total number of bytes in all leaves after compression
147 TObjArray fBranches; ///< -> List of Branches of this branch
148 TObjArray fLeaves; ///< -> List of leaves of this branch
149 TObjArray fBaskets; ///< -> List of baskets of this branch
150 Int_t *fBasketBytes; ///<[fMaxBaskets] Length of baskets on file
151 Long64_t *fBasketEntry; ///<[fMaxBaskets] Table of first entry in each basket
152 Long64_t *fBasketSeek; ///<[fMaxBaskets] Addresses of baskets on file
153 TTree *fTree; ///<! Pointer to Tree header
154 TBranch *fMother; ///<! Pointer to top-level parent branch in the tree.
155 TBranch *fParent; ///<! Pointer to parent branch.
156 char *fAddress; ///<! Address of 1st leaf (variable or object)
157 TDirectory *fDirectory; ///<! Pointer to directory where this branch buffers are stored
158 TString fFileName; ///< Name of file where buffers are stored ("" if in same file as Tree header)
159 TBuffer *fEntryBuffer; ///<! Buffer used to directly pass the content without streaming
160 TBuffer *fTransientBuffer; ///<! Pointer to the current transient buffer.
161 TList *fBrowsables; ///<! List of TVirtualBranchBrowsables used for Browse()
162 BulkObj fBulk; ///<! Helper for performing bulk IO
163
164 bool fSkipZip; ///<! After being read, the buffer will not be unzipped.
165
167 CacheInfo_t fCacheInfo; ///<! Hold info about which basket are in the cache and if they have been retrieved from the cache.
168
169 typedef void (TBranch::*ReadLeaves_t)(TBuffer &b);
170 ReadLeaves_t fReadLeaves; ///<! Pointer to the ReadLeaves implementation to use.
171 typedef void (TBranch::*FillLeaves_t)(TBuffer &b);
172 FillLeaves_t fFillLeaves; ///<! Pointer to the FillLeaves implementation to use.
173 void ReadLeavesImpl(TBuffer &b);
177 void FillLeavesImpl(TBuffer &b);
178
179 void SetSkipZip(bool skip = true) { fSkipZip = skip; }
180 void Init(const char *name, const char *leaflist, Int_t compress);
181
185
186 TString GetRealFileName() const;
187
188 virtual void SetAddressImpl(void *addr, bool /* implied */, Int_t /* offset */) { SetAddress(addr); }
189
190private:
198 TBranch(const TBranch&) = delete; // not implemented
199 TBranch& operator=(const TBranch&) = delete; // not implemented
200
201public:
202 TBranch();
203 TBranch(TTree *tree, const char *name, void *address, const char *leaflist, Int_t basketsize=32000, Int_t compress = ROOT::RCompressionSetting::EAlgorithm::kInherit);
204 TBranch(TBranch *parent, const char *name, void *address, const char *leaflist, Int_t basketsize=32000, Int_t compress = ROOT::RCompressionSetting::EAlgorithm::kInherit);
205 ~TBranch() override;
206
207 virtual void AddBasket(TBasket &b, bool ondisk, Long64_t startEntry);
208 virtual void AddLastBasket(Long64_t startEntry);
209 Int_t BackFill();
210 void Browse(TBrowser *b) override;
211 virtual void DeleteBaskets(Option_t* option="");
212 virtual void DropBaskets(Option_t *option = "");
213 void ExpandBasketArrays();
214 Int_t Fill() { return FillImpl(nullptr); }
216 virtual TBranch *FindBranch(const char *name);
217 virtual TLeaf *FindLeaf(const char *name);
220
221 virtual char *GetAddress() const {return fAddress;}
225 virtual Long64_t GetBasketSeek(Int_t basket) const;
226 virtual Int_t GetBasketSize() const {return fBasketSize;}
228 virtual TList *GetBrowsables();
229 virtual const char* GetClassName() const;
234 virtual Int_t GetEntry(Long64_t entry=0, Int_t getall = 0);
238 virtual TString GetFullName() const;
239 const char *GetIconName() const override;
241 virtual TLeaf *GetLeaf(const char *name) const;
242 virtual TFile *GetFile(Int_t mode=0);
243 const char *GetFileName() const {return fFileName.Data();}
244 Int_t GetOffset() const {return fOffset;}
258 Int_t GetNleaves() const {return fNleaves;}
260 Long64_t GetEntries() const {return fEntries;}
261 TTree *GetTree() const {return fTree;}
262 virtual Int_t GetRow(Int_t row);
263 virtual bool GetMakeClass() const;
264 TBranch *GetMother() const;
265 TBranch *GetSubBranch(const TBranch *br) const;
267 bool IsAutoDelete() const;
268 bool IsFolder() const override;
269 virtual void KeepCircular(Long64_t maxEntries);
270 virtual Int_t LoadBaskets();
271 void Print(Option_t *option="") const override;
272 void PrintCacheInfo() const;
273 virtual void ReadBasket(TBuffer &b);
274 virtual void Refresh(TBranch *b);
275 virtual void Reset(Option_t *option="");
276 virtual void ResetAfterMerge(TFileMergeInfo *);
277 virtual void ResetAddress();
278 virtual void ResetReadEntry() {fReadEntry = -1;}
279 virtual void SetAddress(void *add);
280 virtual void SetObject(void *objadd);
281 virtual void SetAutoDelete(bool autodel=true);
282 virtual void SetBasketSize(Int_t bufsize);
283 virtual void SetBufferAddress(TBuffer *entryBuffer);
287 virtual void SetEntries(Long64_t entries);
288 virtual void SetEntryOffsetLen(Int_t len, bool updateSubBranches = false);
289 virtual void SetFirstEntry(Long64_t entry);
290 virtual void SetFile(TFile *file = nullptr);
291 virtual void SetFile(const char *filename);
293 virtual bool SetMakeClass(bool decomposeObj = true);
295 virtual void SetStatus(bool status=true);
296 virtual void SetTree(TTree *tree) { fTree = tree; }
297 virtual void SetupAddresses();
298 bool SupportsBulkRead() const;
299 virtual void UpdateAddress() {}
300 virtual void UpdateFile();
301
302 static void ResetCount();
303
304 ClassDefOverride(TBranch, 13); // Branch descriptor
305};
306
307//______________________________________________________________________________
309{
310 return (fCompress < 0) ? -1 : fCompress / 100;
311}
312
313//______________________________________________________________________________
315{
316 return (fCompress < 0) ? -1 : fCompress % 100;
317}
318
319//______________________________________________________________________________
321{
322 return (fCompress < 0) ? -1 : fCompress;
323}
324
325namespace ROOT {
326namespace Experimental {
327namespace Internal {
328
333
334} // Internal
335} // Experimental
336} // ROOT
337
338#endif
#define b(i)
Definition RSha256.hxx:100
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
int Int_t
Signed integer 4 bytes (int)
Definition RtypesCore.h:59
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int)
Definition RtypesCore.h:60
long long Long64_t
Portable signed long integer 8 bytes.
Definition RtypesCore.h:83
const char Option_t
Option string (const char)
Definition RtypesCore.h:80
#define BIT(n)
Definition Rtypes.h:91
#define ClassDefOverride(name, id)
Definition Rtypes.h:348
const Int_t kBranchAny
Definition TBranch.h:59
const Int_t kMapObject
Definition TBranch.h:60
const Int_t kBranchObject
Definition TBranch.h:58
const Int_t kDoNotProcess
Definition TBranch.h:56
const Int_t kIsClone
Definition TBranch.h:57
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
EDataType
Definition TDataType.h:28
#define N
Option_t Option_t option
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h offset
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
Option_t Option_t TPoint TPoint const char mode
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
char name[80]
Definition TGX11.cxx:110
Helper class for reading many branch entries at once to optimize throughput.
Definition TBranch.h:68
Int_t GetEntriesSerialized(Long64_t evt, TBuffer &user_buf)
See TBranch::GetEntriesSerialized(Long64_t evt, TBuffer &user_buf);.
Definition TBranch.h:330
bool SupportsBulkRead() const
Return true if the branch can be read through the bulk interfaces.
Definition TBranch.h:332
Int_t GetBulkEntries(Long64_t evt, TBuffer &user_buf)
See TBranch::GetBulkEntries(Long64_t evt, TBuffer &user_buf);.
Definition TBranch.h:329
A helper class for managing IMT work during TTree:Fill operations.
TIOFeatures provides the end-user with the ability to change the IO behavior of data written via a TT...
Fill Area Attributes class.
Definition TAttFill.h:20
Manages buffers for branches of a Tree.
Definition TBasket.h:34
A Branch for the case of an object.
A TTree is a list of TBranches.
Definition TBranch.h:93
virtual TLeaf * GetLeaf(const char *name) const
Return pointer to the 1st Leaf named name in thisBranch.
Definition TBranch.cxx:2054
virtual bool GetMakeClass() const
Return whether this branch is in a mode where the object are decomposed or not (Also known as MakeCla...
Definition TBranch.cxx:2116
virtual void SetupAddresses()
If the branch address is not set, we set all addresses starting with the top level parent branch.
Definition TBranch.cxx:3306
virtual void ResetAddress()
Reset the address of the branch.
Definition TBranch.cxx:2650
TString fFileName
Name of file where buffers are stored ("" if in same file as Tree header)
Definition TBranch.h:158
virtual const char * GetClassName() const
Return the name of the user class whose content is stored in this branch, if any.
Definition TBranch.cxx:1323
TBasket * GetFreshBasket(Int_t basketnumber, TBuffer *user_buffer)
Return a fresh basket by either reusing an existing basket that needs to be drop (according to TTree:...
Definition TBranch.cxx:1893
TBasket * GetBasketImpl(Int_t basket, TBuffer *user_buffer)
Return pointer to basket basketnumber in this Branch.
Definition TBranch.cxx:1225
Int_t fEntryOffsetLen
Initial Length of fEntryOffset table in the basket buffers.
Definition TBranch.h:128
virtual void DeleteBaskets(Option_t *option="")
Loop on all branch baskets.
Definition TBranch.cxx:725
virtual Long64_t GetBasketSeek(Int_t basket) const
Return address of basket in the file.
Definition TBranch.cxx:1301
TBranch()
Default constructor. Used for I/O by default.
Definition TBranch.cxx:86
virtual char * GetAddress() const
Definition TBranch.h:221
void SetCompressionSettings(Int_t settings=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault)
Set compression settings.
Definition TBranch.cxx:2817
const char * GetIconName() const override
Return icon name depending on type of branch.
Definition TBranch.cxx:1331
Int_t BackFill()
Loop on all leaves of this branch to back fill Basket buffer.
Definition TBranch.cxx:679
Int_t GetCompressionSettings() const
Definition TBranch.h:320
~TBranch() override
Destructor.
Definition TBranch.cxx:449
Int_t GetCompressionLevel() const
Definition TBranch.h:314
Int_t GetCompressionAlgorithm() const
Definition TBranch.h:308
Int_t fMaxBaskets
Maximum number of Baskets so far.
Definition TBranch.h:134
Long64_t fTotBytes
Total number of bytes in all leaves before compression.
Definition TBranch.h:145
TBuffer * fTransientBuffer
! Pointer to the current transient buffer.
Definition TBranch.h:160
virtual void ReadBasket(TBuffer &b)
Loop on all leaves of this branch to read Basket buffer.
Definition TBranch.cxx:2452
TTree * GetTree() const
Definition TBranch.h:261
FillLeaves_t fFillLeaves
! Pointer to the FillLeaves implementation to use.
Definition TBranch.h:172
virtual TString GetFullName() const
Return the 'full' name of the branch.
Definition TBranch.cxx:2030
Int_t GetWriteBasket() const
Definition TBranch.h:247
void(TBranch::* ReadLeaves_t)(TBuffer &b)
Definition TBranch.h:169
EStatusBits
TBranch status bits.
Definition TBranch.h:105
@ kAutoDelete
Definition TBranch.h:119
@ kDoNotUseBufferMap
If set, at least one of the entry in the branch will use the buffer's map of classname and objects.
Definition TBranch.h:121
@ kBranchAny
Branch is an object*.
Definition TBranch.h:114
@ kIsClone
To indicate a TBranchClones.
Definition TBranch.h:112
@ kBranchObject
Branch is a TObject*.
Definition TBranch.h:113
@ kDoNotProcess
Active bit for branches.
Definition TBranch.h:111
TObjArray fLeaves
-> List of leaves of this branch
Definition TBranch.h:148
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:1352
char * fAddress
! Address of 1st leaf (variable or object)
Definition TBranch.h:156
virtual void DropBaskets(Option_t *option="")
Loop on all branch baskets.
Definition TBranch.cxx:756
TObjArray * GetListOfBranches()
Definition TBranch.h:255
virtual TList * GetBrowsables()
Returns (and, if 0, creates) browsable objects for this branch See TVirtualBranchBrowsable::FillListO...
Definition TBranch.cxx:1311
TList * fBrowsables
! List of TVirtualBranchBrowsables used for Browse()
Definition TBranch.h:161
void ReadLeavesImpl(TBuffer &b)
Loop on all leaves of this branch to read Basket buffer.
Definition TBranch.cxx:2460
virtual void SetTree(TTree *tree)
Definition TBranch.h:296
Int_t fOffset
Offset of this branch.
Definition TBranch.h:133
Long64_t * fBasketEntry
[fMaxBaskets] Table of first entry in each basket
Definition TBranch.h:151
Int_t GetEntriesSerialized(Long64_t N, TBuffer &user_buf)
Definition TBranch.h:194
ROOT::Experimental::Internal::TBulkBranchRead & GetBulkRead()
Definition TBranch.h:227
void ExpandBasketArrays()
Increase BasketEntry buffer of a minimum of 10 locations and a maximum of 50 per cent of current size...
Definition TBranch.cxx:824
Int_t GetSplitLevel() const
Definition TBranch.h:259
ROOT::TIOFeatures TIOFeatures
Definition TBranch.h:95
void Init(const char *name, const char *leaflist, Int_t compress)
Definition TBranch.cxx:299
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:1705
const char * GetFileName() const
Definition TBranch.h:243
TIOFeatures GetIOFeatures() const
Returns the IO settings currently in use for this branch.
Definition TBranch.cxx:2254
void FillLeavesImpl(TBuffer &b)
Loop on all leaves of this branch to fill Basket buffer.
Definition TBranch.cxx:2495
Long64_t fReadEntry
! Current entry number when reading
Definition TBranch.h:139
void Print(Option_t *option="") const override
Print TBranch parameters.
Definition TBranch.cxx:2340
static void ResetCount()
Static function resetting fgCount.
Definition TBranch.cxx:2673
TBranch * GetSubBranch(const TBranch *br) const
Find the parent branch of child.
Definition TBranch.cxx:2163
ReadLeaves_t fReadLeaves
! Pointer to the ReadLeaves implementation to use.
Definition TBranch.h:170
virtual void SetObject(void *objadd)
Set object this branch is pointing to.
Definition TBranch.cxx:2948
Int_t FlushBaskets()
Flush to disk all the baskets of this branch and any of subbranches.
Definition TBranch.cxx:1135
void ReadLeaves2Impl(TBuffer &b)
Read two leaves without the overhead of a loop.
Definition TBranch.cxx:2486
virtual void AddBasket(TBasket &b, bool ondisk, Long64_t startEntry)
Add the basket to this branch.
Definition TBranch.cxx:544
virtual void SetAddress(void *add)
Set address of this branch.
Definition TBranch.cxx:2694
static Int_t fgCount
! branch counter
Definition TBranch.h:125
void(TBranch::* FillLeaves_t)(TBuffer &b)
Definition TBranch.h:171
Int_t GetEvent(Long64_t entry=0)
Definition TBranch.h:237
virtual void AddLastBasket(Long64_t startEntry)
Add the start entry of the write basket (not yet created)
Definition TBranch.cxx:617
TBasket * GetBasket(Int_t basket)
Definition TBranch.h:222
Int_t fNBaskets
! Number of baskets in memory
Definition TBranch.h:135
void ReadLeaves1Impl(TBuffer &b)
Read one leaf without the overhead of a loop.
Definition TBranch.cxx:2478
Int_t GetNleaves() const
Definition TBranch.h:258
Int_t GetBulkEntries(Long64_t, TBuffer &)
Read a basket of events into the given buffer with byte swapping.
Definition TBranch.cxx:1471
virtual void SetFile(TFile *file=nullptr)
Set file where this branch writes/reads its buffers.
Definition TBranch.cxx:2875
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:1761
virtual void SetAutoDelete(bool autodel=true)
Set the automatic delete bit.
Definition TBranch.cxx:2728
Long64_t fZipBytes
Total number of bytes in all leaves after compression.
Definition TBranch.h:146
TIOFeatures fIOFeatures
IO features for newly-created baskets.
Definition TBranch.h:132
void Browse(TBrowser *b) override
Browser interface.
Definition TBranch.cxx:698
void SetCompressionAlgorithm(Int_t algorithm=ROOT::RCompressionSetting::EAlgorithm::kUseGlobal)
Set compression algorithm.
Definition TBranch.cxx:2775
virtual void UpdateAddress()
Definition TBranch.h:299
Int_t GetOffset() const
Definition TBranch.h:244
virtual void SetEntryOffsetLen(Int_t len, bool updateSubBranches=false)
Update the default value for the branch's fEntryOffsetLen if and only if it was already non zero (and...
Definition TBranch.cxx:2833
virtual TLeaf * FindLeaf(const char *name)
Find the leaf corresponding to the name 'searchname'.
Definition TBranch.cxx:1080
BulkObj fBulk
! Helper for performing bulk IO
Definition TBranch.h:162
Long64_t GetReadEntry() const
Definition TBranch.h:246
CacheInfo_t fCacheInfo
! Hold info about which basket are in the cache and if they have been retrieved from the cache.
Definition TBranch.h:167
TObjArray * GetListOfBaskets()
Definition TBranch.h:254
virtual void SetBufferAddress(TBuffer *entryBuffer)
Set address of this branch directly from a TBuffer to avoid streaming.
Definition TBranch.cxx:2757
Long64_t GetEntries() const
Definition TBranch.h:260
Int_t fNleaves
! Number of leaves
Definition TBranch.h:137
Int_t fSplitLevel
Branch split level.
Definition TBranch.h:136
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:3214
virtual void UpdateFile()
Refresh the value of fDirectory (i.e.
Definition TBranch.cxx:3316
void SetSkipZip(bool skip=true)
Definition TBranch.h:179
Int_t GetReadBasket() const
Definition TBranch.h:245
Int_t * fBasketBytes
[fMaxBaskets] Length of baskets on file
Definition TBranch.h:150
Long64_t fNextBasketEntry
! Next entry that will requires us to go to the next basket
Definition TBranch.h:141
bool IsAutoDelete() const
Return true if an existing object in a TBranchObject must be deleted.
Definition TBranch.cxx:2262
Int_t GetMaxBaskets() const
Definition TBranch.h:257
Int_t * GetBasketBytes() const
Definition TBranch.h:223
TBranch & operator=(const TBranch &)=delete
Int_t FillEntryBuffer(TBasket *basket, TBuffer *buf, Int_t &lnew)
Copy the data from fEntryBuffer into the current basket.
Definition TBranch.cxx:934
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:1852
TObjArray fBranches
-> List of Branches of this branch
Definition TBranch.h:147
virtual void KeepCircular(Long64_t maxEntries)
keep a maximum of fMaxEntries in memory
Definition TBranch.cxx:2282
virtual void SetStatus(bool status=true)
Set branch status to Process or DoNotProcess.
Definition TBranch.cxx:2959
virtual void ResetAfterMerge(TFileMergeInfo *)
Reset a Branch.
Definition TBranch.cxx:2597
void ReadLeaves0Impl(TBuffer &b)
Read zero leaves without the overhead of a loop.
Definition TBranch.cxx:2471
bool SupportsBulkRead() const
Returns true if this branch supports bulk IO, false otherwise.
Definition TBranch.cxx:1430
virtual void ResetReadEntry()
Definition TBranch.h:278
TString GetRealFileName() const
Get real file name.
Definition TBranch.cxx:2067
virtual TBranch * FindBranch(const char *name)
Find the immediate sub-branch with passed name.
Definition TBranch.cxx:1034
TBranch(const TBranch &)=delete
TDirectory * fDirectory
! Pointer to directory where this branch buffers are stored
Definition TBranch.h:157
void PrintCacheInfo() const
Print the information we have about which basket is currently cached and whether they have been 'used...
Definition TBranch.cxx:2444
TObjArray fBaskets
-> List of baskets of this branch
Definition TBranch.h:149
virtual Int_t LoadBaskets()
Baskets associated to this branch are forced to be in memory.
Definition TBranch.cxx:2308
void SetIOFeatures(TIOFeatures &features)
Definition TBranch.h:292
TBranch * fMother
! Pointer to top-level parent branch in the tree.
Definition TBranch.h:154
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:2219
TBranch * fParent
! Pointer to parent branch.
Definition TBranch.h:155
Int_t WriteBasket(TBasket *basket, Int_t where)
Definition TBranch.h:184
virtual void SetOffset(Int_t offset=0)
Definition TBranch.h:294
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:1181
bool fSkipZip
! After being read, the buffer will not be unzipped.
Definition TBranch.h:164
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:1833
virtual Int_t GetBasketSize() const
Definition TBranch.h:226
bool IsFolder() const override
Return true if more than one leaf or browsables, false otherwise.
Definition TBranch.cxx:2270
virtual void SetFirstEntry(Long64_t entry)
set the first entry number (case of TBranchSTL)
Definition TBranch.cxx:3291
Long64_t GetTotalSize(Option_t *option="") const
Return total number of bytes in the branch (including current buffer)
Definition TBranch.cxx:2200
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:2237
virtual void Refresh(TBranch *b)
Refresh this branch using new information in b This function is called by TTree::Refresh.
Definition TBranch.cxx:2507
virtual bool SetMakeClass(bool decomposeObj=true)
Set the branch in a mode where the object are decomposed (Also known as MakeClass mode).
Definition TBranch.cxx:2939
Int_t fWriteBasket
Last basket number written.
Definition TBranch.h:129
Long64_t * fBasketSeek
[fMaxBaskets] Addresses of baskets on file
Definition TBranch.h:152
Long64_t GetEntryNumber() const
Definition TBranch.h:251
TObjArray * GetListOfLeaves()
Definition TBranch.h:256
virtual void SetEntries(Long64_t entries)
Set the number of entries in this branch.
Definition TBranch.cxx:2850
Int_t fReadBasket
! Current basket number when reading
Definition TBranch.h:138
TDirectory * GetDirectory() const
Definition TBranch.h:233
Long64_t fFirstEntry
Number of the first entry in this branch.
Definition TBranch.h:144
TBasket * fExtraBasket
! Allocated basket not currently holding any data.
Definition TBranch.h:131
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:2107
Long64_t GetFirstEntry() const
Definition TBranch.h:252
Int_t fBasketSize
Initial Size of Basket Buffer.
Definition TBranch.h:127
Int_t Fill()
Definition TBranch.h:214
virtual void Reset(Option_t *option="")
Reset a Branch.
Definition TBranch.cxx:2556
virtual void SetBasketSize(Int_t bufsize)
Set the basket size The function makes sure that the basket size is greater than fEntryOffsetlen.
Definition TBranch.cxx:2741
Long64_t fEntryNumber
Current entry number (last one filled in this branch)
Definition TBranch.h:130
TBranch * GetMother() const
Get our top-level parent branch in the tree.
Definition TBranch.cxx:2126
Int_t fCompress
Compression level and algorithm.
Definition TBranch.h:126
TBuffer * GetTransientBuffer(Int_t size)
Returns the transient buffer currently used by this TBranch for reading/writing baskets.
Definition TBranch.cxx:522
virtual Int_t FillImpl(ROOT::Internal::TBranchIMTHelper *)
Loop on all leaves of this branch to fill Basket buffer.
Definition TBranch.cxx:855
TBuffer * fEntryBuffer
! Buffer used to directly pass the content without streaming
Definition TBranch.h:159
TBasket * fCurrentBasket
! Pointer to the current basket.
Definition TBranch.h:142
Long64_t fFirstBasketEntry
! First entry in the current basket.
Definition TBranch.h:140
void SetCompressionLevel(Int_t level=ROOT::RCompressionSetting::ELevel::kUseMin)
Set compression level.
Definition TBranch.cxx:2795
Long64_t * GetBasketEntry() const
Definition TBranch.h:224
Int_t GetEntryOffsetLen() const
Definition TBranch.h:236
Long64_t fEntries
Number of entries.
Definition TBranch.h:143
TBasket * GetFreshCluster(TBuffer *user_buffer)
Drops the cluster two behind the current cluster and returns a fresh basket by either reusing or crea...
Definition TBranch.cxx:1952
virtual void SetAddressImpl(void *addr, bool, Int_t)
Definition TBranch.h:188
TTree * fTree
! Pointer to Tree header
Definition TBranch.h:153
Using a TBrowser one can browse all ROOT objects.
Definition TBrowser.h:37
Buffer base class used for serializing objects.
Definition TBuffer.h:43
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition TClass.h:84
An array of clone (identical) objects.
Describe directory structure in memory.
Definition TDirectory.h:45
A class to pass information from the TFileMerger to the objects being merged.
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
Definition TFile.h:130
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
Definition TLeaf.h:57
A doubly linked list.
Definition TList.h:38
The TNamed class is the base class for all named ROOT classes.
Definition TNamed.h:29
An array of TObjects.
Definition TObjArray.h:31
Basic string class.
Definition TString.h:138
const char * Data() const
Definition TString.h:384
A cache to speed-up the reading of ROOT datasets.
Definition TTreeCache.h:32
Class implementing or helping the various TTree cloning method.
Definition TTreeCloner.h:31
A TTree represents a columnar dataset.
Definition TTree.h:89
const Int_t n
Definition legend1.C:16
@ kUseGlobal
Use the global compression algorithm.
Definition Compression.h:93
@ kInherit
Some objects use this value to denote that the compression algorithm should be inherited from the par...
Definition Compression.h:91
@ kUseCompiledDefault
Use the compile-time default setting.
Definition Compression.h:53
@ kUseMin
Compression level reserved when we are not sure what to use (1 is for the fastest compression)
Definition Compression.h:72