Logo ROOT  
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 "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 
34 class TTree;
35 class TBasket;
36 class TBranchElement;
37 class TLeaf;
38 class TBrowser;
39 class TDirectory;
40 class TFile;
41 class TClonesArray;
42 class TTreeCloner;
43 class TTreeCache;
44 
45 namespace ROOT {
46 namespace Experimental {
47 namespace Internal {
48 class TBulkBranchRead;
49 }
50 }
51 namespace Internal {
52 class TBranchIMTHelper; ///< A helper class for managing IMT work during TTree:Fill operations.
53 }
54 }
55 
56 const Int_t kDoNotProcess = BIT(10); // Active bit for branches
57 const Int_t kIsClone = BIT(11); // to indicate a TBranchClones
58 const Int_t kBranchObject = BIT(12); // branch is a TObject*
59 const Int_t kBranchAny = BIT(17); // branch is an object*
61 
62 namespace ROOT {
63 namespace Experimental {
64 namespace Internal {
65 
66 ///\class TBulkBranchRead
67 /// Helper class for reading many branch entries at once to optimize throughput.
69 
70  friend class ::TBranch;
71 
72 public:
73  Int_t GetBulkEntries(Long64_t evt, TBuffer &user_buf);
75  Int_t GetEntriesSerialized(Long64_t evt, TBuffer &user_buf, TBuffer *count_buf);
76  Bool_t SupportsBulkRead() const;
77 
78 private:
80  : fParent(parent)
81  {}
82 
84 };
85 }
86 }
87 }
88 
89 class TBranch : public TNamed , public TAttFill {
91 
92 protected:
93  friend class TTreeCache;
94  friend class TTreeCloner;
95  friend class TTree;
96  friend class TBranchElement;
98 
99  // TBranch status bits
100  enum EStatusBits {
101  kDoNotProcess = ::kDoNotProcess, // Active bit for branches
102  kIsClone = ::kIsClone, // to indicate a TBranchClones
103  kBranchObject = ::kBranchObject, // branch is a TObject*
104  kBranchAny = ::kBranchAny, // branch is an object*
105  // kMapObject = kBranchObject | kBranchAny;
107 
108  kDoNotUseBufferMap = BIT(22) // If set, at least one of the entry in the branch will use the buffer's map of classname and objects.
109  };
110 
112  static Int_t fgCount; ///<! branch counter
113  Int_t fCompress; ///< Compression level and algorithm
114  Int_t fBasketSize; ///< Initial Size of Basket Buffer
115  Int_t fEntryOffsetLen; ///< Initial Length of fEntryOffset table in the basket buffers
116  Int_t fWriteBasket; ///< Last basket number written
117  Long64_t fEntryNumber; ///< Current entry number (last one filled in this branch)
118  TBasket *fExtraBasket; ///<! Allocated basket not currently holding any data.
119  TIOFeatures fIOFeatures; ///< IO features for newly-created baskets.
120  Int_t fOffset; ///< Offset of this branch
121  Int_t fMaxBaskets; ///< Maximum number of Baskets so far
122  Int_t fNBaskets; ///<! Number of baskets in memory
123  Int_t fSplitLevel; ///< Branch split level
124  Int_t fNleaves; ///<! Number of leaves
125  Int_t fReadBasket; ///<! Current basket number when reading
126  Long64_t fReadEntry; ///<! Current entry number when reading
127  Long64_t fFirstBasketEntry; ///<! First entry in the current basket.
128  Long64_t fNextBasketEntry; ///<! Next entry that will requires us to go to the next basket
129  TBasket *fCurrentBasket; ///<! Pointer to the current basket.
130  Long64_t fEntries; ///< Number of entries
131  Long64_t fFirstEntry; ///< Number of the first entry in this branch
132  Long64_t fTotBytes; ///< Total number of bytes in all leaves before compression
133  Long64_t fZipBytes; ///< Total number of bytes in all leaves after compression
134  TObjArray fBranches; ///< -> List of Branches of this branch
135  TObjArray fLeaves; ///< -> List of leaves of this branch
136  TObjArray fBaskets; ///< -> List of baskets of this branch
137  Int_t *fBasketBytes; ///<[fMaxBaskets] Length of baskets on file
138  Long64_t *fBasketEntry; ///<[fMaxBaskets] Table of first entry in each basket
139  Long64_t *fBasketSeek; ///<[fMaxBaskets] Addresses of baskets on file
140  TTree *fTree; ///<! Pointer to Tree header
141  TBranch *fMother; ///<! Pointer to top-level parent branch in the tree.
142  TBranch *fParent; ///<! Pointer to parent branch.
143  char *fAddress; ///<! Address of 1st leaf (variable or object)
144  TDirectory *fDirectory; ///<! Pointer to directory where this branch buffers are stored
145  TString fFileName; ///< Name of file where buffers are stored ("" if in same file as Tree header)
146  TBuffer *fEntryBuffer; ///<! Buffer used to directly pass the content without streaming
147  TBuffer *fTransientBuffer; ///<! Pointer to the current transient buffer.
148  TList *fBrowsables; ///<! List of TVirtualBranchBrowsables used for Browse()
149  BulkObj fBulk; ///<! Helper for performing bulk IO
150 
151  Bool_t fSkipZip; ///<! After being read, the buffer will not be unzipped.
152 
154  CacheInfo_t fCacheInfo; ///<! Hold info about which basket are in the cache and if they have been retrieved from the cache.
155 
157  ReadLeaves_t fReadLeaves; ///<! Pointer to the ReadLeaves implementation to use.
159  FillLeaves_t fFillLeaves; ///<! Pointer to the FillLeaves implementation to use.
160  void ReadLeavesImpl(TBuffer &b);
161  void ReadLeaves0Impl(TBuffer &b);
162  void ReadLeaves1Impl(TBuffer &b);
163  void ReadLeaves2Impl(TBuffer &b);
164  void FillLeavesImpl(TBuffer &b);
165 
166  void SetSkipZip(Bool_t skip = kTRUE) { fSkipZip = skip; }
167  void Init(const char *name, const char *leaflist, Int_t compress);
168 
169  TBasket *GetFreshBasket(TBuffer *user_buffer);
171  Int_t WriteBasket(TBasket* basket, Int_t where) { return WriteBasketImpl(basket, where, nullptr); }
172 
173  TString GetRealFileName() const;
174 
175  virtual void SetAddressImpl(void *addr, Bool_t /* implied */) { SetAddress(addr); }
176 
177 private:
178  Int_t GetBasketAndFirst(TBasket*& basket, Long64_t& first, TBuffer* user_buffer);
179  TBasket *GetBasketImpl(Int_t basket, TBuffer* user_buffer);
181  Int_t GetEntriesSerialized(Long64_t N, TBuffer& user_buf) {return GetEntriesSerialized(N, user_buf, nullptr);}
183  Int_t FillEntryBuffer(TBasket* basket,TBuffer* buf, Int_t& lnew);
185  TBranch(const TBranch&) = delete; // not implemented
186  TBranch& operator=(const TBranch&) = delete; // not implemented
187 
188 public:
189  TBranch();
190  TBranch(TTree *tree, const char *name, void *address, const char *leaflist, Int_t basketsize=32000, Int_t compress = ROOT::RCompressionSetting::EAlgorithm::kInherit);
191  TBranch(TBranch *parent, const char *name, void *address, const char *leaflist, Int_t basketsize=32000, Int_t compress = ROOT::RCompressionSetting::EAlgorithm::kInherit);
192  virtual ~TBranch();
193 
194  virtual void AddBasket(TBasket &b, Bool_t ondisk, Long64_t startEntry);
195  virtual void AddLastBasket(Long64_t startEntry);
196  Int_t BackFill();
197  virtual void Browse(TBrowser *b);
198  virtual void DeleteBaskets(Option_t* option="");
199  virtual void DropBaskets(Option_t *option = "");
200  void ExpandBasketArrays();
201  Int_t Fill() { return FillImpl(nullptr); }
203  virtual TBranch *FindBranch(const char *name);
204  virtual TLeaf *FindLeaf(const char *name);
206  Int_t FlushOneBasket(UInt_t which);
207 
208  virtual char *GetAddress() const {return fAddress;}
209  TBasket *GetBasket(Int_t basket) {return GetBasketImpl(basket, nullptr);}
210  Int_t *GetBasketBytes() const {return fBasketBytes;}
212  virtual Long64_t GetBasketSeek(Int_t basket) const;
213  virtual Int_t GetBasketSize() const {return fBasketSize;}
215  virtual TList *GetBrowsables();
216  virtual const char* GetClassName() const;
218  Int_t GetCompressionLevel() const;
220  TDirectory *GetDirectory() const {return fDirectory;}
221  virtual Int_t GetEntry(Long64_t entry=0, Int_t getall = 0);
222  virtual Int_t GetEntryExport(Long64_t entry, Int_t getall, TClonesArray *list, Int_t n);
224  Int_t GetEvent(Long64_t entry=0) {return GetEntry(entry);}
225  TString GetFullName() const;
226  const char *GetIconName() const;
227  virtual Int_t GetExpectedType(TClass *&clptr,EDataType &type);
228  virtual TLeaf *GetLeaf(const char *name) const;
229  virtual TFile *GetFile(Int_t mode=0);
230  const char *GetFileName() const {return fFileName.Data();}
231  Int_t GetOffset() const {return fOffset;}
232  Int_t GetReadBasket() const {return fReadBasket;}
233  Long64_t GetReadEntry() const {return fReadEntry;}
235  Long64_t GetTotalSize(Option_t *option="") const;
236  Long64_t GetTotBytes(Option_t *option="") const;
237  Long64_t GetZipBytes(Option_t *option="") const;
239  Long64_t GetFirstEntry() const {return fFirstEntry; }
240  TIOFeatures GetIOFeatures() const;
244  Int_t GetMaxBaskets() const {return fMaxBaskets;}
245  Int_t GetNleaves() const {return fNleaves;}
246  Int_t GetSplitLevel() const {return fSplitLevel;}
247  Long64_t GetEntries() const {return fEntries;}
248  TTree *GetTree() const {return fTree;}
249  virtual Int_t GetRow(Int_t row);
250  virtual Bool_t GetMakeClass() const;
251  TBranch *GetMother() const;
252  TBranch *GetSubBranch(const TBranch *br) const;
254  Bool_t IsAutoDelete() const;
255  Bool_t IsFolder() const;
256  virtual void KeepCircular(Long64_t maxEntries);
257  virtual Int_t LoadBaskets();
258  virtual void Print(Option_t *option="") const;
259  void PrintCacheInfo() const;
260  virtual void ReadBasket(TBuffer &b);
261  virtual void Refresh(TBranch *b);
262  virtual void Reset(Option_t *option="");
263  virtual void ResetAfterMerge(TFileMergeInfo *);
264  virtual void ResetAddress();
265  virtual void ResetReadEntry() {fReadEntry = -1;}
266  virtual void SetAddress(void *add);
267  virtual void SetObject(void *objadd);
268  virtual void SetAutoDelete(Bool_t autodel=kTRUE);
269  virtual void SetBasketSize(Int_t buffsize);
270  virtual void SetBufferAddress(TBuffer *entryBuffer);
274  virtual void SetEntries(Long64_t entries);
275  virtual void SetEntryOffsetLen(Int_t len, Bool_t updateSubBranches = kFALSE);
276  virtual void SetFirstEntry( Long64_t entry );
277  virtual void SetFile(TFile *file=0);
278  virtual void SetFile(const char *filename);
279  void SetIOFeatures(TIOFeatures &features) {fIOFeatures = features;}
280  virtual Bool_t SetMakeClass(Bool_t decomposeObj = kTRUE);
281  virtual void SetOffset(Int_t offset=0) {fOffset=offset;}
282  virtual void SetStatus(Bool_t status=1);
283  virtual void SetTree(TTree *tree) { fTree = tree;}
284  virtual void SetupAddresses();
285  Bool_t SupportsBulkRead() const;
286  virtual void UpdateAddress() {;}
287  virtual void UpdateFile();
288 
289  static void ResetCount();
290 
291  ClassDef(TBranch, 13); // Branch descriptor
292 };
293 
294 //______________________________________________________________________________
296 {
297  return (fCompress < 0) ? -1 : fCompress / 100;
298 }
299 
300 //______________________________________________________________________________
302 {
303  return (fCompress < 0) ? -1 : fCompress % 100;
304 }
305 
306 //______________________________________________________________________________
308 {
309  return (fCompress < 0) ? -1 : fCompress;
310 }
311 
312 namespace ROOT {
313 namespace Experimental {
314 namespace Internal {
315 
316 inline Int_t TBulkBranchRead::GetBulkEntries(Long64_t evt, TBuffer& user_buf) { return fParent.GetBulkEntries(evt, user_buf); }
318 inline Int_t TBulkBranchRead::GetEntriesSerialized(Long64_t evt, TBuffer& user_buf, TBuffer* count_buf) { return fParent.GetEntriesSerialized(evt, user_buf, count_buf); }
320 
321 } // Internal
322 } // Experimental
323 } // ROOT
324 
325 #endif
TBranch::ExpandBasketArrays
void ExpandBasketArrays()
Increase BasketEntry buffer of a minimum of 10 locations and a maximum of 50 per cent of current size...
Definition: TBranch.cxx:804
TBranch::fNleaves
Int_t fNleaves
! Number of leaves
Definition: TBranch.h:124
TBranch::GetCompressionAlgorithm
Int_t GetCompressionAlgorithm() const
Definition: TBranch.h:295
TBranch::ResetAddress
virtual void ResetAddress()
Reset the address of the branch.
Definition: TBranch.cxx:2483
TBranch::GetReadBasket
Int_t GetReadBasket() const
Definition: TBranch.h:232
TBranch::GetBasketBytes
Int_t * GetBasketBytes() const
Definition: TBranch.h:210
TBranch::fCacheInfo
CacheInfo_t fCacheInfo
! Hold info about which basket are in the cache and if they have been retrieved from the cache.
Definition: TBranch.h:154
TBranch::FillLeavesImpl
void FillLeavesImpl(TBuffer &b)
Loop on all leaves of this branch to fill Basket buffer.
Definition: TBranch.cxx:2328
TBranch::GetBasketAndFirst
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:1328
Compression.h
n
const Int_t n
Definition: legend1.C:16
TFileMergeInfo
Definition: TFileMergeInfo.h:42
TBranch::fBasketSize
Int_t fBasketSize
Initial Size of Basket Buffer.
Definition: TBranch.h:114
TBranch::GetNleaves
Int_t GetNleaves() const
Definition: TBranch.h:245
TBranch::fOffset
Int_t fOffset
Offset of this branch.
Definition: TBranch.h:120
TBranch::GetEntryOffsetLen
Int_t GetEntryOffsetLen() const
Definition: TBranch.h:223
ROOT::Experimental::Internal::TBulkBranchRead::GetEntriesSerialized
Int_t GetEntriesSerialized(Long64_t evt, TBuffer &user_buf)
Definition: TBranch.h:317
TBranch::GetOffset
Int_t GetOffset() const
Definition: TBranch.h:231
first
Definition: first.py:1
TBrowser
Definition: TBrowser.h:37
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
TBranch::SetBufferAddress
virtual void SetBufferAddress(TBuffer *entryBuffer)
Set address of this branch directly from a TBuffer to avoid streaming.
Definition: TBranch.cxx:2577
TBranch::GetLeaf
virtual TLeaf * GetLeaf(const char *name) const
Return pointer to the 1st Leaf named name in thisBranch.
Definition: TBranch.cxx:1902
TBranch::IsAutoDelete
Bool_t IsAutoDelete() const
Return kTRUE if an existing object in a TBranchObject must be deleted.
Definition: TBranch.cxx:2095
TObjArray
Definition: TObjArray.h:37
TBranch::fLeaves
TObjArray fLeaves
-> List of leaves of this branch
Definition: TBranch.h:135
TBranch::FillEntryBuffer
Int_t FillEntryBuffer(TBasket *basket, TBuffer *buf, Int_t &lnew)
Copy the data from fEntryBuffer into the current basket.
Definition: TBranch.cxx:914
TBranch::FindBranch
virtual TBranch * FindBranch(const char *name)
Find the immediate sub-branch with passed name.
Definition: TBranch.cxx:1014
TBranch::GetZipBytes
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:2070
ROOT::RCompressionSetting::ELevel::kUseMin
@ kUseMin
Compression level reserved when we are not sure what to use (1 is for the fastest compression)
Definition: Compression.h:80
TBranch::GetMaxBaskets
Int_t GetMaxBaskets() const
Definition: TBranch.h:244
TBranch::GetEntryExport
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:1638
TBranch::GetEntriesSerialized
Int_t GetEntriesSerialized(Long64_t N, TBuffer &user_buf)
Definition: TBranch.h:181
ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault
@ kUseCompiledDefault
Use the compile-time default setting.
Definition: Compression.h:74
TBranch::GetBulkRead
ROOT::Experimental::Internal::TBulkBranchRead & GetBulkRead()
Definition: TBranch.h:214
TBranchElement
Definition: TBranchElement.h:39
TBranch::GetSplitLevel
Int_t GetSplitLevel() const
Definition: TBranch.h:246
ROOT::Experimental::Internal::TBulkBranchRead
Definition: TBranch.h:68
TBranch::SetMakeClass
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:2759
TBranch::UpdateAddress
virtual void UpdateAddress()
Definition: TBranch.h:286
TString::Data
const char * Data() const
Definition: TString.h:369
TBranch::fIOFeatures
TIOFeatures fIOFeatures
IO features for newly-created baskets.
Definition: TBranch.h:119
tree
Definition: tree.py:1
TBranch::GetIconName
const char * GetIconName() const
Return icon name depending on type of branch.
Definition: TBranch.cxx:1311
TBranch::GetFreshBasket
TBasket * GetFreshBasket(TBuffer *user_buffer)
Return a fresh basket by either resusing an existing basket that needs to be drop (according to TTree...
Definition: TBranch.cxx:1767
TBranch::fReadEntry
Long64_t fReadEntry
! Current entry number when reading
Definition: TBranch.h:126
TBranch::GetListOfBranches
TObjArray * GetListOfBranches()
Definition: TBranch.h:242
TBranch::fReadLeaves
ReadLeaves_t fReadLeaves
! Pointer to the ReadLeaves implementation to use.
Definition: TBranch.h:157
TBranch::AddBasket
virtual void AddBasket(TBasket &b, Bool_t ondisk, Long64_t startEntry)
Add the basket to this branch.
Definition: TBranch.cxx:535
TNamed.h
Long64_t
long long Long64_t
Definition: RtypesCore.h:73
TBranch::GetReadEntry
Long64_t GetReadEntry() const
Definition: TBranch.h:233
TBranch::GetMakeClass
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:1964
TBranch::SetFirstEntry
virtual void SetFirstEntry(Long64_t entry)
set the first entry number (case of TBranchSTL)
Definition: TBranch.cxx:3107
TBranch::fZipBytes
Long64_t fZipBytes
Total number of bytes in all leaves after compression.
Definition: TBranch.h:133
TTree
Definition: TTree.h:79
TBranch::GetSubBranch
TBranch * GetSubBranch(const TBranch *br) const
Find the parent branch of child.
Definition: TBranch.cxx:1995
TBranch::fBranches
TObjArray fBranches
-> List of Branches of this branch
Definition: TBranch.h:134
TBranch::GetTransientBuffer
TBuffer * GetTransientBuffer(Int_t size)
Returns the transient buffer currently used by this TBranch for reading/writing baskets.
Definition: TBranch.cxx:513
TBranch::SupportsBulkRead
Bool_t SupportsBulkRead() const
Returns true if this branch supports bulk IO, false otherwise.
Definition: TBranch.cxx:1403
TBranch::GetListOfBaskets
TObjArray * GetListOfBaskets()
Definition: TBranch.h:241
TBranch::SetEntries
virtual void SetEntries(Long64_t entries)
Set the number of entries in this branch.
Definition: TBranch.cxx:2670
TBranch::GetFirstEntry
Long64_t GetFirstEntry() const
Definition: TBranch.h:239
TBranch::fEntryOffsetLen
Int_t fEntryOffsetLen
Initial Length of fEntryOffset table in the basket buffers.
Definition: TBranch.h:115
TBranch::GetBrowsables
virtual TList * GetBrowsables()
Returns (and, if 0, creates) browsable objects for this branch See TVirtualBranchBrowsable::FillListO...
Definition: TBranch.cxx:1291
Int_t
int Int_t
Definition: RtypesCore.h:45
kBranchObject
const Int_t kBranchObject
Definition: TBranch.h:58
TBranch::SetAddressImpl
virtual void SetAddressImpl(void *addr, Bool_t)
Definition: TBranch.h:175
N
#define N
TBranch::ResetReadEntry
virtual void ResetReadEntry()
Definition: TBranch.h:265
TBranch::GetIOFeatures
TIOFeatures GetIOFeatures() const
Returns the IO settings currently in use for this branch.
Definition: TBranch.cxx:2087
kBranchAny
const Int_t kBranchAny
Definition: TBranch.h:59
ROOT::Experimental::Internal::TBulkBranchRead::TBulkBranchRead
TBulkBranchRead(TBranch &parent)
Definition: TBranch.h:79
TIOFeatures.hxx
TBranch::GetRealFileName
TString GetRealFileName() const
Get real file name.
Definition: TBranch.cxx:1915
TBranch::kBranchObject
@ kBranchObject
Definition: TBranch.h:103
TBranch::LoadBaskets
virtual Int_t LoadBaskets()
Baskets associated to this branch are forced to be in memory.
Definition: TBranch.cxx:2141
TBuffer
Definition: TBuffer.h:43
ROOT::TIOFeatures
Definition: TIOFeatures.hxx:69
TBranch::kIsClone
@ kIsClone
Definition: TBranch.h:102
TBranch::ReadLeavesImpl
void ReadLeavesImpl(TBuffer &b)
Loop on all leaves of this branch to read Basket buffer.
Definition: TBranch.cxx:2293
TBranch::GetClassName
virtual const char * GetClassName() const
Return the name of the user class whose content is stored in this branch, if any.
Definition: TBranch.cxx:1303
TBranch::IsFolder
Bool_t IsFolder() const
Return kTRUE if more than one leaf or browsables, kFALSE otherwise.
Definition: TBranch.cxx:2103
TString
Definition: TString.h:136
TBranch::SetIOFeatures
void SetIOFeatures(TIOFeatures &features)
Definition: TBranch.h:279
TBranch::ReadLeaves1Impl
void ReadLeaves1Impl(TBuffer &b)
Read one leaf without the overhead of a loop.
Definition: TBranch.cxx:2311
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
TBranch::GetBasketEntry
Long64_t * GetBasketEntry() const
Definition: TBranch.h:211
TBranch::GetEvent
Int_t GetEvent(Long64_t entry=0)
Definition: TBranch.h:224
kDoNotProcess
const Int_t kDoNotProcess
Definition: TBranch.h:56
b
#define b(i)
Definition: RSha256.hxx:118
TBranchCacheInfo.h
TBranch::fFileName
TString fFileName
Name of file where buffers are stored ("" if in same file as Tree header)
Definition: TBranch.h:145
bool
ROOT::Experimental::Internal::TBulkBranchRead::fParent
TBranch & fParent
Definition: TBranch.h:83
TBranch::fParent
TBranch * fParent
! Pointer to parent branch.
Definition: TBranch.h:142
TBranch::SetCompressionAlgorithm
void SetCompressionAlgorithm(Int_t algorithm=ROOT::RCompressionSetting::EAlgorithm::kUseGlobal)
Set compression algorithm.
Definition: TBranch.cxx:2595
ROOT::Internal::TBranchCacheInfo
Definition: TBranchCacheInfo.h:35
TBranch::fgCount
static Int_t fgCount
! branch counter
Definition: TBranch.h:112
TBranch::GetTotBytes
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:2052
TBranch::kDoNotUseBufferMap
@ kDoNotUseBufferMap
Definition: TBranch.h:108
TBranch::kAutoDelete
@ kAutoDelete
Definition: TBranch.h:106
TBranch::KeepCircular
virtual void KeepCircular(Long64_t maxEntries)
keep a maximum of fMaxEntries in memory
Definition: TBranch.cxx:2115
TBranch::FlushBaskets
Int_t FlushBaskets()
Flush to disk all the baskets of this branch and any of subbranches.
Definition: TBranch.cxx:1115
TBranch::fTransientBuffer
TBuffer * fTransientBuffer
! Pointer to the current transient buffer.
Definition: TBranch.h:147
TBranch::fEntries
Long64_t fEntries
Number of entries.
Definition: TBranch.h:130
TBranch::fCompress
Int_t fCompress
Compression level and algorithm.
Definition: TBranch.h:113
TBranch::Fill
Int_t Fill()
Definition: TBranch.h:201
TBranch
Definition: TBranch.h:89
TBranch::GetBulkEntries
Int_t GetBulkEntries(Long64_t, TBuffer &)
Read as many events as possible into the given buffer, using zero-copy mechanisms.
Definition: TBranch.cxx:1428
TBranch::SetSkipZip
void SetSkipZip(Bool_t skip=kTRUE)
Definition: TBranch.h:166
TBranch::fBaskets
TObjArray fBaskets
-> List of baskets of this branch
Definition: TBranch.h:136
TBranch::Init
void Init(const char *name, const char *leaflist, Int_t compress)
Definition: TBranch.cxx:297
TBranch::fNextBasketEntry
Long64_t fNextBasketEntry
! Next entry that will requires us to go to the next basket
Definition: TBranch.h:128
TBranch::GetExpectedType
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:1710
TDataType.h
Option_t
const typedef char Option_t
Definition: RtypesCore.h:66
TBranch::fFillLeaves
FillLeaves_t fFillLeaves
! Pointer to the FillLeaves implementation to use.
Definition: TBranch.h:159
TBranch::fTotBytes
Long64_t fTotBytes
Total number of bytes in all leaves before compression.
Definition: TBranch.h:132
TAttFill.h
TBranch::SetOffset
virtual void SetOffset(Int_t offset=0)
Definition: TBranch.h:281
TBranch::fMaxBaskets
Int_t fMaxBaskets
Maximum number of Baskets so far.
Definition: TBranch.h:121
TBranch::GetFreshCluster
TBasket * GetFreshCluster()
Drops the cluster two behind the current cluster and returns a fresh basket by either reusing or crea...
Definition: TBranch.cxx:1821
TBranch::GetFile
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:1729
TBranch::fWriteBasket
Int_t fWriteBasket
Last basket number written.
Definition: TBranch.h:116
TBranch::SetStatus
virtual void SetStatus(Bool_t status=1)
Set branch status to Process or DoNotProcess.
Definition: TBranch.cxx:2779
TBranch::GetBasketSeek
virtual Long64_t GetBasketSeek(Int_t basket) const
Return address of basket in the file.
Definition: TBranch.cxx:1281
TBranch::FindLeaf
virtual TLeaf * FindLeaf(const char *name)
Find the leaf corresponding to the name 'searchname'.
Definition: TBranch.cxx:1060
TBranch::SetCompressionLevel
void SetCompressionLevel(Int_t level=ROOT::RCompressionSetting::ELevel::kUseMin)
Set compression level.
Definition: TBranch.cxx:2615
TBranch::fTree
TTree * fTree
! Pointer to Tree header
Definition: TBranch.h:140
TLeaf
Definition: TLeaf.h:57
TBranch::ReadLeaves0Impl
void ReadLeaves0Impl(TBuffer &b)
Read zero leaves without the overhead of a loop.
Definition: TBranch.cxx:2304
TTreeCloner
Definition: TTreeCloner.h:29
TNamed
Definition: TNamed.h:29
ROOT::Experimental::Internal::TBulkBranchRead::GetBulkEntries
Int_t GetBulkEntries(Long64_t evt, TBuffer &user_buf)
Definition: TBranch.h:316
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
TBranch::SetTree
virtual void SetTree(TTree *tree)
Definition: TBranch.h:283
TBranch::SetAutoDelete
virtual void SetAutoDelete(Bool_t autodel=kTRUE)
Set the automatic delete bit.
Definition: TBranch.cxx:2548
TBranch::GetEntry
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:1582
TBranch::fBasketSeek
Long64_t * fBasketSeek
[fMaxBaskets] Addresses of baskets on file
Definition: TBranch.h:139
TBranch::Refresh
virtual void Refresh(TBranch *b)
Refresh this branch using new information in b This function is called by TTree::Refresh.
Definition: TBranch.cxx:2340
TBranch::GetCompressionLevel
Int_t GetCompressionLevel() const
Definition: TBranch.h:301
BIT
#define BIT(n)
Definition: Rtypes.h:85
TBranch::ReadBasket
virtual void ReadBasket(TBuffer &b)
Loop on all leaves of this branch to read Basket buffer.
Definition: TBranch.cxx:2285
UInt_t
unsigned int UInt_t
Definition: RtypesCore.h:46
TBranch::fDirectory
TDirectory * fDirectory
! Pointer to directory where this branch buffers are stored
Definition: TBranch.h:144
TBranch::SetupAddresses
virtual void SetupAddresses()
If the branch address is not set, we set all addresses starting with the top level parent branch.
Definition: TBranch.cxx:3122
TBranch::FillImpl
virtual Int_t FillImpl(ROOT::Internal::TBranchIMTHelper *)
Loop on all leaves of this branch to fill Basket buffer.
Definition: TBranch.cxx:835
TBranch::ResetAfterMerge
virtual void ResetAfterMerge(TFileMergeInfo *)
Reset a Branch.
Definition: TBranch.cxx:2430
TBranch::Print
virtual void Print(Option_t *option="") const
Print TBranch parameters.
Definition: TBranch.cxx:2173
TBranch::GetTotalSize
Long64_t GetTotalSize(Option_t *option="") const
Return total number of bytes in the branch (including current buffer)
Definition: TBranch.cxx:2033
kIsClone
const Int_t kIsClone
Definition: TBranch.h:57
TBranch::SetAddress
virtual void SetAddress(void *add)
Set address of this branch.
Definition: TBranch.cxx:2514
ROOT::RCompressionSetting::EAlgorithm::kUseGlobal
@ kUseGlobal
Use the global compression algorithm.
Definition: Compression.h:100
TBranch::GetBasketSize
virtual Int_t GetBasketSize() const
Definition: TBranch.h:213
TBranch::PrintCacheInfo
void PrintCacheInfo() const
Print the information we have about which basket is currently cached and whether they have been 'used...
Definition: TBranch.cxx:2277
void
typedef void((*Func_t)())
TBranch::fAddress
char * fAddress
! Address of 1st leaf (variable or object)
Definition: TBranch.h:143
TFile
Definition: TFile.h:54
TBranch::SetFile
virtual void SetFile(TFile *file=0)
Set file where this branch writes/reads its buffers.
Definition: TBranch.cxx:2695
TBranch::fReadBasket
Int_t fReadBasket
! Current basket number when reading
Definition: TBranch.h:125
TBranch::fEntryBuffer
TBuffer * fEntryBuffer
! Buffer used to directly pass the content without streaming
Definition: TBranch.h:146
TBranch::fBrowsables
TList * fBrowsables
! List of TVirtualBranchBrowsables used for Browse()
Definition: TBranch.h:148
TBranch::ResetCount
static void ResetCount()
Static function resetting fgCount.
Definition: TBranch.cxx:2506
TBranch::Reset
virtual void Reset(Option_t *option="")
Reset a Branch.
Definition: TBranch.cxx:2389
TBranch::GetDirectory
TDirectory * GetDirectory() const
Definition: TBranch.h:220
TBranch::UpdateFile
virtual void UpdateFile()
Refresh the value of fDirectory (i.e.
Definition: TBranch.cxx:3132
TBranch::GetMother
TBranch * GetMother() const
Get our top-level parent branch in the tree.
Definition: TBranch.cxx:1974
TBasket
Definition: TBasket.h:34
TTreeCache
A cache to speed-up the reading of ROOT datasets.
Definition: TTreeCache.h:32
TBranch::ReadLeaves2Impl
void ReadLeaves2Impl(TBuffer &b)
Read two leaves without the overhead of a loop.
Definition: TBranch.cxx:2319
TBranch::BackFill
Int_t BackFill()
Loop on all leaves of this branch to back fill Basket buffer.
Definition: TBranch.cxx:659
TBranch::TIOFeatures
ROOT::TIOFeatures TIOFeatures
Definition: TBranch.h:90
TBranch::fBulk
BulkObj fBulk
! Helper for performing bulk IO
Definition: TBranch.h:149
TBranch::GetEntryNumber
Long64_t GetEntryNumber() const
Definition: TBranch.h:238
TObjArray.h
TClass
Definition: TClass.h:80
file
Definition: file.py:1
EDataType
EDataType
Definition: TDataType.h:28
TBranch::fNBaskets
Int_t fNBaskets
! Number of baskets in memory
Definition: TBranch.h:122
ROOT::Internal::TBranchIMTHelper
Definition: TBranchIMTHelper.h:38
TBranch::operator=
TBranch & operator=(const TBranch &)=delete
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TBranch::~TBranch
virtual ~TBranch()
Destructor.
Definition: TBranch.cxx:442
TBranch::GetWriteBasket
Int_t GetWriteBasket() const
Definition: TBranch.h:234
TBranch::fFirstBasketEntry
Long64_t fFirstBasketEntry
! First entry in the current basket.
Definition: TBranch.h:127
name
char name[80]
Definition: TGX11.cxx:110
TBranch::GetAddress
virtual char * GetAddress() const
Definition: TBranch.h:208
TBranch::FillLeaves_t
void(TBranch::* FillLeaves_t)(TBuffer &b)
Definition: TBranch.h:158
TBranch::fBasketBytes
Int_t * fBasketBytes
[fMaxBaskets] Length of baskets on file
Definition: TBranch.h:137
TBranch::AddLastBasket
virtual void AddLastBasket(Long64_t startEntry)
Add the start entry of the write basket (not yet created)
Definition: TBranch.cxx:601
TDirectory
Definition: TDirectory.h:40
TBranch::SetObject
virtual void SetObject(void *objadd)
Set object this branch is pointing to.
Definition: TBranch.cxx:2768
TBranch::fSkipZip
Bool_t fSkipZip
! After being read, the buffer will not be unzipped.
Definition: TBranch.h:151
TBranch::ReadLeaves_t
void(TBranch::* ReadLeaves_t)(TBuffer &b)
Definition: TBranch.h:156
TBranch::fFirstEntry
Long64_t fFirstEntry
Number of the first entry in this branch.
Definition: TBranch.h:131
TBranch::WriteBasket
Int_t WriteBasket(TBasket *basket, Int_t where)
Definition: TBranch.h:171
TBranch::DropBaskets
virtual void DropBaskets(Option_t *option="")
Loop on all branch baskets.
Definition: TBranch.cxx:736
TBranch::Browse
virtual void Browse(TBrowser *b)
Browser interface.
Definition: TBranch.cxx:678
ROOT::Experimental::Internal::TBulkBranchRead::SupportsBulkRead
Bool_t SupportsBulkRead() const
Definition: TBranch.h:319
TBranch::FlushOneBasket
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:1161
TAttFill
Definition: TAttFill.h:19
type
int type
Definition: TGX11.cxx:121
TBranch::GetFullName
TString GetFullName() const
Return the 'full' name of the branch.
Definition: TBranch.cxx:1886
TBranch::WriteBasketImpl
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:3031
TBranch::kDoNotProcess
@ kDoNotProcess
Definition: TBranch.h:101
TBranch::fBasketEntry
Long64_t * fBasketEntry
[fMaxBaskets] Table of first entry in each basket
Definition: TBranch.h:138
TBranch::GetListOfLeaves
TObjArray * GetListOfLeaves()
Definition: TBranch.h:243
TBranch::GetTree
TTree * GetTree() const
Definition: TBranch.h:248
TBranch::GetBasket
TBasket * GetBasket(Int_t basket)
Definition: TBranch.h:209
TBranch::GetFileName
const char * GetFileName() const
Definition: TBranch.h:230
TBranch::fExtraBasket
TBasket * fExtraBasket
! Allocated basket not currently holding any data.
Definition: TBranch.h:118
TBranch::fMother
TBranch * fMother
! Pointer to top-level parent branch in the tree.
Definition: TBranch.h:141
TClonesArray
Definition: TClonesArray.h:29
TBranch::fSplitLevel
Int_t fSplitLevel
Branch split level.
Definition: TBranch.h:123
TBranch::GetEntries
Long64_t GetEntries() const
Definition: TBranch.h:247
ROOT
VSD Structures.
Definition: StringConv.hxx:21
TBranch::DeleteBaskets
virtual void DeleteBaskets(Option_t *option="")
Loop on all branch baskets.
Definition: TBranch.cxx:705
TBranch::fCurrentBasket
TBasket * fCurrentBasket
! Pointer to the current basket.
Definition: TBranch.h:129
TBranch::kBranchAny
@ kBranchAny
Definition: TBranch.h:104
TObject::EStatusBits
EStatusBits
Definition: TObject.h:57
ROOT::RCompressionSetting::EAlgorithm::kInherit
@ kInherit
Some objects use this value to denote that the compression algorithm should be inherited from the par...
Definition: Compression.h:98
TBranch::SetBasketSize
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:2561
TBranch::SetEntryOffsetLen
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:2653
TList
Definition: TList.h:44
TBranch::GetRow
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:1955
TBranch::fEntryNumber
Long64_t fEntryNumber
Current entry number (last one filled in this branch)
Definition: TBranch.h:117
int
TBranch::TBranch
TBranch()
Default constructor. Used for I/O by default.
Definition: TBranch.cxx:86
TBranch::GetCompressionSettings
Int_t GetCompressionSettings() const
Definition: TBranch.h:307
kMapObject
const Int_t kMapObject
Definition: TBranch.h:60
TBranch::SetCompressionSettings
void SetCompressionSettings(Int_t settings=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault)
Set compression settings.
Definition: TBranch.cxx:2637
TBranch::GetBasketImpl
TBasket * GetBasketImpl(Int_t basket, TBuffer *user_buffer)
Return pointer to basket basketnumber in this Branch.
Definition: TBranch.cxx:1205