Logo ROOT   master
Reference Guide
TTree.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_TTree
13 #define ROOT_TTree
14 
15 //////////////////////////////////////////////////////////////////////////
16 // //
17 // TTree //
18 // //
19 // A TTree object is a list of TBranch. //
20 // To Create a TTree object one must: //
21 // - Create the TTree header via the TTree constructor //
22 // - Call the TBranch constructor for every branch. //
23 // //
24 // To Fill this object, use member function Fill with no parameters. //
25 // The Fill function loops on all defined TBranch. //
26 // //
27 //////////////////////////////////////////////////////////////////////////
28 
29 #include "Compression.h"
30 #include "ROOT/TIOFeatures.hxx"
31 #include "TArrayD.h"
32 #include "TArrayI.h"
33 #include "TAttFill.h"
34 #include "TAttLine.h"
35 #include "TAttMarker.h"
36 #include "TBranch.h"
37 #include "TBuffer.h"
38 #include "TClass.h"
39 #include "TDataType.h"
40 #include "TDirectory.h"
41 #include "TObjArray.h"
42 #include "TVirtualTreePlayer.h"
43 
44 #include <array>
45 #include <atomic>
46 
47 
48 class TBranch;
49 class TBrowser;
50 class TFile;
51 class TLeaf;
52 class TH1;
53 class TTreeFormula;
54 class TPolyMarker;
55 class TEventList;
56 class TEntryList;
57 class TList;
58 class TSQLResult;
59 class TSelector;
60 class TPrincipal;
61 class TFriendElement;
62 class TCut;
63 class TVirtualIndex;
64 class TBranchRef;
65 class TBasket;
66 class TStreamerInfo;
67 class TTreeCache;
68 class TTreeCloner;
69 class TFileMergeInfo;
70 class TVirtualPerfStats;
71 
72 class TTree : public TNamed, public TAttLine, public TAttFill, public TAttMarker {
73 
75 
76 protected:
77  Long64_t fEntries; ///< Number of entries
78 // NOTE: cannot use std::atomic for these counters as it cannot be serialized.
79  Long64_t fTotBytes; ///< Total number of bytes in all branches before compression
80  Long64_t fZipBytes; ///< Total number of bytes in all branches after compression
81  Long64_t fSavedBytes; ///< Number of autosaved bytes
82  Long64_t fFlushedBytes; ///< Number of auto-flushed bytes
83  Double_t fWeight; ///< Tree weight (see TTree::SetWeight)
84  Int_t fTimerInterval; ///< Timer interval in milliseconds
85  Int_t fScanField; ///< Number of runs before prompting in Scan
86  Int_t fUpdate; ///< Update frequency for EntryLoop
87  Int_t fDefaultEntryOffsetLen; ///< Initial Length of fEntryOffset table in the basket buffers
88  Int_t fNClusterRange; ///< Number of Cluster range in addition to the one defined by 'AutoFlush'
89  Int_t fMaxClusterRange; ///<! Memory allocated for the cluster range.
90  Long64_t fMaxEntries; ///< Maximum number of entries in case of circular buffers
91  Long64_t fMaxEntryLoop; ///< Maximum number of entries to process
92  Long64_t fMaxVirtualSize; ///< Maximum total size of buffers kept in memory
93  Long64_t fAutoSave; ///< Autosave tree when fAutoSave entries written or -fAutoSave (compressed) bytes produced
94  Long64_t fAutoFlush; ///< Auto-flush tree when fAutoFlush entries written or -fAutoFlush (compressed) bytes produced
95  Long64_t fEstimate; ///< Number of entries to estimate histogram limits
96  Long64_t *fClusterRangeEnd; ///<[fNClusterRange] Last entry of a cluster range.
97  Long64_t *fClusterSize; ///<[fNClusterRange] Number of entries in each cluster for a given range.
98  Long64_t fCacheSize; ///<! Maximum size of file buffers
99  Long64_t fChainOffset; ///<! Offset of 1st entry of this Tree in a TChain
100  Long64_t fReadEntry; ///<! Number of the entry being processed
101  std::atomic<Long64_t> fTotalBuffers; ///<! Total number of bytes in branch buffers
102  Int_t fPacketSize; ///<! Number of entries in one packet for parallel root
103  Int_t fNfill; ///<! Local for EntryLoop
104  Int_t fDebug; ///<! Debug level
105  Long64_t fDebugMin; ///<! First entry number to debug
106  Long64_t fDebugMax; ///<! Last entry number to debug
107  TIOFeatures fIOFeatures{0}; ///< IO features to define for newly-written baskets and branches.
108  Int_t fMakeClass; ///<! not zero when processing code generated by MakeClass
109  Int_t fFileNumber; ///<! current file number (if file extensions)
110  TObject *fNotify; ///<! Object to be notified when loading a Tree
111  TDirectory *fDirectory; ///<! Pointer to directory holding this tree
112  TObjArray fBranches; ///< List of Branches
113  TObjArray fLeaves; ///< Direct pointers to individual branch leaves
114  TList *fAliases; ///< List of aliases for expressions based on the tree branches.
115  TEventList *fEventList; ///<! Pointer to event selection list (if one)
116  TEntryList *fEntryList; ///<! Pointer to event selection list (if one)
117  TArrayD fIndexValues; ///< Sorted index values
118  TArrayI fIndex; ///< Index of sorted values
119  TVirtualIndex *fTreeIndex; ///< Pointer to the tree Index (if any)
120  TList *fFriends; ///< pointer to list of friend elements
121  TList *fExternalFriends; ///<! List of TFriendsElement pointing to us and need to be notified of LoadTree. Content not owned.
122  TVirtualPerfStats *fPerfStats; ///<! pointer to the current perf stats object
123  TList *fUserInfo; ///< pointer to a list of user objects associated to this Tree
124  TVirtualTreePlayer *fPlayer; ///<! Pointer to current Tree player
125  TList *fClones; ///<! List of cloned trees which share our addresses
126  TBranchRef *fBranchRef; ///< Branch supporting the TRefTable (if any)
127  UInt_t fFriendLockStatus; ///<! Record which method is locking the friend recursion
128  TBuffer *fTransientBuffer; ///<! Pointer to the current transient buffer.
129  Bool_t fCacheDoAutoInit; ///<! true if cache auto creation or resize check is needed
130  Bool_t fCacheDoClusterPrefetch;///<! true if cache is prefetching whole clusters
131  Bool_t fCacheUserSet; ///<! true if the cache setting was explicitly given by user
132  Bool_t fIMTEnabled; ///<! true if implicit multi-threading is enabled for this tree
133  UInt_t fNEntriesSinceSorting; ///<! Number of entries processed since the last re-sorting of branches
134  std::vector<std::pair<Long64_t,TBranch*>> fSortedBranches; ///<! Branches to be processed in parallel when IMT is on, sorted by average task time
135  std::vector<TBranch*> fSeqBranches; ///<! Branches to be processed sequentially when IMT is on
136  Float_t fTargetMemoryRatio{1.1f}; ///<! Ratio for memory usage in uncompressed buffers versus actual occupancy. 1.0
137  /// indicates basket should be resized to exact memory usage, but causes significant
138 /// memory churn.
139 #ifdef R__TRACK_BASKET_ALLOC_TIME
140  mutable std::atomic<ULong64_t> fAllocationTime{0}; ///<! Time spent reallocating basket memory buffers, in microseconds.
141 #endif
142  mutable std::atomic<UInt_t> fAllocationCount{0}; ///<! Number of reallocations basket memory buffers.
143 
144  static Int_t fgBranchStyle; ///< Old/New branch style
145  static Long64_t fgMaxTreeSize; ///< Maximum size of a file containing a Tree
146 
147 private:
148  // For simplicity, although fIMTFlush is always disabled in non-IMT builds, we don't #ifdef it out.
149  mutable Bool_t fIMTFlush{false}; ///<! True if we are doing a multithreaded flush.
150  mutable std::atomic<Long64_t> fIMTTotBytes; ///<! Total bytes for the IMT flush baskets
151  mutable std::atomic<Long64_t> fIMTZipBytes; ///<! Zip bytes for the IMT flush baskets.
152 
153  void InitializeBranchLists(bool checkLeafCount);
154  void SortBranchesByTime();
155  Int_t FlushBasketsImpl() const;
156  void MarkEventCluster();
157 
158 protected:
159  virtual void KeepCircular();
160  virtual TBranch *BranchImp(const char* branchname, const char* classname, TClass* ptrClass, void* addobj, Int_t bufsize, Int_t splitlevel);
161  virtual TBranch *BranchImp(const char* branchname, TClass* ptrClass, void* addobj, Int_t bufsize, Int_t splitlevel);
162  virtual TBranch *BranchImpRef(const char* branchname, const char* classname, TClass* ptrClass, void* addobj, Int_t bufsize, Int_t splitlevel);
163  virtual TBranch *BranchImpRef(const char* branchname, TClass* ptrClass, EDataType datatype, void* addobj, Int_t bufsize, Int_t splitlevel);
164  virtual TBranch *BranchImpArr(const char* branchname, EDataType datatype, std::size_t N, void* addobj, Int_t bufsize, Int_t splitlevel);
165  virtual Int_t CheckBranchAddressType(TBranch* branch, TClass* ptrClass, EDataType datatype, Bool_t ptr);
166  virtual TBranch *BronchExec(const char* name, const char* classname, void* addobj, Bool_t isptrptr, Int_t bufsize, Int_t splitlevel);
167  friend TBranch *TTreeBranchImpRef(TTree *tree, const char* branchname, TClass* ptrClass, EDataType datatype, void* addobj, Int_t bufsize, Int_t splitlevel);
168  Int_t SetBranchAddressImp(TBranch *branch, void* addr, TBranch** ptr);
169  virtual TLeaf *GetLeafImpl(const char* branchname, const char* leafname);
170 
171  Long64_t GetCacheAutoSize(Bool_t withDefault = kFALSE) const;
172  char GetNewlineValue(std::istream &inputStream);
173  void ImportClusterRanges(TTree *fromtree);
174  void MoveReadCache(TFile *src, TDirectory *dir);
175  Int_t SetCacheSizeAux(Bool_t autocache = kTRUE, Long64_t cacheSize = 0);
176 
177  class TFriendLock {
178  // Helper class to prevent infinite recursion in the
179  // usage of TTree Friends. Implemented in TTree.cxx.
180  TTree *fTree; // Pointer to the locked tree
181  UInt_t fMethodBit; // BIT for the locked method
182  Bool_t fPrevious; // Previous value of the BIT.
183 
184  protected:
185  TFriendLock(const TFriendLock&);
187 
188  public:
189  TFriendLock(TTree* tree, UInt_t methodbit);
190  ~TFriendLock();
191  };
192  friend class TFriendLock;
193  // So that the index class can use TFriendLock:
194  friend class TTreeIndex;
195  friend class TChainIndex;
196  // So that the TTreeCloner can access the protected interfaces
197  friend class TTreeCloner;
198 
199  // use to update fFriendLockStatus
209  kGetLeaf = BIT(8),
211  kPrint = BIT(10),
214  };
215 
216 public:
217  // Used as the max value for any TTree range operation.
219 
220  // SetBranchAddress return values
225  kMismatch = -2,
227  kMatch = 0,
231  kVoidPtr = 4,
233  };
234 
235  // TTree status bits
236  enum EStatusBits {
238  kCircular = BIT(12),
239  /// If set, the branch's buffers will grow until an event cluster boundary is hit,
240  /// guaranteeing a basket per cluster. This mode does not provide any guarantee on the
241  /// memory bounds in the case of extremely large events.
243  /// If set, signals that this TTree is the output of the processing of another TTree, and
244  /// the entries are reshuffled w.r.t. to the original TTree. As a safety measure, a TTree
245  /// with this bit set cannot add friends nor can be added as a friend. If you know what
246  /// you are doing, you can manually unset this bit with `ResetBit(EStatusBits::kEntriesReshuffled)`.
247  kEntriesReshuffled = BIT(19) // bits 15-18 are used by TChain
248  };
249 
250  // Split level modifier
251  enum {
253  };
254 
256  {
257  private:
258  TTree *fTree; // TTree upon which we are iterating.
259  Int_t fClusterRange; // Which cluster range are we looking at.
260  Long64_t fStartEntry; // Where does the cluster start.
261  Long64_t fNextEntry; // Where does the cluster end (exclusive).
262  Long64_t fEstimatedSize; // If positive, the calculated estimated tree size.
263 
265 
266  protected:
267  friend class TTree;
268  TClusterIterator(TTree *tree, Long64_t firstEntry);
269 
270  public:
271  // Intentionally used the default copy constructor and default destructor
272  // as the TClusterIterator does not own the TTree.
273  // TClusterIterator(const TClusterIterator&);
274  // ~TClusterIterator();
275 
276  // No public constructors, the iterator must be
277  // created via TTree::GetClusterIterator
278 
279  // Move on to the next cluster and return the starting entry
280  // of this next cluster
281  Long64_t Next();
282 
283  // Move on to the previous cluster and return the starting entry
284  // of this previous cluster
285  Long64_t Previous();
286 
287  // Return the start entry of the current cluster.
289  return fStartEntry;
290  }
291 
292  // Return the first entry of the next cluster.
294  return fNextEntry;
295  }
296 
297  Long64_t operator()() { return Next(); }
298  };
299 
300  TTree();
301  TTree(const char* name, const char* title, Int_t splitlevel = 99, TDirectory* dir = gDirectory);
302  virtual ~TTree();
303 
304  TTree(const TTree& tt) = delete;
305  TTree& operator=(const TTree& tt) = delete;
306 
307  virtual Int_t AddBranchToCache(const char *bname, Bool_t subbranches = kFALSE);
308  virtual Int_t AddBranchToCache(TBranch *branch, Bool_t subbranches = kFALSE);
309  virtual Int_t DropBranchFromCache(const char *bname, Bool_t subbranches = kFALSE);
310  virtual Int_t DropBranchFromCache(TBranch *branch, Bool_t subbranches = kFALSE);
311  void AddClone(TTree*);
312  virtual TFriendElement *AddFriend(const char* treename, const char* filename = "");
313  virtual TFriendElement *AddFriend(const char* treename, TFile* file);
314  virtual TFriendElement *AddFriend(TTree* tree, const char* alias = "", Bool_t warn = kFALSE);
315  // As the TBasket invokes Add{Tot,Zip}Bytes on its parent tree, we must do these updates in a thread-safe
316  // manner only when we are flushing multiple baskets in parallel.
317  virtual void AddTotBytes(Int_t tot) { if (fIMTFlush) { fIMTTotBytes += tot; } else { fTotBytes += tot; } }
318  virtual void AddZipBytes(Int_t zip) { if (fIMTFlush) { fIMTZipBytes += zip; } else { fZipBytes += zip; } }
319 // NOTE: these counters aren't thread safe like the ones above.
320 #ifdef R__TRACK_BASKET_ALLOC_TIME
321  void AddAllocationTime(ULong64_t time) { fAllocationTime += time; }
322 #endif
323  void AddAllocationCount(UInt_t count) { fAllocationCount += count; }
324  virtual Long64_t AutoSave(Option_t* option = "");
325 
326  /// Add a new branch, and infer the data type from the type of `obj` being passed.
327  ///
328  /// \note This and the next overload should cover most cases for creating a branch. Try to use these two whenever
329  /// possible, unless e.g. type conversions are needed.
330  ///
331  /// \param[in] name Name of the branch to be created.
332  /// \param[in] obj Address of the object to be added. Make sure to pass a pointer to the actual type/class that
333  /// should be stored in the tree (no pointers to base classes). When calling Fill(), the current value of the type/object will be saved.
334  /// \param[in] bufsize The buffer size in bytes for this branch. When the buffer is full, it is compressed and written to disc.
335  /// The default value of 32000 bytes and should be ok for most simple types. Larger buffers (e.g. 256000) if your Tree is not split and each entry is large (Megabytes).
336  /// A small value for bufsize is beneficial if entries in the Tree are accessed randomly and the Tree is in split mode.
337  /// \param[in] splitlevel If T is a class or struct and splitlevel > 0, the members of the object are serialised as separate branches.
338  /// \return Pointer to the TBranch that was created. The branch is owned by the tree.
339  template <class T> TBranch *Branch(const char* name, T* obj, Int_t bufsize = 32000, Int_t splitlevel = 99)
340  {
341  return BranchImpRef(name, TClass::GetClass<T>(), TDataType::GetType(typeid(T)), obj, bufsize, splitlevel);
342  }
343 
344  /// Add a new branch, and infer the data type from the array `addobj` being passed.
345  ///
346  /// \note This and the previous overload should cover most cases for creating a branch. Try to use these two whenever
347  /// possible, unless e.g. type conversions are needed.
348  ///
349  /// \param[in] name Name of the branch to be created.
350  /// \param[in] obj Array of the objects to be added. When calling Fill(), the current value of the type/object will be saved.
351  /// \param[in] bufsize he buffer size in bytes for this branch. When the buffer is full, it is compressed and written to disc.
352  /// The default value of 32000 bytes and should be ok for most simple types. Larger buffers (e.g. 256000) if your Tree is not split and each entry is large (Megabytes).
353  /// A small value for bufsize is beneficial if entries in the Tree are accessed randomly and the Tree is in split mode.
354  /// \param[in] splitlevel If T is a class or struct and splitlevel > 0, the members of the object are serialised as separate branches.
355  /// \return Pointer to the TBranch that was created. The branch is owned by the tree.
356  template <class T> TBranch *Branch(const char* name, T** addobj, Int_t bufsize = 32000, Int_t splitlevel = 99)
357  {
358  return BranchImp(name, TClass::GetClass<T>(), addobj, bufsize, splitlevel);
359  }
360 
361  virtual Int_t Branch(TCollection* list, Int_t bufsize = 32000, Int_t splitlevel = 99, const char* name = "");
362  virtual Int_t Branch(TList* list, Int_t bufsize = 32000, Int_t splitlevel = 99);
363  virtual Int_t Branch(const char* folder, Int_t bufsize = 32000, Int_t splitlevel = 99);
364  virtual TBranch *Branch(const char* name, void* address, const char* leaflist, Int_t bufsize = 32000);
365  TBranch *Branch(const char* name, char* address, const char* leaflist, Int_t bufsize = 32000)
366  {
367  // Overload to avoid confusion between this signature and the template instance.
368  return Branch(name,(void*)address,leaflist,bufsize);
369  }
370  TBranch *Branch(const char* name, Long_t address, const char* leaflist, Int_t bufsize = 32000)
371  {
372  // Overload to avoid confusion between this signature and the template instance.
373  return Branch(name,(void*)address,leaflist,bufsize);
374  }
375  TBranch *Branch(const char* name, int address, const char* leaflist, Int_t bufsize = 32000)
376  {
377  // Overload to avoid confusion between this signature and the template instance.
378  return Branch(name,(void*)(Long_t)address,leaflist,bufsize);
379  }
380  virtual TBranch *Branch(const char* name, const char* classname, void* addobj, Int_t bufsize = 32000, Int_t splitlevel = 99);
381  template <class T> TBranch *Branch(const char* name, const char* classname, T* obj, Int_t bufsize = 32000, Int_t splitlevel = 99)
382  {
383  // See BranchImpRed for details. Here we __ignore
384  return BranchImpRef(name, classname, TClass::GetClass<T>(), obj, bufsize, splitlevel);
385  }
386  template <class T> TBranch *Branch(const char* name, const char* classname, T** addobj, Int_t bufsize = 32000, Int_t splitlevel = 99)
387  {
388  // See BranchImp for details
389  return BranchImp(name, classname, TClass::GetClass<T>(), addobj, bufsize, splitlevel);
390  }
391  template <typename T, std::size_t N> TBranch *Branch(const char* name, std::array<T, N> *obj, Int_t bufsize = 32000, Int_t splitlevel = 99)
392  {
393  TClass *cl = TClass::GetClass<T>();
394  if (cl) {
395  TClass *arrCl = TClass::GetClass<std::array<T, N>>();
396  Error("Branch","std::array of objects not yet supported as top level branch object (the class is %s)",
397  arrCl ? arrCl->GetName() : cl->GetName());
398  return nullptr;
399  }
400  return BranchImpArr(name, TDataType::GetType(typeid(T)), N, obj, bufsize, splitlevel);
401  }
402  virtual TBranch *Bronch(const char* name, const char* classname, void* addobj, Int_t bufsize = 32000, Int_t splitlevel = 99);
403  virtual TBranch *BranchOld(const char* name, const char* classname, void* addobj, Int_t bufsize = 32000, Int_t splitlevel = 1);
404  virtual TBranch *BranchRef();
405  virtual void Browse(TBrowser*);
406  virtual Int_t BuildIndex(const char* majorname, const char* minorname = "0");
407  TStreamerInfo *BuildStreamerInfo(TClass* cl, void* pointer = 0, Bool_t canOptimize = kTRUE);
408  virtual TFile *ChangeFile(TFile* file);
409  virtual TTree *CloneTree(Long64_t nentries = -1, Option_t* option = "");
410  virtual void CopyAddresses(TTree*,Bool_t undo = kFALSE);
411  virtual Long64_t CopyEntries(TTree* tree, Long64_t nentries = -1, Option_t *option = "");
412  virtual TTree *CopyTree(const char* selection, Option_t* option = "", Long64_t nentries = kMaxEntries, Long64_t firstentry = 0);
413  virtual TBasket *CreateBasket(TBranch*);
414  virtual void DirectoryAutoAdd(TDirectory *);
415  Int_t Debug() const { return fDebug; }
416  virtual void Delete(Option_t* option = ""); // *MENU*
417  virtual void Draw(Option_t* opt) { Draw(opt, "", "", kMaxEntries, 0); }
418  virtual Long64_t Draw(const char* varexp, const TCut& selection, Option_t* option = "", Long64_t nentries = kMaxEntries, Long64_t firstentry = 0);
419  virtual Long64_t Draw(const char* varexp, const char* selection, Option_t* option = "", Long64_t nentries = kMaxEntries, Long64_t firstentry = 0); // *MENU*
420  virtual void DropBaskets();
421  virtual void DropBuffers(Int_t nbytes);
422  virtual Int_t Fill();
423  virtual TBranch *FindBranch(const char* name);
424  virtual TLeaf *FindLeaf(const char* name);
425  virtual Int_t Fit(const char* funcname, const char* varexp, const char* selection = "", Option_t* option = "", Option_t* goption = "", Long64_t nentries = kMaxEntries, Long64_t firstentry = 0); // *MENU*
426  virtual Int_t FlushBaskets(Bool_t create_cluster = true) const;
427  virtual const char *GetAlias(const char* aliasName) const;
429 #ifdef R__TRACK_BASKET_ALLOC_TIME
430  ULong64_t GetAllocationTime() const { return fAllocationTime; }
431 #endif
432  virtual Long64_t GetAutoFlush() const {return fAutoFlush;}
433  virtual Long64_t GetAutoSave() const {return fAutoSave;}
434  virtual TBranch *GetBranch(const char* name);
435  virtual TBranchRef *GetBranchRef() const { return fBranchRef; };
436  virtual Bool_t GetBranchStatus(const char* branchname) const;
437  static Int_t GetBranchStyle();
438  virtual Long64_t GetCacheSize() const { return fCacheSize; }
439  virtual TClusterIterator GetClusterIterator(Long64_t firstentry);
440  virtual Long64_t GetChainEntryNumber(Long64_t entry) const { return entry; }
441  virtual Long64_t GetChainOffset() const { return fChainOffset; }
443  TFile *GetCurrentFile() const;
445  Long64_t GetDebugMax() const { return fDebugMax; }
446  Long64_t GetDebugMin() const { return fDebugMin; }
447  TDirectory *GetDirectory() const { return fDirectory; }
448  virtual Long64_t GetEntries() const { return fEntries; }
449  virtual Long64_t GetEntries(const char *selection);
450  virtual Long64_t GetEntriesFast() const { return fEntries; }
451  virtual Long64_t GetEntriesFriend() const;
452  virtual Long64_t GetEstimate() const { return fEstimate; }
453  virtual Int_t GetEntry(Long64_t entry = 0, Int_t getall = 0);
454  Int_t GetEvent(Long64_t entry = 0, Int_t getall = 0) { return GetEntry(entry, getall); }
455  virtual Int_t GetEntryWithIndex(Int_t major, Int_t minor = 0);
456  virtual Long64_t GetEntryNumberWithBestIndex(Long64_t major, Long64_t minor = 0) const;
457  virtual Long64_t GetEntryNumberWithIndex(Long64_t major, Long64_t minor = 0) const;
458  TEventList *GetEventList() const { return fEventList; }
459  virtual TEntryList *GetEntryList();
460  virtual Long64_t GetEntryNumber(Long64_t entry) const;
461  virtual Int_t GetFileNumber() const { return fFileNumber; }
462  virtual TTree *GetFriend(const char*) const;
463  virtual const char *GetFriendAlias(TTree*) const;
465  virtual Bool_t GetImplicitMT() { return fIMTEnabled; }
466  virtual Int_t *GetIndex() { return &fIndex.fArray[0]; }
467  virtual Double_t *GetIndexValues() { return &fIndexValues.fArray[0]; }
470  virtual TLeaf *GetLeaf(const char* branchname, const char* leafname);
471  virtual TLeaf *GetLeaf(const char* name);
472  virtual TList *GetListOfClones() { return fClones; }
473  virtual TObjArray *GetListOfBranches() { return &fBranches; }
474  virtual TObjArray *GetListOfLeaves() { return &fLeaves; }
475  virtual TList *GetListOfFriends() const { return fFriends; }
476  virtual TList *GetListOfAliases() const { return fAliases; }
477 
478  // GetMakeClass is left non-virtual for efficiency reason.
479  // Making it virtual affects the performance of the I/O
480  Int_t GetMakeClass() const { return fMakeClass; }
481 
482  virtual Long64_t GetMaxEntryLoop() const { return fMaxEntryLoop; }
483  virtual Double_t GetMaximum(const char* columname);
484  static Long64_t GetMaxTreeSize();
485  virtual Long64_t GetMaxVirtualSize() const { return fMaxVirtualSize; }
486  virtual Double_t GetMinimum(const char* columname);
487  virtual Int_t GetNbranches() { return fBranches.GetEntriesFast(); }
488  TObject *GetNotify() const { return fNotify; }
490  virtual Int_t GetPacketSize() const { return fPacketSize; }
491  virtual TVirtualPerfStats *GetPerfStats() const { return fPerfStats; }
494  virtual Long64_t GetReadEntry() const { return fReadEntry; }
495  virtual Long64_t GetReadEvent() const { return fReadEntry; }
496  virtual Int_t GetScanField() const { return fScanField; }
499  virtual Int_t GetTimerInterval() const { return fTimerInterval; }
501  virtual Long64_t GetTotBytes() const { return fTotBytes; }
502  virtual TTree *GetTree() const { return const_cast<TTree*>(this); }
503  virtual TVirtualIndex *GetTreeIndex() const { return fTreeIndex; }
504  virtual Int_t GetTreeNumber() const { return 0; }
506  virtual Int_t GetUpdate() const { return fUpdate; }
507  virtual TList *GetUserInfo();
508  // See TSelectorDraw::GetVar
509  TTreeFormula *GetVar(Int_t i) { return GetPlayer()->GetVar(i); }
510  // See TSelectorDraw::GetVar
511  TTreeFormula *GetVar1() { return GetPlayer()->GetVar1(); }
512  // See TSelectorDraw::GetVar
513  TTreeFormula *GetVar2() { return GetPlayer()->GetVar2(); }
514  // See TSelectorDraw::GetVar
515  TTreeFormula *GetVar3() { return GetPlayer()->GetVar3(); }
516  // See TSelectorDraw::GetVar
517  TTreeFormula *GetVar4() { return GetPlayer()->GetVar4(); }
518  // See TSelectorDraw::GetVal
519  virtual Double_t *GetVal(Int_t i) { return GetPlayer()->GetVal(i); }
520  // See TSelectorDraw::GetVal
521  virtual Double_t *GetV1() { return GetPlayer()->GetV1(); }
522  // See TSelectorDraw::GetVal
523  virtual Double_t *GetV2() { return GetPlayer()->GetV2(); }
524  // See TSelectorDraw::GetVal
525  virtual Double_t *GetV3() { return GetPlayer()->GetV3(); }
526  // See TSelectorDraw::GetVal
527  virtual Double_t *GetV4() { return GetPlayer()->GetV4(); }
528  virtual Double_t *GetW() { return GetPlayer()->GetW(); }
529  virtual Double_t GetWeight() const { return fWeight; }
530  virtual Long64_t GetZipBytes() const { return fZipBytes; }
531  virtual void IncrementTotalBuffers(Int_t nbytes) { fTotalBuffers += nbytes; }
532  Bool_t IsFolder() const { return kTRUE; }
533  virtual Int_t LoadBaskets(Long64_t maxmemory = 2000000000);
534  virtual Long64_t LoadTree(Long64_t entry);
535  virtual Long64_t LoadTreeFriend(Long64_t entry, TTree* T);
536  virtual Int_t MakeClass(const char* classname = 0, Option_t* option = "");
537  virtual Int_t MakeCode(const char* filename = 0);
538  virtual Int_t MakeProxy(const char* classname, const char* macrofilename = 0, const char* cutfilename = 0, const char* option = 0, Int_t maxUnrolling = 3);
539  virtual Int_t MakeSelector(const char* selector = 0, Option_t* option = "");
540  Bool_t MemoryFull(Int_t nbytes);
541  virtual Long64_t Merge(TCollection* list, Option_t* option = "");
542  virtual Long64_t Merge(TCollection* list, TFileMergeInfo *info);
543  static TTree *MergeTrees(TList* list, Option_t* option = "");
544  virtual Bool_t Notify();
545  virtual void OptimizeBaskets(ULong64_t maxMemory=10000000, Float_t minComp=1.1, Option_t *option="");
546  TPrincipal *Principal(const char* varexp = "", const char* selection = "", Option_t* option = "np", Long64_t nentries = kMaxEntries, Long64_t firstentry = 0);
547  virtual void Print(Option_t* option = "") const; // *MENU*
548  virtual void PrintCacheStats(Option_t* option = "") const;
549  virtual Long64_t Process(const char* filename, Option_t* option = "", Long64_t nentries = kMaxEntries, Long64_t firstentry = 0); // *MENU*
550  virtual Long64_t Process(TSelector* selector, Option_t* option = "", Long64_t nentries = kMaxEntries, Long64_t firstentry = 0);
551  virtual Long64_t Project(const char* hname, const char* varexp, const char* selection = "", Option_t* option = "", Long64_t nentries = kMaxEntries, Long64_t firstentry = 0);
552  virtual TSQLResult *Query(const char* varexp = "", const char* selection = "", Option_t* option = "", Long64_t nentries = kMaxEntries, Long64_t firstentry = 0);
553  virtual Long64_t ReadFile(const char* filename, const char* branchDescriptor = "", char delimiter = ' ');
554  virtual Long64_t ReadStream(std::istream& inputStream, const char* branchDescriptor = "", char delimiter = ' ');
555  virtual void Refresh();
556  virtual void RegisterExternalFriend(TFriendElement *);
558  virtual void RemoveFriend(TTree*);
559  virtual void RecursiveRemove(TObject *obj);
560  virtual void Reset(Option_t* option = "");
561  virtual void ResetAfterMerge(TFileMergeInfo *);
562  virtual void ResetBranchAddress(TBranch *);
563  virtual void ResetBranchAddresses();
564  virtual Long64_t Scan(const char* varexp = "", const char* selection = "", Option_t* option = "", Long64_t nentries = kMaxEntries, Long64_t firstentry = 0); // *MENU*
565  virtual Bool_t SetAlias(const char* aliasName, const char* aliasFormula);
566  virtual void SetAutoSave(Long64_t autos = -300000000);
567  virtual void SetAutoFlush(Long64_t autof = -30000000);
568  virtual void SetBasketSize(const char* bname, Int_t buffsize = 16000);
569  virtual Int_t SetBranchAddress(const char *bname,void *add, TBranch **ptr = 0);
570  virtual Int_t SetBranchAddress(const char *bname,void *add, TClass *realClass, EDataType datatype, Bool_t isptr);
571  virtual Int_t SetBranchAddress(const char *bname,void *add, TBranch **ptr, TClass *realClass, EDataType datatype, Bool_t isptr);
572  template <class T> Int_t SetBranchAddress(const char *bname, T **add, TBranch **ptr = 0) {
573  TClass *cl = TClass::GetClass<T>();
575  if (cl==0) type = TDataType::GetType(typeid(T));
576  return SetBranchAddress(bname,add,ptr,cl,type,true);
577  }
578 #ifndef R__NO_CLASS_TEMPLATE_SPECIALIZATION
579  // This can only be used when the template overload resolution can distinguish between
580  // T* and T**
581  template <class T> Int_t SetBranchAddress(const char *bname, T *add, TBranch **ptr = 0) {
582  TClass *cl = TClass::GetClass<T>();
584  if (cl==0) type = TDataType::GetType(typeid(T));
585  return SetBranchAddress(bname,add,ptr,cl,type,false);
586  }
587 #endif
588  virtual void SetBranchStatus(const char* bname, Bool_t status = 1, UInt_t* found = 0);
589  static void SetBranchStyle(Int_t style = 1); //style=0 for old branch, =1 for new branch style
590  virtual Int_t SetCacheSize(Long64_t cachesize = -1);
592  virtual void SetCacheLearnEntries(Int_t n=10);
593  virtual void SetChainOffset(Long64_t offset = 0) { fChainOffset=offset; }
594  virtual void SetCircular(Long64_t maxEntries);
595  virtual void SetClusterPrefetch(Bool_t enabled) { fCacheDoClusterPrefetch = enabled; }
596  virtual void SetDebug(Int_t level = 1, Long64_t min = 0, Long64_t max = 9999999); // *MENU*
597  virtual void SetDefaultEntryOffsetLen(Int_t newdefault, Bool_t updateExisting = kFALSE);
598  virtual void SetDirectory(TDirectory* dir);
599  virtual Long64_t SetEntries(Long64_t n = -1);
600  virtual void SetEstimate(Long64_t nentries = 1000000);
602  virtual void SetFileNumber(Int_t number = 0);
603  virtual void SetEventList(TEventList* list);
604  virtual void SetEntryList(TEntryList* list, Option_t *opt="");
605  virtual void SetImplicitMT(Bool_t enabled) { fIMTEnabled = enabled; }
606  virtual void SetMakeClass(Int_t make);
607  virtual void SetMaxEntryLoop(Long64_t maxev = kMaxEntries) { fMaxEntryLoop = maxev; } // *MENU*
608  static void SetMaxTreeSize(Long64_t maxsize = 100000000000LL);
609  virtual void SetMaxVirtualSize(Long64_t size = 0) { fMaxVirtualSize = size; } // *MENU*
610  virtual void SetName(const char* name); // *MENU*
611 
612  /**
613  * @brief Sets the address of the object to be notified when the tree is loaded.
614  *
615  * The method TObject::Notify is called for the given object when the tree
616  * is loaded. Specifically this occurs in the TTree::LoadTree method. To
617  * remove the notification call this method with nullptr:
618  * @code tree->SetNotify(nullptr); @endcode
619  *
620  * @param[in] obj Pointer to a TObject to be notified.
621  */
622  virtual void SetNotify(TObject* obj) { fNotify = obj; }
623 
624  virtual void SetObject(const char* name, const char* title);
625  virtual void SetParallelUnzip(Bool_t opt=kTRUE, Float_t RelSize=-1);
626  virtual void SetPerfStats(TVirtualPerfStats* perf);
627  virtual void SetScanField(Int_t n = 50) { fScanField = n; } // *MENU*
629  virtual void SetTimerInterval(Int_t msec = 333) { fTimerInterval=msec; }
630  virtual void SetTreeIndex(TVirtualIndex* index);
631  virtual void SetWeight(Double_t w = 1, Option_t* option = "");
632  virtual void SetUpdate(Int_t freq = 0) { fUpdate = freq; }
633  virtual void Show(Long64_t entry = -1, Int_t lenmax = 20);
634  virtual void StartViewer(); // *MENU*
635  virtual Int_t StopCacheLearningPhase();
636  virtual Int_t UnbinnedFit(const char* funcname, const char* varexp, const char* selection = "", Option_t* option = "", Long64_t nentries = kMaxEntries, Long64_t firstentry = 0);
637  void UseCurrentStyle();
638  virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0);
639  virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0) const;
640 
641  ClassDef(TTree, 20) // Tree descriptor (the main ROOT I/O class)
642 };
643 
644 //////////////////////////////////////////////////////////////////////////
645 // //
646 // TTreeFriendLeafIter //
647 // //
648 // Iterator on all the leaves in a TTree and its friend //
649 // //
650 //////////////////////////////////////////////////////////////////////////
651 
653 
654 protected:
655  TTree *fTree; ///< tree being iterated
656  TIterator *fLeafIter; ///< current leaf sub-iterator.
657  TIterator *fTreeIter; ///< current tree sub-iterator.
658  Bool_t fDirection; ///< iteration direction
659 
661  fDirection(0) { }
662 
663 public:
664  TTreeFriendLeafIter(const TTree* t, Bool_t dir = kIterForward);
667  TIterator &operator=(const TIterator &rhs);
669 
670  const TCollection *GetCollection() const { return 0; }
671  Option_t *GetOption() const;
672  TObject *Next();
674  Bool_t operator !=(const TIterator&) const {
675  // TODO: Implement me
676  return false;
677  }
679  // TODO: Implement me
680  return false;
681  }
682  TObject *operator*() const {
683  // TODO: Implement me
684  return nullptr;
685  }
686  ClassDef(TTreeFriendLeafIter,0) //Linked list iterator
687  };
688 
689 
690 #endif
virtual Double_t * GetV3()
Definition: TTree.h:525
TBranch * Branch(const char *name, const char *classname, T **addobj, Int_t bufsize=32000, Int_t splitlevel=99)
Definition: TTree.h:386
Describe Streamer information for one class version
Definition: TStreamerInfo.h:43
virtual TBranch * FindBranch(const char *name)
Return the branch that correspond to the path &#39;branchname&#39;, which can include the name of the tree or...
Definition: TTree.cxx:4715
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
Double_t fWeight
Tree weight (see TTree::SetWeight)
Definition: TTree.h:83
Int_t GetDefaultEntryOffsetLen() const
Definition: TTree.h:444
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
Definition: TLeaf.h:49
Long64_t Previous()
Move on to the previous cluster and return the starting entry of this previous cluster.
Definition: TTree.cxx:677
TTreeCache * GetReadCache(TFile *file) const
Find and return the TTreeCache registered with the file and which may contain branches for us...
Definition: TTree.cxx:6156
virtual void AddTotBytes(Int_t tot)
Definition: TTree.h:317
virtual TList * GetListOfClones()
Definition: TTree.h:472
UInt_t GetAllocationCount() const
Definition: TTree.h:428
TStreamerInfo * BuildStreamerInfo(TClass *cl, void *pointer=0, Bool_t canOptimize=kTRUE)
Build StreamerInfo for class cl.
Definition: TTree.cxx:2623
An array of TObjects.
Definition: TObjArray.h:37
Long64_t fDebugMin
! First entry number to debug
Definition: TTree.h:105
TBranch * Branch(const char *name, T **addobj, Int_t bufsize=32000, Int_t splitlevel=99)
Add a new branch, and infer the data type from the array addobj being passed.
Definition: TTree.h:356
Principal Components Analysis (PCA)
Definition: TPrincipal.h:20
TTree * fTree
tree being iterated
Definition: TTree.h:655
Long64_t GetNextEntry()
Definition: TTree.h:293
Bool_t fPrevious
Definition: TTree.h:182
auto * tt
Definition: textangle.C:16
virtual void OptimizeBaskets(ULong64_t maxMemory=10000000, Float_t minComp=1.1, Option_t *option="")
This function may be called after having filled some entries in a Tree.
Definition: TTree.cxx:6873
Bool_t MemoryFull(Int_t nbytes)
Check if adding nbytes to memory we are still below MaxVirtualsize.
Definition: TTree.cxx:6675
virtual TBranch * BranchImpRef(const char *branchname, const char *classname, TClass *ptrClass, void *addobj, Int_t bufsize, Int_t splitlevel)
Same as TTree::Branch but automatic detection of the class name.
Definition: TTree.cxx:1609
virtual Int_t MakeCode(const char *filename=0)
Generate a skeleton function for this tree.
Definition: TTree.cxx:6478
long long Long64_t
Definition: RtypesCore.h:69
TTreeFormula * GetVar2()
Definition: TTree.h:513
TIterator * fTreeIter
current tree sub-iterator.
Definition: TTree.h:657
Abstract interface for Tree Index.
Definition: TVirtualIndex.h:30
virtual Int_t GetScanField() const
Definition: TTree.h:496
virtual TTreeFormula * GetVar1() const =0
virtual Long64_t ReadStream(std::istream &inputStream, const char *branchDescriptor="", char delimiter=' ')
Create or simply read branches from an input stream.
Definition: TTree.cxx:7426
static constexpr Long64_t kMaxEntries
virtual Int_t StopCacheLearningPhase()
Stop the cache learning phase.
Definition: TTree.cxx:9195
virtual void SetBranchStatus(const char *bname, Bool_t status=1, UInt_t *found=0)
Set branch status to Process or DoNotProcess.
Definition: TTree.cxx:8286
virtual void IncrementTotalBuffers(Int_t nbytes)
Definition: TTree.h:531
virtual void Delete(Option_t *option="")
Delete this tree from memory or/and disk.
Definition: TTree.cxx:3655
virtual Int_t FlushBaskets(Bool_t create_cluster=true) const
Write to disk all the basket that have not yet been individually written and create an event cluster ...
Definition: TTree.cxx:4997
TTree & operator=(const TTree &tt)=delete
static Int_t fgBranchStyle
Old/New branch style.
Definition: TTree.h:144
virtual void AddZipBytes(Int_t zip)
Definition: TTree.h:318
virtual Double_t * GetV4()
Definition: TTree.h:527
virtual Int_t LoadBaskets(Long64_t maxmemory=2000000000)
Read in memory all baskets from all branches up to the limit of maxmemory bytes.
Definition: TTree.cxx:6289
float Float_t
Definition: RtypesCore.h:53
static Long64_t GetMaxTreeSize()
Static function which returns the tree file size limit in bytes.
Definition: TTree.cxx:6103
virtual void SetParallelUnzip(Bool_t opt=kTRUE, Float_t RelSize=-1)
Enable or disable parallel unzipping of Tree buffers.
Definition: TTree.cxx:9012
Provides the interface for the PROOF internal performance measurement and event tracing.
const char Option_t
Definition: RtypesCore.h:62
virtual Bool_t Notify()
Function called when loading a new class library.
Definition: TTree.cxx:6849
TTree()
Default constructor and I/O constructor.
Definition: TTree.cxx:720
virtual TTree * GetFriend(const char *) const
Return a pointer to the TTree friend whose name or alias is &#39;friendname.
Definition: TTree.cxx:5820
virtual Long64_t GetEntriesFast() const
Definition: TTree.h:450
TBuffer * fTransientBuffer
! Pointer to the current transient buffer.
Definition: TTree.h:128
virtual void Print(Option_t *option="") const
Print a summary of the tree contents.
Definition: TTree.cxx:7035
double T(double x)
Definition: ChebyshevPol.h:34
virtual Bool_t GetClusterPrefetch() const
Definition: TTree.h:442
virtual Int_t Fit(const char *funcname, const char *varexp, const char *selection="", Option_t *option="", Option_t *goption="", Long64_t nentries=kMaxEntries, Long64_t firstentry=0)
Fit a projected item(s) from a tree.
Definition: TTree.cxx:4947
TIterator * fLeafIter
current leaf sub-iterator.
Definition: TTree.h:656
If set, the branch&#39;s buffers will grow until an event cluster boundary is hit, guaranteeing a basket ...
Definition: TTree.h:242
TList * fFriends
pointer to list of friend elements
Definition: TTree.h:120
virtual Double_t * GetV3() const =0
TPrincipal * Principal(const char *varexp="", const char *selection="", Option_t *option="np", Long64_t nentries=kMaxEntries, Long64_t firstentry=0)
Interface to the Principal Components Analysis class.
Definition: TTree.cxx:7016
virtual TH1 * GetHistogram() const =0
virtual Int_t Fill()
Fill all branches.
Definition: TTree.cxx:4479
Int_t GetMakeClass() const
Definition: TTree.h:480
virtual TEntryList * GetEntryList()
Returns the entry list assigned to this tree.
Definition: TTree.cxx:5699
ROOT::TIOFeatures SetIOFeatures(const ROOT::TIOFeatures &)
Provide the end-user with the ability to enable/disable various experimental IO features for this TTr...
Definition: TTree.cxx:8877
virtual void SetMaxEntryLoop(Long64_t maxev=kMaxEntries)
Definition: TTree.h:607
#define BIT(n)
Definition: Rtypes.h:83
virtual Int_t GetPacketSize() const
Definition: TTree.h:490
static void SetBranchStyle(Int_t style=1)
Set the current branch style.
Definition: TTree.cxx:8417
A cache to speed-up the reading of ROOT datasets.
Definition: TTreeCache.h:35
virtual TLeaf * GetLeaf(const char *branchname, const char *leafname)
Return pointer to the 1st Leaf named name in any Branch of this Tree or any branch in the list of fri...
Definition: TTree.cxx:6033
TTree * fTree
Definition: TTree.h:180
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
Definition: TFile.h:48
virtual TLeaf * GetLeafImpl(const char *branchname, const char *leafname)
Return pointer to the 1st Leaf named name in any Branch of this Tree or any branch in the list of fri...
Definition: TTree.cxx:5943
virtual TList * GetListOfFriends() const
Definition: TTree.h:475
TTreeFormula * GetSelect()
Definition: TTree.h:497
virtual Long64_t GetAutoFlush() const
Definition: TTree.h:432
Buffer base class used for serializing objects.
Definition: TBuffer.h:42
TDirectory * fDirectory
! Pointer to directory holding this tree
Definition: TTree.h:111
Int_t fMakeClass
! not zero when processing code generated by MakeClass
Definition: TTree.h:108
virtual TBasket * CreateBasket(TBranch *)
Create a basket for this tree and given branch.
Definition: TTree.cxx:3639
#define N
Long64_t GetDebugMin() const
Definition: TTree.h:446
virtual void SetAutoSave(Long64_t autos=-300000000)
This function may be called at the start of a program to change the default value for fAutoSave (and ...
Definition: TTree.cxx:8097
Long64_t fEstimatedSize
Definition: TTree.h:262
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0)
Read all branches of entry and return total number of bytes read.
Definition: TTree.cxx:5482
virtual TTreeFormula * GetVar(Int_t) const =0
virtual TList * GetListOfAliases() const
Definition: TTree.h:476
virtual Int_t MakeProxy(const char *classname, const char *macrofilename=0, const char *cutfilename=0, const char *option=0, Int_t maxUnrolling=3)
Generate a skeleton analysis class for this Tree using TBranchProxy.
Definition: TTree.cxx:6606
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
virtual Long64_t GetMaxEntryLoop() const
Definition: TTree.h:482
virtual void Browse(TBrowser *)
Browse content of the TTree.
Definition: TTree.cxx:2580
constexpr std::array< decltype(std::declval< F >)(std::declval< int >))), N > make(F f)
static void SetMaxTreeSize(Long64_t maxsize=100000000000LL)
Set the maximum size in bytes of a Tree file (static function).
Definition: TTree.cxx:8944
TIOFeatures provides the end-user with the ability to change the IO behavior of data written via a TT...
Definition: TIOFeatures.hxx:62
Int_t fScanField
Number of runs before prompting in Scan.
Definition: TTree.h:85
virtual Double_t * GetV4() const =0
virtual TTree * CloneTree(Long64_t nentries=-1, Option_t *option="")
Create a clone of this tree and copy nentries.
Definition: TTree.cxx:3076
virtual TTree * CopyTree(const char *selection, Option_t *option="", Long64_t nentries=kMaxEntries, Long64_t firstentry=0)
Copy a tree with selection.
Definition: TTree.cxx:3627
const TCollection * GetCollection() const
Definition: TTree.h:670
virtual void KeepCircular()
Keep a maximum of fMaxEntries in memory.
Definition: TTree.cxx:6253
TArrayD fIndexValues
Sorted index values.
Definition: TTree.h:117
Long64_t fMaxEntryLoop
Maximum number of entries to process.
Definition: TTree.h:91
TVirtualTreePlayer * GetPlayer()
Load the TTreePlayer (if not already done).
Definition: TTree.cxx:6143
virtual void SetMaxVirtualSize(Long64_t size=0)
Definition: TTree.h:609
virtual TSQLResult * Query(const char *varexp="", const char *selection="", Option_t *option="", Long64_t nentries=kMaxEntries, Long64_t firstentry=0)
Loop over entries and return a TSQLResult object containing entries following selection.
Definition: TTree.cxx:7329
A Tree Index with majorname and minorname.
Definition: TTreeIndex.h:29
ELockStatusBits
Definition: TTree.h:200
Long64_t fStartEntry
Definition: TTree.h:260
virtual Int_t GetFileNumber() const
Definition: TTree.h:461
Iterator abstract base class.
Definition: TIterator.h:30
Array of integers (32 bits per element).
Definition: TArrayI.h:27
virtual TTreeFormula * GetSelect() const =0
virtual void Refresh()
Refresh contents of this tree and its branches from the current status on disk.
Definition: TTree.cxx:7723
virtual void SetFileNumber(Int_t number=0)
Set fFileNumber to number.
Definition: TTree.cxx:8900
virtual Double_t GetMinimum(const char *columname)
Return minimum of column with name columname.
Definition: TTree.cxx:6113
virtual void DirectoryAutoAdd(TDirectory *)
Called by TKey and TObject::Clone to automatically add us to a directory when we are read from a file...
Definition: TTree.cxx:3727
Bool_t fIMTFlush
! True if we are doing a multithreaded flush.
Definition: TTree.h:149
virtual Double_t GetWeight() const
Definition: TTree.h:529
virtual void StartViewer()
Start the TTreeViewer on this tree.
Definition: TTree.cxx:9180
virtual Long64_t Merge(TCollection *list, Option_t *option="")
Merge the trees in the TList into this tree.
Definition: TTree.cxx:6732
Marker Attributes class.
Definition: TAttMarker.h:19
virtual Int_t GetEntryWithIndex(Int_t major, Int_t minor=0)
Read entry corresponding to major and minor number.
Definition: TTree.cxx:5772
TList * fAliases
List of aliases for expressions based on the tree branches.
Definition: TTree.h:114
TBranch * Branch(const char *name, Long_t address, const char *leaflist, Int_t bufsize=32000)
Definition: TTree.h:370
virtual TTreeFormula * GetVar3() const =0
Bool_t fCacheDoClusterPrefetch
! true if cache is prefetching whole clusters
Definition: TTree.h:130
virtual Long64_t GetCacheSize() const
Definition: TTree.h:438
virtual TObjArray * GetListOfBranches()
Definition: TTree.h:473
Helper class to iterate over cluster of baskets.
Definition: TTree.h:255
TVirtualTreePlayer * fPlayer
! Pointer to current Tree player
Definition: TTree.h:124
Fill Area Attributes class.
Definition: TAttFill.h:19
void ImportClusterRanges(TTree *fromtree)
Appends the cluster range information stored in &#39;fromtree&#39; to this tree, including the value of fAuto...
Definition: TTree.cxx:6210
virtual void SetAutoFlush(Long64_t autof=-30000000)
This function may be called at the start of a program to change the default value for fAutoFlush...
Definition: TTree.cxx:7988
#define ClassDef(name, id)
Definition: Rtypes.h:326
virtual Long64_t GetSelectedRows()
Definition: TTree.h:498
TTreeFormula * GetVar(Int_t i)
Definition: TTree.h:509
virtual Long64_t GetReadEvent() const
Definition: TTree.h:495
virtual void RegisterExternalFriend(TFriendElement *)
Record a TFriendElement that we need to warn when the chain switches to a new file (typically this is...
Definition: TTree.cxx:7764
virtual Long64_t CopyEntries(TTree *tree, Long64_t nentries=-1, Option_t *option="")
Copy nentries from given tree to this tree.
Definition: TTree.cxx:3458
virtual Int_t SetBranchAddress(const char *bname, void *add, TBranch **ptr=0)
Change branch address, dealing with clone trees properly.
Definition: TTree.cxx:8140
Int_t fNfill
! Local for EntryLoop
Definition: TTree.h:103
std::atomic< UInt_t > fAllocationCount
indicates basket should be resized to exact memory usage, but causes significant
Definition: TTree.h:142
Float_t fTargetMemoryRatio
! Ratio for memory usage in uncompressed buffers versus actual occupancy.
Definition: TTree.h:136
virtual void SetObject(const char *name, const char *title)
Change the name and title of this tree.
Definition: TTree.cxx:8981
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
virtual Long64_t GetEntryNumberWithBestIndex(Long64_t major, Long64_t minor=0) const
Return entry number corresponding to major and minor number.
Definition: TTree.cxx:5735
virtual Long64_t GetReadEntry() const
Definition: TTree.h:494
virtual const char * GetAlias(const char *aliasName) const
Returns the expanded value of the alias. Search in the friends if any.
Definition: TTree.cxx:5094
virtual Long64_t LoadTree(Long64_t entry)
Set current entry.
Definition: TTree.cxx:6311
Bool_t fCacheUserSet
! true if the cache setting was explicitly given by user
Definition: TTree.h:131
virtual void SetTreeIndex(TVirtualIndex *index)
The current TreeIndex is replaced by the new index.
Definition: TTree.cxx:9067
Int_t fMaxClusterRange
! Memory allocated for the cluster range.
Definition: TTree.h:89
static Int_t GetBranchStyle()
Static function returning the current branch style.
Definition: TTree.cxx:5249
virtual Int_t BuildIndex(const char *majorname, const char *minorname="0")
Build a Tree Index (default is TTreeIndex).
Definition: TTree.cxx:2608
virtual Int_t UnbinnedFit(const char *funcname, const char *varexp, const char *selection="", Option_t *option="", Long64_t nentries=kMaxEntries, Long64_t firstentry=0)
Unbinned fit of one or more variable(s) from a tree.
Definition: TTree.cxx:9446
virtual TBranch * BranchOld(const char *name, const char *classname, void *addobj, Int_t bufsize=32000, Int_t splitlevel=1)
Create a new TTree BranchObject.
Definition: TTree.cxx:2045
virtual Int_t GetNbranches()
Definition: TTree.h:487
virtual TVirtualPerfStats * GetPerfStats() const
Definition: TTree.h:491
virtual void Show(Long64_t entry=-1, Int_t lenmax=20)
Print values of all active leaves for entry.
Definition: TTree.cxx:9106
TBranchRef * fBranchRef
Branch supporting the TRefTable (if any)
Definition: TTree.h:126
virtual Int_t MakeClass(const char *classname=0, Option_t *option="")
Generate a skeleton analysis class for this tree.
Definition: TTree.cxx:6445
virtual TClusterIterator GetClusterIterator(Long64_t firstentry)
Return an iterator over the cluster of baskets starting at firstentry.
Definition: TTree.cxx:5311
UInt_t fFriendLockStatus
! Record which method is locking the friend recursion
Definition: TTree.h:127
Double_t * fArray
Definition: TArrayD.h:30
Int_t fTimerInterval
Timer interval in milliseconds.
Definition: TTree.h:84
virtual TFriendElement * AddFriend(const char *treename, const char *filename="")
Add a TFriendElement to the list of friends.
Definition: TTree.cxx:1306
const Bool_t kIterForward
Definition: TCollection.h:40
virtual Long64_t Scan(const char *varexp="", const char *selection="", Option_t *option="", Long64_t nentries=kMaxEntries, Long64_t firstentry=0)
Loop over tree entries and print entries passing selection.
Definition: TTree.cxx:7891
Long64_t fFlushedBytes
Number of auto-flushed bytes.
Definition: TTree.h:82
TObject * GetNotify() const
Definition: TTree.h:488
UInt_t fNEntriesSinceSorting
! Number of entries processed since the last re-sorting of branches
Definition: TTree.h:133
If set, signals that this TTree is the output of the processing of another TTree, and the entries are...
Definition: TTree.h:247
virtual Double_t GetMaximum(const char *columname)
Return maximum of column with name columname.
Definition: TTree.cxx:6073
virtual void RemoveFriend(TTree *)
Remove a friend from the list of friends.
Definition: TTree.cxx:7774
virtual Double_t * GetW() const =0
Float_t GetTargetMemoryRatio() const
Definition: TTree.h:505
virtual TList * GetUserInfo()
Return a pointer to the list containing user objects associated to this tree.
Definition: TTree.cxx:6194
std::atomic< Long64_t > fIMTZipBytes
! Zip bytes for the IMT flush baskets.
Definition: TTree.h:151
virtual void SetCacheLearnEntries(Int_t n=10)
Interface to TTreeCache to set the number of entries for the learning phase.
Definition: TTree.cxx:8612
A branch containing and managing a TRefTable for TRef autoloading.
Definition: TBranchRef.h:29
Long64_t fZipBytes
Total number of bytes in all branches after compression.
Definition: TTree.h:80
Long64_t fDebugMax
! Last entry number to debug
Definition: TTree.h:106
virtual TBranch * BranchImp(const char *branchname, const char *classname, TClass *ptrClass, void *addobj, Int_t bufsize, Int_t splitlevel)
Same as TTree::Branch() with added check that addobj matches className.
Definition: TTree.cxx:1528
TBranch * Branch(const char *name, char *address, const char *leaflist, Int_t bufsize=32000)
Definition: TTree.h:365
TTreeFormula * GetVar4()
Definition: TTree.h:517
Used to pass a selection expression to the Tree drawing routine.
Definition: TTreeFormula.h:58
virtual TTree * GetTree() const
Definition: TTree.h:502
virtual void SetEventList(TEventList *list)
This function transfroms the given TEventList into a TEntryList The new TEntryList is owned by the TT...
Definition: TTree.cxx:8816
virtual Int_t GetTreeNumber() const
Definition: TTree.h:504
void UseCurrentStyle()
Replace current attributes by current style.
Definition: TTree.cxx:9458
A specialized string object used for TTree selections.
Definition: TCut.h:25
A doubly linked list.
Definition: TList.h:44
virtual TBranch * GetBranch(const char *name)
Return pointer to the branch with the given name in this tree or its friends.
Definition: TTree.cxx:5135
Bool_t fCacheDoAutoInit
! true if cache auto creation or resize check is needed
Definition: TTree.h:129
Int_t SetBranchAddress(const char *bname, T **add, TBranch **ptr=0)
Definition: TTree.h:572
TH1 * GetHistogram()
Definition: TTree.h:464
Int_t GetType() const
Definition: TDataType.h:68
TObjArray fLeaves
Direct pointers to individual branch leaves.
Definition: TTree.h:113
Long64_t * fClusterRangeEnd
[fNClusterRange] Last entry of a cluster range.
Definition: TTree.h:96
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:37
Int_t fNClusterRange
Number of Cluster range in addition to the one defined by &#39;AutoFlush&#39;.
Definition: TTree.h:88
virtual Long64_t GetEntryNumber(Long64_t entry) const
Return entry number corresponding to entry.
Definition: TTree.cxx:5710
TEntryList * fEntryList
! Pointer to event selection list (if one)
Definition: TTree.h:116
virtual Long64_t GetAutoSave() const
Definition: TTree.h:433
void SetTargetMemoryRatio(Float_t ratio)
Definition: TTree.h:628
virtual TTreeFormula * GetVar4() const =0
TBranch * Branch(const char *name, int address, const char *leaflist, Int_t bufsize=32000)
Definition: TTree.h:375
virtual Long64_t GetChainOffset() const
Definition: TTree.h:441
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
Definition: TTree.cxx:9495
virtual void SetEstimate(Long64_t nentries=1000000)
Set number of entries to estimate variable limits.
Definition: TTree.cxx:8857
virtual Double_t * GetV2() const =0
ESetBranchAddressStatus
Definition: TTree.h:221
Long64_t fChainOffset
! Offset of 1st entry of this Tree in a TChain
Definition: TTree.h:99
~TFriendLock()
Restore the state of tree the same as before we set the lock.
Definition: TTree.cxx:528
Long64_t * fClusterSize
[fNClusterRange] Number of entries in each cluster for a given range.
Definition: TTree.h:97
virtual Double_t * GetV2()
Definition: TTree.h:523
virtual Long64_t GetEntryNumberWithIndex(Long64_t major, Long64_t minor=0) const
Return entry number corresponding to major and minor number.
Definition: TTree.cxx:5755
virtual void SetUpdate(Int_t freq=0)
Definition: TTree.h:632
TVirtualPerfStats * fPerfStats
! pointer to the current perf stats object
Definition: TTree.h:122
TObject * operator*() const
Return current object or nullptr.
Definition: TTree.h:682
virtual TObject * Remove(TObject *obj)
Remove object from the list.
Definition: TList.cxx:819
Long64_t fReadEntry
! Number of the entry being processed
Definition: TTree.h:100
virtual TVirtualIndex * GetTreeIndex() const
Definition: TTree.h:503
virtual ~TTree()
Destructor.
Definition: TTree.cxx:903
Collection abstract base class.
Definition: TCollection.h:63
TList * fUserInfo
pointer to a list of user objects associated to this Tree
Definition: TTree.h:123
TObjArray fBranches
List of Branches.
Definition: TTree.h:112
virtual void SetNotify(TObject *obj)
Sets the address of the object to be notified when the tree is loaded.
Definition: TTree.h:622
unsigned int UInt_t
Definition: RtypesCore.h:42
friend TBranch * TTreeBranchImpRef(TTree *tree, const char *branchname, TClass *ptrClass, EDataType datatype, void *addobj, Int_t bufsize, Int_t splitlevel)
Int_t GetEntriesFast() const
Definition: TObjArray.h:64
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:887
TFile * GetCurrentFile() const
Return pointer to the current file.
Definition: TTree.cxx:5323
Int_t Debug() const
Definition: TTree.h:415
Manages buffers for branches of a Tree.
Definition: TBasket.h:34
TTreeFormula * GetVar3()
Definition: TTree.h:515
A TEventList object is a list of selected events (entries) in a TTree.
Definition: TEventList.h:31
virtual TLeaf * FindLeaf(const char *name)
Find leaf..
Definition: TTree.cxx:4787
TArrayI fIndex
Index of sorted values.
Definition: TTree.h:118
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition: TClass.h:75
virtual Long64_t GetEstimate() const
Definition: TTree.h:452
void AddAllocationCount(UInt_t count)
Definition: TTree.h:323
Bool_t fIMTEnabled
! true if implicit multi-threading is enabled for this tree
Definition: TTree.h:132
Option_t * GetOption() const
Returns the object option stored in the list.
Definition: TTree.cxx:9596
virtual TBranchRef * GetBranchRef() const
Definition: TTree.h:435
TBranch * Branch(const char *name, std::array< T, N > *obj, Int_t bufsize=32000, Int_t splitlevel=99)
Definition: TTree.h:391
virtual void ResetBranchAddress(TBranch *)
Tell all of our branches to set their addresses to zero.
Definition: TTree.cxx:7862
ROOT::TIOFeatures GetIOFeatures() const
Returns the current set of IO settings.
Definition: TTree.cxx:5919
Bool_t fDirection
iteration direction
Definition: TTree.h:658
virtual Double_t * GetVal(Int_t) const =0
TEventList * fEventList
! Pointer to event selection list (if one)
Definition: TTree.h:115
virtual TBranch * Bronch(const char *name, const char *classname, void *addobj, Int_t bufsize=32000, Int_t splitlevel=99)
Create a new TTree BranchElement.
Definition: TTree.cxx:2375
virtual Bool_t GetBranchStatus(const char *branchname) const
Return status of branch with name branchname.
Definition: TTree.cxx:5234
Bool_t operator!=(const TIterator &) const
Compare two iterator objects.
Definition: TTree.h:674
Long64_t fMaxEntries
Maximum number of entries in case of circular buffers.
Definition: TTree.h:90
void AddClone(TTree *)
Add a cloned tree to our list of trees to be notified whenever we change our branch addresses or when...
Definition: TTree.cxx:1194
void MarkEventCluster()
Mark the previous event as being at the end of the event cluster.
Definition: TTree.cxx:8050
char GetNewlineValue(std::istream &inputStream)
Determine which newline this file is using.
Definition: TTree.cxx:7399
virtual Int_t DropBranchFromCache(const char *bname, Bool_t subbranches=kFALSE)
Remove the branch with name &#39;bname&#39; from the Tree cache.
Definition: TTree.cxx:1117
void InitializeBranchLists(bool checkLeafCount)
Divides the top-level branches into two vectors: (i) branches to be processed sequentially and (ii) b...
Definition: TTree.cxx:5626
virtual Int_t * GetIndex()
Definition: TTree.h:466
Long64_t fAutoSave
Autosave tree when fAutoSave entries written or -fAutoSave (compressed) bytes produced.
Definition: TTree.h:93
Bool_t IsFolder() const
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects)...
Definition: TTree.h:532
const Bool_t kFALSE
Definition: RtypesCore.h:88
virtual Int_t CheckBranchAddressType(TBranch *branch, TClass *ptrClass, EDataType datatype, Bool_t ptr)
Check whether or not the address described by the last 3 parameters matches the content of the branch...
Definition: TTree.cxx:2812
virtual void SetDebug(Int_t level=1, Long64_t min=0, Long64_t max=9999999)
Set the debug level and the debug range.
Definition: TTree.cxx:8675
virtual Long64_t Process(const char *filename, Option_t *option="", Long64_t nentries=kMaxEntries, Long64_t firstentry=0)
Process this tree executing the TSelector code in the specified filename.
Definition: TTree.cxx:7266
TBranch * Branch(const char *name, T *obj, Int_t bufsize=32000, Int_t splitlevel=99)
Add a new branch, and infer the data type from the type of obj being passed.
Definition: TTree.h:339
#define SafeDelete(p)
Definition: RConfig.hxx:543
long Long_t
Definition: RtypesCore.h:50
virtual void DropBuffers(Int_t nbytes)
Drop branch buffers to accommodate nbytes below MaxVirtualsize.
Definition: TTree.cxx:4411
virtual Int_t GetTimerInterval() const
Definition: TTree.h:499
virtual void SetMakeClass(Int_t make)
Set all the branches in this TTree to be in decomposed object mode (also known as MakeClass mode)...
Definition: TTree.cxx:8924
virtual void SetWeight(Double_t w=1, Option_t *option="")
Set tree weight.
Definition: TTree.cxx:9095
TBranch * Branch(const char *name, const char *classname, T *obj, Int_t bufsize=32000, Int_t splitlevel=99)
Definition: TTree.h:381
A PolyMarker is defined by an array on N points in a 2-D space.
Definition: TPolyMarker.h:31
Long64_t Next()
Move on to the next cluster and return the starting entry of this next cluster.
Definition: TTree.cxx:633
virtual void SetDirectory(TDirectory *dir)
Change the tree&#39;s directory.
Definition: TTree.cxx:8713
virtual Long64_t LoadTreeFriend(Long64_t entry, TTree *T)
Load entry on behalf of our master tree, we may use an index.
Definition: TTree.cxx:6395
virtual Int_t GetUpdate() const
Definition: TTree.h:506
Long64_t fMaxVirtualSize
Maximum total size of buffers kept in memory.
Definition: TTree.h:92
Int_t GetEvent(Long64_t entry=0, Int_t getall=0)
Definition: TTree.h:454
virtual void SetEntryList(TEntryList *list, Option_t *opt="")
Set an EntryList.
Definition: TTree.cxx:8793
TIterator & operator=(const TIterator &rhs)
Overridden assignment operator. Does NOT copy the &#39;cursor&#39; location!
Definition: TTree.cxx:9534
double Double_t
Definition: RtypesCore.h:55
Long64_t GetStartEntry()
Definition: TTree.h:288
Long64_t GetCacheAutoSize(Bool_t withDefault=kFALSE) const
Used for automatic sizing of the cache.
Definition: TTree.cxx:5261
virtual Double_t * GetW()
Definition: TTree.h:528
Int_t * fArray
Definition: TArrayI.h:30
Long64_t fTotBytes
Total number of bytes in all branches before compression.
Definition: TTree.h:79
std::vector< TBranch * > fSeqBranches
! Branches to be processed sequentially when IMT is on
Definition: TTree.h:135
Describe directory structure in memory.
Definition: TDirectory.h:34
virtual void SetPerfStats(TVirtualPerfStats *perf)
Set perf stats.
Definition: TTree.cxx:9050
std::vector< std::pair< Long64_t, TBranch * > > fSortedBranches
! Branches to be processed in parallel when IMT is on, sorted by average task time ...
Definition: TTree.h:134
TDirectory * GetDirectory() const
Definition: TTree.h:447
EStatusBits
Definition: TObject.h:57
void SortBranchesByTime()
Sorts top-level branches by the last average task time recorded per branch.
Definition: TTree.cxx:5679
int type
Definition: TGX11.cxx:120
unsigned long long ULong64_t
Definition: RtypesCore.h:70
virtual Long64_t ReadFile(const char *filename, const char *branchDescriptor="", char delimiter=' ')
Create or simply read branches from filename.
Definition: TTree.cxx:7380
Long64_t fAutoFlush
Auto-flush tree when fAutoFlush entries written or -fAutoFlush (compressed) bytes produced...
Definition: TTree.h:94
virtual Bool_t GetImplicitMT()
Definition: TTree.h:465
virtual void ResetBranchAddresses()
Tell all of our branches to drop their current objects and allocate new ones.
Definition: TTree.cxx:7872
virtual void Draw(Option_t *opt)
Default Draw method for all objects.
Definition: TTree.h:417
TCanvas * style()
Definition: style.C:1
int nentries
Definition: THbookFile.cxx:89
EDataType
Definition: TDataType.h:28
Int_t fDefaultEntryOffsetLen
Initial Length of fEntryOffset table in the basket buffers.
Definition: TTree.h:87
The TH1 histogram class.
Definition: TH1.h:56
virtual Long64_t GetChainEntryNumber(Long64_t entry) const
Definition: TTree.h:440
Long64_t fEstimate
Number of entries to estimate histogram limits.
Definition: TTree.h:95
UInt_t fMethodBit
Definition: TTree.h:181
Helper class to prevent infinite recursion in the usage of TTree Friends.
Definition: TTree.h:177
virtual Int_t SetCacheSize(Long64_t cachesize=-1)
Set maximum size of the file cache .
Definition: TTree.cxx:8433
Int_t fDebug
! Debug level
Definition: TTree.h:104
Int_t SetCacheSizeAux(Bool_t autocache=kTRUE, Long64_t cacheSize=0)
Set the size of the file cache and create it if possible.
Definition: TTree.cxx:8459
Array of doubles (64 bits per element).
Definition: TArrayD.h:27
virtual Long64_t GetEntries() const
Definition: TTree.h:448
virtual void SetBasketSize(const char *bname, Int_t buffsize=16000)
Set a branch&#39;s basket size.
Definition: TTree.cxx:8113
virtual TBranch * BranchRef()
Build the optional branch supporting the TRefTable.
Definition: TTree.cxx:2299
virtual void ResetAfterMerge(TFileMergeInfo *)
Resets the state of this TTree after a merge (keep the customization but forget the data)...
Definition: TTree.cxx:7831
virtual Bool_t SetAlias(const char *aliasName, const char *aliasFormula)
Set a tree variable alias.
Definition: TTree.cxx:7933
Int_t fFileNumber
! current file number (if file extensions)
Definition: TTree.h:109
virtual TBranch * BranchImpArr(const char *branchname, EDataType datatype, std::size_t N, void *addobj, Int_t bufsize, Int_t splitlevel)
Definition: TTree.cxx:1705
Mother of all ROOT objects.
Definition: TObject.h:37
Int_t fUpdate
Update frequency for EntryLoop.
Definition: TTree.h:86
Long64_t operator()()
Definition: TTree.h:297
Long64_t fEntries
Number of entries.
Definition: TTree.h:77
TList * fClones
! List of cloned trees which share our addresses
Definition: TTree.h:125
virtual Int_t MakeSelector(const char *selector=0, Option_t *option="")
Generate skeleton selector class for this tree.
Definition: TTree.cxx:6660
TBuffer * GetTransientBuffer(Int_t size)
Returns the transient buffer currently used by this TTree for reading/writing baskets.
Definition: TTree.cxx:1012
virtual Long64_t GetTotBytes() const
Definition: TTree.h:501
virtual Long64_t GetSelectedRows() const =0
Class implementing or helping the various TTree cloning method.
Definition: TTreeCloner.h:29
virtual Double_t * GetVal(Int_t i)
Definition: TTree.h:519
Abstract base class defining the interface for the plugins that implement Draw, Scan, Process, MakeProxy, etc.
Long64_t GetDebugMax() const
Definition: TTree.h:445
TClusterIterator(TTree *tree, Long64_t firstEntry)
Regular constructor.
Definition: TTree.cxx:545
Definition: file.py:1
A TFriendElement TF describes a TTree object TF in a file.
virtual Long64_t GetZipBytes() const
Definition: TTree.h:530
Long64_t fNextEntry
Definition: TTree.h:261
Iterator on all the leaves in a TTree and its friend.
Definition: TTree.h:652
virtual TBranch * BronchExec(const char *name, const char *classname, void *addobj, Bool_t isptrptr, Int_t bufsize, Int_t splitlevel)
Helper function implementing TTree::Bronch and TTree::Branch(const char *name, T &obj);.
Definition: TTree.cxx:2383
virtual void RecursiveRemove(TObject *obj)
Make sure that obj (which is being deleted or will soon be) is no longer referenced by this TTree...
Definition: TTree.cxx:7692
virtual void SetCircular(Long64_t maxEntries)
Enable/Disable circularity for this tree.
Definition: TTree.cxx:8639
virtual void Reset(Option_t *option="")
Reset baskets, buffers and entries count in all branches and leaves.
Definition: TTree.cxx:7800
virtual void SetClusterPrefetch(Bool_t enabled)
Definition: TTree.h:595
Definition: tree.py:1
std::atomic< Long64_t > fTotalBuffers
! Total number of bytes in branch buffers
Definition: TTree.h:101
virtual void SetTimerInterval(Int_t msec=333)
Definition: TTree.h:629
virtual TTreeFormula * GetVar2() const =0
TObject * fNotify
! Object to be notified when loading a Tree
Definition: TTree.h:110
virtual Int_t SetCacheEntryRange(Long64_t first, Long64_t last)
interface to TTreeCache to set the cache entry range
Definition: TTree.cxx:8578
TTreeFormula * GetVar1()
Definition: TTree.h:511
A TTree represents a columnar dataset.
Definition: TTree.h:72
#define gDirectory
Definition: TDirectory.h:223
TVirtualIndex * fTreeIndex
Pointer to the tree Index (if any)
Definition: TTree.h:119
TList * fExternalFriends
! List of TFriendsElement pointing to us and need to be notified of LoadTree. Content not owned...
Definition: TTree.h:121
TFriendLock & operator=(const TFriendLock &)
Assignment operator.
Definition: TTree.cxx:515
Int_t SetBranchAddressImp(TBranch *branch, void *addr, TBranch **ptr)
Change branch address, dealing with clone trees properly.
Definition: TTree.cxx:8197
TEventList * GetEventList() const
Definition: TTree.h:458
virtual void SetDefaultEntryOffsetLen(Int_t newdefault, Bool_t updateExisting=kFALSE)
Update the default value for the branch&#39;s fEntryOffsetLen.
Definition: TTree.cxx:8687
TObject * Next()
Go the next friend element.
Definition: TTree.cxx:9557
Definition: first.py:1
virtual void DropBaskets()
Remove some baskets from memory.
Definition: TTree.cxx:4398
virtual TIterator * GetIteratorOnAllLeaves(Bool_t dir=kIterForward)
Creates a new iterator that will go through all the leaves on the tree itself and its friend...
Definition: TTree.cxx:5927
virtual void SetImplicitMT(Bool_t enabled)
Definition: TTree.h:605
static Long64_t fgMaxTreeSize
Maximum size of a file containing a Tree.
Definition: TTree.h:145
virtual Long64_t SetEntries(Long64_t n=-1)
Change number of entries in the tree.
Definition: TTree.cxx:8758
virtual TFile * ChangeFile(TFile *file)
Called by TTree::Fill() when file has reached its maximum fgMaxTreeSize.
Definition: TTree.cxx:2698
static TTree * MergeTrees(TList *list, Option_t *option="")
Static function merging the trees in the TList into a new tree.
Definition: TTree.cxx:6689
A TTree is a list of TBranches.
Definition: TBranch.h:90
A TSelector object is used by the TTree::Draw, TTree::Scan, TTree::Process to navigate in a TTree and...
Definition: TSelector.h:33
Int_t FlushBasketsImpl() const
Internal implementation of the FlushBaskets algorithm.
Definition: TTree.cxx:5014
A List of entry numbers in a TTree or TChain.
Definition: TEntryList.h:25
virtual Int_t AddBranchToCache(const char *bname, Bool_t subbranches=kFALSE)
Add branch with name bname to the Tree cache.
Definition: TTree.cxx:1034
const Bool_t kTRUE
Definition: RtypesCore.h:87
Int_t fPacketSize
! Number of entries in one packet for parallel root
Definition: TTree.h:102
const Int_t n
Definition: legend1.C:16
virtual Long64_t Project(const char *hname, const char *varexp, const char *selection="", Option_t *option="", Long64_t nentries=kMaxEntries, Long64_t firstentry=0)
Make a projection of a tree using selections.
Definition: TTree.cxx:7314
virtual void SetScanField(Int_t n=50)
Definition: TTree.h:627
Line Attributes class.
Definition: TAttLine.h:18
virtual Double_t * GetV1()
Definition: TTree.h:521
Int_t SetBranchAddress(const char *bname, T *add, TBranch **ptr=0)
Definition: TTree.h:581
TIOFeatures fIOFeatures
IO features to define for newly-written baskets and branches.
Definition: TTree.h:107
static constexpr Long64_t kMaxEntries
Definition: TTree.h:218
char name[80]
Definition: TGX11.cxx:109
TFriendLock(const TFriendLock &)
Copy constructor.
Definition: TTree.cxx:505
virtual Long64_t GetEntriesFriend() const
Return pointer to the 1st Leaf named name in any Branch of this Tree or any branch in the list of fri...
Definition: TTree.cxx:5356
virtual void SetName(const char *name)
Change the name of this tree.
Definition: TTree.cxx:8952
Long64_t GetEstimatedClusterSize()
Estimate the cluster size.
Definition: TTree.cxx:596
A Chain Index.
Definition: TChainIndex.h:39
virtual void PrintCacheStats(Option_t *option="") const
Print statistics about the TreeCache for this tree.
Definition: TTree.cxx:7186
void MoveReadCache(TFile *src, TDirectory *dir)
Move a cache from a file to the current file in dir.
Definition: TTree.cxx:6827
virtual void CopyAddresses(TTree *, Bool_t undo=kFALSE)
Set branch addresses of passed tree equal to ours.
Definition: TTree.cxx:3236
virtual TObjArray * GetListOfLeaves()
Definition: TTree.h:474
virtual Long64_t GetMaxVirtualSize() const
Definition: TTree.h:485
Long64_t fSavedBytes
Number of autosaved bytes.
Definition: TTree.h:81
Long64_t fCacheSize
! Maximum size of file buffers
Definition: TTree.h:98
virtual const char * GetFriendAlias(TTree *) const
If the &#39;tree&#39; is a friend, this method returns its alias name.
Definition: TTree.cxx:5877
virtual void SetChainOffset(Long64_t offset=0)
Definition: TTree.h:593
virtual Long64_t AutoSave(Option_t *option="")
AutoSave tree header every fAutoSave bytes.
Definition: TTree.cxx:1474
virtual void RemoveExternalFriend(TFriendElement *fe)
Definition: TTree.h:557
virtual Double_t * GetIndexValues()
Definition: TTree.h:467
virtual Double_t * GetV1() const =0
std::atomic< Long64_t > fIMTTotBytes
! Total bytes for the IMT flush baskets
Definition: TTree.h:150