ROOT  6.06/09
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 #ifndef ROOT_TBranch
30 #include "TBranch.h"
31 #endif
32 
33 #ifndef ROOT_TObjArray
34 #include "TObjArray.h"
35 #endif
36 
37 #ifndef ROOT_TAttLine
38 #include "TAttLine.h"
39 #endif
40 
41 #ifndef ROOT_TAttFill
42 #include "TAttFill.h"
43 #endif
44 
45 #ifndef ROOT_TAttMarker
46 #include "TAttMarker.h"
47 #endif
48 
49 #ifndef ROOT_TArrayD
50 #include "TArrayD.h"
51 #endif
52 
53 #ifndef ROOT_TArrayI
54 #include "TArrayI.h"
55 #endif
56 
57 #ifndef ROOT_TDataType
58 #include "TDataType.h"
59 #endif
60 
61 #ifndef ROOT_TClass
62 #include "TClass.h"
63 #endif
64 
65 #ifndef ROOT_TVirtualTreePlayer
66 #include "TVirtualTreePlayer.h"
67 #endif
68 
69 class TBranch;
70 class TBrowser;
71 class TFile;
72 class TDirectory;
73 class TLeaf;
74 class TH1;
75 class TTreeFormula;
76 class TPolyMarker;
77 class TEventList;
78 class TEntryList;
79 class TList;
80 class TSQLResult;
81 class TSelector;
82 class TPrincipal;
83 class TFriendElement;
84 class TCut;
85 class TVirtualIndex;
86 class TBranchRef;
87 class TBasket;
88 class TStreamerInfo;
89 class TTreeCache;
90 class TTreeCloner;
91 class TFileMergeInfo;
92 class TVirtualPerfStats;
93 
94 class TTree : public TNamed, public TAttLine, public TAttFill, public TAttMarker {
95 
96 protected:
97  Long64_t fEntries; // Number of entries
98  Long64_t fTotBytes; // Total number of bytes in all branches before compression
99  Long64_t fZipBytes; // Total number of bytes in all branches after compression
100  Long64_t fSavedBytes; // Number of autosaved bytes
101  Long64_t fFlushedBytes; // Number of autoflushed bytes
102  Double_t fWeight; // Tree weight (see TTree::SetWeight)
103  Int_t fTimerInterval; // Timer interval in milliseconds
104  Int_t fScanField; // Number of runs before prompting in Scan
105  Int_t fUpdate; // Update frequency for EntryLoop
106  Int_t fDefaultEntryOffsetLen; // Initial Length of fEntryOffset table in the basket buffers
107  Int_t fNClusterRange; // Number of Cluster range in addition to the one defined by 'AutoFlush'
108  Int_t fMaxClusterRange; //! Memory allocated for the cluster range.
109  Long64_t fMaxEntries; // Maximum number of entries in case of circular buffers
110  Long64_t fMaxEntryLoop; // Maximum number of entries to process
111  Long64_t fMaxVirtualSize; // Maximum total size of buffers kept in memory
112  Long64_t fAutoSave; // Autosave tree when fAutoSave entries written or -fAutoSave (compressed) bytes produced
113  Long64_t fAutoFlush; // Autoflush tree when fAutoFlush entries written or -fAutoFlush (compressed) bytes produced
114  Long64_t fEstimate; // Number of entries to estimate histogram limits
115  Long64_t *fClusterRangeEnd; //[fNClusterRange] Last entry of a cluster range.
116  Long64_t *fClusterSize; //[fNClusterRange] Number of entries in each cluster for a given range.
117  Long64_t fCacheSize; //! Maximum size of file buffers
118  Long64_t fChainOffset; //! Offset of 1st entry of this Tree in a TChain
119  Long64_t fReadEntry; //! Number of the entry being processed
120  Long64_t fTotalBuffers; //! Total number of bytes in branch buffers
121  Int_t fPacketSize; //! Number of entries in one packet for parallel root
122  Int_t fNfill; //! Local for EntryLoop
123  Int_t fDebug; //! Debug level
124  Long64_t fDebugMin; //! First entry number to debug
125  Long64_t fDebugMax; //! Last entry number to debug
126  Int_t fMakeClass; //! not zero when processing code generated by MakeClass
127  Int_t fFileNumber; //! current file number (if file extensions)
128  TObject *fNotify; //! Object to be notified when loading a Tree
129  TDirectory *fDirectory; //! Pointer to directory holding this tree
130  TObjArray fBranches; // List of Branches
131  TObjArray fLeaves; // Direct pointers to individual branch leaves
132  TList *fAliases; // List of aliases for expressions based on the tree branches.
133  TEventList *fEventList; //! Pointer to event selection list (if one)
134  TEntryList *fEntryList; //! Pointer to event selection list (if one)
135  TArrayD fIndexValues; // Sorted index values
136  TArrayI fIndex; // Index of sorted values
137  TVirtualIndex *fTreeIndex; // Pointer to the tree Index (if any)
138  TList *fFriends; // pointer to list of friend elements
139  TVirtualPerfStats *fPerfStats; //! pointer to the current perf stats object
140  TList *fUserInfo; // pointer to a list of user objects associated to this Tree
141  TVirtualTreePlayer *fPlayer; //! Pointer to current Tree player
142  TList *fClones; //! List of cloned trees which share our addresses
143  TBranchRef *fBranchRef; // Branch supporting the TRefTable (if any)
144  UInt_t fFriendLockStatus; //! Record which method is locking the friend recursion
145  TBuffer *fTransientBuffer; //! Pointer to the current transient buffer.
146  Bool_t fCacheDoAutoInit; //! true if cache auto creation or resize check is needed
147  Bool_t fCacheUserSet; //! true if the cache setting was explicitly given by user
148 
149  static Int_t fgBranchStyle; // Old/New branch style
150  static Long64_t fgMaxTreeSize; // Maximum size of a file containg a Tree
151 
152 private:
153  TTree(const TTree& tt); // not implemented
154  TTree& operator=(const TTree& tt); // not implemented
155 
156 protected:
157  void AddClone(TTree*);
158  virtual void KeepCircular();
159  virtual TBranch *BranchImp(const char* branchname, const char* classname, TClass* ptrClass, void* addobj, Int_t bufsize, Int_t splitlevel);
160  virtual TBranch *BranchImp(const char* branchname, TClass* ptrClass, void* addobj, Int_t bufsize, Int_t splitlevel);
161  virtual TBranch *BranchImpRef(const char* branchname, const char* classname, TClass* ptrClass, void* addobj, Int_t bufsize, Int_t splitlevel);
162  virtual TBranch *BranchImpRef(const char* branchname, TClass* ptrClass, EDataType datatype, void* addobj, Int_t bufsize, Int_t splitlevel);
163  virtual Int_t CheckBranchAddressType(TBranch* branch, TClass* ptrClass, EDataType datatype, Bool_t ptr);
164  virtual TBranch *BronchExec(const char* name, const char* classname, void* addobj, Bool_t isptrptr, Int_t bufsize, Int_t splitlevel);
165  friend TBranch *TTreeBranchImpRef(TTree *tree, const char* branchname, TClass* ptrClass, EDataType datatype, void* addobj, Int_t bufsize, Int_t splitlevel);
166  Int_t SetBranchAddressImp(TBranch *branch, void* addr, TBranch** ptr);
167  virtual TLeaf *GetLeafImpl(const char* branchname, const char* leafname);
168 
169  Long64_t GetCacheAutoSize(Bool_t withDefault = kFALSE) const;
170  char GetNewlineValue(std::istream &inputStream);
171  TTreeCache *GetReadCache(TFile *file, Bool_t create = kFALSE);
172  void ImportClusterRanges(TTree *fromtree);
173  void MoveReadCache(TFile *src, TDirectory *dir);
174  Int_t SetCacheSizeAux(Bool_t autocache = kTRUE, Long64_t cacheSize = 0);
175 
176  class TFriendLock {
177  // Helper class to prevent infinite recursion in the
178  // usage of TTree Friends. Implemented in TTree.cxx.
179  TTree *fTree; // Pointer to the locked tree
180  UInt_t fMethodBit; // BIT for the locked method
181  Bool_t fPrevious; // Previous value of the BIT.
182 
183  protected:
184  TFriendLock(const TFriendLock&);
186 
187  public:
188  TFriendLock(TTree* tree, UInt_t methodbit);
189  ~TFriendLock();
190  };
191  friend class TFriendLock;
192  // So that the index class can use TFriendLock:
193  friend class TTreeIndex;
194  friend class TChainIndex;
195  // So that the TTreeCloner can access the protected interfaces
196  friend class TTreeCloner;
197 
198  // use to update fFriendLockStatus
208  kGetLeaf = BIT(8),
210  kPrint = BIT(10),
213  };
214 
215 public:
216  // Used as the max value for any TTree range operation.
218 
219  // SetBranchAddress return values
224  kMismatch = -2,
226  kMatch = 0,
230  kVoidPtr = 4,
232  };
233 
234  // TTree status bits
235  enum {
238  };
239 
240  // Split level modifier
241  enum {
243  };
244 
246  {
247  private:
248  TTree *fTree; // TTree upon which we are iterating.
249  Int_t fClusterRange; // Which cluster range are we looking at.
250  Long64_t fStartEntry; // Where does the cluster start.
251  Long64_t fNextEntry; // Where does the cluster end (exclusive).
252 
254 
255  protected:
256  friend class TTree;
257  TClusterIterator(TTree *tree, Long64_t firstEntry);
258 
259  public:
260  // Intentionally used the default copy constructor and default destructor
261  // as the TClusterIterator does not own the TTree.
262  // TClusterIterator(const TClusterIterator&);
263  // ~TClusterIterator();
264 
265  // No public constructors, the iterator must be
266  // created via TTree::GetClusterIterator
267 
268  // Move on to the next cluster and return the starting entry
269  // of this next cluster
270  Long64_t Next();
271 
272  // Return the start entry of the current cluster.
274  return fStartEntry;
275  }
276 
277  // Return the first entry of the next cluster.
279  return fNextEntry;
280  }
281 
282  Long64_t operator()() { return Next(); }
283  };
284 
285  TTree();
286  TTree(const char* name, const char* title, Int_t splitlevel = 99);
287  virtual ~TTree();
288 
289  virtual Int_t AddBranchToCache(const char *bname, Bool_t subbranches = kFALSE);
290  virtual Int_t AddBranchToCache(TBranch *branch, Bool_t subbranches = kFALSE);
291  virtual Int_t DropBranchFromCache(const char *bname, Bool_t subbranches = kFALSE);
292  virtual Int_t DropBranchFromCache(TBranch *branch, Bool_t subbranches = kFALSE);
293  virtual TFriendElement *AddFriend(const char* treename, const char* filename = "");
294  virtual TFriendElement *AddFriend(const char* treename, TFile* file);
295  virtual TFriendElement *AddFriend(TTree* tree, const char* alias = "", Bool_t warn = kFALSE);
296  virtual void AddTotBytes(Int_t tot) { fTotBytes += tot; }
297  virtual void AddZipBytes(Int_t zip) { fZipBytes += zip; }
298  virtual Long64_t AutoSave(Option_t* option = "");
299  virtual Int_t Branch(TCollection* list, Int_t bufsize = 32000, Int_t splitlevel = 99, const char* name = "");
300  virtual Int_t Branch(TList* list, Int_t bufsize = 32000, Int_t splitlevel = 99);
301  virtual Int_t Branch(const char* folder, Int_t bufsize = 32000, Int_t splitlevel = 99);
302  virtual TBranch *Branch(const char* name, void* address, const char* leaflist, Int_t bufsize = 32000);
303  TBranch *Branch(const char* name, char* address, const char* leaflist, Int_t bufsize = 32000)
304  {
305  // Overload to avoid confusion between this signature and the template instance.
306  return Branch(name,(void*)address,leaflist,bufsize);
307  }
308  TBranch *Branch(const char* name, Long_t address, const char* leaflist, Int_t bufsize = 32000)
309  {
310  // Overload to avoid confusion between this signature and the template instance.
311  return Branch(name,(void*)address,leaflist,bufsize);
312  }
313  TBranch *Branch(const char* name, int address, const char* leaflist, Int_t bufsize = 32000)
314  {
315  // Overload to avoid confusion between this signature and the template instance.
316  return Branch(name,(void*)(Long_t)address,leaflist,bufsize);
317  }
318 #if !defined(__CINT__)
319  virtual TBranch *Branch(const char* name, const char* classname, void* addobj, Int_t bufsize = 32000, Int_t splitlevel = 99);
320 #endif
321  template <class T> TBranch *Branch(const char* name, const char* classname, T* obj, Int_t bufsize = 32000, Int_t splitlevel = 99)
322  {
323  // See BranchImpRed for details. Here we __ignore
324  return BranchImpRef(name, classname, TBuffer::GetClass(typeid(T)), obj, bufsize, splitlevel);
325  }
326  template <class T> TBranch *Branch(const char* name, const char* classname, T** addobj, Int_t bufsize = 32000, Int_t splitlevel = 99)
327  {
328  // See BranchImp for details
329  return BranchImp(name, classname, TBuffer::GetClass(typeid(T)), addobj, bufsize, splitlevel);
330  }
331  template <class T> TBranch *Branch(const char* name, T** addobj, Int_t bufsize = 32000, Int_t splitlevel = 99)
332  {
333  // See BranchImp for details
334  return BranchImp(name, TBuffer::GetClass(typeid(T)), addobj, bufsize, splitlevel);
335  }
336  template <class T> TBranch *Branch(const char* name, T* obj, Int_t bufsize = 32000, Int_t splitlevel = 99)
337  {
338  // See BranchImp for details
339  return BranchImpRef(name, TBuffer::GetClass(typeid(T)), TDataType::GetType(typeid(T)), obj, bufsize, splitlevel);
340  }
341  virtual TBranch *Bronch(const char* name, const char* classname, void* addobj, Int_t bufsize = 32000, Int_t splitlevel = 99);
342  virtual TBranch *BranchOld(const char* name, const char* classname, void* addobj, Int_t bufsize = 32000, Int_t splitlevel = 1);
343  virtual TBranch *BranchRef();
344  virtual void Browse(TBrowser*);
345  virtual Int_t BuildIndex(const char* majorname, const char* minorname = "0");
346  TStreamerInfo *BuildStreamerInfo(TClass* cl, void* pointer = 0, Bool_t canOptimize = kTRUE);
347  virtual TFile *ChangeFile(TFile* file);
348  virtual TTree *CloneTree(Long64_t nentries = -1, Option_t* option = "");
349  virtual void CopyAddresses(TTree*,Bool_t undo = kFALSE);
350  virtual Long64_t CopyEntries(TTree* tree, Long64_t nentries = -1, Option_t *option = "");
351  virtual TTree *CopyTree(const char* selection, Option_t* option = "", Long64_t nentries = kMaxEntries, Long64_t firstentry = 0);
352  virtual TBasket *CreateBasket(TBranch*);
353  virtual void DirectoryAutoAdd(TDirectory *);
354  Int_t Debug() const { return fDebug; }
355  virtual void Delete(Option_t* option = ""); // *MENU*
356  virtual void Draw(Option_t* opt) { Draw(opt, "", "", kMaxEntries, 0); }
357  virtual Long64_t Draw(const char* varexp, const TCut& selection, Option_t* option = "", Long64_t nentries = kMaxEntries, Long64_t firstentry = 0);
358  virtual Long64_t Draw(const char* varexp, const char* selection, Option_t* option = "", Long64_t nentries = kMaxEntries, Long64_t firstentry = 0); // *MENU*
359  virtual void DropBaskets();
360  virtual void DropBuffers(Int_t nbytes);
361  virtual Int_t Fill();
362  virtual TBranch *FindBranch(const char* name);
363  virtual TLeaf *FindLeaf(const char* name);
364  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*
365  virtual Int_t FlushBaskets() const;
366  virtual const char *GetAlias(const char* aliasName) const;
367  virtual Long64_t GetAutoFlush() const {return fAutoFlush;}
368  virtual Long64_t GetAutoSave() const {return fAutoSave;}
369  virtual TBranch *GetBranch(const char* name);
370  virtual TBranchRef *GetBranchRef() const { return fBranchRef; };
371  virtual Bool_t GetBranchStatus(const char* branchname) const;
372  static Int_t GetBranchStyle();
373  virtual Long64_t GetCacheSize() const { return fCacheSize; }
374  virtual TClusterIterator GetClusterIterator(Long64_t firstentry);
375  virtual Long64_t GetChainEntryNumber(Long64_t entry) const { return entry; }
376  virtual Long64_t GetChainOffset() const { return fChainOffset; }
377  TFile *GetCurrentFile() const;
379  Long64_t GetDebugMax() const { return fDebugMax; }
380  Long64_t GetDebugMin() const { return fDebugMin; }
381  TDirectory *GetDirectory() const { return fDirectory; }
382  virtual Long64_t GetEntries() const { return fEntries; }
383  virtual Long64_t GetEntries(const char *selection);
384  virtual Long64_t GetEntriesFast() const { return fEntries; }
385  virtual Long64_t GetEntriesFriend() const;
386  virtual Long64_t GetEstimate() const { return fEstimate; }
387  virtual Int_t GetEntry(Long64_t entry = 0, Int_t getall = 0);
388  Int_t GetEvent(Long64_t entry = 0, Int_t getall = 0) { return GetEntry(entry, getall); }
389  virtual Int_t GetEntryWithIndex(Int_t major, Int_t minor = 0);
390  virtual Long64_t GetEntryNumberWithBestIndex(Long64_t major, Long64_t minor = 0) const;
391  virtual Long64_t GetEntryNumberWithIndex(Long64_t major, Long64_t minor = 0) const;
392  TEventList *GetEventList() const { return fEventList; }
393  virtual TEntryList *GetEntryList();
394  virtual Long64_t GetEntryNumber(Long64_t entry) const;
395  virtual Int_t GetFileNumber() const { return fFileNumber; }
396  virtual TTree *GetFriend(const char*) const;
397  virtual const char *GetFriendAlias(TTree*) const;
399  virtual Int_t *GetIndex() { return &fIndex.fArray[0]; }
400  virtual Double_t *GetIndexValues() { return &fIndexValues.fArray[0]; }
402  virtual TLeaf *GetLeaf(const char* branchname, const char* leafname);
403  virtual TLeaf *GetLeaf(const char* name);
404  virtual TList *GetListOfClones() { return fClones; }
405  virtual TObjArray *GetListOfBranches() { return &fBranches; }
406  virtual TObjArray *GetListOfLeaves() { return &fLeaves; }
407  virtual TList *GetListOfFriends() const { return fFriends; }
408  virtual TList *GetListOfAliases() const { return fAliases; }
409 
410  // GetMakeClass is left non-virtual for efficiency reason.
411  // Making it virtual affects the performance of the I/O
412  Int_t GetMakeClass() const { return fMakeClass; }
413 
414  virtual Long64_t GetMaxEntryLoop() const { return fMaxEntryLoop; }
415  virtual Double_t GetMaximum(const char* columname);
416  static Long64_t GetMaxTreeSize();
417  virtual Long64_t GetMaxVirtualSize() const { return fMaxVirtualSize; }
418  virtual Double_t GetMinimum(const char* columname);
419  virtual Int_t GetNbranches() { return fBranches.GetEntriesFast(); }
420  TObject *GetNotify() const { return fNotify; }
422  virtual Int_t GetPacketSize() const { return fPacketSize; }
423  virtual TVirtualPerfStats *GetPerfStats() const { return fPerfStats; }
424  virtual Long64_t GetReadEntry() const { return fReadEntry; }
425  virtual Long64_t GetReadEvent() const { return fReadEntry; }
426  virtual Int_t GetScanField() const { return fScanField; }
429  virtual Int_t GetTimerInterval() const { return fTimerInterval; }
431  virtual Long64_t GetTotBytes() const { return fTotBytes; }
432  virtual TTree *GetTree() const { return const_cast<TTree*>(this); }
433  virtual TVirtualIndex *GetTreeIndex() const { return fTreeIndex; }
434  virtual Int_t GetTreeNumber() const { return 0; }
435  virtual Int_t GetUpdate() const { return fUpdate; }
436  virtual TList *GetUserInfo();
437  // See TSelectorDraw::GetVar
438  TTreeFormula *GetVar(Int_t i) { return GetPlayer()->GetVar(i); }
439  // See TSelectorDraw::GetVar
440  TTreeFormula *GetVar1() { return GetPlayer()->GetVar1(); }
441  // See TSelectorDraw::GetVar
442  TTreeFormula *GetVar2() { return GetPlayer()->GetVar2(); }
443  // See TSelectorDraw::GetVar
444  TTreeFormula *GetVar3() { return GetPlayer()->GetVar3(); }
445  // See TSelectorDraw::GetVar
446  TTreeFormula *GetVar4() { return GetPlayer()->GetVar4(); }
447  // See TSelectorDraw::GetVal
448  virtual Double_t *GetVal(Int_t i) { return GetPlayer()->GetVal(i); }
449  // See TSelectorDraw::GetVal
450  virtual Double_t *GetV1() { return GetPlayer()->GetV1(); }
451  // See TSelectorDraw::GetVal
452  virtual Double_t *GetV2() { return GetPlayer()->GetV2(); }
453  // See TSelectorDraw::GetVal
454  virtual Double_t *GetV3() { return GetPlayer()->GetV3(); }
455  // See TSelectorDraw::GetVal
456  virtual Double_t *GetV4() { return GetPlayer()->GetV4(); }
457  virtual Double_t *GetW() { return GetPlayer()->GetW(); }
458  virtual Double_t GetWeight() const { return fWeight; }
459  virtual Long64_t GetZipBytes() const { return fZipBytes; }
460  virtual void IncrementTotalBuffers(Int_t nbytes) { fTotalBuffers += nbytes; }
461  Bool_t IsFolder() const { return kTRUE; }
462  virtual Int_t LoadBaskets(Long64_t maxmemory = 2000000000);
463  virtual Long64_t LoadTree(Long64_t entry);
465  virtual Int_t MakeClass(const char* classname = 0, Option_t* option = "");
466  virtual Int_t MakeCode(const char* filename = 0);
467  virtual Int_t MakeProxy(const char* classname, const char* macrofilename = 0, const char* cutfilename = 0, const char* option = 0, Int_t maxUnrolling = 3);
468  virtual Int_t MakeSelector(const char* selector = 0, Option_t* option = "");
469  Bool_t MemoryFull(Int_t nbytes);
470  virtual Long64_t Merge(TCollection* list, Option_t* option = "");
471  virtual Long64_t Merge(TCollection* list, TFileMergeInfo *info);
472  static TTree *MergeTrees(TList* list, Option_t* option = "");
473  virtual Bool_t Notify();
474  virtual void OptimizeBaskets(ULong64_t maxMemory=10000000, Float_t minComp=1.1, Option_t *option="");
475  TPrincipal *Principal(const char* varexp = "", const char* selection = "", Option_t* option = "np", Long64_t nentries = kMaxEntries, Long64_t firstentry = 0);
476  virtual void Print(Option_t* option = "") const; // *MENU*
477  virtual void PrintCacheStats(Option_t* option = "") const;
478  virtual Long64_t Process(const char* filename, Option_t* option = "", Long64_t nentries = kMaxEntries, Long64_t firstentry = 0); // *MENU*
479 #if defined(__CINT__)
480 #if defined(R__MANUAL_DICT)
481  virtual Long64_t Process(void* selector, Option_t* option = "", Long64_t nentries = kMaxEntries, Long64_t firstentry = 0);
482 #endif
483 #else
484  virtual Long64_t Process(TSelector* selector, Option_t* option = "", Long64_t nentries = kMaxEntries, Long64_t firstentry = 0);
485 #endif
486  virtual Long64_t Project(const char* hname, const char* varexp, const char* selection = "", Option_t* option = "", Long64_t nentries = kMaxEntries, Long64_t firstentry = 0);
487  virtual TSQLResult *Query(const char* varexp = "", const char* selection = "", Option_t* option = "", Long64_t nentries = kMaxEntries, Long64_t firstentry = 0);
488  virtual Long64_t ReadFile(const char* filename, const char* branchDescriptor = "", char delimiter = ' ');
489  virtual Long64_t ReadStream(std::istream& inputStream, const char* branchDescriptor = "", char delimiter = ' ');
490  virtual void Refresh();
491  virtual void RecursiveRemove(TObject *obj);
492  virtual void RemoveFriend(TTree*);
493  virtual void Reset(Option_t* option = "");
494  virtual void ResetAfterMerge(TFileMergeInfo *);
495  virtual void ResetBranchAddress(TBranch *);
496  virtual void ResetBranchAddresses();
497  virtual Long64_t Scan(const char* varexp = "", const char* selection = "", Option_t* option = "", Long64_t nentries = kMaxEntries, Long64_t firstentry = 0); // *MENU*
498  virtual Bool_t SetAlias(const char* aliasName, const char* aliasFormula);
499  virtual void SetAutoSave(Long64_t autos = -300000000);
500  virtual void SetAutoFlush(Long64_t autof = -30000000);
501  virtual void SetBasketSize(const char* bname, Int_t buffsize = 16000);
502 #if !defined(__CINT__)
503  virtual Int_t SetBranchAddress(const char *bname,void *add, TBranch **ptr = 0);
504 #endif
505  virtual Int_t SetBranchAddress(const char *bname,void *add, TClass *realClass, EDataType datatype, Bool_t isptr);
506  virtual Int_t SetBranchAddress(const char *bname,void *add, TBranch **ptr, TClass *realClass, EDataType datatype, Bool_t isptr);
507  template <class T> Int_t SetBranchAddress(const char *bname, T **add, TBranch **ptr = 0) {
508  TClass *cl = TClass::GetClass(typeid(T));
510  if (cl==0) type = TDataType::GetType(typeid(T));
511  return SetBranchAddress(bname,add,ptr,cl,type,true);
512  }
513 #ifndef R__NO_CLASS_TEMPLATE_SPECIALIZATION
514  // This can only be used when the template overload resolution can distringuish between
515  // T* and T**
516  template <class T> Int_t SetBranchAddress(const char *bname, T *add, TBranch **ptr = 0) {
517  TClass *cl = TClass::GetClass(typeid(T));
519  if (cl==0) type = TDataType::GetType(typeid(T));
520  return SetBranchAddress(bname,add,ptr,cl,type,false);
521  }
522 #endif
523  virtual void SetBranchStatus(const char* bname, Bool_t status = 1, UInt_t* found = 0);
524  static void SetBranchStyle(Int_t style = 1); //style=0 for old branch, =1 for new branch style
525  virtual Int_t SetCacheSize(Long64_t cachesize = -1);
526  virtual Int_t SetCacheEntryRange(Long64_t first, Long64_t last);
527  virtual void SetCacheLearnEntries(Int_t n=10);
528  virtual void SetChainOffset(Long64_t offset = 0) { fChainOffset=offset; }
529  virtual void SetCircular(Long64_t maxEntries);
530  virtual void SetDebug(Int_t level = 1, Long64_t min = 0, Long64_t max = 9999999); // *MENU*
531  virtual void SetDefaultEntryOffsetLen(Int_t newdefault, Bool_t updateExisting = kFALSE);
532  virtual void SetDirectory(TDirectory* dir);
533  virtual Long64_t SetEntries(Long64_t n = -1);
534  virtual void SetEstimate(Long64_t nentries = 1000000);
535  virtual void SetFileNumber(Int_t number = 0);
536  virtual void SetEventList(TEventList* list);
537  virtual void SetEntryList(TEntryList* list, Option_t *opt="");
538  virtual void SetMakeClass(Int_t make);
539  virtual void SetMaxEntryLoop(Long64_t maxev = kMaxEntries) { fMaxEntryLoop = maxev; } // *MENU*
540  static void SetMaxTreeSize(Long64_t maxsize = 1900000000);
541  virtual void SetMaxVirtualSize(Long64_t size = 0) { fMaxVirtualSize = size; } // *MENU*
542  virtual void SetName(const char* name); // *MENU*
543  virtual void SetNotify(TObject* obj) { fNotify = obj; }
544  virtual void SetObject(const char* name, const char* title);
545  virtual void SetParallelUnzip(Bool_t opt=kTRUE, Float_t RelSize=-1);
546  virtual void SetPerfStats(TVirtualPerfStats* perf);
547  virtual void SetScanField(Int_t n = 50) { fScanField = n; } // *MENU*
548  virtual void SetTimerInterval(Int_t msec = 333) { fTimerInterval=msec; }
549  virtual void SetTreeIndex(TVirtualIndex* index);
550  virtual void SetWeight(Double_t w = 1, Option_t* option = "");
551  virtual void SetUpdate(Int_t freq = 0) { fUpdate = freq; }
552  virtual void Show(Long64_t entry = -1, Int_t lenmax = 20);
553  virtual void StartViewer(); // *MENU*
554  virtual Int_t StopCacheLearningPhase();
555  virtual Int_t UnbinnedFit(const char* funcname, const char* varexp, const char* selection = "", Option_t* option = "", Long64_t nentries = kMaxEntries, Long64_t firstentry = 0);
556  void UseCurrentStyle();
557  virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0);
558  virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0) const;
559 
560 
561  ClassDef(TTree,19) //Tree descriptor (the main ROOT I/O class)
562 };
563 
564 //////////////////////////////////////////////////////////////////////////
565 // //
566 // TTreeFriendLeafIter //
567 // //
568 // Iterator on all the leaves in a TTree and its friend //
569 // //
570 //////////////////////////////////////////////////////////////////////////
571 
573 
574 protected:
575  TTree *fTree; //tree being iterated
576  TIterator *fLeafIter; //current leaf sub-iterator.
577  TIterator *fTreeIter; //current tree sub-iterator.
578  Bool_t fDirection; //iteration direction
579 
580  TTreeFriendLeafIter() : fTree(0), fLeafIter(0), fTreeIter(0),
581  fDirection(0) { }
582 
583 public:
584  TTreeFriendLeafIter(const TTree* t, Bool_t dir = kIterForward);
586  ~TTreeFriendLeafIter() { SafeDelete(fLeafIter); SafeDelete(fTreeIter); }
587  TIterator &operator=(const TIterator &rhs);
589 
590  const TCollection *GetCollection() const { return 0; }
591  Option_t *GetOption() const;
592  TObject *Next();
593  void Reset() { SafeDelete(fLeafIter); SafeDelete(fTreeIter); }
594  Bool_t operator !=(const TIterator&) const {
595  // TODO: Implement me
596  return false;
597  }
599  // TODO: Implement me
600  return false;
601  }
602  TObject *operator*() const {
603  // TODO: Implement me
604  return nullptr;
605  }
606  ClassDef(TTreeFriendLeafIter,0) //Linked list iterator
607  };
608 
609 
610 #endif
virtual Double_t * GetV3()
Definition: TTree.h:454
TBranch * Branch(const char *name, const char *classname, T **addobj, Int_t bufsize=32000, Int_t splitlevel=99)
Definition: TTree.h:326
Describe Streamer information for one class version.
Definition: TStreamerInfo.h:47
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:4511
Double_t fWeight
Definition: TTree.h:102
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
Definition: TLeaf.h:37
Bool_t IsFolder() const
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects)...
Definition: TTree.h:461
virtual void AddTotBytes(Int_t tot)
Definition: TTree.h:296
TTreeCache * GetReadCache(TFile *file, Bool_t create=kFALSE)
Find and return the TTreeCache registered with the file and which may contain branches for us...
Definition: TTree.cxx:5667
virtual TList * GetListOfAliases() const
Definition: TTree.h:408
virtual TList * GetListOfClones()
Definition: TTree.h:404
TStreamerInfo * BuildStreamerInfo(TClass *cl, void *pointer=0, Bool_t canOptimize=kTRUE)
Build StreamerInfo for class cl.
Definition: TTree.cxx:2524
An array of TObjects.
Definition: TObjArray.h:39
Long64_t fDebugMin
Debug level.
Definition: TTree.h:124
TBranch * Branch(const char *name, T **addobj, Int_t bufsize=32000, Int_t splitlevel=99)
Definition: TTree.h:331
Principal Components Analysis (PCA)
Definition: TPrincipal.h:28
TTree * fTree
Definition: TTree.h:575
Long64_t GetNextEntry()
Definition: TTree.h:278
virtual Long64_t GetAutoSave() const
Definition: TTree.h:368
Bool_t fPrevious
Definition: TTree.h:181
static Vc_ALWAYS_INLINE int_v min(const int_v &x, const int_v &y)
Definition: vector.h:433
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 Using the information in the e...
Definition: TTree.cxx:6369
virtual const char * GetFriendAlias(TTree *) const
If the 'tree' is a friend, this method returns its alias name.
Definition: TTree.cxx:5390
Bool_t MemoryFull(Int_t nbytes)
Check if adding nbytes to memory we are still below MaxVirtualsize.
Definition: TTree.cxx:6176
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:1444
virtual TVirtualPerfStats * GetPerfStats() const
Definition: TTree.h:423
Long64_t fTotalBuffers
Number of the entry being processed.
Definition: TTree.h:120
virtual Int_t MakeCode(const char *filename=0)
Generate a skeleton function for this tree.
Definition: TTree.cxx:5979
long long Long64_t
Definition: RtypesCore.h:69
TTreeFormula * GetVar2()
Definition: TTree.h:442
TIterator * fTreeIter
Definition: TTree.h:577
Abstract interface for Tree Index.
Definition: TVirtualIndex.h:31
virtual TTreeFormula * GetVar1() const =0
static constexpr Long64_t kMaxEntries
virtual Int_t StopCacheLearningPhase()
Stop the cache learning phase.
Definition: TTree.cxx:8519
virtual void SetBranchStatus(const char *bname, Bool_t status=1, UInt_t *found=0)
Set branch status to Process or DoNotProcess.
Definition: TTree.cxx:7675
virtual void IncrementTotalBuffers(Int_t nbytes)
Definition: TTree.h:460
virtual void Delete(Option_t *option="")
Delete this tree from memory or/and disk.
Definition: TTree.cxx:3520
Int_t GetType() const
Definition: TDataType.h:70
static Int_t fgBranchStyle
true if the cache setting was explicitly given by user
Definition: TTree.h:149
virtual void AddZipBytes(Int_t zip)
Definition: TTree.h:297
virtual Double_t * GetV4()
Definition: TTree.h:456
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:5783
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:5614
virtual void SetParallelUnzip(Bool_t opt=kTRUE, Float_t RelSize=-1)
Enable or disable parallel unzipping of Tree buffers.
Definition: TTree.cxx:8360
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:6345
TTree()
Default constructor and I/O constructor.
Definition: TTree.cxx:626
TEventList * GetEventList() const
Definition: TTree.h:392
virtual Long64_t GetReadEntry() const
Definition: TTree.h:424
TBuffer * fTransientBuffer
Record which method is locking the friend recursion.
Definition: TTree.h:145
double T(double x)
Definition: ChebyshevPol.h:34
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:4739
TIterator * fLeafIter
Definition: TTree.h:576
TList * fFriends
Definition: TTree.h:138
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:6495
const char Int_t perf
Definition: TXSlave.cxx:46
virtual TH1 * GetHistogram() const =0
virtual Int_t Fill()
Fill all branches.
Definition: TTree.cxx:4328
virtual TEntryList * GetEntryList()
Returns the entry list, set to this tree.
Definition: TTree.cxx:5213
virtual void SetMaxEntryLoop(Long64_t maxev=kMaxEntries)
Definition: TTree.h:539
#define BIT(n)
Definition: Rtypes.h:120
const TCollection * GetCollection() const
Definition: TTree.h:590
Long64_t GetCacheAutoSize(Bool_t withDefault=kFALSE) const
Used for automatic sizing of the cache.
Definition: TTree.cxx:4945
static void SetBranchStyle(Int_t style=1)
Set the current branch style.
Definition: TTree.cxx:7801
A specialized TFileCacheRead object for a TTree.
Definition: TTreeCache.h:34
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:5539
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:5039
TTree * fTree
Definition: TTree.h:179
static TClass * GetClass(const type_info &typeinfo)
Forward to TROOT::GetClass().
Definition: TBuffer.cxx:295
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
Definition: TFile.h:45
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:5449
TTreeFormula * GetSelect()
Definition: TTree.h:427
Buffer base class used for serializing objects.
Definition: TBuffer.h:40
TDirectory * fDirectory
Object to be notified when loading a Tree.
Definition: TTree.h:129
static const char * filename()
Int_t fMakeClass
Last entry number to debug.
Definition: TTree.h:126
virtual TBasket * CreateBasket(TBranch *)
Create a basket for this tree and given branch.
Definition: TTree.cxx:3504
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:7486
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:5163
virtual TTreeFormula * GetVar(Int_t) const =0
virtual TTree * GetFriend(const char *) const
Return a pointer to the TTree friend whose name or alias is 'friendname.
Definition: TTree.cxx:5333
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:6107
virtual Long64_t GetChainEntryNumber(Long64_t entry) const
Definition: TTree.h:375
TAlienJobStatus * status
Definition: TAlienJob.cxx:51
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
virtual void PrintCacheStats(Option_t *option="") const
print statistics about the TreeCache for this tree, like ******TreeCache statistics for file: cms2...
Definition: TTree.cxx:6628
Long64_t GetDebugMin() const
Definition: TTree.h:380
const Bool_t kFALSE
Definition: Rtypes.h:92
virtual void Browse(TBrowser *)
Browse content of the TTree.
Definition: TTree.cxx:2484
constexpr std::array< decltype(std::declval< F >)(std::declval< int >))), N > make(F f)
virtual Long64_t GetZipBytes() const
Definition: TTree.h:459
virtual Long64_t GetEntryNumber(Long64_t entry) const
Return entry number corresponding to entry.
Definition: TTree.cxx:5224
Int_t fScanField
Definition: TTree.h:104
virtual Double_t * GetV4() const =0
virtual Int_t FlushBaskets() const
Write to disk all the basket that have not yet been individually written.
Definition: TTree.cxx:4753
Int_t GetEntriesFast() const
Definition: TObjArray.h:66
virtual TTree * CloneTree(Long64_t nentries=-1, Option_t *option="")
Create a clone of this tree and copy nentries.
Definition: TTree.cxx:2961
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:3492
virtual TVirtualIndex * GetTreeIndex() const
Definition: TTree.h:433
virtual void KeepCircular()
Keep a maximum of fMaxEntries in memory.
Definition: TTree.cxx:5747
TArrayD fIndexValues
Pointer to event selection list (if one)
Definition: TTree.h:135
virtual Long64_t GetEstimate() const
Definition: TTree.h:386
TFile * GetCurrentFile() const
Return pointer to the current file.
Definition: TTree.cxx:5006
Long64_t fMaxEntryLoop
Definition: TTree.h:110
TVirtualTreePlayer * GetPlayer()
Load the TTreePlayer (if not already done).
Definition: TTree.cxx:5653
virtual void SetMaxVirtualSize(Long64_t size=0)
Definition: TTree.h:541
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:6769
A Tree Index with majorname and minorname.
Definition: TTreeIndex.h:32
ELockStatusBits
Definition: TTree.h:199
Long64_t fStartEntry
Definition: TTree.h:250
Iterator abstract base class.
Definition: TIterator.h:32
Array of integers (32 bits per element).
Definition: TArrayI.h:29
virtual Long64_t GetChainOffset() const
Definition: TTree.h:376
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:7148
virtual void SetFileNumber(Int_t number=0)
Set fFileNumber to number.
Definition: TTree.cxx:8258
virtual Double_t GetMinimum(const char *columname)
Return minimum of column with name columname.
Definition: TTree.cxx:5624
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:3592
TTree & operator=(const TTree &tt)
virtual void StartViewer()
Start the TTreeViewer on this tree.
Definition: TTree.cxx:8504
virtual TList * GetListOfFriends() const
Definition: TTree.h:407
virtual Long64_t Merge(TCollection *list, Option_t *option="")
Merge the trees in the TList into this tree.
Definition: TTree.cxx:6233
Marker Attributes class.
Definition: TAttMarker.h:32
virtual void Print(Option_t *option="") const
Print a summary of the tree contents.
Definition: TTree.cxx:6514
virtual Int_t GetEntryWithIndex(Int_t major, Int_t minor=0)
Read entry corresponding to major and minor number.
Definition: TTree.cxx:5286
TList * fAliases
Definition: TTree.h:132
TBranch * Branch(const char *name, Long_t address, const char *leaflist, Int_t bufsize=32000)
Definition: TTree.h:308
virtual TTreeFormula * GetVar3() const =0
#define SafeDelete(p)
Definition: RConfig.h:436
virtual TObjArray * GetListOfBranches()
Definition: TTree.h:405
Helper class to iterate over cluster of baskets.
Definition: TTree.h:245
TVirtualTreePlayer * fPlayer
Definition: TTree.h:141
Fill Area Attributes class.
Definition: TAttFill.h:32
void ImportClusterRanges(TTree *fromtree)
Appends the cluster range information stored in 'fromtree' to this tree, including the value of fAuto...
Definition: TTree.cxx:5708
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:7401
#define ClassDef(name, id)
Definition: Rtypes.h:254
virtual Long64_t GetSelectedRows()
Definition: TTree.h:428
TTreeFormula * GetVar(Int_t i)
Definition: TTree.h:438
virtual Long64_t CopyEntries(TTree *tree, Long64_t nentries=-1, Option_t *option="")
Copy nentries from given tree to this tree.
Definition: TTree.cxx:3323
virtual Int_t SetBranchAddress(const char *bname, void *add, TBranch **ptr=0)
Change branch address, dealing with clone trees properly.
Definition: TTree.cxx:7529
Int_t fNfill
Number of entries in one packet for parallel root.
Definition: TTree.h:122
TText * tt
Definition: textangle.C:16
virtual void SetObject(const char *name, const char *title)
Change the name and title of this tree.
Definition: TTree.cxx:8329
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:33
virtual Long64_t LoadTree(Long64_t entry)
Set current entry.
Definition: TTree.cxx:5804
Bool_t fCacheUserSet
true if cache auto creation or resize check is needed
Definition: TTree.h:147
virtual void SetTreeIndex(TVirtualIndex *index)
The current TreeIndex is replaced by the new index.
Definition: TTree.cxx:8391
Int_t fMaxClusterRange
Definition: TTree.h:108
static Int_t GetBranchStyle()
Static function returning the current branch style.
Definition: TTree.cxx:4933
virtual Int_t BuildIndex(const char *majorname, const char *minorname="0")
Build a Tree Index (default is TTreeIndex).
Definition: TTree.cxx:2509
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:8762
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:1857
virtual Int_t GetNbranches()
Definition: TTree.h:419
virtual void Show(Long64_t entry=-1, Int_t lenmax=20)
Print values of all active leaves for entry.
Definition: TTree.cxx:8430
std::map< std::string, std::string >::const_iterator iter
Definition: TAlienJob.cxx:54
TBranchRef * fBranchRef
List of cloned trees which share our addresses.
Definition: TTree.h:143
virtual Int_t MakeClass(const char *classname=0, Option_t *option="")
Generate a skeleton analysis class for this tree.
Definition: TTree.cxx:5946
virtual TClusterIterator GetClusterIterator(Long64_t firstentry)
Return an iterator over the cluster of baskets starting at firstentry.
Definition: TTree.cxx:4995
UInt_t fFriendLockStatus
Definition: TTree.h:144
Double_t * fArray
Definition: TArrayD.h:32
const int maxsize
Int_t fTimerInterval
Definition: TTree.h:103
virtual TFriendElement * AddFriend(const char *treename, const char *filename="")
Add a TFriendElement to the list of friends.
Definition: TTree.cxx:1157
ClassDef(TAttLine, 2)
const Bool_t kIterForward
Definition: TCollection.h:43
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:7304
Long64_t fFlushedBytes
Definition: TTree.h:101
virtual Long64_t GetReadEvent() const
Definition: TTree.h:425
virtual Double_t GetMaximum(const char *columname)
Return maximum of column with name columname.
Definition: TTree.cxx:5585
virtual void RemoveFriend(TTree *)
Remove a friend from the list of friends.
Definition: TTree.cxx:7187
virtual Double_t * GetW() const =0
Bool_t operator!=(const TIterator &) const
Definition: TTree.h:594
virtual TList * GetUserInfo()
Return a pointer to the list containing user objects associated to this tree.
Definition: TTree.cxx:5692
virtual void SetCacheLearnEntries(Int_t n=10)
Interface to TTreeCache to set the number of entries for the learning phase.
Definition: TTree.cxx:7994
A branch containing and managing a TRefTable for TRef autoloading.
Definition: TBranchRef.h:33
Long64_t fZipBytes
Definition: TTree.h:99
Long64_t fDebugMax
First entry number to debug.
Definition: TTree.h:125
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:1363
TBranch * Branch(const char *name, char *address, const char *leaflist, Int_t bufsize=32000)
Definition: TTree.h:303
TTreeFormula * GetVar4()
Definition: TTree.h:446
Used to pass a selection expression to the Tree drawing routine.
Definition: TTreeFormula.h:64
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:8195
void UseCurrentStyle()
Replace current attributes by current style.
Definition: TTree.cxx:8774
A specialized string object used for TTree selections.
Definition: TCut.h:27
A doubly linked list.
Definition: TList.h:47
virtual TBranch * GetBranch(const char *name)
Return pointer to the branch with the given name in this tree or its friends.
Definition: TTree.cxx:4822
Bool_t fCacheDoAutoInit
Pointer to the current transient buffer.
Definition: TTree.h:146
Int_t SetBranchAddress(const char *bname, T **add, TBranch **ptr=0)
Definition: TTree.h:507
TH1 * GetHistogram()
Definition: TTree.h:398
TObjArray fLeaves
Definition: TTree.h:131
Long64_t * fClusterRangeEnd
Definition: TTree.h:115
virtual Long64_t GetTotBytes() const
Definition: TTree.h:431
TObject * GetNotify() const
Definition: TTree.h:420
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:41
Int_t fNClusterRange
Definition: TTree.h:107
virtual Int_t GetTimerInterval() const
Definition: TTree.h:429
TEntryList * fEntryList
Pointer to event selection list (if one)
Definition: TTree.h:134
virtual Long64_t GetMaxEntryLoop() const
Definition: TTree.h:414
virtual TTreeFormula * GetVar4() const =0
TBranch * Branch(const char *name, int address, const char *leaflist, Int_t bufsize=32000)
Definition: TTree.h:313
Option_t * GetOption() const
Returns the object option stored in the list.
Definition: TTree.cxx:8912
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:8811
virtual void SetEstimate(Long64_t nentries=1000000)
Set number of entries to estimate variable limits.
Definition: TTree.cxx:8236
virtual Double_t * GetV2() const =0
ESetBranchAddressStatus
Definition: TTree.h:220
Long64_t fChainOffset
Maximum size of file buffers.
Definition: TTree.h:118
virtual Long64_t GetCacheSize() const
Definition: TTree.h:373
~TFriendLock()
Restore the state of tree the same as before we set the lock.
Definition: TTree.cxx:484
Long64_t * fClusterSize
Definition: TTree.h:116
virtual Double_t * GetV2()
Definition: TTree.h:452
virtual void SetUpdate(Int_t freq=0)
Definition: TTree.h:551
TVirtualPerfStats * fPerfStats
Definition: TTree.h:139
virtual Int_t GetTreeNumber() const
Definition: TTree.h:434
TDirectory * GetDirectory() const
Definition: TTree.h:381
Long64_t fReadEntry
Offset of 1st entry of this Tree in a TChain.
Definition: TTree.h:119
virtual ~TTree()
Destructor.
Definition: TTree.cxx:801
Collection abstract base class.
Definition: TCollection.h:48
virtual const char * GetAlias(const char *aliasName) const
Returns the expanded value of the alias. Search in the friends if any.
Definition: TTree.cxx:4781
TList * fUserInfo
pointer to the current perf stats object
Definition: TTree.h:140
TObjArray fBranches
Pointer to directory holding this tree.
Definition: TTree.h:130
virtual void SetNotify(TObject *obj)
Definition: TTree.h:543
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)
static void SetMaxTreeSize(Long64_t maxsize=1900000000)
Set the maximum size in bytes of a Tree file (static function).
Definition: TTree.cxx:8292
Manages buffers for branches of a Tree.
Definition: TBasket.h:38
TTreeFormula * GetVar3()
Definition: TTree.h:444
virtual TBranchRef * GetBranchRef() const
Definition: TTree.h:370
A TEventList object is a list of selected events (entries) in a TTree.
Definition: TEventList.h:33
virtual TLeaf * FindLeaf(const char *name)
Find leaf..
Definition: TTree.cxx:4583
virtual Long64_t GetEntryNumberWithIndex(Long64_t major, Long64_t minor=0) const
Return entry number corresponding to major and minor number.
Definition: TTree.cxx:5269
TArrayI fIndex
Definition: TTree.h:136
The ROOT global object gROOT contains a list of all defined classes.
Definition: TClass.h:81
virtual void ResetBranchAddress(TBranch *)
Tell all of our branches to set their addresses to zero.
Definition: TTree.cxx:7275
Bool_t fDirection
Definition: TTree.h:578
virtual Double_t * GetVal(Int_t) const =0
Long64_t entry
TEventList * fEventList
Definition: TTree.h:133
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:2187
virtual Long64_t GetMaxVirtualSize() const
Definition: TTree.h:417
Long64_t fMaxEntries
Memory allocated for the cluster range.
Definition: TTree.h:109
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:1072
char GetNewlineValue(std::istream &inputStream)
Determine which newline this file is using.
Definition: TTree.cxx:6839
virtual Int_t DropBranchFromCache(const char *bname, Bool_t subbranches=kFALSE)
Remove the branch with name 'bname' from the Tree cache.
Definition: TTree.cxx:995
virtual Int_t * GetIndex()
Definition: TTree.h:399
Long64_t fAutoSave
Definition: TTree.h:112
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:2712
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:8057
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:6706
TBranch * Branch(const char *name, T *obj, Int_t bufsize=32000, Int_t splitlevel=99)
Definition: TTree.h:336
long Long_t
Definition: RtypesCore.h:50
virtual Long64_t ReadStream(std::istream &inputStream, const char *branchDescriptor="", char delimiter= ' ')
Create or simply read branches from an input stream.
Definition: TTree.cxx:6866
virtual void DropBuffers(Int_t nbytes)
Drop branch buffers to accommodate nbytes below MaxVirtualsize.
Definition: TTree.cxx:4260
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:8272
virtual void SetWeight(Double_t w=1, Option_t *option="")
Set tree weight.
Definition: TTree.cxx:8419
TBranch * Branch(const char *name, const char *classname, T *obj, Int_t bufsize=32000, Int_t splitlevel=99)
Definition: TTree.h:321
A PolyMarker is defined by an array on N points in a 2-D space.
Definition: TPolyMarker.h:37
Long64_t Next()
Move on to the next cluster and return the starting entry of this next cluster.
Definition: TTree.cxx:575
virtual void SetDirectory(TDirectory *dir)
Change the tree's directory.
Definition: TTree.cxx:8095
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:5896
virtual Long64_t GetAutoFlush() const
Definition: TTree.h:367
Long64_t fMaxVirtualSize
Definition: TTree.h:111
Int_t GetEvent(Long64_t entry=0, Int_t getall=0)
Definition: TTree.h:388
virtual void SetEntryList(TEntryList *list, Option_t *opt="")
Set an EntryList.
Definition: TTree.cxx:8172
TIterator & operator=(const TIterator &rhs)
Overridden assignment operator. Does NOT copy the 'cursor' location!
Definition: TTree.cxx:8850
double Double_t
Definition: RtypesCore.h:55
Long64_t GetStartEntry()
Definition: TTree.h:273
virtual Double_t * GetW()
Definition: TTree.h:457
Int_t * fArray
Definition: TArrayI.h:32
Long64_t fTotBytes
Definition: TTree.h:98
virtual Int_t GetUpdate() const
Definition: TTree.h:435
Describe directory structure in memory.
Definition: TDirectory.h:41
virtual void SetPerfStats(TVirtualPerfStats *perf)
Set perf stats.
Definition: TTree.cxx:8374
virtual Long64_t GetEntriesFast() const
Definition: TTree.h:384
int type
Definition: TGX11.cxx:120
unsigned long long ULong64_t
Definition: RtypesCore.h:70
Long64_t GetDebugMax() const
Definition: TTree.h:379
Long64_t fAutoFlush
Definition: TTree.h:113
virtual void ResetBranchAddresses()
Tell all of our branches to drop their current objects and allocate new ones.
Definition: TTree.cxx:7285
virtual void Draw(Option_t *opt)
Default Draw method for all objects.
Definition: TTree.h:356
TCanvas * style()
Definition: style.C:1
int nentries
Definition: THbookFile.cxx:89
EDataType
Definition: TDataType.h:30
Int_t fDefaultEntryOffsetLen
Definition: TTree.h:106
The TH1 histogram class.
Definition: TH1.h:80
virtual TTree * GetTree() const
Definition: TTree.h:432
Long64_t fEstimate
Definition: TTree.h:114
UInt_t fMethodBit
Definition: TTree.h:180
Helper class to prevent infinite recursion in the usage of TTree Friends.
Definition: TTree.h:176
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
Definition: TClass.cxx:2881
virtual Int_t SetCacheSize(Long64_t cachesize=-1)
Set maximum size of the file cache .
Definition: TTree.cxx:7817
Int_t fDebug
Local for EntryLoop.
Definition: TTree.h:123
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:7843
Array of doubles (64 bits per element).
Definition: TArrayD.h:29
static Vc_ALWAYS_INLINE int_v max(const int_v &x, const int_v &y)
Definition: vector.h:440
#define name(a, b)
Definition: linkTestLib0.cpp:5
virtual void SetBasketSize(const char *bname, Int_t buffsize=16000)
Set a branch's basket size.
Definition: TTree.cxx:7502
virtual TBranch * BranchRef()
Build the optional branch supporting the TRefTable.
Definition: TTree.cxx:2111
virtual void ResetAfterMerge(TFileMergeInfo *)
Resets the state of this TTree after a merge (keep the customization but forget the data)...
Definition: TTree.cxx:7244
virtual Bool_t SetAlias(const char *aliasName, const char *aliasFormula)
Set a tree variable alias.
Definition: TTree.cxx:7346
Int_t fFileNumber
not zero when processing code generated by MakeClass
Definition: TTree.h:127
Mother of all ROOT objects.
Definition: TObject.h:58
virtual Long64_t ReadFile(const char *filename, const char *branchDescriptor="", char delimiter= ' ')
Create or simply read branches from filename.
Definition: TTree.cxx:6820
Int_t fUpdate
Definition: TTree.h:105
Long64_t operator()()
Definition: TTree.h:282
virtual Int_t Branch(TCollection *list, Int_t bufsize=32000, Int_t splitlevel=99, const char *name="")
Create one branch for each element in the collection.
Definition: TTree.cxx:1624
virtual Int_t GetFileNumber() const
Definition: TTree.h:395
Long64_t fEntries
Definition: TTree.h:97
TList * fClones
Pointer to current Tree player.
Definition: TTree.h:142
virtual Int_t MakeSelector(const char *selector=0, Option_t *option="")
Generate skeleton selector class for this tree.
Definition: TTree.cxx:6161
TBuffer * GetTransientBuffer(Int_t size)
Returns the transient buffer currently used by this TTree for reading/writing baskets.
Definition: TTree.cxx:890
virtual Long64_t GetSelectedRows() const =0
Int_t Debug() const
Definition: TTree.h:354
Class implementing or helping the various TTree cloning method.
Definition: TTreeCloner.h:40
virtual Double_t * GetVal(Int_t i)
Definition: TTree.h:448
Abstract base class defining the interface for the plugins that implement Draw, Scan, Process, MakeProxy, etc.
TClusterIterator(TTree *tree, Long64_t firstEntry)
Regular constructor.
Definition: TTree.cxx:501
TObject * operator*() const
Return current object or nullptr.
Definition: TTree.h:602
A TFriendElement TF describes a TTree object TF in a file.
Long64_t fNextEntry
Definition: TTree.h:251
Iterator on all the leaves in a TTree and its friend.
Definition: TTree.h:572
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:2195
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:7117
virtual void SetCircular(Long64_t maxEntries)
Enable/Disable circularity for this tree.
Definition: TTree.cxx:8021
virtual void Reset(Option_t *option="")
Reset baskets, buffers and entries count in all branches and leaves.
Definition: TTree.cxx:7213
virtual void SetTimerInterval(Int_t msec=333)
Definition: TTree.h:548
virtual TTreeFormula * GetVar2() const =0
TObject * fNotify
current file number (if file extensions)
Definition: TTree.h:128
virtual Int_t SetCacheEntryRange(Long64_t first, Long64_t last)
interface to TTreeCache to set the cache entry range
Definition: TTree.cxx:7960
virtual Long64_t GetEntries() const
Definition: TTree.h:382
TTreeFormula * GetVar1()
Definition: TTree.h:440
A TTree object has a header with a name and a title.
Definition: TTree.h:94
TVirtualIndex * fTreeIndex
Definition: TTree.h:137
TFriendLock & operator=(const TFriendLock &)
Assignment operator.
Definition: TTree.cxx:471
Int_t SetBranchAddressImp(TBranch *branch, void *addr, TBranch **ptr)
Change branch address, dealing with clone trees properly.
Definition: TTree.cxx:7586
virtual void SetDefaultEntryOffsetLen(Int_t newdefault, Bool_t updateExisting=kFALSE)
Update the default value for the branch's fEntryOffsetLen.
Definition: TTree.cxx:8069
virtual Double_t GetWeight() const
Definition: TTree.h:458
Int_t GetMakeClass() const
Definition: TTree.h:412
TObject * Next()
Go the next friend element.
Definition: TTree.cxx:8873
virtual void DropBaskets()
Remove some baskets from memory.
Definition: TTree.cxx:4247
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:5433
static Long64_t fgMaxTreeSize
Definition: TTree.h:150
virtual Long64_t SetEntries(Long64_t n=-1)
Change number of entries in the tree.
Definition: TTree.cxx:8140
virtual TFile * ChangeFile(TFile *file)
Called by TTree::Fill() when file has reached its maximum fgMaxTreeSize.
Definition: TTree.cxx:2599
static TTree * MergeTrees(TList *list, Option_t *option="")
Static function merging the trees in the TList into a new tree.
Definition: TTree.cxx:6190
A TTree is a list of TBranches.
Definition: TBranch.h:58
virtual Bool_t GetBranchStatus(const char *branchname) const
Return status of branch with name branchname.
Definition: TTree.cxx:4918
A TSelector object is used by the TTree::Draw, TTree::Scan, TTree::Process to navigate in a TTree and...
Definition: TSelector.h:39
const Bool_t kTRUE
Definition: Rtypes.h:91
TObject * obj
A List of entry numbers in a TTree or TChain.
Definition: TEntryList.h:27
virtual Long64_t GetEntryNumberWithBestIndex(Long64_t major, Long64_t minor=0) const
Return entry number corresponding to major and minor number.
Definition: TTree.cxx:5249
virtual Int_t AddBranchToCache(const char *bname, Bool_t subbranches=kFALSE)
Add branch with name bname to the Tree cache.
Definition: TTree.cxx:912
Int_t fPacketSize
Total number of bytes in branch buffers.
Definition: TTree.h:121
virtual Int_t GetPacketSize() const
Definition: TTree.h:422
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:6754
virtual void SetScanField(Int_t n=50)
Definition: TTree.h:547
Line Attributes class.
Definition: TAttLine.h:32
virtual Double_t * GetV1()
Definition: TTree.h:450
Int_t SetBranchAddress(const char *bname, T *add, TBranch **ptr=0)
Definition: TTree.h:516
static constexpr Long64_t kMaxEntries
Definition: TTree.h:217
TFriendLock(const TFriendLock &)
Copy constructor.
Definition: TTree.cxx:461
Int_t GetDefaultEntryOffsetLen() const
Definition: TTree.h:378
virtual Int_t GetScanField() const
Definition: TTree.h:426
virtual void SetName(const char *name)
Change the name of this tree.
Definition: TTree.cxx:8300
Long64_t GetEstimatedClusterSize()
In the case where the cluster size was not fixed (old files and case where autoflush was explicitly s...
Definition: TTree.cxx:544
A Chain Index.
Definition: TChainIndex.h:41
void MoveReadCache(TFile *src, TDirectory *dir)
Move a cache from a file to the current file in dir.
Definition: TTree.cxx:6323
virtual void CopyAddresses(TTree *, Bool_t undo=kFALSE)
Set branch addresses of passed tree equal to ours.
Definition: TTree.cxx:3116
virtual TObjArray * GetListOfLeaves()
Definition: TTree.h:406
Long64_t fSavedBytes
Definition: TTree.h:100
Long64_t fCacheSize
Definition: TTree.h:117
virtual void SetChainOffset(Long64_t offset=0)
Definition: TTree.h:528
virtual Long64_t AutoSave(Option_t *option="")
AutoSave tree header every fAutoSave bytes.
Definition: TTree.cxx:1309
virtual Double_t * GetIndexValues()
Definition: TTree.h:400
virtual Double_t * GetV1() const =0