Logo ROOT  
Reference Guide
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Loading...
Searching...
No Matches
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 "TClass.h"
37#include "TDataType.h"
38#include "TDirectory.h"
39#include "TObjArray.h"
40#include "TVirtualTreePlayer.h"
41
42#ifdef R__LESS_INCLUDES
43class TBranch;
44class TList;
45#else
46#include "TBranch.h"
47// #include "TBuffer.h"
48#include "TList.h"
49#endif
50
51#include <array>
52#include <atomic>
53#include <vector>
54#include <utility>
55
56class TBuffer;
57class TBrowser;
58class TFile;
59class TLeaf;
60class TH1;
61class TTreeFormula;
62class TPolyMarker;
63class TEventList;
64class TEntryList;
65class TSQLResult;
66class TSelector;
67class TPrincipal;
68class TFriendElement;
69class TCut;
70class TVirtualIndex;
71class TBranchRef;
72class TBasket;
73class TStreamerInfo;
74class TTreeCache;
75class TTreeCloner;
76class TFileMergeInfo;
78
79class TTree : public TNamed, public TAttLine, public TAttFill, public TAttMarker {
80
82
83protected:
84 Long64_t fEntries; ///< Number of entries
85// NOTE: cannot use std::atomic for these counters as it cannot be serialized.
86 Long64_t fTotBytes; ///< Total number of bytes in all branches before compression
87 Long64_t fZipBytes; ///< Total number of bytes in all branches after compression
88 Long64_t fSavedBytes; ///< Number of autosaved bytes
89 Long64_t fFlushedBytes; ///< Number of auto-flushed bytes
90 Double_t fWeight; ///< Tree weight (see TTree::SetWeight)
91 Int_t fTimerInterval; ///< Timer interval in milliseconds
92 Int_t fScanField; ///< Number of runs before prompting in Scan
93 Int_t fUpdate; ///< Update frequency for EntryLoop
94 Int_t fDefaultEntryOffsetLen; ///< Initial Length of fEntryOffset table in the basket buffers
95 Int_t fNClusterRange; ///< Number of Cluster range in addition to the one defined by 'AutoFlush'
96 Int_t fMaxClusterRange; ///<! Memory allocated for the cluster range.
97 Long64_t fMaxEntries; ///< Maximum number of entries in case of circular buffers
98 Long64_t fMaxEntryLoop; ///< Maximum number of entries to process
99 Long64_t fMaxVirtualSize; ///< Maximum total size of buffers kept in memory
100 Long64_t fAutoSave; ///< Autosave tree when fAutoSave entries written or -fAutoSave (compressed) bytes produced
101 Long64_t fAutoFlush; ///< Auto-flush tree when fAutoFlush entries written or -fAutoFlush (compressed) bytes produced
102 Long64_t fEstimate; ///< Number of entries to estimate histogram limits
103 Long64_t *fClusterRangeEnd; ///<[fNClusterRange] Last entry of a cluster range.
104 Long64_t *fClusterSize; ///<[fNClusterRange] Number of entries in each cluster for a given range.
105 Long64_t fCacheSize; ///<! Maximum size of file buffers
106 Long64_t fChainOffset; ///<! Offset of 1st entry of this Tree in a TChain
107 Long64_t fReadEntry; ///<! Number of the entry being processed
108 std::atomic<Long64_t> fTotalBuffers; ///<! Total number of bytes in branch buffers
109 Int_t fPacketSize; ///<! Number of entries in one packet for parallel root
110 Int_t fNfill; ///<! Local for EntryLoop
111 Int_t fDebug; ///<! Debug level
112 Long64_t fDebugMin; ///<! First entry number to debug
113 Long64_t fDebugMax; ///<! Last entry number to debug
114 TIOFeatures fIOFeatures{0}; ///< IO features to define for newly-written baskets and branches.
115 Int_t fMakeClass; ///<! not zero when processing code generated by MakeClass
116 Int_t fFileNumber; ///<! current file number (if file extensions)
117 /// Object to be notified when loading a Tree.
118 /// TTree::LoadTree() and TChain::LoadTree() will call fNotify->Notify().
119 /// Usually points to a TNotifyLink if this is a TChain.
121 TDirectory *fDirectory; ///<! Pointer to directory holding this tree
122 TObjArray fBranches; ///< List of Branches
123 TObjArray fLeaves; ///< Direct pointers to individual branch leaves
124 TList *fAliases; ///< List of aliases for expressions based on the tree branches.
125 TEventList *fEventList; ///<! Pointer to event selection list (if one)
126 TEntryList *fEntryList; ///<! Pointer to event selection list (if one)
127 TArrayD fIndexValues; ///< Sorted index values
128 TArrayI fIndex; ///< Index of sorted values
129 TVirtualIndex *fTreeIndex; ///< Pointer to the tree Index (if any)
130 TList *fFriends; ///< pointer to list of friend elements
131 TList *fExternalFriends; ///<! List of TFriendsElement pointing to us and need to be notified of LoadTree. Content not owned.
132 TVirtualPerfStats *fPerfStats; ///<! pointer to the current perf stats object
133 TList *fUserInfo; ///< pointer to a list of user objects associated to this Tree
134 TVirtualTreePlayer *fPlayer; ///<! Pointer to current Tree player
135 TList *fClones; ///<! List of cloned trees which share our addresses
136 TBranchRef *fBranchRef; ///< Branch supporting the TRefTable (if any)
137 UInt_t fFriendLockStatus; ///<! Record which method is locking the friend recursion
138 TBuffer *fTransientBuffer; ///<! Pointer to the current transient buffer.
139 bool fCacheDoAutoInit; ///<! true if cache auto creation or resize check is needed
140 bool fCacheDoClusterPrefetch;///<! true if cache is prefetching whole clusters
141 bool fCacheUserSet; ///<! true if the cache setting was explicitly given by user
142 bool fIMTEnabled; ///<! true if implicit multi-threading is enabled for this tree
143 UInt_t fNEntriesSinceSorting; ///<! Number of entries processed since the last re-sorting of branches
144 std::vector<std::pair<Long64_t,TBranch*>> fSortedBranches; ///<! Branches to be processed in parallel when IMT is on, sorted by average task time
145 std::vector<TBranch*> fSeqBranches; ///<! Branches to be processed sequentially when IMT is on
146 Float_t fTargetMemoryRatio{1.1f}; ///<! Ratio for memory usage in uncompressed buffers versus actual occupancy. 1.0
147 /// indicates basket should be resized to exact memory usage, but causes significant
148/// memory churn.
149#ifdef R__TRACK_BASKET_ALLOC_TIME
150 mutable std::atomic<ULong64_t> fAllocationTime{0}; ///<! Time spent reallocating basket memory buffers, in microseconds.
151#endif
152 mutable std::atomic<UInt_t> fAllocationCount{0}; ///<! Number of reallocations basket memory buffers.
153
154 static Int_t fgBranchStyle; ///< Old/New branch style
155 static Long64_t fgMaxTreeSize; ///< Maximum size of a file containing a Tree
156
157private:
158 // For simplicity, although fIMTFlush is always disabled in non-IMT builds, we don't #ifdef it out.
159 mutable bool fIMTFlush{false}; ///<! True if we are doing a multithreaded flush.
160 mutable std::atomic<Long64_t> fIMTTotBytes; ///<! Total bytes for the IMT flush baskets
161 mutable std::atomic<Long64_t> fIMTZipBytes; ///<! Zip bytes for the IMT flush baskets.
162
164 void SortBranchesByTime();
165 Int_t FlushBasketsImpl() const;
166 void MarkEventCluster();
168
169protected:
170 virtual void KeepCircular();
171 virtual TBranch *BranchImp(const char* branchname, const char* classname, TClass* ptrClass, void* addobj, Int_t bufsize, Int_t splitlevel);
173 virtual TBranch *BranchImpRef(const char* branchname, const char* classname, TClass* ptrClass, void* addobj, Int_t bufsize, Int_t splitlevel);
175 virtual TBranch *BranchImpArr(const char* branchname, EDataType datatype, std::size_t N, void* addobj, Int_t bufsize, Int_t splitlevel);
177 virtual TBranch *BronchExec(const char* name, const char* classname, void* addobj, bool isptrptr, Int_t bufsize, Int_t splitlevel);
180 virtual TLeaf *GetLeafImpl(const char* branchname, const char* leafname);
181
183 char GetNewlineValue(std::istream &inputStream);
185 void MoveReadCache(TFile *src, TDirectory *dir);
186 Int_t SetCacheSizeAux(bool autocache = true, Long64_t cacheSize = 0);
187
189 // Helper class to prevent infinite recursion in the
190 // usage of TTree Friends. Implemented in TTree.cxx.
191 TTree *fTree; // Pointer to the locked tree
192 UInt_t fMethodBit; // BIT for the locked method
193 bool fPrevious; // Previous value of the BIT.
194
195 protected:
196 TFriendLock(const TFriendLock&);
198
199 public:
201 ~TFriendLock();
202 };
203 friend class TFriendLock;
204 // So that the index class can use TFriendLock:
205 friend class TTreeIndex;
206 friend class TChainIndex;
207 // So that the TTreeCloner can access the protected interfaces
208 friend class TTreeCloner;
209
210 // use to update fFriendLockStatus
227
228public:
229 // Used as the max value for any TTree range operation.
231
232 // SetBranchAddress return values
249
250 // TTree status bits
254 /// If set, the branch's buffers will grow until an event cluster boundary is hit,
255 /// guaranteeing a basket per cluster. This mode does not provide any guarantee on the
256 /// memory bounds in the case of extremely large events.
258 /// If set, signals that this TTree is the output of the processing of another TTree, and
259 /// the entries are reshuffled w.r.t. to the original TTree. As a safety measure, a TTree
260 /// with this bit set cannot add friends nor can be added as a friend. If you know what
261 /// you are doing, you can manually unset this bit with `ResetBit(EStatusBits::kEntriesReshuffled)`.
262 kEntriesReshuffled = BIT(19) // bits 15-18 are used by TChain
263 };
264
265 // Split level modifier
266 enum {
268 };
269
271 {
272 private:
273 TTree *fTree; // TTree upon which we are iterating.
274 Int_t fClusterRange; // Which cluster range are we looking at.
275 Long64_t fStartEntry; // Where does the cluster start.
276 Long64_t fNextEntry; // Where does the cluster end (exclusive).
277 Long64_t fEstimatedSize; // If positive, the calculated estimated tree size.
278
280
281 protected:
282 friend class TTree;
284
285 public:
286 // Intentionally used the default copy constructor and default destructor
287 // as the TClusterIterator does not own the TTree.
288 // TClusterIterator(const TClusterIterator&);
289 // ~TClusterIterator();
290
291 // No public constructors, the iterator must be
292 // created via TTree::GetClusterIterator
293
294 // Move on to the next cluster and return the starting entry
295 // of this next cluster
296 Long64_t Next();
297
298 // Move on to the previous cluster and return the starting entry
299 // of this previous cluster
301
302 // Return the start entry of the current cluster.
304 return fStartEntry;
305 }
306
307 // Return the first entry of the next cluster.
309 return fNextEntry;
310 }
311
312 Long64_t operator()() { return Next(); }
313 };
314
315 TTree();
316 TTree(const char* name, const char* title, Int_t splitlevel = 99, TDirectory* dir = gDirectory);
317 ~TTree() override;
318
319 TTree(const TTree& tt) = delete;
320 TTree& operator=(const TTree& tt) = delete;
321
322 virtual Int_t AddBranchToCache(const char *bname, bool subbranches = false);
323 virtual Int_t AddBranchToCache(TBranch *branch, bool subbranches = false);
324 virtual Int_t DropBranchFromCache(const char *bname, bool subbranches = false);
325 virtual Int_t DropBranchFromCache(TBranch *branch, bool subbranches = false);
326 void AddClone(TTree*);
327 virtual TFriendElement *AddFriend(const char* treename, const char* filename = "");
328 virtual TFriendElement *AddFriend(const char* treename, TFile* file);
329 virtual TFriendElement *AddFriend(TTree* tree, const char* alias = "", bool warn = false);
330 // As the TBasket invokes Add{Tot,Zip}Bytes on its parent tree, we must do these updates in a thread-safe
331 // manner only when we are flushing multiple baskets in parallel.
332 virtual void AddTotBytes(Int_t tot) { if (fIMTFlush) { fIMTTotBytes += tot; } else { fTotBytes += tot; } }
333 virtual void AddZipBytes(Int_t zip) { if (fIMTFlush) { fIMTZipBytes += zip; } else { fZipBytes += zip; } }
334// NOTE: these counters aren't thread safe like the ones above.
335#ifdef R__TRACK_BASKET_ALLOC_TIME
336 void AddAllocationTime(ULong64_t time) { fAllocationTime += time; }
337#endif
339 virtual Long64_t AutoSave(Option_t* option = "");
340
341 /// Add a new branch, and infer the data type from the type of `obj` being passed.
342 ///
343 /// \note This and the next overload should cover most cases for creating a branch. Try to use these two whenever
344 /// possible, unless e.g. type conversions are needed.
345 ///
346 /// \param[in] name Name of the branch to be created.
347 /// \param[in] obj Address of the object to be added. Make sure to pass a pointer to the actual type/class that
348 /// should be stored in the tree (no pointers to base classes). When calling Fill(), the current value of the type/object will be saved.
349 /// \param[in] bufsize The buffer size in bytes for this branch. When the buffer is full, it is compressed and written to disc.
350 /// 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).
351 /// A small value for bufsize is beneficial if entries in the Tree are accessed randomly and the Tree is in split mode.
352 /// \param[in] splitlevel If T is a class or struct and splitlevel > 0, the members of the object are serialised as separate branches.
353 /// \return Pointer to the TBranch that was created. The branch is owned by the tree.
354 template <class T> TBranch *Branch(const char* name, T* obj, Int_t bufsize = 32000, Int_t splitlevel = 99)
355 {
356 return BranchImpRef(name, TClass::GetClass<T>(), TDataType::GetType(typeid(T)), obj, bufsize, splitlevel);
357 }
358
359 /// Add a new branch, and infer the data type from the array `addobj` being passed.
360 ///
361 /// \note This and the previous overload should cover most cases for creating a branch. Try to use these two whenever
362 /// possible, unless e.g. type conversions are needed.
363 ///
364 /// \param[in] name Name of the branch to be created.
365 /// \param[in] addobj Array of the objects to be added. When calling Fill(), the current value of the type/object will be saved.
366 /// \param[in] bufsize he buffer size in bytes for this branch. When the buffer is full, it is compressed and written to disc.
367 /// 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).
368 /// A small value for bufsize is beneficial if entries in the Tree are accessed randomly and the Tree is in split mode.
369 /// \param[in] splitlevel If T is a class or struct and splitlevel > 0, the members of the object are serialised as separate branches.
370 /// \return Pointer to the TBranch that was created. The branch is owned by the tree.
371 template <class T> TBranch *Branch(const char* name, T** addobj, Int_t bufsize = 32000, Int_t splitlevel = 99)
372 {
373 return BranchImp(name, TClass::GetClass<T>(), addobj, bufsize, splitlevel);
374 }
375
376 virtual Int_t Branch(TCollection* list, Int_t bufsize = 32000, Int_t splitlevel = 99, const char* name = "");
377 virtual Int_t Branch(TList* list, Int_t bufsize = 32000, Int_t splitlevel = 99);
378 virtual Int_t Branch(const char* folder, Int_t bufsize = 32000, Int_t splitlevel = 99);
379 virtual TBranch *Branch(const char* name, void* address, const char* leaflist, Int_t bufsize = 32000);
380 TBranch *Branch(const char* name, char* address, const char* leaflist, Int_t bufsize = 32000)
381 {
382 // Overload to avoid confusion between this signature and the template instance.
383 return Branch(name,(void*)address,leaflist,bufsize);
384 }
385 TBranch *Branch(const char* name, Longptr_t address, const char* leaflist, Int_t bufsize = 32000)
386 {
387 // Overload to avoid confusion between this signature and the template instance.
388 return Branch(name,(void*)address,leaflist,bufsize);
389 }
390 TBranch *Branch(const char* name, int address, const char* leaflist, Int_t bufsize = 32000)
391 {
392 // Overload to avoid confusion between this signature and the template instance.
393 return Branch(name,(void*)(Longptr_t)address,leaflist,bufsize);
394 }
395 virtual TBranch *Branch(const char* name, const char* classname, void* addobj, Int_t bufsize = 32000, Int_t splitlevel = 99);
396 template <class T> TBranch *Branch(const char* name, const char* classname, T* obj, Int_t bufsize = 32000, Int_t splitlevel = 99)
397 {
398 // See BranchImpRed for details. Here we __ignore
399 return BranchImpRef(name, classname, TClass::GetClass<T>(), obj, bufsize, splitlevel);
400 }
401 template <class T> TBranch *Branch(const char* name, const char* classname, T** addobj, Int_t bufsize = 32000, Int_t splitlevel = 99)
402 {
403 // See BranchImp for details
404 return BranchImp(name, classname, TClass::GetClass<T>(), addobj, bufsize, splitlevel);
405 }
406 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)
407 {
408 TClass *cl = TClass::GetClass<T>();
409 if (cl) {
410 TClass *arrCl = TClass::GetClass<std::array<T, N>>();
411 Error("Branch","std::array of objects not yet supported as top level branch object (the class is %s)",
412 arrCl ? arrCl->GetName() : cl->GetName());
413 return nullptr;
414 }
415 return BranchImpArr(name, TDataType::GetType(typeid(T)), N, obj, bufsize, splitlevel);
416 }
417 virtual TBranch *Bronch(const char* name, const char* classname, void* addobj, Int_t bufsize = 32000, Int_t splitlevel = 99);
418 virtual TBranch *BranchOld(const char* name, const char* classname, void* addobj, Int_t bufsize = 32000, Int_t splitlevel = 1);
419 virtual TBranch *BranchRef();
420 void Browse(TBrowser*) override;
421 virtual Int_t BuildIndex(const char *majorname, const char *minorname = "0");
422 TStreamerInfo *BuildStreamerInfo(TClass* cl, void *pointer = nullptr, bool canOptimize = true);
423 virtual TFile *ChangeFile(TFile* file);
424 virtual TTree *CloneTree(Long64_t nentries = -1, Option_t* option = "");
425 virtual void CopyAddresses(TTree*,bool undo = false);
426 virtual Long64_t CopyEntries(TTree* tree, Long64_t nentries = -1, Option_t *option = "", bool needCopyAddresses = false);
428 virtual TBasket *CreateBasket(TBranch*);
429 virtual void DirectoryAutoAdd(TDirectory *);
430 Int_t Debug() const { return fDebug; }
431 void Delete(Option_t* option = "") override; // *MENU*
432 void Draw(Option_t* opt) override { Draw(opt, "", "", kMaxEntries, 0); }
433 virtual Long64_t Draw(const char* varexp, const TCut& selection, Option_t* option = "", Long64_t nentries = kMaxEntries, Long64_t firstentry = 0);
434 virtual Long64_t Draw(const char* varexp, const char* selection, Option_t* option = "", Long64_t nentries = kMaxEntries, Long64_t firstentry = 0); // *MENU*
435 virtual void DropBaskets();
436 virtual void DropBuffers(Int_t nbytes);
437 bool EnableCache();
438 virtual Int_t Fill();
439 virtual TBranch *FindBranch(const char* name);
440 virtual TLeaf *FindLeaf(const char* name);
441 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*
442 virtual Int_t FlushBaskets(bool create_cluster = true) const;
443 virtual const char *GetAlias(const char* aliasName) const;
445#ifdef R__TRACK_BASKET_ALLOC_TIME
447#endif
448 virtual Long64_t GetAutoFlush() const {return fAutoFlush;}
449 virtual Long64_t GetAutoSave() const {return fAutoSave;}
450 virtual TBranch *GetBranch(const char* name);
451 virtual TBranchRef *GetBranchRef() const { return fBranchRef; };
452 virtual bool GetBranchStatus(const char* branchname) const;
453 static Int_t GetBranchStyle();
454 virtual Long64_t GetCacheSize() const { return fCacheSize; }
455 virtual TClusterIterator GetClusterIterator(Long64_t firstentry);
457 virtual Long64_t GetChainOffset() const { return fChainOffset; }
458 virtual bool GetClusterPrefetch() const { return fCacheDoClusterPrefetch; }
459 TFile *GetCurrentFile() const;
461 Long64_t GetDebugMax() const { return fDebugMax; }
462 Long64_t GetDebugMin() const { return fDebugMin; }
463 TDirectory *GetDirectory() const { return fDirectory; }
464 virtual Long64_t GetEntries() const { return fEntries; }
465 virtual Long64_t GetEntries(const char *selection);
466 /// Return a number greater or equal to the total number of entries in the
467 /// dataset.
468 ///
469 /// \note If you are interested in the total number of entries in a TChain,
470 /// this function will give that number once the last file of the chain
471 /// is opened. In general, using this instead of GetEntries will avoid
472 /// opening all files in the chain which could be very costly for very
473 /// large number of files stored at a remote location.
474 ///
475 /// The logic depends on whether the dataset is a TTree or a TChain. In the
476 /// first case, it simply returns the total number of entries in the tree. In
477 /// the latter case, it depends on which point of the processing of the chain
478 /// this function is called. During most of the chain processing, this
479 /// function will return TTree::kMaxEntries. When the chain arrives at the
480 /// last file, then the function will return the accumulated total number of
481 /// entries in the whole chain. A notable use case where this function
482 /// becomes quite useful is when writing the following for loop to traverse
483 /// the entries in the dataset:
484 ///
485 /// \code{.cpp}
486 /// for(Long64_t ievent = 0; ievent < dataset.GetEntriesFast(); ievent++) {
487 /// // Do something with the event in the dataset
488 /// }
489 /// \endcode
490 ///
491 /// In the example above, independently on whether the dataset is a TTree or
492 /// a TChain, the GetEntriesFast call will provide the correct stopping
493 /// condition for the loop (i.e. the total number of entries). In the TChain
494 /// case, calling GetEntries instead would open all the files in the chain
495 /// upfront which could be costly.
496 ///
497 /// The functionality offered by this method can also be seen when used in
498 /// conjunction with LoadTree. For a call like <tt> LoadTree(ievent) </tt>,
499 /// the condition <tt> ievent < dataset.GetEntriesFast() </tt> is only
500 /// satisfied if \p ievent is strictly smaller than the total number of
501 /// entries in the dataset. In fact, even when the dataset is a TChain, the
502 /// first time LoadTree is called with an entry number that belongs to the
503 /// last file of the chain, this will update the internal data member of the
504 /// class so that the next call to GetEntriesFast returns the total number
505 /// of entries in the dataset.
506 virtual Long64_t GetEntriesFast() const { return fEntries; }
507 virtual Long64_t GetEntriesFriend() const;
508 virtual Long64_t GetEstimate() const { return fEstimate; }
509 virtual Int_t GetEntry(Long64_t entry, Int_t getall = 0);
514 TEventList *GetEventList() const { return fEventList; }
515 virtual TEntryList *GetEntryList();
516 virtual Long64_t GetEntryNumber(Long64_t entry) const;
517 virtual Int_t GetFileNumber() const { return fFileNumber; }
518 virtual TTree *GetFriend(const char*) const;
519 virtual const char *GetFriendAlias(TTree*) const;
521 virtual bool GetImplicitMT() { return fIMTEnabled; }
522 virtual Int_t *GetIndex() { return &fIndex.fArray[0]; }
523 virtual Double_t *GetIndexValues() { return &fIndexValues.fArray[0]; }
525 virtual TIterator *GetIteratorOnAllLeaves(bool dir = kIterForward);
526 virtual TLeaf *GetLeaf(const char* branchname, const char* leafname);
527 virtual TLeaf *GetLeaf(const char* name);
528 virtual TList *GetListOfClones() { return fClones; }
529 virtual TObjArray *GetListOfBranches() { return &fBranches; }
530 virtual TObjArray *GetListOfLeaves() { return &fLeaves; }
531 virtual TList *GetListOfFriends() const { return fFriends; }
532 virtual TList *GetListOfAliases() const { return fAliases; }
533
534 // GetMakeClass is left non-virtual for efficiency reason.
535 // Making it virtual affects the performance of the I/O
536 Int_t GetMakeClass() const { return fMakeClass; }
537
538 virtual Long64_t GetMaxEntryLoop() const { return fMaxEntryLoop; }
539 virtual Double_t GetMaximum(const char* columname);
540 static Long64_t GetMaxTreeSize();
541 virtual Long64_t GetMaxVirtualSize() const { return fMaxVirtualSize; }
542 virtual Double_t GetMinimum(const char* columname);
544 TObject *GetNotify() const { return fNotify; }
546 virtual Int_t GetPacketSize() const { return fPacketSize; }
547 virtual TVirtualPerfStats *GetPerfStats() const { return fPerfStats; }
548 TTreeCache *GetReadCache(TFile *file) const;
549 TTreeCache *GetReadCache(TFile *file, bool create);
550 virtual Long64_t GetReadEntry() const { return fReadEntry; }
551 virtual Long64_t GetReadEvent() const { return fReadEntry; }
552 virtual Int_t GetScanField() const { return fScanField; }
555 virtual Int_t GetTimerInterval() const { return fTimerInterval; }
557 virtual Long64_t GetTotBytes() const { return fTotBytes; }
558 virtual TTree *GetTree() const { return const_cast<TTree*>(this); }
559 virtual TVirtualIndex *GetTreeIndex() const { return fTreeIndex; }
560 virtual Int_t GetTreeNumber() const { return 0; }
562 virtual Int_t GetUpdate() const { return fUpdate; }
563 virtual TList *GetUserInfo();
564 // See TSelectorDraw::GetVar
566 // See TSelectorDraw::GetVar
568 // See TSelectorDraw::GetVar
570 // See TSelectorDraw::GetVar
572 // See TSelectorDraw::GetVar
574 // See TSelectorDraw::GetVal
575 virtual Double_t *GetVal(Int_t i) { return GetPlayer()->GetVal(i); }
576 // See TSelectorDraw::GetVal
577 virtual Double_t *GetV1() { return GetPlayer()->GetV1(); }
578 // See TSelectorDraw::GetVal
579 virtual Double_t *GetV2() { return GetPlayer()->GetV2(); }
580 // See TSelectorDraw::GetVal
581 virtual Double_t *GetV3() { return GetPlayer()->GetV3(); }
582 // See TSelectorDraw::GetVal
583 virtual Double_t *GetV4() { return GetPlayer()->GetV4(); }
584 virtual Double_t *GetW() { return GetPlayer()->GetW(); }
585 virtual Double_t GetWeight() const { return fWeight; }
586 virtual Long64_t GetZipBytes() const { return fZipBytes; }
588 bool IsFolder() const override { return true; }
589 virtual bool InPlaceClone(TDirectory *newdirectory, const char *options = "");
590 virtual Int_t LoadBaskets(Long64_t maxmemory = 2000000000);
593 virtual Int_t MakeClass(const char *classname = nullptr, Option_t* option = "");
594 virtual Int_t MakeCode(const char *filename = nullptr);
595 virtual Int_t MakeProxy(const char* classname, const char* macrofilename = nullptr, const char* cutfilename = nullptr, const char* option = nullptr, Int_t maxUnrolling = 3);
596 virtual Int_t MakeSelector(const char *selector = nullptr, Option_t *option = "");
597 bool MemoryFull(Int_t nbytes);
598 virtual Long64_t Merge(TCollection* list, Option_t* option = "");
600 static TTree *MergeTrees(TList* list, Option_t* option = "");
601 bool Notify() override;
602 virtual void OptimizeBaskets(ULong64_t maxMemory=10000000, Float_t minComp=1.1, Option_t *option="");
603 TPrincipal *Principal(const char* varexp = "", const char* selection = "", Option_t* option = "np", Long64_t nentries = kMaxEntries, Long64_t firstentry = 0);
604 void Print(Option_t* option = "") const override; // *MENU*
605 virtual void PrintCacheStats(Option_t* option = "") const;
606 virtual Long64_t Process(const char* filename, Option_t* option = "", Long64_t nentries = kMaxEntries, Long64_t firstentry = 0); // *MENU*
608 virtual Long64_t Project(const char* hname, const char* varexp, const char* selection = "", Option_t* option = "", Long64_t nentries = kMaxEntries, Long64_t firstentry = 0);
609 virtual TSQLResult *Query(const char* varexp = "", const char* selection = "", Option_t* option = "", Long64_t nentries = kMaxEntries, Long64_t firstentry = 0);
610 virtual Long64_t ReadFile(const char* filename, const char* branchDescriptor = "", char delimiter = ' ');
611 virtual Long64_t ReadStream(std::istream& inputStream, const char* branchDescriptor = "", char delimiter = ' ');
612 virtual void Refresh();
614 virtual void RemoveExternalFriend(TFriendElement *);
615 virtual void RemoveFriend(TTree*);
616 void RecursiveRemove(TObject *obj) override;
617 virtual void Reset(Option_t* option = "");
618 virtual void ResetAfterMerge(TFileMergeInfo *);
619 virtual void ResetBranchAddress(TBranch *);
620 virtual void ResetBranchAddresses();
621 virtual Long64_t Scan(const char* varexp = "", const char* selection = "", Option_t* option = "", Long64_t nentries = kMaxEntries, Long64_t firstentry = 0); // *MENU*
622 virtual bool SetAlias(const char* aliasName, const char* aliasFormula);
623 virtual void SetAutoSave(Long64_t autos = -300000000);
624 virtual void SetAutoFlush(Long64_t autof = -30000000);
625 virtual void SetBasketSize(const char* bname, Int_t buffsize = 16000);
626 virtual Int_t SetBranchAddress(const char *bname,void *add, TBranch **ptr = nullptr);
627 virtual Int_t SetBranchAddress(const char *bname,void *add, TClass *realClass, EDataType datatype, bool isptr);
628 virtual Int_t SetBranchAddress(const char *bname,void *add, TBranch **ptr, TClass *realClass, EDataType datatype, bool isptr);
629 template <class T> Int_t SetBranchAddress(const char *bname, T **add, TBranch **ptr = nullptr) {
630 TClass *cl = TClass::GetClass<T>();
632 if (!cl) type = TDataType::GetType(typeid(T));
633 return SetBranchAddress(bname,add,ptr,cl,type,true);
634 }
635#ifndef R__NO_CLASS_TEMPLATE_SPECIALIZATION
636 // This can only be used when the template overload resolution can distinguish between
637 // T* and T**
638 template <class T> Int_t SetBranchAddress(const char *bname, T *add, TBranch **ptr = nullptr) {
639 TClass *cl = TClass::GetClass<T>();
641 if (!cl) type = TDataType::GetType(typeid(T));
642 return SetBranchAddress(bname,add,ptr,cl,type,false);
643 }
644#endif
645 virtual void SetBranchStatus(const char* bname, bool status = true, UInt_t* found = nullptr);
646 static void SetBranchStyle(Int_t style = 1); //style=0 for old branch, =1 for new branch style
647 virtual Int_t SetCacheSize(Long64_t cachesize = -1);
648 virtual Int_t SetCacheEntryRange(Long64_t first, Long64_t last);
649 virtual void SetCacheLearnEntries(Int_t n=10);
651 virtual void SetCircular(Long64_t maxEntries);
653 virtual void SetDebug(Int_t level = 1, Long64_t min = 0, Long64_t max = 9999999); // *MENU*
654 virtual void SetDefaultEntryOffsetLen(Int_t newdefault, bool updateExisting = false);
655 virtual void SetDirectory(TDirectory* dir);
656 virtual Long64_t SetEntries(Long64_t n = -1);
657 virtual void SetEstimate(Long64_t nentries = 1000000);
659 virtual void SetFileNumber(Int_t number = 0);
660 virtual void SetEventList(TEventList* list);
661 virtual void SetEntryList(TEntryList* list, Option_t *opt="");
662 virtual void SetImplicitMT(bool enabled) { fIMTEnabled = enabled; }
663 virtual void SetMakeClass(Int_t make);
665 static void SetMaxTreeSize(Long64_t maxsize = 100000000000LL);
666 virtual void SetMaxVirtualSize(Long64_t size = 0) { fMaxVirtualSize = size; } // *MENU*
667 void SetName(const char* name) override; // *MENU*
668
669 /**
670 * @brief Sets the address of the object to be notified when the tree is loaded.
671 *
672 * The method TObject::Notify is called for the given object when the tree
673 * is loaded. Specifically this occurs in the TTree::LoadTree method. To
674 * remove the notification call this method with nullptr:
675 * @code tree->SetNotify(nullptr); @endcode
676 *
677 * If this is a TChain, `obj` is most often going to be a TNotifyLink.
678 *
679 * @param[in] obj Pointer to a TObject to be notified.
680 */
681 virtual void SetNotify(TObject* obj);
682
683 virtual void SetObject(const char* name, const char* title);
684 virtual void SetParallelUnzip(bool opt=true, Float_t RelSize=-1);
685 virtual void SetPerfStats(TVirtualPerfStats* perf);
686 /**
687 * \brief Sets the default maximum number of lines to be shown before `<CR>` when calling Scan().
688 * \param n the maximum number of lines. Default=50, if 0, all entries of the Tree are shown
689 * and there is no need to press `<CR>` or `q` to exit the function.
690 * \see TTreePlayer::Scan for more details on how to redirect the output to an ASCII file
691 */
692 virtual void SetScanField(Int_t n = 50) { fScanField = n; } // *MENU*
695 virtual void SetTreeIndex(TVirtualIndex* index);
696 virtual void SetWeight(Double_t w = 1, Option_t* option = "");
697 virtual void SetUpdate(Int_t freq = 0) { fUpdate = freq; }
698 virtual void Show(Long64_t entry = -1, Int_t lenmax = 20);
699 virtual void StartViewer(); // *MENU*
701 virtual Int_t UnbinnedFit(const char* funcname, const char* varexp, const char* selection = "", Option_t* option = "", Long64_t nentries = kMaxEntries, Long64_t firstentry = 0);
702 void UseCurrentStyle() override;
703 Int_t Write(const char *name=nullptr, Int_t option=0, Int_t bufsize=0) override;
704 Int_t Write(const char *name=nullptr, Int_t option=0, Int_t bufsize=0) const override;
705
706 ClassDefOverride(TTree, 20) // Tree descriptor (the main ROOT I/O class)
707};
708
709//////////////////////////////////////////////////////////////////////////
710// //
711// TTreeFriendLeafIter //
712// //
713// Iterator on all the leaves in a TTree and its friend //
714// //
715//////////////////////////////////////////////////////////////////////////
716
718
719protected:
720 TTree *fTree; ///< tree being iterated
721 TIterator *fLeafIter; ///< current leaf sub-iterator.
722 TIterator *fTreeIter; ///< current tree sub-iterator.
723 bool fDirection; ///< iteration direction
724
725 TTreeFriendLeafIter() : fTree(nullptr), fLeafIter(nullptr), fTreeIter(nullptr),
726 fDirection(false) { }
727
728public:
729 TTreeFriendLeafIter(const TTree* t, bool dir = kIterForward);
732 TIterator &operator=(const TIterator &rhs) override;
734
735 const TCollection *GetCollection() const override { return nullptr; }
736 Option_t *GetOption() const override;
737 TObject *Next() override;
739 bool operator !=(const TIterator&) const override {
740 // TODO: Implement me
741 return false;
742 }
743 bool operator !=(const TTreeFriendLeafIter&) const {
744 // TODO: Implement me
745 return false;
746 }
747 TObject *operator*() const override {
748 // TODO: Implement me
749 return nullptr;
750 }
751 ClassDefOverride(TTreeFriendLeafIter,0) //Linked list iterator
752 };
753
754
755#endif
#define SafeDelete(p)
Definition RConfig.hxx:541
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
int Int_t
Definition RtypesCore.h:45
long Longptr_t
Definition RtypesCore.h:75
unsigned int UInt_t
Definition RtypesCore.h:46
float Float_t
Definition RtypesCore.h:57
double Double_t
Definition RtypesCore.h:59
long long Long64_t
Definition RtypesCore.h:69
unsigned long long ULong64_t
Definition RtypesCore.h:70
const char Option_t
Definition RtypesCore.h:66
#define BIT(n)
Definition Rtypes.h:90
#define ClassDefOverride(name, id)
Definition Rtypes.h:346
const Bool_t kIterForward
Definition TCollection.h:42
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
EDataType
Definition TDataType.h:28
@ kOther_t
Definition TDataType.h:32
#define gDirectory
Definition TDirectory.h:384
#define N
Option_t Option_t option
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h offset
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t src
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
Option_t Option_t style
char name[80]
Definition TGX11.cxx:110
int nentries
TIOFeatures provides the end-user with the ability to change the IO behavior of data written via a TT...
Array of doubles (64 bits per element).
Definition TArrayD.h:27
Double_t * fArray
Definition TArrayD.h:30
Array of integers (32 bits per element).
Definition TArrayI.h:27
Int_t * fArray
Definition TArrayI.h:30
Fill Area Attributes class.
Definition TAttFill.h:20
Line Attributes class.
Definition TAttLine.h:20
Marker Attributes class.
Definition TAttMarker.h:20
Manages buffers for branches of a Tree.
Definition TBasket.h:34
A branch containing and managing a TRefTable for TRef autoloading.
Definition TBranchRef.h:34
A TTree is a list of TBranches.
Definition TBranch.h:93
Using a TBrowser one can browse all ROOT objects.
Definition TBrowser.h:37
Buffer base class used for serializing objects.
Definition TBuffer.h:43
A Chain Index.
Definition TChainIndex.h:40
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition TClass.h:84
Collection abstract base class.
Definition TCollection.h:65
A specialized string object used for TTree selections.
Definition TCut.h:25
Int_t GetType() const
Definition TDataType.h:68
Describe directory structure in memory.
Definition TDirectory.h:45
A List of entry numbers in a TTree or TChain.
Definition TEntryList.h:26
<div class="legacybox"><h2>Legacy Code</h2> TEventList is a legacy interface: there will be no bug fi...
Definition TEventList.h:31
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
Definition TFile.h:131
A TFriendElement TF describes a TTree object TF in a file.
TH1 is the base class of all histogram classes in ROOT.
Definition TH1.h:59
Iterator abstract base class.
Definition TIterator.h:30
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
Definition TLeaf.h:57
A doubly linked list.
Definition TList.h:38
The TNamed class is the base class for all named ROOT classes.
Definition TNamed.h:29
const char * GetName() const override
Returns name of object.
Definition TNamed.h:49
An array of TObjects.
Definition TObjArray.h:31
Int_t GetEntriesFast() const
Definition TObjArray.h:58
Mother of all ROOT objects.
Definition TObject.h:41
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition TObject.cxx:1054
A PolyMarker is defined by an array on N points in a 2-D space.
Definition TPolyMarker.h:31
Principal Components Analysis (PCA)
Definition TPrincipal.h:21
A TSelector object is used by the TTree::Draw, TTree::Scan, TTree::Process to navigate in a TTree and...
Definition TSelector.h:31
Describes a persistent version of a class.
A cache to speed-up the reading of ROOT datasets.
Definition TTreeCache.h:32
Class implementing or helping the various TTree cloning method.
Definition TTreeCloner.h:31
Used to pass a selection expression to the Tree drawing routine.
Iterator on all the leaves in a TTree and its friend.
Definition TTree.h:717
bool operator!=(const TIterator &) const override
Compare two iterator objects.
Definition TTree.h:739
const TCollection * GetCollection() const override
Definition TTree.h:735
TTree * fTree
tree being iterated
Definition TTree.h:720
TObject * operator*() const override
Return current object or nullptr.
Definition TTree.h:747
void Reset() override
Definition TTree.h:738
TIterator & operator=(const TIterator &rhs) override
Overridden assignment operator. Does NOT copy the 'cursor' location!
Definition TTree.cxx:9897
~TTreeFriendLeafIter() override
Definition TTree.h:731
TObject * Next() override
Go the next friend element.
Definition TTree.cxx:9920
TIterator * fLeafIter
current leaf sub-iterator.
Definition TTree.h:721
Option_t * GetOption() const override
Returns the object option stored in the list.
Definition TTree.cxx:9959
TIterator * fTreeIter
current tree sub-iterator.
Definition TTree.h:722
bool fDirection
iteration direction
Definition TTree.h:723
A Tree Index with majorname and minorname.
Definition TTreeIndex.h:29
Helper class to iterate over cluster of baskets.
Definition TTree.h:271
Long64_t GetEstimatedClusterSize()
Estimate the cluster size.
Definition TTree.cxx:601
Long64_t Previous()
Move on to the previous cluster and return the starting entry of this previous cluster.
Definition TTree.cxx:684
Long64_t GetStartEntry()
Definition TTree.h:303
Long64_t operator()()
Definition TTree.h:312
Long64_t Next()
Move on to the next cluster and return the starting entry of this next cluster.
Definition TTree.cxx:640
Long64_t GetNextEntry()
Definition TTree.h:308
Long64_t fEstimatedSize
Definition TTree.h:277
TClusterIterator(TTree *tree, Long64_t firstEntry)
Regular constructor.
Definition TTree.cxx:550
Helper class to prevent infinite recursion in the usage of TTree Friends.
Definition TTree.h:188
TFriendLock & operator=(const TFriendLock &)
Assignment operator.
Definition TTree.cxx:520
UInt_t fMethodBit
Definition TTree.h:192
TTree * fTree
Definition TTree.h:191
~TFriendLock()
Restore the state of tree the same as before we set the lock.
Definition TTree.cxx:533
A TTree represents a columnar dataset.
Definition TTree.h:79
virtual Int_t Fill()
Fill all branches.
Definition TTree.cxx:4606
virtual TFriendElement * AddFriend(const char *treename, const char *filename="")
Add a TFriendElement to the list of friends.
Definition TTree.cxx:1322
TBranchRef * fBranchRef
Branch supporting the TRefTable (if any)
Definition TTree.h:136
TStreamerInfo * BuildStreamerInfo(TClass *cl, void *pointer=nullptr, bool canOptimize=true)
Build StreamerInfo for class cl.
Definition TTree.cxx:2645
virtual TBranch * FindBranch(const char *name)
Return the branch that correspond to the path 'branchname', which can include the name of the tree or...
Definition TTree.cxx:4842
virtual TVirtualPerfStats * GetPerfStats() const
Definition TTree.h:547
virtual void SetTimerInterval(Int_t msec=333)
Definition TTree.h:694
virtual void SetBranchStatus(const char *bname, bool status=true, UInt_t *found=nullptr)
Set branch status to Process or DoNotProcess.
Definition TTree.cxx:8628
TTreeFormula * GetSelect()
Definition TTree.h:553
bool EnableCache()
Enable the TTreeCache unless explicitly disabled for this TTree by a prior call to SetCacheSize(0).
Definition TTree.cxx:2678
virtual TBranch * GetBranch(const char *name)
Return pointer to the branch with the given name in this tree or its friends.
Definition TTree.cxx:5295
virtual Int_t GetScanField() const
Definition TTree.h:552
static Int_t GetBranchStyle()
Static function returning the current branch style.
Definition TTree.cxx:5396
TList * fFriends
pointer to list of friend elements
Definition TTree.h:130
bool fIMTEnabled
! true if implicit multi-threading is enabled for this tree
Definition TTree.h:142
virtual Long64_t GetChainEntryNumber(Long64_t entry) const
Definition TTree.h:456
virtual bool GetBranchStatus(const char *branchname) const
Return status of branch with name branchname.
Definition TTree.cxx:5381
UInt_t fFriendLockStatus
! Record which method is locking the friend recursion
Definition TTree.h:137
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:6101
Long64_t fTotBytes
Total number of bytes in all branches before compression.
Definition TTree.h:86
virtual Int_t FlushBaskets(bool 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:5130
Int_t GetDefaultEntryOffsetLen() const
Definition TTree.h:460
Int_t fMaxClusterRange
! Memory allocated for the cluster range.
Definition TTree.h:96
virtual void Show(Long64_t entry=-1, Int_t lenmax=20)
Print values of all active leaves for entry.
Definition TTree.cxx:9490
TEventList * fEventList
! Pointer to event selection list (if one)
Definition TTree.h:125
virtual Long64_t GetAutoSave() const
Definition TTree.h:449
virtual Int_t StopCacheLearningPhase()
Stop the cache learning phase.
Definition TTree.cxx:9579
virtual Int_t GetEntry(Long64_t entry, Int_t getall=0)
Read all branches of entry and return total number of bytes read.
Definition TTree.cxx:5641
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:144
virtual void SetCircular(Long64_t maxEntries)
Enable/Disable circularity for this tree.
Definition TTree.cxx:8986
virtual Long64_t GetEstimate() const
Definition TTree.h:508
Long64_t GetDebugMax() const
Definition TTree.h:461
Long64_t fSavedBytes
Number of autosaved bytes.
Definition TTree.h:88
virtual Int_t AddBranchToCache(const char *bname, bool subbranches=false)
Add branch with name bname to the Tree cache.
Definition TTree.cxx:1049
Long64_t GetMedianClusterSize()
Estimate the median cluster size for the TTree.
Definition TTree.cxx:8391
virtual TClusterIterator GetClusterIterator(Long64_t firstentry)
Return an iterator over the cluster of baskets starting at firstentry.
Definition TTree.cxx:5468
virtual void ResetBranchAddress(TBranch *)
Tell a branch to set its address to zero.
Definition TTree.cxx:8145
bool fCacheUserSet
! true if the cache setting was explicitly given by user
Definition TTree.h:141
char GetNewlineValue(std::istream &inputStream)
Determine which newline this file is using.
Definition TTree.cxx:7668
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:371
TIOFeatures fIOFeatures
IO features to define for newly-written baskets and branches.
Definition TTree.h:114
virtual Long64_t GetSelectedRows()
Definition TTree.h:554
void AddAllocationCount(UInt_t count)
Definition TTree.h:338
virtual void SetMaxEntryLoop(Long64_t maxev=kMaxEntries)
Definition TTree.h:664
virtual Long64_t GetEntryNumberWithIndex(Long64_t major, Long64_t minor=0) const
Return entry number corresponding to major and minor number.
Definition TTree.cxx:5913
Long64_t fDebugMin
! First entry number to debug
Definition TTree.h:112
virtual Long64_t SetEntries(Long64_t n=-1)
Change number of entries in the tree.
Definition TTree.cxx:9105
virtual TObjArray * GetListOfLeaves()
Definition TTree.h:530
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:2067
Long64_t GetCacheAutoSize(bool withDefault=false)
Used for automatic sizing of the cache.
Definition TTree.cxx:5408
virtual TBranch * BranchRef()
Build the optional branch supporting the TRefTable.
Definition TTree.cxx:2321
TFile * GetCurrentFile() const
Return pointer to the current file.
Definition TTree.cxx:5480
TObject * GetNotify() const
Definition TTree.h:544
TList * fAliases
List of aliases for expressions based on the tree branches.
Definition TTree.h:124
TBranch * Branch(const char *name, Longptr_t address, const char *leaflist, Int_t bufsize=32000)
Definition TTree.h:385
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:3722
virtual Int_t DropBranchFromCache(const char *bname, bool subbranches=false)
Remove the branch with name 'bname' from the Tree cache.
Definition TTree.cxx:1132
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:5080
Long64_t * fClusterRangeEnd
[fNClusterRange] Last entry of a cluster range.
Definition TTree.h:103
std::atomic< Long64_t > fIMTZipBytes
! Zip bytes for the IMT flush baskets.
Definition TTree.h:161
void RecursiveRemove(TObject *obj) override
Make sure that obj (which is being deleted or will soon be) is no longer referenced by this TTree.
Definition TTree.cxx:7961
TVirtualTreePlayer * GetPlayer()
Load the TTreePlayer (if not already done).
Definition TTree.cxx:6308
virtual Int_t MakeProxy(const char *classname, const char *macrofilename=nullptr, const char *cutfilename=nullptr, const char *option=nullptr, Int_t maxUnrolling=3)
Generate a skeleton analysis class for this Tree using TBranchProxy.
Definition TTree.cxx:6771
Float_t fTargetMemoryRatio
! Ratio for memory usage in uncompressed buffers versus actual occupancy.
Definition TTree.h:146
virtual Double_t * GetIndexValues()
Definition TTree.h:523
virtual TList * GetListOfAliases() const
Definition TTree.h:532
virtual Long64_t ReadStream(std::istream &inputStream, const char *branchDescriptor="", char delimiter=' ')
Create or simply read branches from an input stream.
Definition TTree.cxx:7695
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:9022
Int_t fScanField
Number of runs before prompting in Scan.
Definition TTree.h:92
virtual Double_t GetWeight() const
Definition TTree.h:585
void Draw(Option_t *opt) override
Default Draw method for all objects.
Definition TTree.h:432
virtual TTree * GetFriend(const char *) const
Return a pointer to the TTree friend whose name or alias is friendname.
Definition TTree.cxx:5978
TTreeFormula * GetVar(Int_t i)
Definition TTree.h:565
virtual void SetNotify(TObject *obj)
Sets the address of the object to be notified when the tree is loaded.
Definition TTree.cxx:9336
virtual Double_t GetMaximum(const char *columname)
Return maximum of column with name columname.
Definition TTree.cxx:6238
virtual Long64_t GetEntryNumberWithBestIndex(Long64_t major, Long64_t minor=0) const
Return entry number corresponding to major and minor number.
Definition TTree.cxx:5893
static void SetMaxTreeSize(Long64_t maxsize=100000000000LL)
Set the maximum size in bytes of a Tree file (static function).
Definition TTree.cxx:9302
void Print(Option_t *option="") const override
Print a summary of the tree contents.
Definition TTree.cxx:7298
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:9807
Int_t fNClusterRange
Number of Cluster range in addition to the one defined by 'AutoFlush'.
Definition TTree.h:95
virtual void PrintCacheStats(Option_t *option="") const
Print statistics about the TreeCache for this tree.
Definition TTree.cxx:7450
virtual Int_t BuildIndex(const char *majorname, const char *minorname="0")
Build a Tree Index (default is TTreeIndex).
Definition TTree.cxx:2630
TVirtualTreePlayer * fPlayer
! Pointer to current Tree player
Definition TTree.h:134
virtual TIterator * GetIteratorOnAllLeaves(bool dir=kIterForward)
Creates a new iterator that will go through all the leaves on the tree itself and its friend.
Definition TTree.cxx:6085
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:9282
virtual bool InPlaceClone(TDirectory *newdirectory, const char *options="")
Copy the content to a new new file, update this TTree with the new location information and attach th...
Definition TTree.cxx:7091
virtual void IncrementTotalBuffers(Int_t nbytes)
Definition TTree.h:587
TObjArray fBranches
List of Branches.
Definition TTree.h:122
TDirectory * GetDirectory() const
Definition TTree.h:463
bool fCacheDoAutoInit
! true if cache auto creation or resize check is needed
Definition TTree.h:139
TTreeCache * GetReadCache(TFile *file) const
Find and return the TTreeCache registered with the file and which may contain branches for us.
Definition TTree.cxx:6321
Long64_t fEntries
Number of entries.
Definition TTree.h:84
virtual TFile * ChangeFile(TFile *file)
Called by TTree::Fill() when file has reached its maximum fgMaxTreeSize.
Definition TTree.cxx:2742
virtual TEntryList * GetEntryList()
Returns the entry list assigned to this tree.
Definition TTree.cxx:5857
virtual void SetWeight(Double_t w=1, Option_t *option="")
Set tree weight.
Definition TTree.cxx:9479
void InitializeBranchLists(bool checkLeafCount)
Divides the top-level branches into two vectors: (i) branches to be processed sequentially and (ii) b...
Definition TTree.cxx:5784
virtual Int_t SetBranchAddress(const char *bname, void *add, TBranch **ptr=nullptr)
Change branch address, dealing with clone trees properly.
Definition TTree.cxx:8479
Long64_t * fClusterSize
[fNClusterRange] Number of entries in each cluster for a given range.
Definition TTree.h:104
Long64_t fFlushedBytes
Number of auto-flushed bytes.
Definition TTree.h:89
virtual void SetPerfStats(TVirtualPerfStats *perf)
Set perf stats.
Definition TTree.cxx:9434
TTreeFormula * GetVar2()
Definition TTree.h:569
std::atomic< Long64_t > fIMTTotBytes
! Total bytes for the IMT flush baskets
Definition TTree.h:160
virtual void SetCacheLearnEntries(Int_t n=10)
Interface to TTreeCache to set the number of entries for the learning phase.
Definition TTree.cxx:8959
Int_t SetBranchAddress(const char *bname, T *add, TBranch **ptr=nullptr)
Definition TTree.h:638
void SetTargetMemoryRatio(Float_t ratio)
Definition TTree.h:693
TEntryList * fEntryList
! Pointer to event selection list (if one)
Definition TTree.h:126
@ kSplitCollectionOfPointers
Definition TTree.h:267
virtual TVirtualIndex * GetTreeIndex() const
Definition TTree.h:559
Int_t Debug() const
Definition TTree.h:430
TList * fExternalFriends
! List of TFriendsElement pointing to us and need to be notified of LoadTree. Content not owned.
Definition TTree.h:131
virtual Long64_t Merge(TCollection *list, Option_t *option="")
Merge the trees in the TList into this tree.
Definition TTree.cxx:6905
virtual void SetMaxVirtualSize(Long64_t size=0)
Definition TTree.h:666
virtual void DropBaskets()
Remove some baskets from memory.
Definition TTree.cxx:4521
virtual void SetAutoSave(Long64_t autos=-300000000)
In case of a program crash, it will be possible to recover the data in the tree up to the last AutoSa...
Definition TTree.cxx:8436
virtual bool GetClusterPrefetch() const
Definition TTree.h:458
TBranch * Branch(const char *name, const char *classname, T **addobj, Int_t bufsize=32000, Int_t splitlevel=99)
Definition TTree.h:401
Long64_t fMaxEntryLoop
Maximum number of entries to process.
Definition TTree.h:98
friend TBranch * TTreeBranchImpRef(TTree *tree, const char *branchname, TClass *ptrClass, EDataType datatype, void *addobj, Int_t bufsize, Int_t splitlevel)
Float_t GetTargetMemoryRatio() const
Definition TTree.h:561
virtual void SetParallelUnzip(bool opt=true, Float_t RelSize=-1)
Enable or disable parallel unzipping of Tree buffers.
Definition TTree.cxx:9396
virtual void SetDirectory(TDirectory *dir)
Change the tree's directory.
Definition TTree.cxx:9060
void SortBranchesByTime()
Sorts top-level branches by the last average task time recorded per branch.
Definition TTree.cxx:5837
void Delete(Option_t *option="") override
Delete this tree from memory or/and disk.
Definition TTree.cxx:3750
virtual Int_t * GetIndex()
Definition TTree.h:522
virtual TBranchRef * GetBranchRef() const
Definition TTree.h:451
virtual Double_t * GetV3()
Definition TTree.h:581
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:7530
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:1625
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:9163
TBranch * Branch(const char *name, int address, const char *leaflist, Int_t bufsize=32000)
Definition TTree.h:390
void MoveReadCache(TFile *src, TDirectory *dir)
Move a cache from a file to the current file in dir.
Definition TTree.cxx:7062
TTree & operator=(const TTree &tt)=delete
Long64_t fAutoFlush
Auto-flush tree when fAutoFlush entries written or -fAutoFlush (compressed) bytes produced.
Definition TTree.h:101
Int_t fUpdate
Update frequency for EntryLoop.
Definition TTree.h:93
virtual void ResetAfterMerge(TFileMergeInfo *)
Resets the state of this TTree after a merge (keep the customization but forget the data).
Definition TTree.cxx:8114
TBranch * Branch(const char *name, std::array< T, N > *obj, Int_t bufsize=32000, Int_t splitlevel=99)
Definition TTree.h:406
virtual Long64_t GetEntries() const
Definition TTree.h:464
virtual void SetEstimate(Long64_t nentries=1000000)
Set number of entries to estimate variable limits.
Definition TTree.cxx:9204
Int_t fTimerInterval
Timer interval in milliseconds.
Definition TTree.h:91
Int_t fDebug
! Debug level
Definition TTree.h:111
Int_t SetCacheSizeAux(bool autocache=true, Long64_t cacheSize=0)
Set the size of the file cache and create it if possible.
Definition TTree.cxx:8805
virtual Long64_t AutoSave(Option_t *option="")
AutoSave tree header every fAutoSave bytes.
Definition TTree.cxx:1490
virtual Long64_t GetEntryNumber(Long64_t entry) const
Return entry number corresponding to entry.
Definition TTree.cxx:5868
virtual TTree * CloneTree(Long64_t nentries=-1, Option_t *option="")
Create a clone of this tree and copy nentries.
Definition TTree.cxx:3136
virtual bool GetImplicitMT()
Definition TTree.h:521
Int_t fFileNumber
! current file number (if file extensions)
Definition TTree.h:116
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:6198
virtual Long64_t GetZipBytes() const
Definition TTree.h:586
TObjArray fLeaves
Direct pointers to individual branch leaves.
Definition TTree.h:123
virtual void Reset(Option_t *option="")
Reset baskets, buffers and entries count in all branches and leaves.
Definition TTree.cxx:8083
virtual void SetImplicitMT(bool enabled)
Definition TTree.h:662
virtual void KeepCircular()
Keep a maximum of fMaxEntries in memory.
Definition TTree.cxx:6418
virtual void SetDefaultEntryOffsetLen(Int_t newdefault, bool updateExisting=false)
Update the default value for the branch's fEntryOffsetLen.
Definition TTree.cxx:9034
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:3822
Long64_t fMaxVirtualSize
Maximum total size of buffers kept in memory.
Definition TTree.h:99
virtual Long64_t GetTotBytes() const
Definition TTree.h:557
virtual Int_t MakeSelector(const char *selector=nullptr, Option_t *option="")
Generate skeleton selector class for this tree.
Definition TTree.cxx:6825
virtual void SetObject(const char *name, const char *title)
Change the name and title of this tree.
Definition TTree.cxx:9365
TVirtualPerfStats * fPerfStats
! pointer to the current perf stats object
Definition TTree.h:132
Double_t fWeight
Tree weight (see TTree::SetWeight)
Definition TTree.h:90
virtual void SetUpdate(Int_t freq=0)
Definition TTree.h:697
std::vector< TBranch * > fSeqBranches
! Branches to be processed sequentially when IMT is on
Definition TTree.h:145
Long64_t fDebugMax
! Last entry number to debug
Definition TTree.h:113
Int_t fDefaultEntryOffsetLen
Initial Length of fEntryOffset table in the basket buffers.
Definition TTree.h:94
TTree()
Default constructor and I/O constructor.
Definition TTree.cxx:727
Long64_t fAutoSave
Autosave tree when fAutoSave entries written or -fAutoSave (compressed) bytes produced.
Definition TTree.h:100
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:354
std::atomic< UInt_t > fAllocationCount
indicates basket should be resized to exact memory usage, but causes significant
Definition TTree.h:152
virtual Int_t GetEntryWithIndex(Int_t major, Int_t minor=0)
Read entry corresponding to major and minor number.
Definition TTree.cxx:5930
static TTree * MergeTrees(TList *list, Option_t *option="")
Static function merging the trees in the TList into a new tree.
Definition TTree.cxx:6856
bool MemoryFull(Int_t nbytes)
Check if adding nbytes to memory we are still below MaxVirtualsize.
Definition TTree.cxx:6840
TTreeFormula * GetVar4()
Definition TTree.h:573
virtual Long64_t GetReadEntry() const
Definition TTree.h:550
virtual TObjArray * GetListOfBranches()
Definition TTree.h:529
Long64_t fZipBytes
Total number of bytes in all branches after compression.
Definition TTree.h:87
virtual TTree * GetTree() const
Definition TTree.h:558
TBuffer * fTransientBuffer
! Pointer to the current transient buffer.
Definition TTree.h:138
virtual Double_t * GetVal(Int_t i)
Definition TTree.h:575
virtual void SetEntryList(TEntryList *list, Option_t *opt="")
Set an EntryList.
Definition TTree.cxx:9140
bool Notify() override
Function called when loading a new class library.
Definition TTree.cxx:7112
virtual void AddZipBytes(Int_t zip)
Definition TTree.h:333
virtual Long64_t LoadTree(Long64_t entry)
Set current entry.
Definition TTree.cxx:6476
virtual Long64_t ReadFile(const char *filename, const char *branchDescriptor="", char delimiter=' ')
Create or simply read branches from filename.
Definition TTree.cxx:7644
virtual const char * GetAlias(const char *aliasName) const
Returns the expanded value of the alias. Search in the friends if any.
Definition TTree.cxx:5227
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:9224
friend class TFriendLock
Definition TTree.h:203
virtual TBasket * CreateBasket(TBranch *)
Create a basket for this tree and given branch.
Definition TTree.cxx:3734
TList * fUserInfo
pointer to a list of user objects associated to this Tree
Definition TTree.h:133
virtual Double_t GetMinimum(const char *columname)
Return minimum of column with name columname.
Definition TTree.cxx:6278
virtual void RemoveFriend(TTree *)
Remove a friend from the list of friends.
Definition TTree.cxx:8057
virtual Long64_t GetEntriesFast() const
Return a number greater or equal to the total number of entries in the dataset.
Definition TTree.h:506
void Browse(TBrowser *) override
Browse content of the TTree.
Definition TTree.cxx:2602
virtual Double_t * GetV1()
Definition TTree.h:577
virtual TList * GetUserInfo()
Return a pointer to the list containing user objects associated to this tree.
Definition TTree.cxx:6359
TEventList * GetEventList() const
Definition TTree.h:514
Long64_t fChainOffset
! Offset of 1st entry of this Tree in a TChain
Definition TTree.h:106
EStatusBits
Definition TTree.h:251
@ kOnlyFlushAtCluster
If set, the branch's buffers will grow until an event cluster boundary is hit, guaranteeing a basket ...
Definition TTree.h:257
@ kEntriesReshuffled
If set, signals that this TTree is the output of the processing of another TTree, and the entries are...
Definition TTree.h:262
@ kCircular
Definition TTree.h:253
@ kForceRead
Definition TTree.h:252
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:5513
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:7593
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:2397
virtual void SetBasketSize(const char *bname, Int_t buffsize=16000)
Set a branch's basket size.
Definition TTree.cxx:8452
static void SetBranchStyle(Int_t style=1)
Set the current branch style.
Definition TTree.cxx:8759
virtual Long64_t GetReadEvent() const
Definition TTree.h:551
~TTree() override
Destructor.
Definition TTree.cxx:910
bool IsFolder() const override
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects).
Definition TTree.h:588
void ImportClusterRanges(TTree *fromtree)
Appends the cluster range information stored in 'fromtree' to this tree, including the value of fAuto...
Definition TTree.cxx:6375
Long64_t fEstimate
Number of entries to estimate histogram limits.
Definition TTree.h:102
TH1 * GetHistogram()
Definition TTree.h:520
UInt_t GetAllocationCount() const
Definition TTree.h:444
Int_t FlushBasketsImpl() const
Internal implementation of the FlushBaskets algorithm.
Definition TTree.cxx:5147
Long64_t GetDebugMin() const
Definition TTree.h:462
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:6560
Int_t Write(const char *name=nullptr, Int_t option=0, Int_t bufsize=0) override
Write this object to the current directory.
Definition TTree.cxx:9858
TVirtualIndex * fTreeIndex
Pointer to the tree Index (if any)
Definition TTree.h:129
void UseCurrentStyle() override
Replace current attributes by current style.
Definition TTree.cxx:9819
virtual Int_t GetTreeNumber() const
Definition TTree.h:560
Int_t GetEvent(Long64_t entry, Int_t getall=0)
Definition TTree.h:510
TObject * fNotify
Object to be notified when loading a Tree.
Definition TTree.h:120
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:1544
virtual TList * GetListOfClones()
Definition TTree.h:528
Long64_t fCacheSize
! Maximum size of file buffers
Definition TTree.h:105
TList * fClones
! List of cloned trees which share our addresses
Definition TTree.h:135
std::atomic< Long64_t > fTotalBuffers
! Total number of bytes in branch buffers
Definition TTree.h:108
ELockStatusBits
Definition TTree.h:211
@ kFindBranch
Definition TTree.h:212
@ kResetBranchAddresses
Definition TTree.h:225
@ kFindLeaf
Definition TTree.h:213
@ kGetEntryWithIndex
Definition TTree.h:217
@ kPrint
Definition TTree.h:222
@ kGetFriend
Definition TTree.h:218
@ kGetBranch
Definition TTree.h:215
@ kSetBranchStatus
Definition TTree.h:224
@ kLoadTree
Definition TTree.h:221
@ kGetEntry
Definition TTree.h:216
@ kGetLeaf
Definition TTree.h:220
@ kRemoveFriend
Definition TTree.h:223
@ kGetFriendAlias
Definition TTree.h:219
@ kGetAlias
Definition TTree.h:214
virtual Double_t * GetV4()
Definition TTree.h:583
TBranch * Branch(const char *name, const char *classname, T *obj, Int_t bufsize=32000, Int_t splitlevel=99)
Definition TTree.h:396
TTreeFormula * GetVar3()
Definition TTree.h:571
virtual void SetTreeIndex(TVirtualIndex *index)
The current TreeIndex is replaced by the new index.
Definition TTree.cxx:9451
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:7136
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:7578
virtual Int_t SetCacheEntryRange(Long64_t first, Long64_t last)
interface to TTreeCache to set the cache entry range
Definition TTree.cxx:8925
static Long64_t GetMaxTreeSize()
Static function which returns the tree file size limit in bytes.
Definition TTree.cxx:6268
bool fCacheDoClusterPrefetch
! true if cache is prefetching whole clusters
Definition TTree.h:140
Int_t SetBranchAddressImp(TBranch *branch, void *addr, TBranch **ptr)
Change branch address, dealing with clone trees properly.
Definition TTree.cxx:8539
virtual bool SetAlias(const char *aliasName, const char *aliasFormula)
Set a tree variable alias.
Definition TTree.cxx:8235
virtual Int_t GetTimerInterval() const
Definition TTree.h:555
virtual void CopyAddresses(TTree *, bool undo=false)
Set branch addresses of passed tree equal to ours.
Definition TTree.cxx:3302
virtual void SetScanField(Int_t n=50)
Sets the default maximum number of lines to be shown before <CR> when calling Scan().
Definition TTree.h:692
TTree(const TTree &tt)=delete
Long64_t fMaxEntries
Maximum number of entries in case of circular buffers.
Definition TTree.h:97
Int_t SetBranchAddress(const char *bname, T **add, TBranch **ptr=nullptr)
Definition TTree.h:629
TBranch * Branch(const char *name, char *address, const char *leaflist, Int_t bufsize=32000)
Definition TTree.h:380
virtual void DropBuffers(Int_t nbytes)
Drop branch buffers to accommodate nbytes below MaxVirtualsize.
Definition TTree.cxx:4534
virtual TList * GetListOfFriends() const
Definition TTree.h:531
virtual void Refresh()
Refresh contents of this tree and its branches from the current status on disk.
Definition TTree.cxx:7996
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:8290
static Long64_t fgMaxTreeSize
Maximum size of a file containing a Tree.
Definition TTree.h:155
Long64_t fReadEntry
! Number of the entry being processed
Definition TTree.h:107
TArrayD fIndexValues
Sorted index values.
Definition TTree.h:127
void MarkEventCluster()
Mark the previous event as being at the end of the event cluster.
Definition TTree.cxx:8352
virtual Int_t GetNbranches()
Definition TTree.h:543
UInt_t fNEntriesSinceSorting
! Number of entries processed since the last re-sorting of branches
Definition TTree.h:143
virtual void SetClusterPrefetch(bool enabled)
Definition TTree.h:652
virtual void SetFileNumber(Int_t number=0)
Set fFileNumber to number.
Definition TTree.cxx:9247
virtual TLeaf * FindLeaf(const char *name)
Find leaf..
Definition TTree.cxx:4917
virtual void StartViewer()
Start the TTreeViewer on this tree.
Definition TTree.cxx:9564
Int_t GetMakeClass() const
Definition TTree.h:536
virtual Int_t MakeCode(const char *filename=nullptr)
Generate a skeleton function for this tree.
Definition TTree.cxx:6643
bool fIMTFlush
! True if we are doing a multithreaded flush.
Definition TTree.h:159
TDirectory * fDirectory
! Pointer to directory holding this tree
Definition TTree.h:121
ESetBranchAddressStatus
Definition TTree.h:233
@ kNeedEnableDecomposedObj
Definition TTree.h:245
@ kClassMismatch
Definition TTree.h:238
@ kNeedDisableDecomposedObj
Definition TTree.h:246
@ kVoidPtr
Definition TTree.h:243
@ kNoCheck
Definition TTree.h:244
@ kMatchConversionCollection
Definition TTree.h:241
@ kMissingCompiledCollectionProxy
Definition TTree.h:236
@ kMismatch
Definition TTree.h:237
@ kMatchConversion
Definition TTree.h:240
@ kInternalError
Definition TTree.h:235
@ kDecomposedObjMask
Definition TTree.h:247
@ kMatch
Definition TTree.h:239
@ kMissingBranch
Definition TTree.h:234
@ kMakeClass
Definition TTree.h:242
static Int_t fgBranchStyle
Old/New branch style.
Definition TTree.h:154
virtual void ResetBranchAddresses()
Tell all of our branches to drop their current objects and allocate new ones.
Definition TTree.cxx:8155
Int_t fNfill
! Local for EntryLoop
Definition TTree.h:110
void SetName(const char *name) override
Change the name of this tree.
Definition TTree.cxx:9310
virtual Long64_t GetCacheSize() const
Definition TTree.h:454
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:8037
TArrayI fIndex
Index of sorted values.
Definition TTree.h:128
virtual Int_t GetPacketSize() const
Definition TTree.h:546
virtual Int_t SetCacheSize(Long64_t cachesize=-1)
Set maximum size of the file cache .
Definition TTree.cxx:8777
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:1209
virtual Int_t CheckBranchAddressType(TBranch *branch, TClass *ptrClass, EDataType datatype, bool ptr)
Check whether or not the address described by the last 3 parameters matches the content of the branch...
Definition TTree.cxx:2864
TBuffer * GetTransientBuffer(Int_t size)
Returns the transient buffer currently used by this TTree for reading/writing baskets.
Definition TTree.cxx:1027
ROOT::TIOFeatures GetIOFeatures() const
Returns the current set of IO settings.
Definition TTree.cxx:6077
virtual Int_t MakeClass(const char *classname=nullptr, Option_t *option="")
Generate a skeleton analysis class for this tree.
Definition TTree.cxx:6610
virtual Int_t GetFileNumber() const
Definition TTree.h:517
virtual const char * GetFriendAlias(TTree *) const
If the 'tree' is a friend, this method returns its alias name.
Definition TTree.cxx:6035
virtual void SetChainOffset(Long64_t offset=0)
Definition TTree.h:650
virtual void RemoveExternalFriend(TFriendElement *)
Removes external friend.
Definition TTree.cxx:8048
virtual Double_t * GetW()
Definition TTree.h:584
TTreeFormula * GetVar1()
Definition TTree.h:567
virtual Double_t * GetV2()
Definition TTree.h:579
Int_t fPacketSize
! Number of entries in one packet for parallel root
Definition TTree.h:109
virtual Int_t GetUpdate() const
Definition TTree.h:562
virtual Long64_t GetChainOffset() const
Definition TTree.h:457
virtual TBranch * BranchImpArr(const char *branchname, EDataType datatype, std::size_t N, void *addobj, Int_t bufsize, Int_t splitlevel)
Definition TTree.cxx:1721
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:8193
virtual TBranch * BronchExec(const char *name, const char *classname, void *addobj, bool isptrptr, Int_t bufsize, Int_t splitlevel)
Helper function implementing TTree::Bronch and TTree::Branch(const char *name, T &obj);.
Definition TTree.cxx:2405
virtual Long64_t GetMaxEntryLoop() const
Definition TTree.h:538
virtual void AddTotBytes(Int_t tot)
Definition TTree.h:332
virtual Long64_t CopyEntries(TTree *tree, Long64_t nentries=-1, Option_t *option="", bool needCopyAddresses=false)
Copy nentries from given tree to this tree.
Definition TTree.cxx:3537
Int_t fMakeClass
! not zero when processing code generated by MakeClass
Definition TTree.h:115
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:6454
static constexpr Long64_t kMaxEntries
Definition TTree.h:230
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:7279
virtual Long64_t GetAutoFlush() const
Definition TTree.h:448
virtual Long64_t GetMaxVirtualSize() const
Definition TTree.h:541
Abstract interface for Tree Index.
Provides the interface for the PROOF internal performance measurement and event tracing.
Abstract base class defining the interface for the plugins that implement Draw, Scan,...
virtual TTreeFormula * GetVar1() const =0
virtual Double_t * GetV4() const =0
virtual Double_t * GetW() const =0
virtual TTreeFormula * GetVar4() const =0
virtual TTreeFormula * GetVar(Int_t) const =0
virtual Double_t * GetVal(Int_t) const =0
virtual TTreeFormula * GetVar2() const =0
virtual Double_t * GetV1() const =0
static constexpr Long64_t kMaxEntries
virtual TTreeFormula * GetVar3() const =0
virtual Double_t * GetV2() const =0
virtual TTreeFormula * GetSelect() const =0
virtual TH1 * GetHistogram() const =0
virtual Long64_t GetSelectedRows() const =0
virtual Double_t * GetV3() const =0
const Int_t n
Definition legend1.C:16
th1 Draw()
auto * tt
Definition textangle.C:16