Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
TChain Class Reference

A chain is a collection of files containing TTree objects.

When the chain is created, the first parameter is the default name for the Tree to be processed later on.

Enter a new element in the chain via the TChain::Add function. Once a chain is defined, one can use the normal TTree functions to Draw,Scan,etc.

Use TChain::SetBranchStatus to activate one or more branches for all the trees in the chain.

Definition at line 33 of file TChain.h.

Public Types

enum  { kSingleKey = (1ULL << (0)) , kOverwrite = (1ULL << (1)) , kWriteDelete = (1ULL << (2)) }
enum  { kSplitCollectionOfPointers = 100 }
enum  {
  kIsOnHeap = 0x01000000 , kNotDeleted = 0x02000000 , kZombie = 0x04000000 , kInconsistent = 0x08000000 ,
  kBitMask = 0x00ffffff
}
enum  EDeprecatedStatusBits { kObjInCanvas = (1ULL << (3)) }
enum  ESetBranchAddressStatus {
  kMissingBranch = -5 , kInternalError = -4 , kMissingCompiledCollectionProxy = -3 , kMismatch = -2 ,
  kClassMismatch = -1 , kMatch = 0 , kMatchConversion = 1 , kMatchConversionCollection = 2 ,
  kMakeClass = 3 , kVoidPtr = 4 , kNoCheck = 5 , kNeedEnableDecomposedObj = (1ULL << (29)) ,
  kNeedDisableDecomposedObj = (1ULL << (30)) , kDecomposedObjMask = kNeedEnableDecomposedObj | kNeedDisableDecomposedObj
}
enum  EStatusBits { kGlobalWeight = (1ULL << (15)) , kAutoDelete = (1ULL << (16)) }
enum  Mode { kWithoutGlobalRegistration , kWithGlobalRegistration }

Public Member Functions

 TChain (const char *name, const char *title="", Mode mode=kWithGlobalRegistration)
 Create a chain.
 TChain (Mode mode=kWithGlobalRegistration)
 Default constructor.
 ~TChain () override
 Destructor.
void AbstractMethod (const char *method) const
 Call this function within a function that you don't want to define as purely virtual, in order not to force all users deriving from that class to implement that maybe (on their side) unused function; but at the same time, emit a run-time warning if they try to call it, telling that it is not implemented in the derived class: action must thus be taken on the user side to override it.
virtual Int_t Add (const char *name, Long64_t nentries=TTree::kMaxEntries)
 Add a new file to this chain.
virtual Int_t Add (TChain *chain)
 Add all files referenced by the passed chain to this chain.
void AddAllocationCount (UInt_t count)
virtual Int_t AddBranchToCache (const char *bname, bool subbranches=false)
 Add branch with name bname to the Tree cache.
virtual Int_t AddBranchToCache (TBranch *branch, bool subbranches=false)
 Add branch b to the Tree cache.
void AddClone (TTree *)
 Add a cloned tree to our list of trees to be notified whenever we change our branch addresses or when we are deleted.
virtual Int_t AddFile (const char *name, Long64_t nentries=TTree::kMaxEntries, const char *tname="")
 Add a new file to this chain.
virtual Int_t AddFileInfoList (TCollection *list, Long64_t nfiles=TTree::kMaxEntries)
 Add all files referenced in the list to the chain.
TFriendElementAddFriend (const char *chainname, const char *dummy="") override
 Add a TFriendElement to the list of friends of this chain.
TFriendElementAddFriend (const char *chainname, TFile *dummy) override
 Add the whole chain or tree as a friend of this chain.
TFriendElementAddFriend (TTree *chain, const char *alias="", bool warn=false) override
 Add the whole chain or tree as a friend of this chain.
virtual void AddTotBytes (Int_t tot)
virtual void AddZipBytes (Int_t zip)
virtual void AppendPad (Option_t *option="")
 Append graphics object to current pad.
virtual Long64_t AutoSave (Option_t *option="")
 AutoSave tree header every fAutoSave bytes.
virtual Int_t Branch (const char *folder, Int_t bufsize=32000, Int_t splitlevel=99)
 Create one branch for each element in the folder.
TBranchBranch (const char *name, char *address, const char *leaflist, Int_t bufsize=32000)
template<class T>
TBranchBranch (const char *name, const char *classname, T **addobj, Int_t bufsize=32000, Int_t splitlevel=99)
template<class T>
TBranchBranch (const char *name, const char *classname, T *obj, Int_t bufsize=32000, Int_t splitlevel=99)
virtual TBranchBranch (const char *name, const char *classname, void *addobj, Int_t bufsize=32000, Int_t splitlevel=99)
 Create a new branch with the object of class classname at address addobj.
TBranchBranch (const char *name, int address, const char *leaflist, Int_t bufsize=32000)
TBranchBranch (const char *name, Longptr_t address, const char *leaflist, Int_t bufsize=32000)
template<typename T, std::size_t N>
TBranchBranch (const char *name, std::array< T, N > *obj, Int_t bufsize=32000, Int_t splitlevel=99)
template<class T>
TBranchBranch (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.
template<class T>
TBranchBranch (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.
virtual TBranchBranch (const char *name, void *address, const char *leaflist, Int_t bufsize=32000)
 Create a new TTree Branch.
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.
virtual Int_t Branch (TList *list, Int_t bufsize=32000, Int_t splitlevel=99)
 Deprecated function. Use next function instead.
virtual TBranchBranchOld (const char *name, const char *classname, void *addobj, Int_t bufsize=32000, Int_t splitlevel=1)
 Create a new TTree BranchObject.
virtual TBranchBranchRef ()
 Build the optional branch supporting the TRefTable.
virtual TBranchBronch (const char *name, const char *classname, void *addobj, Int_t bufsize=32000, Int_t splitlevel=99)
 Create a new TTree BranchElement.
void Browse (TBrowser *) override
 Browse the contents of the chain.
Int_t BuildIndex (const char *majorname, bool long64major)
 Build index with only a major formula.
virtual Int_t BuildIndex (const char *majorname, const char *minorname="0", bool long64major=false, bool long64minor=false)
 Build a Tree Index (default is TTreeIndex).
TStreamerInfoBuildStreamerInfo (TClass *cl, void *pointer=nullptr, bool canOptimize=true)
 Build StreamerInfo for class cl.
virtual void CanDeleteRefs (bool flag=true)
 When closing a file during the chain processing, the file may be closed with option "R" if flag is set to true.
virtual TFileChangeFile (TFile *file)
 Called by TTree::Fill() when file has reached its maximum fgMaxTreeSize.
ULong_t CheckedHash ()
 Check and record whether this class has a consistent Hash/RecursiveRemove setup (*) and then return the regular Hash value for this object.
virtual const char * ClassName () const
 Returns name of class to which the object belongs.
void Clear (Option_t *option="") override
 Set name and title to empty strings ("").
TObjectClone (const char *newname="") const override
 Make a clone of an object using the Streamer facility.
virtual TTreeCloneTree (Long64_t nentries=-1, Option_t *option="")
 Create a clone of this tree and copy nentries.
Int_t Compare (const TObject *obj) const override
 Compare two TNamed objects.
void Copy (TAttFill &attfill) const
void Copy (TAttLine &attline) const
void Copy (TAttMarker &attmarker) const
void Copy (TObject &named) const override
 Copy this to obj.
virtual void CopyAddresses (TTree *, bool undo=false)
 Set branch addresses of passed tree equal to ours.
virtual Long64_t CopyEntries (TTree *tree, Long64_t nentries=-1, Option_t *option="", bool needCopyAddresses=false)
 Copy nentries from given tree to this tree.
virtual TTreeCopyTree (const char *selection, Option_t *option="", Long64_t nentries=kMaxEntries, Long64_t firstentry=0) override
 Copy a tree with selection.
virtual TBasketCreateBasket (TBranch *)
 Create a basket for this tree and given branch.
virtual void CreatePackets ()
 Initialize the packet descriptor string.
Int_t Debug () const
void Delete (Option_t *option="") override
 Delete this tree from memory or/and disk.
void DirectoryAutoAdd (TDirectory *) override
 Override the TTree::DirectoryAutoAdd behavior: we never auto add.
Int_t DistancetoLine (Int_t px, Int_t py, Double_t xp1, Double_t yp1, Double_t xp2, Double_t yp2)
virtual Int_t DistancetoPrimitive (Int_t px, Int_t py)
 Computes distance from point (px,py) to the object.
Long64_t Draw (const char *varexp, const char *selection, Option_t *option="", Long64_t nentries=kMaxEntries, Long64_t firstentry=0) override
 Process all entries in this chain and draw histogram corresponding to expression varexp.
Long64_t Draw (const char *varexp, const TCut &selection, Option_t *option="", Long64_t nentries=kMaxEntries, Long64_t firstentry=0) override
 Draw expression varexp for selected entries.
void Draw (Option_t *opt) override
 Default Draw method for all objects.
virtual void DrawClass () const
 Draw class inheritance tree of the class to which this object belongs.
virtual TObjectDrawClone (Option_t *option="") const
 Draw a clone of this object in the current selected pad with: gROOT->SetSelectedPad(c1).
virtual void DropBaskets ()
 Remove some baskets from memory.
virtual Int_t DropBranchFromCache (const char *bname, bool subbranches=false)
 Remove the branch with name 'bname' from the Tree cache.
virtual Int_t DropBranchFromCache (TBranch *branch, bool subbranches=false)
 Remove the branch b from the Tree cache.
virtual void DropBuffers (Int_t nbytes)
 Drop branch buffers to accommodate nbytes below MaxVirtualsize.
virtual void Dump () const
 Dump contents of object on stdout.
bool EnableCache ()
 Enable the TTreeCache unless explicitly disabled for this TTree by a prior call to SetCacheSize(0).
virtual void Error (const char *method, const char *msgfmt,...) const
 Issue error message.
virtual void Execute (const char *method, const char *params, Int_t *error=nullptr)
 Execute method on this object with the given parameter string, e.g.
virtual void Execute (TMethod *method, TObjArray *params, Int_t *error=nullptr)
 Execute method on this object with parameters stored in the TObjArray.
virtual void ExecuteEvent (Int_t event, Int_t px, Int_t py)
 Execute action corresponding to an event at (px,py).
virtual void Fatal (const char *method, const char *msgfmt,...) const
 Issue fatal error message.
Int_t Fill () override
 Fill all branches.
virtual void FillBuffer (char *&buffer)
 Encode TNamed into output buffer.
TBranchFindBranch (const char *name) override
 See TTree::GetReadEntry().
TLeafFindLeaf (const char *name) override
 See TTree::GetReadEntry().
virtual TObjectFindObject (const char *name) const
 Must be redefined in derived classes.
virtual TObjectFindObject (const TObject *obj) const
 Must be redefined in derived classes.
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.
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 boundary (by default).
const char * GetAlias (const char *aliasName) const override
 Returns the expanded value of the alias. Search in the friends if any.
UInt_t GetAllocationCount () const
virtual Long64_t GetAutoFlush () const
virtual Long64_t GetAutoSave () const
TBranchGetBranch (const char *name) override
 Return pointer to the branch name in the current tree.
virtual TBranchRefGetBranchRef () const
bool GetBranchStatus (const char *branchname) const override
 See TTree::GetReadEntry().
Long64_t GetCacheSize () const override
Long64_t GetChainEntryNumber (Long64_t entry) const override
 Return absolute entry number in the chain.
virtual Long64_t GetChainOffset () const
TClusterIterator GetClusterIterator (Long64_t firstentry) override
 Return an iterator over the cluster of baskets starting at firstentry.
virtual bool GetClusterPrefetch () const
TFileGetCurrentFile () const
 Return pointer to the current file.
Long64_t GetDebugMax () const
Long64_t GetDebugMin () const
Int_t GetDefaultEntryOffsetLen () const
TDirectoryGetDirectory () const
virtual Option_tGetDrawOption () const
 Get option used by the graphics system to draw this object.
Long64_t GetEntries () const override
 Return the total number of entries in the chain.
Long64_t GetEntries (const char *sel) override
 Return the number of entries matching the selection.
virtual Long64_t GetEntriesFast () const
 Return a number greater or equal to the total number of entries in the dataset.
virtual Long64_t GetEntriesFriend () const
 Returns a number corresponding to:
Int_t GetEntry (Long64_t entry=0, Int_t getall=0) override
 Get entry from the file to memory.
virtual TEntryListGetEntryList ()
 Returns the entry list assigned to this tree.
Long64_t GetEntryNumber (Long64_t entry) const override
 Return entry number corresponding to entry.
virtual Long64_t GetEntryNumberWithBestIndex (Long64_t major, Long64_t minor=0) const
 Return entry number corresponding to major and minor number.
virtual Long64_t GetEntryNumberWithIndex (Long64_t major, Long64_t minor=0) const
 Return entry number corresponding to major and minor number.
Int_t GetEntryWithIndex (Long64_t major, Long64_t minor=0) override
 Return entry corresponding to major and minor number.
virtual Long64_t GetEstimate () const
Int_t GetEvent (Long64_t entry, Int_t getall=0)
TEventListGetEventList () const
TFileGetFile () const
 Return a pointer to the current file.
virtual Int_t GetFileNumber () const
virtual Color_t GetFillColor () const
 Return the fill area color.
virtual Style_t GetFillStyle () const
 Return the fill area style.
virtual TTreeGetFriend (const char *) const
 Return a pointer to the TTree friend whose name or alias is friendname.
virtual const char * GetFriendAlias (TTree *) const
 If the 'tree' is a friend, this method returns its alias name.
TH1GetHistogram ()
virtual const char * GetIconName () const
 Returns mime type name of object.
virtual bool GetImplicitMT ()
virtual Int_tGetIndex ()
virtual Double_tGetIndexValues ()
ROOT::TIOFeatures GetIOFeatures () const
 Returns the current set of IO settings.
virtual TIteratorGetIteratorOnAllLeaves (bool dir=kIterForward)
 Creates a new iterator that will go through all the leaves on the tree itself and its friend.
TLeafGetLeaf (const char *branchname, const char *leafname) override
 Return a pointer to the leaf name in the current tree.
TLeafGetLeaf (const char *name) override
 Return a pointer to the leaf name in the current tree.
virtual Color_t GetLineColor () const
 Return the line color.
virtual Style_t GetLineStyle () const
 Return the line style.
virtual Width_t GetLineWidth () const
 Return the line width.
virtual TListGetListOfAliases () const
TObjArrayGetListOfBranches () override
 Return a pointer to the list of branches of the current tree.
virtual TListGetListOfClones ()
TObjArrayGetListOfFiles () const
virtual TListGetListOfFriends () const
TObjArrayGetListOfLeaves () override
 Return a pointer to the list of leaves of the current tree.
Int_t GetMakeClass () const
virtual Color_t GetMarkerColor () const
 Return the marker color.
virtual Size_t GetMarkerSize () const
 Return the marker size.
virtual Style_t GetMarkerStyle () const
 Return the marker style.
virtual Long64_t GetMaxEntryLoop () const
Double_t GetMaximum (const char *columname) override
 Return maximum of column with name columname.
virtual Long64_t GetMaxVirtualSize () const
Double_t GetMinimum (const char *columname) override
 Return minimum of column with name columname.
const char * GetName () const override
 Returns name of object.
Int_t GetNbranches () override
 Return the number of branches of the current tree.
TObjectGetNotify () const
Int_t GetNtrees () const
virtual char * GetObjectInfo (Int_t px, Int_t py) const
 Returns string containing info about the object at position (px,py).
virtual Option_tGetOption () const
virtual Int_t GetPacketSize () const
virtual TVirtualPerfStatsGetPerfStats () const
TVirtualTreePlayerGetPlayer ()
 Load the TTreePlayer (if not already done).
TTreeCacheGetReadCache (TFile *file) const
 Find and return the TTreeCache registered with the file and which may contain branches for us.
TTreeCacheGetReadCache (TFile *file, bool create)
 Find and return the TTreeCache registered with the file and which may contain branches for us.
Long64_t GetReadEntry () const override
 See TTree::GetReadEntry().
virtual Long64_t GetReadEvent () const
virtual Int_t GetScanField () const
TTreeFormulaGetSelect ()
virtual Long64_t GetSelectedRows ()
TListGetStatus () const
Float_t GetTargetMemoryRatio () const
virtual Int_t GetTimerInterval () const
const char * GetTitle () const override
 Returns title of object.
virtual Long64_t GetTotBytes () const
TBufferGetTransientBuffer (Int_t size)
 Returns the transient buffer currently used by this TTree for reading/writing baskets.
TTreeGetTree () const override
virtual TVirtualIndexGetTreeIndex () const
Int_t GetTreeNumber () const override
Long64_tGetTreeOffset () const
Int_t GetTreeOffsetLen () const
virtual UInt_t GetUniqueID () const
 Return the unique object id.
virtual Int_t GetUpdate () const
virtual TListGetUserInfo ()
 Return a pointer to the list containing user objects associated to this tree.
virtual Double_tGetV1 ()
virtual Double_tGetV2 ()
virtual Double_tGetV3 ()
virtual Double_tGetV4 ()
virtual Double_tGetVal (Int_t i)
TTreeFormulaGetVar (Int_t i)
TTreeFormulaGetVar1 ()
TTreeFormulaGetVar2 ()
TTreeFormulaGetVar3 ()
TTreeFormulaGetVar4 ()
virtual Double_tGetW ()
Double_t GetWeight () const override
 Return the chain weight.
virtual Long64_t GetZipBytes () const
virtual Bool_t HandleTimer (TTimer *timer)
 Execute action in response of a timer timing out.
ULong_t Hash () const override
 Return hash value for this object.
Bool_t HasInconsistentHash () const
 Return true is the type of this object is known to have an inconsistent setup for Hash and RecursiveRemove (i.e.
virtual void IncrementTotalBuffers (Int_t nbytes)
virtual void Info (const char *method, const char *msgfmt,...) const
 Issue info message.
virtual Bool_t InheritsFrom (const char *classname) const
 Returns kTRUE if object inherits from class "classname".
virtual Bool_t InheritsFrom (const TClass *cl) const
 Returns kTRUE if object inherits from TClass cl.
bool InPlaceClone (TDirectory *newdirectory, const char *options="") override
 Move content to a new file. (NOT IMPLEMENTED for TChain).
virtual void Inspect () const
 Dump contents of this object in a graphics canvas.
void InvertBit (UInt_t f)
TClassIsA () const override
Bool_t IsDestructed () const
 IsDestructed.
virtual Bool_t IsEqual (const TObject *obj) const
 Default equal comparison (objects are equal if they have the same address in memory).
bool IsFolder () const override
 Returns kTRUE in case object contains browsable objects (like containers or lists of other objects).
Bool_t IsOnHeap () const
Bool_t IsSortable () const override
virtual Bool_t IsTransparent () const
Bool_t IsZombie () const
Int_t LoadBaskets (Long64_t maxmemory) override
 Dummy function.
Long64_t LoadTree (Long64_t entry) override
 Find the tree which contains entry, and set it as the current tree.
virtual Long64_t LoadTreeFriend (Long64_t entry, TTree *T)
 Load entry on behalf of our master tree, we may use an index.
void Lookup (bool force=false)
 Check / locate the files in the chain.
void ls (Option_t *option="") const override
 List the chain.
virtual Int_t MakeClass (const char *classname=nullptr, Option_t *option="")
 Generate a skeleton analysis class for this tree.
virtual Int_t MakeCode (const char *filename=nullptr)
 Generate a skeleton function for this tree.
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.
virtual Int_t MakeSelector (const char *selector=nullptr, Option_t *option="")
 Generate skeleton selector class for this tree.
void MayNotUse (const char *method) const
 Use this method to signal that a method (defined in a base class) may not be called in a derived class (in principle against good design since a child class should not provide less functionality than its parent, however, sometimes it is necessary).
bool MemoryFull (Int_t nbytes)
 Check if adding nbytes to memory we are still below MaxVirtualsize.
virtual Long64_t Merge (const char *name, Option_t *option="")
 Merge all the entries in the chain into a new tree in a new file.
Long64_t Merge (TCollection *list, Option_t *option="") override
 Merge all chains in the collection. (NOT IMPLEMENTED).
Long64_t Merge (TCollection *list, TFileMergeInfo *info) override
 Merge all chains in the collection. (NOT IMPLEMENTED).
virtual Long64_t Merge (TFile *file, Int_t basketsize, Option_t *option="")
 Merge all the entries in the chain into a new tree in the current file.
virtual void Modify ()
virtual void Modify ()
virtual void Modify ()
virtual void ModifyOn (TVirtualPad &pad)
virtual void ModifyOn (TVirtualPad &pad)
virtual void ModifyOn (TVirtualPad &pad)
bool Notify () override
 Function called when loading a new class library.
void Obsolete (const char *method, const char *asOfVers, const char *removedFromVers) const
 Use this method to declare a method obsolete.
void operator delete (void *, size_t)
 Operator delete for sized deallocation.
void operator delete (void *ptr)
 Operator delete.
void operator delete (void *ptr, void *vp)
 Only called by placement new when throwing an exception.
void operator delete[] (void *, size_t)
 Operator delete [] for sized deallocation.
void operator delete[] (void *ptr)
 Operator delete [].
void operator delete[] (void *ptr, void *vp)
 Only called by placement new[] when throwing an exception.
void * operator new (size_t sz)
void * operator new (size_t sz, void *vp)
void * operator new[] (size_t sz)
void * operator new[] (size_t sz, void *vp)
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.
virtual void Paint (Option_t *option="")
 This method must be overridden if a class wants to paint itself.
virtual void Pop ()
 Pop on object drawn in a pad to the top of the display list.
TPrincipalPrincipal (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.
void Print (Option_t *option="") const override
 Print the header information of each tree in the chain.
virtual void PrintCacheStats (Option_t *option="") const
 Print statistics about the TreeCache for this tree.
Long64_t Process (const char *filename, Option_t *option="", Long64_t nentries=kMaxEntries, Long64_t firstentry=0) override
 Process all entries in this chain, calling functions in filename.
Long64_t Process (TSelector *selector, Option_t *option="", Long64_t nentries=kMaxEntries, Long64_t firstentry=0) override
 Process this chain executing the code in selector.
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.
virtual TSQLResultQuery (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.
virtual Int_t Read (const char *name)
 Read contents of object with specified name from the current directory.
virtual Long64_t ReadFile (const char *filename, const char *branchDescriptor="", char delimiter=' ')
 Create or simply read branches from filename.
virtual Long64_t ReadStream (std::istream &inputStream, const char *branchDescriptor="", char delimiter=' ')
 Create or simply read branches from an input stream.
void RecursiveRemove (TObject *obj) override
 Make sure that obj (which is being deleted or will soon be) is no longer referenced by this TTree.
virtual void Refresh ()
 Refresh contents of this tree and its branches from the current status on disk.
virtual void RegisterExternalFriend (TFriendElement *)
 Record a TFriendElement that we need to warn when the chain switches to a new file (typically this is because this chain is a friend of another TChain).
virtual void RemoveExternalFriend (TFriendElement *)
 Removes external friend.
void RemoveFriend (TTree *) override
 Remove a friend from the list of friends.
void Reset (Option_t *option="") override
 Resets the state of this chain.
void ResetAfterMerge (TFileMergeInfo *) override
 Resets the state of this chain after a merge (keep the customization but forget the data).
virtual void ResetAttFill (Option_t *option="")
virtual void ResetAttLine (Option_t *option="")
virtual void ResetAttMarker (Option_t *toption="")
void ResetBit (UInt_t f)
void ResetBranchAddress (TBranch *) override
 Reset the addresses of the branch.
void ResetBranchAddresses () override
 Reset the addresses of the branches.
virtual void SaveAs (const char *filename="", Option_t *option="") const
 Save this object in the file specified by filename.
virtual void SaveFillAttributes (std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1001)
virtual void SaveLineAttributes (std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t widdef=1)
virtual void SaveMarkerAttributes (std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t sizdef=1)
void SavePrimitive (std::ostream &out, Option_t *option="") override
 Save TChain as a C++ statements on output stream out.
Long64_t Scan (const char *varexp="", const char *selection="", Option_t *option="", Long64_t nentries=kMaxEntries, Long64_t firstentry=0) override
 Loop on tree and print entries passing selection.
virtual bool SetAlias (const char *aliasName, const char *aliasFormula)
 Set a tree variable alias.
virtual void SetAutoDelete (bool autodel=true)
 Set the global branch kAutoDelete bit.
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.
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 AutoSave point.
virtual void SetBasketSize (const char *bname, Int_t buffsize=16000)
 Set a branch's basket size.
void SetBit (UInt_t f)
void SetBit (UInt_t f, Bool_t set)
 Set or unset the user status bits as specified in f.
template<class T>
Int_t SetBranchAddress (const char *bname, T **add, TBranch **ptr=nullptr)
template<class T>
Int_t SetBranchAddress (const char *bname, T *add, TBranch **ptr=nullptr)
Int_t SetBranchAddress (const char *bname, void *add, TBranch **ptr, TClass *realClass, EDataType datatype, bool isptr) override
 Check if bname is already in the status list, and if not, create a TChainElement object and set its address.
Int_t SetBranchAddress (const char *bname, void *add, TBranch **ptr=nullptr) override
 Set branch address.
Int_t SetBranchAddress (const char *bname, void *add, TClass *realClass, EDataType datatype, bool isptr) override
 Check if bname is already in the status list, and if not, create a TChainElement object and set its address.
void SetBranchStatus (const char *bname, bool status=true, UInt_t *found=nullptr) override
 Set branch status to Process or DoNotProcess.
virtual Int_t SetCacheEntryRange (Long64_t first, Long64_t last)
 interface to TTreeCache to set the cache entry range
virtual void SetCacheLearnEntries (Int_t n=10)
 Interface to TTreeCache to set the number of entries for the learning phase.
Int_t SetCacheSize (Long64_t cacheSize=-1) override
 Set maximum size of the file cache (TTreeCache) in bytes.
virtual void SetChainOffset (Long64_t offset=0)
virtual void SetCircular (Long64_t maxEntries)
 Enable/Disable circularity for this tree.
virtual void SetClusterPrefetch (bool enabled)
 Enables (or disables) the early decompression of the baskets of the current cluster (whose compressed data is already in memory if used in conjunction with the TTreeCache).
virtual void SetDebug (Int_t level=1, Long64_t min=0, Long64_t max=9999999)
 Set the debug level and the debug range.
virtual void SetDefaultEntryOffsetLen (Int_t newdefault, bool updateExisting=false)
 Update the default value for the branch's fEntryOffsetLen.
void SetDirectory (TDirectory *dir) override
 Remove reference to this chain from current directory and add reference to new directory dir.
virtual void SetDrawOption (Option_t *option="")
 Set drawing option for object.
virtual Long64_t SetEntries (Long64_t n=-1)
 Change number of entries in the tree.
void SetEntryList (TEntryList *elist, Option_t *opt="") override
 Set the input entry list (processing the entries of the chain will then be limited to the entries in the list).
virtual void SetEntryListFile (const char *filename="", Option_t *opt="")
 Set the input entry list (processing the entries of the chain will then be limited to the entries in the list).
virtual void SetEstimate (Long64_t nentries=1000000)
 Set number of entries to estimate variable limits.
void SetEventList (TEventList *evlist) override
 This function transfroms the given TEventList into a TEntryList.
virtual void SetFileNumber (Int_t number=0)
 Set fFileNumber to number.
virtual void SetFillAttributes ()
virtual void SetFillColor (Color_t fcolor)
 Set the fill area color.
void SetFillColor (TColorNumber)
virtual void SetFillColorAlpha (Color_t fcolor, Float_t falpha)
virtual void SetFillStyle (Style_t fstyle)
 Set the fill area style.
virtual void SetImplicitMT (bool enabled)
ROOT::TIOFeatures SetIOFeatures (const ROOT::TIOFeatures &)
 Provide the end-user with the ability to enable/disable various experimental IO features for this TTree.
virtual void SetLineAttributes ()
virtual void SetLineColor (Color_t lcolor)
 Set the line color.
void SetLineColor (TColorNumber lcolor)
virtual void SetLineColorAlpha (Color_t lcolor, Float_t lalpha)
virtual void SetLineStyle (Style_t lstyle)
 Set the line style.
virtual void SetLineWidth (Width_t lwidth)
 Set the line width.
void SetMakeClass (Int_t make) override
 Set all the branches in this TTree to be in decomposed object mode (also known as MakeClass mode).
virtual void SetMarkerAttributes ()
virtual void SetMarkerColor (Color_t mcolor=1)
 Set the marker color.
void SetMarkerColor (TColorNumber lcolor)
virtual void SetMarkerColorAlpha (Color_t mcolor, Float_t malpha)
virtual void SetMarkerSize (Size_t msize=1)
 Set the marker size.
virtual void SetMarkerStyle (Style_t mstyle=1)
 Set the marker style.
virtual void SetMaxEntryLoop (Long64_t maxev=kMaxEntries)
virtual void SetMaxVirtualSize (Long64_t size=0)
void SetName (const char *name) override
 Change the name of this TChain.
virtual void SetNameTitle (const char *name, const char *title)
 Set all the TNamed parameters (name and title).
virtual void SetNotify (TObject *obj)
 Sets the address of the object to be notified when the tree is loaded.
virtual void SetObject (const char *name, const char *title)
 Change the name and title of this tree.
virtual void SetPacketSize (Int_t size=100)
 Set number of entries per packet for parallel root.
virtual void SetParallelUnzip (bool opt=true, Float_t RelSize=-1)
 Enable or disable parallel unzipping of Tree buffers.
virtual void SetPerfStats (TVirtualPerfStats *perf)
 Set perf stats.
virtual void SetScanField (Int_t n=50)
 Sets the default maximum number of lines to be shown before <CR> when calling Scan().
void SetTargetMemoryRatio (Float_t ratio)
virtual void SetTimerInterval (Int_t msec=333)
virtual void SetTitle (const char *title="")
 Set the title of the TNamed.
virtual void SetTreeIndex (TVirtualIndex *index)
 The current TreeIndex is replaced by the new index.
virtual void SetUniqueID (UInt_t uid)
 Set the unique object id.
virtual void SetUpdate (Int_t freq=0)
void SetWeight (Double_t w=1, Option_t *option="") override
 Set chain weight.
virtual void Show (Long64_t entry=-1, Int_t lenmax=20)
 Print values of all active leaves for entry.
virtual Int_t Sizeof () const
 Return size of the TNamed part of the TObject.
virtual void StartViewer ()
 Start the TTreeViewer on this tree.
virtual Int_t StopCacheLearningPhase ()
 Stop the cache learning phase.
void Streamer (TBuffer &) override
 Stream a class object.
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
virtual void SysError (const char *method, const char *msgfmt,...) const
 Issue system error message.
Bool_t TestBit (UInt_t f) const
Int_t TestBits (UInt_t f) const
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.
virtual void UseCache (Int_t maxCacheSize=10, Int_t pageSize=0)
 Dummy function kept for back compatibility.
void UseCurrentStyle () override
 Replace current attributes by current style.
virtual void Warning (const char *method, const char *msgfmt,...) const
 Issue warning message.
Int_t Write (const char *name=nullptr, Int_t option=0, Int_t bufsize=0) const override
 Write this object to the current directory.
Int_t Write (const char *name=nullptr, Int_t option=0, Int_t bufsize=0) override
 Write this object to the current directory.

Static Public Member Functions

static TClassClass ()
static const char * Class_Name ()
static constexpr Version_t Class_Version ()
static const char * DeclFileName ()
static Int_t GetBranchStyle ()
 Static function returning the current branch style.
static Longptr_t GetDtorOnly ()
 Return destructor only flag.
static Width_t GetMarkerLineWidth (Style_t style)
static Style_t GetMarkerStyleBase (Style_t style)
static Long64_t GetMaxTreeSize ()
 Static function which returns the tree file size limit in bytes.
static Bool_t GetObjectStat ()
 Get status of object stat flag.
static TTreeMergeTrees (TList *list, Option_t *option="")
 Static function merging the trees in the TList into a new tree.
static void SetBranchStyle (Int_t style=1)
 Set the current branch style.
static void SetDtorOnly (void *obj)
 Set destructor only flag.
static void SetMaxTreeSize (Long64_t maxsize=100000000000LL)
 Set the maximum size in bytes of a Tree file (static function).
static void SetObjectStat (Bool_t stat)
 Turn on/off tracking of objects in the TObjectTable.

Static Public Attributes

static constexpr auto kBigNumber = TTree::kMaxEntries
static constexpr Long64_t kMaxEntries = TVirtualTreePlayer::kMaxEntries
 Used as the max value for any TTree range operation.

Protected Types

enum  { kOnlyPrepStep = (1ULL << (3)) }
enum  ELockStatusBits {
  kFindBranch = (1ULL << (0)) , kFindLeaf = (1ULL << (1)) , kGetAlias = (1ULL << (2)) , kGetBranch = (1ULL << (3)) ,
  kGetEntry = (1ULL << (4)) , kGetEntryWithIndex = (1ULL << (5)) , kGetFriend = (1ULL << (6)) , kGetFriendAlias = (1ULL << (7)) ,
  kGetLeaf = (1ULL << (8)) , kLoadTree = (1ULL << (9)) , kPrint = (1ULL << (10)) , kRemoveFriend = (1ULL << (11)) ,
  kSetBranchStatus = (1ULL << (12)) , kResetBranchAddresses = (1ULL << (13))
}

Protected Member Functions

virtual TBranchBranchImp (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.
virtual TBranchBranchImp (const char *branchname, TClass *ptrClass, void *addobj, Int_t bufsize, Int_t splitlevel)
 Same as TTree::Branch but automatic detection of the class name.
virtual TBranchBranchImpArr (const char *branchname, EDataType datatype, std::size_t N, void *addobj, Int_t bufsize, Int_t splitlevel)
virtual TBranchBranchImpRef (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.
virtual TBranchBranchImpRef (const char *branchname, TClass *ptrClass, EDataType datatype, void *addobj, Int_t bufsize, Int_t splitlevel)
 Same as TTree::Branch but automatic detection of the class name.
virtual TBranchBronchExec (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);.
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.
virtual void DoError (int level, const char *location, const char *fmt, va_list va) const
 Interface to ErrorHandler (protected).
TBranchGetBranchFromFriends (const char *branchName)
 Returns a pointer to the branch with the given name, if it can be found in the list of friends of this tree.
TBranchGetBranchFromSelf (const char *branchName)
 Returns a pointer to the branch with the given name, if it can be found in this tree.
Long64_t GetCacheAutoSize (bool withDefault=false)
 Used for automatic sizing of the cache.
virtual TLeafGetLeafImpl (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 friend trees.
char GetNewlineValue (std::istream &inputStream)
 Determine which newline this file is using.
void ImportClusterRanges (TTree *fromtree)
 Appends the cluster range information stored in 'fromtree' to this tree, including the value of fAutoFlush.
void InvalidateCurrentTree ()
 Set the TTree to be reloaded as soon as possible.
virtual void KeepCircular ()
 Keep a maximum of fMaxEntries in memory.
void MakeZombie ()
void MoveReadCache (TFile *src, TDirectory *dir)
 Move a cache from a file to the current file in dir.
void SavePrimitiveNameTitle (std::ostream &out, const char *variable_name)
 Save object name and title into the output stream "out".
Int_t SetBranchAddress (const char *bname, void *add, TBranch **ptr, TClass *realClass, EDataType datatype, bool isptr, bool suppressMissingBranchError) override
Int_t SetBranchAddressImp (TBranch *branch, void *addr, TBranch **ptr)
 Change branch address, dealing with clone trees properly.
Int_t SetCacheSizeAux (bool autocache=true, Long64_t cacheSize=0)
 Set the maximum size of the file cache (TTreeCache) in bytes and create it if possible.

Static Protected Member Functions

static void SavePrimitiveConstructor (std::ostream &out, TClass *cl, const char *variable_name, const char *constructor_agrs="", Bool_t empty_line=kTRUE)
 Save object constructor in the output stream "out".
static void SavePrimitiveDraw (std::ostream &out, const char *variable_name, Option_t *option=nullptr)
 Save invocation of primitive Draw() method Skipped if option contains "nodraw" string.
static TString SavePrimitiveVector (std::ostream &out, const char *prefix, Int_t len, Double_t *arr, Int_t flag=0)
 Save array in the output stream "out" as vector.

Protected Attributes

TListfAliases
 List of aliases for expressions based on the tree branches.
std::atomic< UInt_tfAllocationCount {0}
 memory churn.
Long64_t fAutoFlush
 Auto-flush tree when fAutoFlush entries written or -fAutoFlush (compressed) bytes produced.
Long64_t fAutoSave
 Autosave tree when fAutoSave entries written or -fAutoSave (compressed) bytes produced.
TObjArray fBranches
 List of Branches.
TBranchReffBranchRef
 Branch supporting the TRefTable (if any).
bool fCacheDoAutoInit
 ! true if cache auto creation or resize check is needed
bool fCacheDoClusterPrefetch
 ! true if cache is prefetching whole clusters
Long64_t fCacheSize
 ! Maximum size of file buffers
bool fCacheUserSet
 ! true if the cache setting was explicitly given by user
bool fCanDeleteRefs
 ! If true, TProcessIDs are deleted when closing a file
Long64_t fChainOffset
 ! Offset of 1st entry of this Tree in a TChain
TListfClones
 ! List of cloned trees which share our addresses
Long64_tfClusterRangeEnd
 [fNClusterRange] Last entry of a cluster range.
Long64_tfClusterSize
 [fNClusterRange] Number of entries in each cluster for a given range.
Int_t fDebug
 ! Debug level
Long64_t fDebugMax
 ! Last entry number to debug
Long64_t fDebugMin
 ! First entry number to debug
Int_t fDefaultEntryOffsetLen
 Initial Length of fEntryOffset table in the basket buffers.
TDirectoryfDirectory
 ! Pointer to directory holding this tree
Long64_t fEntries
 Number of entries.
TEntryListfEntryList
 ! Pointer to event selection list (if one)
Long64_t fEstimate
 Number of entries to estimate histogram limits.
TEventListfEventList
 ! Pointer to event selection list (if one)
TListfExternalFriends
 ! List of TFriendsElement pointing to us and need to be notified of LoadTree. Content not owned.
TFilefFile
 ! Pointer to current file (We own the file).
Int_t fFileNumber
 !
TObjArrayfFiles
 -> List of file names containing the trees (TChainElement, owned)
Color_t fFillColor
 Fill area color.
Style_t fFillStyle
 Fill area style.
Long64_t fFlushedBytes
 Number of auto-flushed bytes.
UInt_t fFriendLockStatus
 ! Record which method is locking the friend recursion
TListfFriends
 pointer to list of friend elements
bool fGlobalRegistration
 ! if true, bypass use of global lists
bool fIMTEnabled
 ! true if implicit multi-threading is enabled for this tree
TArrayI fIndex
 Index of sorted values.
TArrayD fIndexValues
 Sorted index values.
TIOFeatures fIOFeatures {0}
 IO features to define for newly-written baskets and branches.
TObjArray fLeaves
 Direct pointers to individual branch leaves.
Color_t fLineColor
 Line color.
Style_t fLineStyle
 Line style.
Width_t fLineWidth
 Line width.
Int_t fMakeClass
 ! not zero when processing code generated by MakeClass
Color_t fMarkerColor
 Marker color.
Size_t fMarkerSize
 Marker size.
Style_t fMarkerStyle
 Marker style.
Int_t fMaxClusterRange
 ! Memory allocated for the cluster range.
Long64_t fMaxEntries
 Maximum number of entries in case of circular buffers.
Long64_t fMaxEntryLoop
 Maximum number of entries to process.
Long64_t fMaxVirtualSize
 Maximum total size of buffers kept in memory.
TString fName
Int_t fNClusterRange
 Number of Cluster range in addition to the one defined by 'AutoFlush'.
UInt_t fNEntriesSinceSorting
 ! Number of entries processed since the last re-sorting of branches
Int_t fNfill
 ! Local for EntryLoop
TObjectfNotify
 Object to be notified when loading a Tree.
Int_t fNtrees
 Number of trees.
Int_t fPacketSize
 ! Number of entries in one packet for parallel root
TVirtualPerfStatsfPerfStats
 ! pointer to the current perf stats object
TVirtualTreePlayerfPlayer
 ! Pointer to current Tree player
Long64_t fReadEntry
 ! Number of the entry being processed
Long64_t fSavedBytes
 Number of autosaved bytes.
Int_t fScanField
 Number of runs before prompting in Scan.
std::vector< TBranch * > fSeqBranches
 ! Branches to be processed sequentially when IMT is on
std::vector< std::pair< Long64_t, TBranch * > > fSortedBranches
 ! Branches to be processed in parallel when IMT is on, sorted by average task time
TListfStatus
 -> List of active/inactive branches (TChainElement, owned)
Float_t fTargetMemoryRatio {1.1f}
 !
Int_t fTimerInterval
 Timer interval in milliseconds.
TString fTitle
std::atomic< Long64_tfTotalBuffers
 ! Total number of bytes in branch buffers
Long64_t fTotBytes
 Total number of bytes in all branches before compression.
TBufferfTransientBuffer
 ! Pointer to the current transient buffer.
TTreefTree
 ! Pointer to current tree (Note: We do not own this tree.)
TVirtualIndexfTreeIndex
 Pointer to the tree Index (if any).
Int_t fTreeNumber
 ! Current Tree number in fTreeOffset table
Long64_tfTreeOffset
 [fTreeOffsetLen] Array of variables
Int_t fTreeOffsetLen
 Current size of fTreeOffset array.
Int_t fUpdate
 Update frequency for EntryLoop.
TListfUserInfo
 pointer to a list of user objects associated to this Tree
Double_t fWeight
 Tree weight (see TTree::SetWeight).
Long64_t fZipBytes
 Total number of bytes in all branches after compression.

Static Protected Attributes

static Int_t fgBranchStyle = 1
 Old/New branch style.
static Long64_t fgMaxTreeSize = 100000000000LL
 Maximum size of a file containing a Tree.

Private Types

using TIOFeatures = ROOT::TIOFeatures

Private Member Functions

 TChain (const TChain &)
Int_t FlushBasketsImpl () const
 Internal implementation of the FlushBaskets algorithm.
Long64_t GetMedianClusterSize ()
 Estimate the median cluster size for the TTree.
void InitializeBranchLists (bool checkLeafCount)
 Divides the top-level branches into two vectors: (i) branches to be processed sequentially and (ii) branches to be processed in parallel.
void MarkEventCluster ()
 Mark the previous event as being at the end of the event cluster.
TChainoperator= (const TChain &)
void ParseTreeFilename (const char *name, TString &filename, TString &treename, TString &query, TString &suffix) const
 Get the tree url or filename and other information from the name.
Long64_t RefreshFriendAddresses ()
 Refresh branch/leaf addresses of friend trees.
void RegisterBranchFullName (std::pair< std::string, TBranch * > &&kv)
Int_t SetBranchAddressImp (const char *bname, void *add, TBranch **ptr, TClass *realClass, EDataType datatype, bool isptr)
void SortBranchesByTime ()
 Sorts top-level branches by the last average task time recorded per branch.

Static Private Member Functions

static void AddToTObjectTable (TObject *)
 Private helper function which will dispatch to TObjectTable::AddObj.

Private Attributes

UInt_t fBits
 bit field status word
bool fIMTFlush {false}
 ! True if we are doing a multithreaded flush.
std::atomic< Long64_tfIMTTotBytes
 ! Total bytes for the IMT flush baskets
std::atomic< Long64_tfIMTZipBytes
 ! Zip bytes for the IMT flush baskets.
std::unordered_map< std::string, TBranch * > fNamesToBranches
 ! maps names to their branches, useful when retrieving branches by name
UInt_t fUniqueID
 object unique identifier

Static Private Attributes

static Longptr_t fgDtorOnly = 0
 object for which to call dtor only (i.e. no delete)
static Bool_t fgObjectStat = kTRUE
 if true keep track of objects in TObjectTable

#include <TChain.h>

Inheritance diagram for TChain:
TTree TNamed TAttLine TAttFill TAttMarker TObject

Member Typedef Documentation

◆ TIOFeatures

using TTree::TIOFeatures = ROOT::TIOFeatures
privateinherited

Definition at line 91 of file TTree.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protectedinherited
Enumerator
kOnlyPrepStep 

Used to request that the class specific implementation of TObject::Write just prepare the objects to be ready to be written but do not actually write them into the TBuffer.

This is just for example by TBufferMerger to request that the TTree inside the file calls TTree::FlushBaskets (outside of the merging lock) and TBufferMerger will later ask for the write (inside the merging lock). To take advantage of this feature the class needs to overload TObject::Write and use this enum value accordingly. (See TTree::Write and TObject::Write) Do not use, this feature will be migrate to the Merge function (See TClass and TTree::Merge)

Definition at line 106 of file TObject.h.

◆ anonymous enum

anonymous enum
inherited
Enumerator
kSingleKey 

write collection with single key

kOverwrite 

overwrite existing object with same name

kWriteDelete 

write object, then delete previous key with same name

Definition at line 99 of file TObject.h.

◆ anonymous enum

anonymous enum
inherited
Enumerator
kSplitCollectionOfPointers 

Definition at line 309 of file TTree.h.

◆ anonymous enum

anonymous enum
inherited
Enumerator
kIsOnHeap 

object is on heap

kNotDeleted 

object has not been deleted

kZombie 

object ctor failed

kInconsistent 

class overload Hash but does call RecursiveRemove in destructor

kBitMask 

Definition at line 89 of file TObject.h.

◆ EDeprecatedStatusBits

Enumerator
kObjInCanvas 

for backward compatibility only, use kMustCleanup

Definition at line 84 of file TObject.h.

◆ ELockStatusBits

enum TTree::ELockStatusBits
protectedinherited
Enumerator
kFindBranch 
kFindLeaf 
kGetAlias 
kGetBranch 
kGetEntry 
kGetEntryWithIndex 
kGetFriend 
kGetFriendAlias 
kGetLeaf 
kLoadTree 
kPrint 
kRemoveFriend 
kSetBranchStatus 
kResetBranchAddresses 

Definition at line 244 of file TTree.h.

◆ ESetBranchAddressStatus

Enumerator
kMissingBranch 
kInternalError 
kMissingCompiledCollectionProxy 
kMismatch 
kClassMismatch 
kMatch 
kMatchConversion 
kMatchConversionCollection 
kMakeClass 
kVoidPtr 
kNoCheck 
kNeedEnableDecomposedObj 
kNeedDisableDecomposedObj 
kDecomposedObjMask 

Definition at line 276 of file TTree.h.

◆ EStatusBits

Enumerator
kGlobalWeight 
kAutoDelete 

Definition at line 65 of file TChain.h.

◆ Mode

Enumerator
kWithoutGlobalRegistration 
kWithGlobalRegistration 

Definition at line 74 of file TChain.h.

Constructor & Destructor Documentation

◆ TChain() [1/3]

TChain::TChain ( const TChain & )
private

◆ TChain() [2/3]

TChain::TChain ( Mode mode = kWithGlobalRegistration)

Default constructor.

Definition at line 73 of file TChain.cxx.

◆ TChain() [3/3]

TChain::TChain ( const char * name,
const char * title = "",
Mode mode = kWithGlobalRegistration )

Create a chain.

A TChain is a collection of TFile objects. the first parameter "name" is the name of the TTree object in the files added with Add. Use TChain::Add to add a new element to this chain.

In case the Tree is in a subdirectory, do, eg:

TChain ch("subdir/treename");
TChain(const TChain &)

Example: Suppose we have 3 files f1.root, f2.root and f3.root. Each file contains a TTree object named "T".

TChain ch("T"); creates a chain to process a Tree called "T"
ch.Add("f1.root");
ch.Add("f2.root");
ch.Add("f3.root");
ch.Draw("x");
#define a(i)
Definition RSha256.hxx:99

The Draw function above will process the variable "x" in Tree "T" reading sequentially the 3 files in the chain ch.

The TChain data structure:

Each TChainElement has a name equal to the tree name of this TChain and a title equal to the file name. So, to loop over the TFiles that have been added to this chain:

TObjArray *fileElements=chain->GetListOfFiles();
TIter next(fileElements);
TChainElement *chEl=0;
while (( chEl=(TChainElement*)next() )) {
TFile f(chEl->GetTitle());
... do something with f ...
}
#define f(i)
Definition RSha256.hxx:104
A TChainElement describes a component of a TChain.
A file, usually with extension .root, that stores data and code in the form of serialized objects in ...
Definition TFile.h:130
const char * GetTitle() const override
Returns title of object.
Definition TNamed.h:50
An array of TObjects.
Definition TObjArray.h:31

Definition at line 137 of file TChain.cxx.

◆ ~TChain()

TChain::~TChain ( )
override

Destructor.

Definition at line 166 of file TChain.cxx.

Member Function Documentation

◆ AbstractMethod()

void TObject::AbstractMethod ( const char * method) const
inherited

Call this function within a function that you don't want to define as purely virtual, in order not to force all users deriving from that class to implement that maybe (on their side) unused function; but at the same time, emit a run-time warning if they try to call it, telling that it is not implemented in the derived class: action must thus be taken on the user side to override it.

In other word, this method acts as a "runtime purely virtual" warning instead of a "compiler purely virtual" error.

Warning
This interface is a legacy function that is no longer recommended to be used by new development code.
Note
The name "AbstractMethod" does not imply that it's an abstract method in the strict C++ sense.

Definition at line 1149 of file TObject.cxx.

◆ Add() [1/2]

Int_t TChain::Add ( const char * name,
Long64_t nentries = TTree::kMaxEntries )
virtual

Add a new file to this chain.

Parameters
[in]nameThe path to the file to be added. See below for details.
[in]nentriesNumber of entries in the file. This can be an estimate or queried from the file. See below for details.
Returns
There are different possible return values:
  • If nentries>0 (including the default of TTree::kMaxEntries) and no wildcarding is used, ALWAYS returns 1 irrespective of whether the file exists or contains the correct tree.
  • If wildcarding is used, regardless of the value of nentries, returns the number of files matching the name irrespective of whether they contain the correct tree.
  • If nentries<=0 and wildcarding is not used, returns 1 if the file exists and contains the correct tree and 0 otherwise.

Details of the name parameter

There are two sets of formats accepted for the parameter name . The first one is:

[//machine]/path/file_name[?[query][#tree_name]]
or [//machine]/path/file_name.root[.oext][/tree_name]

Note the following:

  • If the tree_name part is missing, it will be assumed that the file contains a tree with the same name as the chain.
  • Tagging the name of the tree with a slash (e.g. /tree_name ) is only supported for backward compatibility; it requires the file name to contain the string '.root' and its use is deprecated. Instead, use the form ?#tree_name (that is an "?" followed by an empty query), for example:
    // DO NOT DO THIS
    // c.Add("myfile.root/treename");
    // DO THIS INSTEAD
    c.Add("myfile.root?#treename");
    #define c(i)
    Definition RSha256.hxx:101
  • Wildcard treatment is triggered by any of the special characters: []*? which may be used in the file name or subdirectory name, eg. specifying "xxx*.root" adds all files starting with xxx in the current file system directory and "*&zwj;/*.root" adds all the files in the current subdirectories (but not in the subsubdirectories).

The second format accepted for name may have the form of a URL, e.g.:

root://machine/path/file_name[?[query][#tree_name]]
or root://machine/path/file_name
or root://machine/path/file_name.root[.oext]/tree_name
or root://machine/path/file_name.root[.oext]/tree_name?query

Note the following:

  • The optional "query" token is to be interpreted by the remote server.
  • Wildcards may be supported in URLs, depending on the protocol plugin and the remote server.
  • http or https URLs can contain a query identifier without tree_name, but generally URLs can not be written with them because of ambiguity with the wildcard character. (Also see the documentation for TChain::AddFile, which does not support wildcards but allows the URL name to contain a query).
  • The rules for tagging the name of the tree in the file are the same as in the format above.

Details of the nentries parameter

Depending on the value of the parameter, the number of entries in the file is retrieved differently:

  • If nentries <= 0, the file is connected and the tree header read in memory to get the number of entries.
  • If nentries > 0, the file is not connected, nentries is assumed to be the number of entries in the file. In this case, no check is made that the file exists and that the corresponding tree exists as well. This second mode is interesting in case the number of entries in the file is already stored in a run data base for example.
  • If nentries == TTree::kMaxEntries (default), the file is not connected. The number of entries in each file will be read only when the file will need to be connected to read an entry. This option is the default and very efficient if one processes the chain sequentially. Note that in case TChain::GetEntry(entry) is called and entry refers to an entry in the 3rd file, for example, this forces the tree headers in the first and second file to be read to find the number of entries in these files. Note that calling TChain::GetEntriesFast after having created a chain with this default returns TTree::kMaxEntries ! Using TChain::GetEntries instead will force all the tree headers in the chain to be read to get the number of entries in each tree.

The TChain data structure

Each element of the chain is a TChainElement object. It has a name equal to the tree name of this chain (or the name of the specific tree in the added file if it was explicitly tagged) and a title equal to the file name. So, to loop over the files that have been added to this chain:

TObjArray *fileElements=chain->GetListOfFiles();
for (TObject *op: *fileElements) {
auto chainElement = static_cast<TChainElement *>(op);
TFile f{chainElement->GetTitle()};
TTree *tree = f.Get<TTree>(chainElement->GetName());
// Do something with the file or the tree
}
TObject()
TObject constructor.
Definition TObject.h:259
A TTree represents a columnar dataset.
Definition TTree.h:89
Note
To add all the files of another TChain to this one, use TChain::Add(TChain* chain).

Definition at line 354 of file TChain.cxx.

◆ Add() [2/2]

Int_t TChain::Add ( TChain * chain)
virtual

Add all files referenced by the passed chain to this chain.

The function returns the total number of files connected.

Definition at line 211 of file TChain.cxx.

◆ AddAllocationCount()

void TTree::AddAllocationCount ( UInt_t count)
inlineinherited

Definition at line 381 of file TTree.h.

◆ AddBranchToCache() [1/2]

Int_t TTree::AddBranchToCache ( const char * bname,
bool subbranches = false )
virtualinherited

Add branch with name bname to the Tree cache.

If bname="*" all branches are added to the cache. if subbranches is true all the branches of the subbranches are also put to the cache.

Returns:

  • 0 branch added or already included
  • -1 on error

Definition at line 1086 of file TTree.cxx.

◆ AddBranchToCache() [2/2]

Int_t TTree::AddBranchToCache ( TBranch * b,
bool subbranches = false )
virtualinherited

Add branch b to the Tree cache.

if subbranches is true all the branches of the subbranches are also put to the cache.

Returns:

  • 0 branch added or already included
  • -1 on error

Definition at line 1125 of file TTree.cxx.

◆ AddClone()

void TTree::AddClone ( TTree * clone)
inherited

Add a cloned tree to our list of trees to be notified whenever we change our branch addresses or when we are deleted.

Definition at line 1246 of file TTree.cxx.

◆ AddFile()

Int_t TChain::AddFile ( const char * name,
Long64_t nentries = TTree::kMaxEntries,
const char * tname = "" )
virtual

Add a new file to this chain.

Filename formats are similar to TChain::Add. Wildcards are not applied. urls may also contain query and fragment identifiers where the tree name can be specified in the url fragment.

eg.

root://machine/path/file_name[?query[#tree_name]]
root://machine/path/file_name.root[.oext]/tree_name[?query]

If tree_name is given as a part of the file name it is used to as the name of the tree to load from the file. Otherwise if tname argument is specified the chain will load the tree named tname from the file, otherwise the original treename specified in the TChain constructor will be used. Tagging the tree_name with a slash [/tree_name] is only supported for backward compatibility; it requires the file name ot contain the string '.root' and its use is deprecated.

A. If nentries <= 0, the file is opened and the tree header read into memory to get the number of entries.

B. If nentries > 0, the file is not opened, and nentries is assumed to be the number of entries in the file. In this case, no check is made that the file exists nor that the tree exists in the file, nor that the real TTree entries match with the input argument. This second mode is interesting in case the number of entries in the file is already stored in a run database for example.

Warning
If you pass nentries > tree_entries, this may lead to silent data corruption in your analysis or undefined behavior in your program. Use the other options if unsure.

C. If nentries == TTree::kMaxEntries (default), the file is not opened. The number of entries in each file will be read only when the file is opened to read an entry. This option is the default and very efficient if one processes the chain sequentially. Note that in case GetEntry(entry) is called and entry refers to an entry in the third file, for example, this forces the tree headers in the first and second file to be read to find the number of entries in those files. Note that if one calls GetEntriesFast() after having created a chain with this default, GetEntriesFast() will return TTree::kMaxEntries! Using the GetEntries() function instead will force all of the tree headers in the chain to be read to read the number of entries in each tree.

D. The TChain data structure Each TChainElement has a name equal to the tree name of this TChain and a title equal to the file name. So, to loop over the TFiles that have been added to this chain:

TObjArray *fileElements=chain->GetListOfFiles();
TIter next(fileElements);
TChainElement *chEl=0;
while (( chEl=(TChainElement*)next() )) {
TFile f(chEl->GetTitle());
... do something with f ...
}

The function returns 1 if the file is successfully connected, 0 otherwise.

Definition at line 479 of file TChain.cxx.

◆ AddFileInfoList()

Int_t TChain::AddFileInfoList ( TCollection * filelist,
Long64_t nfiles = TTree::kMaxEntries )
virtual

Add all files referenced in the list to the chain.

The object type in the list must be either TFileInfo or TObjString or TUrl . The function return 1 if successful, 0 otherwise.

Definition at line 574 of file TChain.cxx.

◆ AddFriend() [1/3]

TFriendElement * TChain::AddFriend ( const char * chain,
const char * dummy = "" )
overridevirtual

Add a TFriendElement to the list of friends of this chain.

A TChain has a list of friends similar to a tree (see TTree::AddFriend). You can add a friend to a chain with the TChain::AddFriend method, and you can retrieve the list of friends with TChain::GetListOfFriends. This example has four chains each has 20 ROOT trees from 20 ROOT files.

TChain ch("t"); // a chain with 20 trees from 20 files
TChain ch1("t1");
TChain ch2("t2");
TChain ch3("t3");

Now we can add the friends to the first chain.

ch.AddFriend("t1")
ch.AddFriend("t2")
ch.AddFriend("t3")

The parameter is the name of friend chain (the name of a chain is always the name of the tree from which it was created). The original chain has access to all variable in its friends. We can use the TChain::Draw method as if the values in the friends were in the original chain. To specify the chain to use in the Draw method, use the syntax:

<chainname>.<branchname>.<varname>

If the variable name is enough to uniquely identify the variable, you can leave out the chain and/or branch name. For example, this generates a 3-d scatter plot of variable "var" in the TChain ch versus variable v1 in TChain t1 versus variable v2 in TChain t2.

ch.Draw("var:t1.v1:t2.v2");

When a TChain::Draw is executed, an automatic call to TTree::AddFriend connects the trees in the chain. When a chain is deleted, its friend elements are also deleted.

The number of entries in the friend must be equal or greater to the number of entries of the original chain. If the friend has fewer entries a warning is given and the resulting histogram will have missing entries. For additional information see TTree::AddFriend.

Reimplemented from TTree.

Definition at line 660 of file TChain.cxx.

◆ AddFriend() [2/3]

TFriendElement * TChain::AddFriend ( const char * chainname,
TFile * dummy )
overridevirtual

Add the whole chain or tree as a friend of this chain.

Reimplemented from TTree.

Definition at line 685 of file TChain.cxx.

◆ AddFriend() [3/3]

TFriendElement * TChain::AddFriend ( TTree * chain,
const char * alias = "",
bool warn = false )
overridevirtual

Add the whole chain or tree as a friend of this chain.

Reimplemented from TTree.

Definition at line 708 of file TChain.cxx.

◆ AddTotBytes()

virtual void TTree::AddTotBytes ( Int_t tot)
inlinevirtualinherited

Definition at line 375 of file TTree.h.

◆ AddToTObjectTable()

void TObject::AddToTObjectTable ( TObject * op)
staticprivateinherited

Private helper function which will dispatch to TObjectTable::AddObj.

Included here to avoid circular dependency between header files.

Definition at line 195 of file TObject.cxx.

◆ AddZipBytes()

virtual void TTree::AddZipBytes ( Int_t zip)
inlinevirtualinherited

Definition at line 376 of file TTree.h.

◆ AppendPad()

void TObject::AppendPad ( Option_t * option = "")
virtualinherited

Append graphics object to current pad.

In case no current pad is set yet, create a default canvas with the name "c1".

Definition at line 204 of file TObject.cxx.

◆ AutoSave()

Long64_t TTree::AutoSave ( Option_t * option = "")
virtualinherited

AutoSave tree header every fAutoSave bytes.

When large Trees are produced, it is safe to activate the AutoSave procedure. Some branches may have buffers holding many entries. If fAutoSave is negative, AutoSave is automatically called by TTree::Fill when the number of bytes generated since the previous AutoSave is greater than -fAutoSave bytes. If fAutoSave is positive, AutoSave is automatically called by TTree::Fill every N entries. This function may also be invoked by the user. Each AutoSave generates a new key on the file. Once the key with the tree header has been written, the previous cycle (if any) is deleted.

Note that calling TTree::AutoSave too frequently (or similarly calling TTree::SetAutoSave with a small value) is an expensive operation. You should make tests for your own application to find a compromise between speed and the quantity of information you may loose in case of a job crash.

In case your program crashes before closing the file holding this tree, the file will be automatically recovered when you will connect the file in UPDATE mode. The Tree will be recovered at the status corresponding to the last AutoSave.

if option contains "SaveSelf", gDirectory->SaveSelf() is called. This allows another process to analyze the Tree while the Tree is being filled.

if option contains "FlushBaskets", TTree::FlushBaskets is called and all the current basket are closed-out and written to disk individually.

By default the previous header is deleted after having written the new header. if option contains "Overwrite", the previous Tree header is deleted before written the new header. This option is slightly faster, but the default option is safer in case of a problem (disk quota exceeded) when writing the new header.

The function returns the number of bytes written to the file. if the number of bytes is null, an error has occurred while writing the header to the file.

How to write a Tree in one process and view it from another process

The following two scripts illustrate how to do this. The script treew.C is executed by process1, treer.C by process2

script treew.C:

void treew() {
TFile f("test.root","recreate");
TNtuple *ntuple = new TNtuple("ntuple","Demo","px:py:pz:random:i");
Float_t px, py, pz;
for ( Int_t i=0; i<10000000; i++) {
gRandom->Rannor(px,py);
pz = px*px + py*py;
Float_t random = gRandom->Rndm(1);
ntuple->Fill(px,py,pz,random,i);
if (i%1000 == 1) ntuple->AutoSave("SaveSelf");
}
}
int Int_t
Signed integer 4 bytes (int).
Definition RtypesCore.h:59
float Float_t
Float 4 bytes (float).
Definition RtypesCore.h:71
externTRandom * gRandom
Definition TRandom.h:62
A simple TTree restricted to a list of float variables only.
Definition TNtuple.h:28

script treer.C:

void treer() {
TFile f("test.root");
TTree *ntuple = (TTree*)f.Get("ntuple");
Int_t first = 0;
while(1) {
if (first == 0) ntuple->Draw("px>>hpx", "","",10000000,first);
else ntuple->Draw("px>>+hpx","","",10000000,first);
first = (Int_t)ntuple->GetEntries();
c1.Update();
gSystem->Sleep(1000); //sleep 1 second
ntuple->Refresh();
}
}
externTSystem * gSystem
Definition TSystem.h:582
The Canvas class.
Definition TCanvas.h:23
TTree()
Default constructor and I/O constructor.
Definition TTree.cxx:764
return c1
Definition legend1.C:41

Definition at line 1527 of file TTree.cxx.

◆ Branch() [1/13]

Int_t TTree::Branch ( const char * foldername,
Int_t bufsize = 32000,
Int_t splitlevel = 99 )
virtualinherited

Create one branch for each element in the folder.

Returns the total number of branches created.

Reimplemented in TTreeSQL.

Definition at line 1910 of file TTree.cxx.

◆ Branch() [2/13]

TBranch * TTree::Branch ( const char * name,
char * address,
const char * leaflist,
Int_t bufsize = 32000 )
inlineinherited

Definition at line 423 of file TTree.h.

◆ Branch() [3/13]

template<class T>
TBranch * TTree::Branch ( const char * name,
const char * classname,
T ** addobj,
Int_t bufsize = 32000,
Int_t splitlevel = 99 )
inlineinherited

Definition at line 444 of file TTree.h.

◆ Branch() [4/13]

template<class T>
TBranch * TTree::Branch ( const char * name,
const char * classname,
T * obj,
Int_t bufsize = 32000,
Int_t splitlevel = 99 )
inlineinherited

Definition at line 439 of file TTree.h.

◆ Branch() [5/13]

TBranch * TTree::Branch ( const char * name,
const char * classname,
void * addobj,
Int_t bufsize = 32000,
Int_t splitlevel = 99 )
virtualinherited

Create a new branch with the object of class classname at address addobj.

WARNING:

Starting with Root version 3.01, the Branch function uses the new style branches (TBranchElement). To get the old behaviour, you can:

  • call BranchOld or
  • call TTree::SetBranchStyle(0)

Note that with the new style, classname does not need to derive from TObject. It must derived from TObject if the branch style has been set to 0 (old)

Note: See the comments in TBranchElement::SetAddress() for a more detailed discussion of the meaning of the addobj parameter in the case of new-style branches.

Use splitlevel < 0 instead of splitlevel=0 when the class has a custom Streamer

Note: if the split level is set to the default (99), TTree::Branch will not issue a warning if the class can not be split.

Reimplemented in TTreeSQL.

Definition at line 2051 of file TTree.cxx.

◆ Branch() [6/13]

TBranch * TTree::Branch ( const char * name,
int address,
const char * leaflist,
Int_t bufsize = 32000 )
inlineinherited

Definition at line 433 of file TTree.h.

◆ Branch() [7/13]

TBranch * TTree::Branch ( const char * name,
Longptr_t address,
const char * leaflist,
Int_t bufsize = 32000 )
inlineinherited

Definition at line 428 of file TTree.h.

◆ Branch() [8/13]

template<typename T, std::size_t N>
TBranch * TTree::Branch ( const char * name,
std::array< T, N > * obj,
Int_t bufsize = 32000,
Int_t splitlevel = 99 )
inlineinherited

Definition at line 449 of file TTree.h.

◆ Branch() [9/13]

template<class T>
TBranch * TTree::Branch ( const char * name,
T ** addobj,
Int_t bufsize = 32000,
Int_t splitlevel = 99 )
inlineinherited

Add a new branch, and infer the data type from the array addobj being passed.

Note
This and the previous overload should cover most cases for creating a branch. Try to use these two whenever possible, unless e.g. type conversions are needed.
Parameters
[in]nameName of the branch to be created.
[in]addobjArray of the objects to be added. When calling Fill(), the current value of the type/object will be saved.
[in]bufsizehe buffer size in bytes for this branch. When the buffer is full, it is compressed and written to disc. 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). A small value for bufsize is beneficial if entries in the Tree are accessed randomly and the Tree is in split mode.
[in]splitlevelIf T is a class or struct and splitlevel > 0, the members of the object are serialised as separate branches.
Returns
Pointer to the TBranch that was created. The branch is owned by the tree.

Definition at line 414 of file TTree.h.

◆ Branch() [10/13]

template<class T>
TBranch * TTree::Branch ( const char * name,
T * obj,
Int_t bufsize = 32000,
Int_t splitlevel = 99 )
inlineinherited

Add a new branch, and infer the data type from the type of obj being passed.

Note
This and the next overload should cover most cases for creating a branch. Try to use these two whenever possible, unless e.g. type conversions are needed.
Parameters
[in]nameName of the branch to be created.
[in]objAddress of the object to be added. Make sure to pass a pointer to the actual type/class that should be stored in the tree (no pointers to base classes). When calling Fill(), the current value of the type/object will be saved.
[in]bufsizeThe buffer size in bytes for this branch. When the buffer is full, it is compressed and written to disc. 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). A small value for bufsize is beneficial if entries in the Tree are accessed randomly and the Tree is in split mode.
[in]splitlevelIf T is a class or struct and splitlevel > 0, the members of the object are serialised as separate branches.
Returns
Pointer to the TBranch that was created. The branch is owned by the tree.

Definition at line 397 of file TTree.h.

◆ Branch() [11/13]

TBranch * TTree::Branch ( const char * name,
void * address,
const char * leaflist,
Int_t bufsize = 32000 )
virtualinherited

Create a new TTree Branch.

This Branch constructor is provided to support non-objects in a Tree. The variables described in leaflist may be simple variables or structures. // See the two following constructors for writing objects in a Tree.

By default the branch buffers are stored in the same file as the Tree. use TBranch::SetFile to specify a different file

  • address is the address of the first item of a structure.
  • leaflist is the concatenation of all the variable names and types separated by a colon character : The variable name and the variable type are separated by a slash (/). The variable type may be 0,1 or 2 characters. If no type is given, the type of the variable is assumed to be the same as the previous variable. If the first variable does not have a type, it is assumed of type F by default. The list of currently supported types is given below:

    • C : a character string terminated by the 0 character
    • B : an 8 bit integer (Char_t); Mostly signed, might be unsigned in special platforms or depending on compiler flags, thus do not use std::int8_t as underlying variable since they are not equivalent; Treated as a character when in an array.
    • b : an 8 bit unsigned integer (UChar_t)
    • S : a 16 bit signed integer (Short_t)
    • s : a 16 bit unsigned integer (UShort_t)
    • I : a 32 bit signed integer (Int_t)
    • i : a 32 bit unsigned integer (UInt_t)
    • F : a 32 bit floating point (Float_t)
    • f : a 24 bit floating point with truncated mantissa (Float16_t)
    • D : a 64 bit floating point (Double_t)
    • d : a 24 bit truncated floating point (Double32_t)
    • L : a 64 bit signed integer (Long64_t)
    • l : a 64 bit unsigned integer (ULong64_t)
    • G : a long signed integer, stored as 64 bit (Long_t)
    • g : a long unsigned integer, stored as 64 bit (ULong_t)
    • O : [the letter o, not a zero] a boolean (bool)

    Arrays of values are supported with the following syntax:

    • If leaf name has the form var[nelem], where nelem is alphanumeric, then if nelem is a leaf name, it is used as the variable size of the array, otherwise return 0. The leaf referred to by nelem MUST be an int (/I),
    • If leaf name has the form var[nelem], where nelem is a non-negative integer, then it is used as the fixed size of the array.
    • If leaf name has the form of a multi-dimensional array (e.g. var[nelem][nelem2]) where nelem and nelem2 are non-negative integer) then it is used as a 2 dimensional array of fixed size.
    • In case of the truncated floating point types (Float16_t and Double32_t) you can furthermore specify the range in the style [xmin,xmax] or [xmin,xmax,nbits] after the type character. See TStreamerElement::GetRange() for further information.

    Any of other form is not supported.

Note that the TTree will assume that all the item are contiguous in memory. On some platform, this is not always true of the member of a struct or a class, due to padding and alignment. Sorting your data member in order of decreasing sizeof usually leads to their being contiguous in memory.

  • bufsize is the buffer size in bytes for this branch The default value is 32000 bytes and should be ok for most cases. You can specify a larger value (e.g. 256000) if your Tree is not split and each entry is large (Megabytes) A small value for bufsize is optimum if you intend to access the entries in the Tree randomly and your Tree is in split mode.

Reimplemented in TTreeSQL.

Definition at line 2016 of file TTree.cxx.

◆ Branch() [12/13]

Int_t TTree::Branch ( TCollection * li,
Int_t bufsize = 32000,
Int_t splitlevel = 99,
const char * name = "" )
virtualinherited

Create one branch for each element in the collection.

Each entry in the collection becomes a top level branch if the corresponding class is not a collection. If it is a collection, the entry in the collection becomes in turn top level branches, etc. The splitlevel is decreased by 1 every time a new collection is found. For example if list is a TObjArray*

  • if splitlevel = 1, one top level branch is created for each element of the TObjArray.
  • if splitlevel = 2, one top level branch is created for each array element. if, in turn, one of the array elements is a TCollection, one top level branch will be created for each element of this collection.

In case a collection element is a TClonesArray, the special Tree constructor for TClonesArray is called. The collection itself cannot be a TClonesArray.

The function returns the total number of branches created.

If name is given, all branch names will be prefixed with name_.

IMPORTANT NOTE1: This function should not be called with splitlevel < 1.

IMPORTANT NOTE2: The branches created by this function will have names corresponding to the collection or object names. It is important to give names to collections to avoid misleading branch names or identical branch names. By default collections have a name equal to the corresponding class name, e.g. the default name for a TList is "TList".

And in general, in case two or more master branches contain subbranches with identical names, one must add a "." (dot) character at the end of the master branch name. This will force the name of the subbranches to be of the form master.subbranch instead of simply subbranch. This situation happens when the top level object has two or more members referencing the same class. Without the dot, the prefix will not be there and that might cause ambiguities. For example, if a Tree has two branches B1 and B2 corresponding to objects of the same class MyClass, one can do:

tree.Branch("B1.","MyClass",&b1,8000,1);
tree.Branch("B2.","MyClass",&b2,8000,1);

if MyClass has 3 members a,b,c, the two instructions above will generate subbranches called B1.a, B1.b ,B1.c, B2.a, B2.b, B2.c In other words, the trailing dot of the branch name is semantically relevant and recommended.

Example:

{
TTree T("T","test list");
TList *list = new TList();
TObjArray *a1 = new TObjArray();
a1->SetName("a1");
list->Add(a1);
TH1F *ha1a = new TH1F("ha1a","ha1",100,0,1);
TH1F *ha1b = new TH1F("ha1b","ha1",100,0,1);
a1->Add(ha1a);
a1->Add(ha1b);
TObjArray *b1 = new TObjArray();
b1->SetName("b1");
list->Add(b1);
TH1F *hb1a = new TH1F("hb1a","hb1",100,0,1);
TH1F *hb1b = new TH1F("hb1b","hb1",100,0,1);
b1->Add(hb1a);
b1->Add(hb1b);
TObjArray *a2 = new TObjArray();
a2->SetName("a2");
list->Add(a2);
TH1S *ha2a = new TH1S("ha2a","ha2",100,0,1);
TH1S *ha2b = new TH1S("ha2b","ha2",100,0,1);
a2->Add(ha2a);
a2->Add(ha2b);
T.Branch(list,16000,2);
T.Print();
}
void SetName(const char *name)
1-D histogram with a float per channel (see TH1 documentation)
Definition TH1.h:878
1-D histogram with a short per channel (see TH1 documentation)
Definition TH1.h:755
A doubly linked list.
Definition TList.h:38
void Add(TObject *obj) override
Definition TObjArray.h:68

Reimplemented in TTreeSQL.

Definition at line 1863 of file TTree.cxx.

◆ Branch() [13/13]

Int_t TTree::Branch ( TList * list,
Int_t bufsize = 32000,
Int_t splitlevel = 99 )
virtualinherited

Deprecated function. Use next function instead.

Reimplemented in TTreeSQL.

Definition at line 1776 of file TTree.cxx.

◆ BranchImp() [1/2]

TBranch * TTree::BranchImp ( const char * branchname,
const char * classname,
TClass * ptrClass,
void * addobj,
Int_t bufsize,
Int_t splitlevel )
protectedvirtualinherited

Same as TTree::Branch() with added check that addobj matches className.

See also
TTree::Branch()

Reimplemented in TTreeSQL.

Definition at line 1581 of file TTree.cxx.

◆ BranchImp() [2/2]

TBranch * TTree::BranchImp ( const char * branchname,
TClass * ptrClass,
void * addobj,
Int_t bufsize,
Int_t splitlevel )
protectedvirtualinherited

Same as TTree::Branch but automatic detection of the class name.

See also
TTree::Branch

Reimplemented in TTreeSQL.

Definition at line 1629 of file TTree.cxx.

◆ BranchImpArr()

TBranch * TTree::BranchImpArr ( const char * branchname,
EDataType datatype,
std::size_t N,
void * addobj,
Int_t bufsize,
Int_t splitlevel )
protectedvirtualinherited

Definition at line 1758 of file TTree.cxx.

◆ BranchImpRef() [1/2]

TBranch * TTree::BranchImpRef ( const char * branchname,
const char * classname,
TClass * ptrClass,
void * addobj,
Int_t bufsize,
Int_t splitlevel )
protectedvirtualinherited

Same as TTree::Branch but automatic detection of the class name.

See also
TTree::Branch

Definition at line 1662 of file TTree.cxx.

◆ BranchImpRef() [2/2]

TBranch * TTree::BranchImpRef ( const char * branchname,
TClass * ptrClass,
EDataType datatype,
void * addobj,
Int_t bufsize,
Int_t splitlevel )
protectedvirtualinherited

Same as TTree::Branch but automatic detection of the class name.

See also
TTree::Branch

Definition at line 1722 of file TTree.cxx.

◆ BranchOld()

TBranch * TTree::BranchOld ( const char * name,
const char * classname,
void * addobj,
Int_t bufsize = 32000,
Int_t splitlevel = 1 )
virtualinherited

Create a new TTree BranchObject.

Build a TBranchObject for an object of class classname. addobj is the address of a pointer to an object of class classname. IMPORTANT: classname must derive from TObject. The class dictionary must be available (ClassDef in class header).

This option requires access to the library where the corresponding class is defined. Accessing one single data member in the object implies reading the full object. See the next Branch constructor for a more efficient storage in case the entry consists of arrays of identical objects.

By default the branch buffers are stored in the same file as the Tree. use TBranch::SetFile to specify a different file

IMPORTANT NOTE about branch names:

And in general, in case two or more master branches contain subbranches with identical names, one must add a "." (dot) character at the end of the master branch name. This will force the name of the subbranches to be of the form master.subbranch instead of simply subbranch. This situation happens when the top level object has two or more members referencing the same class. For example, if a Tree has two branches B1 and B2 corresponding to objects of the same class MyClass, one can do:

tree.Branch("B1.","MyClass",&b1,8000,1);
tree.Branch("B2.","MyClass",&b2,8000,1);

if MyClass has 3 members a,b,c, the two instructions above will generate subbranches called B1.a, B1.b ,B1.c, B2.a, B2.b, B2.c

bufsize is the buffer size in bytes for this branch The default value is 32000 bytes and should be ok for most cases. You can specify a larger value (e.g. 256000) if your Tree is not split and each entry is large (Megabytes) A small value for bufsize is optimum if you intend to access the entries in the Tree randomly and your Tree is in split mode.

Reimplemented in TTreeSQL.

Definition at line 2104 of file TTree.cxx.

◆ BranchRef()

TBranch * TTree::BranchRef ( )
virtualinherited

Build the optional branch supporting the TRefTable.

This branch will keep all the information to find the branches containing referenced objects.

At each Tree::Fill, the branch numbers containing the referenced objects are saved to the TBranchRef basket. When the Tree header is saved (via TTree::Write), the branch is saved keeping the information with the pointers to the branches having referenced objects.

Definition at line 2358 of file TTree.cxx.

◆ Bronch()

TBranch * TTree::Bronch ( const char * name,
const char * classname,
void * addr,
Int_t bufsize = 32000,
Int_t splitlevel = 99 )
virtualinherited

Create a new TTree BranchElement.

WARNING about this new function

This function is designed to replace the internal implementation of the old TTree::Branch (whose implementation has been moved to BranchOld).

NOTE: The 'Bronch' method supports only one possible calls signature (where the object type has to be specified explicitly and the address must be the address of a pointer). For more flexibility use 'Branch'. Use Bronch only in (rare) cases (likely to be legacy cases) where both the new and old implementation of Branch needs to be used at the same time.

This function is far more powerful than the old Branch function. It supports the full C++, including STL and has the same behaviour in split or non-split mode. classname does not have to derive from TObject. The function is based on the new TStreamerInfo.

Build a TBranchElement for an object of class classname.

addr is the address of a pointer to an object of class classname. The class dictionary must be available (ClassDef in class header).

Note: See the comments in TBranchElement::SetAddress() for a more detailed discussion of the meaning of the addr parameter.

This option requires access to the library where the corresponding class is defined. Accessing one single data member in the object implies reading the full object.

By default the branch buffers are stored in the same file as the Tree. use TBranch::SetFile to specify a different file

IMPORTANT NOTE about branch names:

And in general, in case two or more master branches contain subbranches with identical names, one must add a "." (dot) character at the end of the master branch name. This will force the name of the subbranches to be of the form master.subbranch instead of simply subbranch. This situation happens when the top level object has two or more members referencing the same class. For example, if a Tree has two branches B1 and B2 corresponding to objects of the same class MyClass, one can do:

tree.Branch("B1.","MyClass",&b1,8000,1);
tree.Branch("B2.","MyClass",&b2,8000,1);

if MyClass has 3 members a,b,c, the two instructions above will generate subbranches called B1.a, B1.b ,B1.c, B2.a, B2.b, B2.c

bufsize is the buffer size in bytes for this branch The default value is 32000 bytes and should be ok for most cases. You can specify a larger value (e.g. 256000) if your Tree is not split and each entry is large (Megabytes) A small value for bufsize is optimum if you intend to access the entries in the Tree randomly and your Tree is in split mode.

Use splitlevel < 0 instead of splitlevel=0 when the class has a custom Streamer

Note: if the split level is set to the default (99), TTree::Branch will not issue a warning if the class can not be split.

Reimplemented in TTreeSQL.

Definition at line 2434 of file TTree.cxx.

◆ BronchExec()

TBranch * TTree::BronchExec ( const char * name,
const char * classname,
void * addobj,
bool isptrptr,
Int_t bufsize,
Int_t splitlevel )
protectedvirtualinherited

Helper function implementing TTree::Bronch and TTree::Branch(const char *name, T &obj);.

Definition at line 2442 of file TTree.cxx.

◆ Browse()

void TChain::Browse ( TBrowser * b)
overridevirtual

Browse the contents of the chain.

Reimplemented from TObject.

Definition at line 731 of file TChain.cxx.

◆ BuildIndex() [1/2]

Int_t TTree::BuildIndex ( const char * majorname,
bool long64major )
inlineinherited

Build index with only a major formula.

Minor formula will be set to "0" ie skip.

See also
TTree::BuildIndex(const char *, const char *, bool, bool)

Definition at line 467 of file TTree.h.

◆ BuildIndex() [2/2]

Int_t TTree::BuildIndex ( const char * majorname,
const char * minorname = "0",
bool long64major = false,
bool long64minor = false )
virtualinherited

Build a Tree Index (default is TTreeIndex).

See a description of the parameters and functionality in TTreeIndex::TTreeIndex().

The return value is the number of entries in the Index (< 0 indicates failure).

A TTreeIndex object pointed by fTreeIndex is created. This object will be automatically deleted by the TTree destructor. If an index is already existing, this is replaced by the new one without being deleted. This behaviour prevents the deletion of a previously external index assigned to the TTree via the TTree::SetTreeIndex() method.

See also
TTree::SetTreeIndex()

Definition at line 2667 of file TTree.cxx.

◆ BuildStreamerInfo()

TStreamerInfo * TTree::BuildStreamerInfo ( TClass * cl,
void * pointer = nullptr,
bool canOptimize = true )
inherited

Build StreamerInfo for class cl.

pointer is an optional argument that may contain a pointer to an object of cl.

Definition at line 2682 of file TTree.cxx.

◆ CanDeleteRefs()

void TChain::CanDeleteRefs ( bool flag = true)
virtual

When closing a file during the chain processing, the file may be closed with option "R" if flag is set to true.

by default flag is true. When closing a file with option "R", all TProcessIDs referenced by this file are deleted. Calling TFile::Close("R") might be necessary in case one reads a long list of files having TRef, writing some of the referenced objects or TRef to a new file. If the TRef or referenced objects of the file being closed will not be referenced again, it is possible to minimize the size of the TProcessID data structures in memory by forcing a delete of the unused TProcessID.

Definition at line 749 of file TChain.cxx.

◆ ChangeFile()

TFile * TTree::ChangeFile ( TFile * file)
virtualinherited

Called by TTree::Fill() when file has reached its maximum fgMaxTreeSize.

Create a new file. If the original file is named "myfile.root", subsequent files are named "myfile_1.root", "myfile_2.root", etc.

Returns a pointer to the new file.

Currently, the automatic change of file is restricted to the case where the tree is in the top level directory. The file should not contain sub-directories.

Before switching to a new file, the tree header is written to the current file, then the current file is closed.

To process the multiple files created by ChangeFile, one must use a TChain.

The new file name has a suffix "_N" where N is equal to fFileNumber+1. By default a Root session starts with fFileNumber=0. One can set fFileNumber to a different value via TTree::SetFileNumber. In case a file named "_N" already exists, the function will try a file named "__N", then "___N", etc.

fgMaxTreeSize can be set via the static function TTree::SetMaxTreeSize. The default value of fgMaxTreeSize is 100 Gigabytes.

If the current file contains other objects like TH1 and TTree, these objects are automatically moved to the new file.

Warning
Be careful when writing the final Tree header to the file! Don't do:
TFile *file = new TFile("myfile.root","recreate");
TTree *T = new TTree("T","title");
T->Fill(); // Loop
file->Write();
file->Close();
Int_t Write(const char *name=nullptr, Int_t opt=0, Int_t bufsize=0) override
Write memory objects to this file.
Definition TFile.cxx:2488
void Close(Option_t *option="") override
Close a file.
Definition TFile.cxx:981
but do the following:
TFile *file = new TFile("myfile.root","recreate");
TTree *T = new TTree("T","title");
T->Fill(); // Loop
file = T->GetCurrentFile(); // To get the pointer to the current file
file->Write();
file->Close();
Note
This method is never called if the input file is a TMemFile or derivate.

Definition at line 2779 of file TTree.cxx.

◆ CheckBranchAddressType()

Int_t TTree::CheckBranchAddressType ( TBranch * branch,
TClass * ptrClass,
EDataType datatype,
bool isptr )
protectedvirtualinherited

Check whether or not the address described by the last 3 parameters matches the content of the branch.

If a Data Model Evolution conversion is involved, reset the fInfo of the branch. The return values are:

  • kMissingBranch (-5) : Missing branch
  • kInternalError (-4) : Internal error (could not find the type corresponding to a data type number)
  • kMissingCompiledCollectionProxy (-3) : Missing compiled collection proxy for a compiled collection
  • kMismatch (-2) : Non-Class Pointer type given does not match the type expected by the branch
  • kClassMismatch (-1) : Class Pointer type given does not match the type expected by the branch
  • kMatch (0) : perfect match
  • kMatchConversion (1) : match with (I/O) conversion
  • kMatchConversionCollection (2) : match with (I/O) conversion of the content of a collection
  • kMakeClass (3) : MakeClass mode so we can not check.
  • kVoidPtr (4) : void* passed so no check was made.
  • kNoCheck (5) : Underlying TBranch not yet available so no check was made. In addition this can be multiplexed with the two bits:
  • kNeedEnableDecomposedObj : in order for the address (type) to be 'usable' the branch needs to be in Decomposed Object (aka MakeClass) mode.
  • kNeedDisableDecomposedObj : in order for the address (type) to be 'usable' the branch needs to not be in Decomposed Object (aka MakeClass) mode. This bits can be masked out by using kDecomposedObjMask

Definition at line 2901 of file TTree.cxx.

◆ CheckedHash()

ULong_t TObject::CheckedHash ( )
inlineinherited

Check and record whether this class has a consistent Hash/RecursiveRemove setup (*) and then return the regular Hash value for this object.

The intent is for this routine to be called instead of directly calling the function Hash during "insert" operations. See TObject::HasInconsistenTObjectHash();

(*) The setup is consistent when all classes in the class hierarchy that overload TObject::Hash do call ROOT::CallRecursiveRemoveIfNeeded in their destructor. i.e. it is safe to call the Hash virtual function during the RecursiveRemove operation.

Definition at line 332 of file TObject.h.

◆ Class()

TClass * TChain::Class ( )
static
Returns
TClass describing this class

◆ Class_Name()

const char * TChain::Class_Name ( )
static
Returns
Name of this class

◆ Class_Version()

constexpr Version_t TChain::Class_Version ( )
inlinestaticconstexpr
Returns
Version of this class

Definition at line 175 of file TChain.h.

◆ ClassName()

const char * TObject::ClassName ( ) const
virtualinherited

Returns name of class to which the object belongs.

Definition at line 227 of file TObject.cxx.

◆ Clear()

void TNamed::Clear ( Option_t * option = "")
overridevirtualinherited

Set name and title to empty strings ("").

Reimplemented from TObject.

Reimplemented in TPrincipal, TProcessID, TStreamerInfo, TTask, TVirtualFitter, and TVirtualStreamerInfo.

Definition at line 63 of file TNamed.cxx.

◆ Clone()

TObject * TNamed::Clone ( const char * newname = "") const
overridevirtualinherited

Make a clone of an object using the Streamer facility.

If newname is specified, this will be the name of the new object.

Reimplemented from TObject.

Reimplemented in TStreamerInfo, and TTreeIndex.

Definition at line 73 of file TNamed.cxx.

◆ CloneTree()

TTree * TTree::CloneTree ( Long64_t nentries = -1,
Option_t * option = "" )
virtualinherited

Create a clone of this tree and copy nentries.

By default copy all entries. The compression level of the cloned tree is set to the destination file's compression level.

NOTE: Only active branches are copied. See TTree::SetBranchStatus for more information and usage regarding the (de)activation of branches. More examples are provided in the tutorials listed below.

NOTE: If the TTree is a TChain, the structure of the first TTree is used for the copy.

IMPORTANT: The cloned tree stays connected with this tree until this tree is deleted. In particular, any changes in branch addresses in this tree are forwarded to the clone trees, unless a branch in a clone tree has had its address changed, in which case that change stays in effect. When this tree is deleted, all the addresses of the cloned tree are reset to their default values.

If 'option' contains the word 'fast' and nentries is -1, the cloning will be done without unzipping or unstreaming the baskets (i.e., a direct copy of the raw bytes on disk).

When 'fast' is specified, 'option' can also contain a sorting order for the baskets in the output file.

There are currently 3 supported sorting order:

  • SortBasketsByOffset (the default)
  • SortBasketsByBranch
  • SortBasketsByEntry

When using SortBasketsByOffset the baskets are written in the output file in the same order as in the original file (i.e. the baskets are sorted by their offset in the original file; Usually this also means that the baskets are sorted by the index/number of the last entry they contain)

When using SortBasketsByBranch all the baskets of each individual branches are stored contiguously. This tends to optimize reading speed when reading a small number (1->5) of branches, since all their baskets will be clustered together instead of being spread across the file. However it might decrease the performance when reading more branches (or the full entry).

When using SortBasketsByEntry the baskets with the lowest starting entry are written first. (i.e. the baskets are sorted by the index/number of the first entry they contain). This means that on the file the baskets will be in the order in which they will be needed when reading the whole tree sequentially.

For examples of CloneTree, see tutorials:

  • copytree.C: A macro to copy a subset of a TTree to a new TTree. The input file has been generated by the program in $ROOTSYS/test/Event with: Event 1000 1 1 1
  • copytree2.C: A macro to copy a subset of a TTree to a new TTree. One branch of the new Tree is written to a separate file. The input file has been generated by the program in $ROOTSYS/test/Event with: Event 1000 1 1 1

Reimplemented in TNtuple.

Definition at line 3173 of file TTree.cxx.

◆ Compare()

Int_t TNamed::Compare ( const TObject * obj) const
overridevirtualinherited

Compare two TNamed objects.

Returns 0 when equal, -1 when this is smaller and +1 when bigger (like strcmp).

Reimplemented from TObject.

Reimplemented in TStructNodeProperty.

Definition at line 84 of file TNamed.cxx.

◆ Copy() [1/4]

void TAttFill::Copy ( TAttFill & attfill) const
inherited

◆ Copy() [2/4]

void TAttLine::Copy ( TAttLine & attline) const
inherited

◆ Copy() [3/4]

void TAttMarker::Copy ( TAttMarker & attmarker) const
inherited

◆ Copy() [4/4]

void TNamed::Copy ( TObject & named) const
overridevirtualinherited

Copy this to obj.

Reimplemented from TObject.

Reimplemented in TPieSlice, TProfile2D, TProfile3D, TProfile, TStyle, TSystemDirectory, TSystemFile, TText, and TXTRU.

Definition at line 93 of file TNamed.cxx.

◆ CopyAddresses()

void TTree::CopyAddresses ( TTree * tree,
bool undo = false )
virtualinherited

Set branch addresses of passed tree equal to ours.

If undo is true, reset the branch addresses instead of copying them. This ensures 'separation' of a cloned tree from its original.

Definition at line 3339 of file TTree.cxx.

◆ CopyEntries()

Long64_t TTree::CopyEntries ( TTree * tree,
Long64_t nentries = -1,
Option_t * option = "",
bool needCopyAddresses = false )
virtualinherited

Copy nentries from given tree to this tree.

This routines assumes that the branches that intended to be copied are already connected. The typical case is that this tree was created using tree->CloneTree(0).

By default copy all entries.

Returns number of bytes copied to this tree.

If 'option' contains the word 'fast' and nentries is -1, the cloning will be done without unzipping or unstreaming the baskets (i.e., a direct copy of the raw bytes on disk).

When 'fast' is specified, 'option' can also contains a sorting order for the baskets in the output file.

There are currently 3 supported sorting order:

  • SortBasketsByOffset (the default)
  • SortBasketsByBranch
  • SortBasketsByEntry

See TTree::CloneTree for a detailed explanation of the semantics of these 3 options.

If the tree or any of the underlying tree of the chain has an index, that index and any index in the subsequent underlying TTree objects will be merged.

There are currently three 'options' to control this merging:

  • NoIndex : all the TTreeIndex object are dropped.
  • DropIndexOnError : if any of the underlying TTree object do no have a TTreeIndex, they are all dropped.
  • AsIsIndexOnError [default]: In case of missing TTreeIndex, the resulting TTree index has gaps.
  • BuildIndexOnError : If any of the underlying TTree objects do not have a TTreeIndex, all TTreeIndex are 'ignored' and the missing piece are rebuilt.

Definition at line 3574 of file TTree.cxx.

◆ CopyTree()

TTree * TChain::CopyTree ( const char * selection,
Option_t * option = "",
Long64_t nentries = kMaxEntries,
Long64_t firstentry = 0 )
overridevirtual

Copy a tree with selection.

See the documentation of TTree::CopyTree

Known limitations for TChain

  • This method is not supported if used on an instance with friends

Reimplemented from TTree.

Definition at line 762 of file TChain.cxx.

◆ CreateBasket()

TBasket * TTree::CreateBasket ( TBranch * branch)
virtualinherited

Create a basket for this tree and given branch.

Reimplemented in TTreeSQL.

Definition at line 3771 of file TTree.cxx.

◆ CreatePackets()

void TChain::CreatePackets ( )
virtual

Initialize the packet descriptor string.

Definition at line 775 of file TChain.cxx.

◆ Debug()

Int_t TTree::Debug ( ) const
inlineinherited

Definition at line 476 of file TTree.h.

◆ DeclFileName()

const char * TChain::DeclFileName ( )
inlinestatic
Returns
Name of the file containing the class declaration

Definition at line 175 of file TChain.h.

◆ Delete()

void TTree::Delete ( Option_t * option = "")
overridevirtualinherited

Delete this tree from memory or/and disk.

  • if option == "all" delete Tree object from memory AND from disk all baskets on disk are deleted. All keys with same name are deleted.
  • if option =="" only Tree object in memory is deleted.

Reimplemented from TObject.

Definition at line 3787 of file TTree.cxx.

◆ DirectoryAutoAdd()

void TChain::DirectoryAutoAdd ( TDirectory * )
overridevirtual

Override the TTree::DirectoryAutoAdd behavior: we never auto add.

Reimplemented from TTree.

Definition at line 788 of file TChain.cxx.

◆ DistancetoLine()

Int_t TAttLine::DistancetoLine ( Int_t px,
Int_t py,
Double_t xp1,
Double_t yp1,
Double_t xp2,
Double_t yp2 )
inherited

◆ DistancetoPrimitive()

◆ DoError()

void TObject::DoError ( int level,
const char * location,
const char * fmt,
va_list va ) const
protectedvirtualinherited

Interface to ErrorHandler (protected).

Reimplemented in TThread, and TTreeViewer.

Definition at line 1059 of file TObject.cxx.

◆ Draw() [1/3]

Long64_t TChain::Draw ( const char * varexp,
const char * selection,
Option_t * option = "",
Long64_t nentries = kMaxEntries,
Long64_t firstentry = 0 )
overridevirtual

Process all entries in this chain and draw histogram corresponding to expression varexp.

Returns -1 in case of error or number of selected events in case of success.

Reimplemented from TTree.

Definition at line 814 of file TChain.cxx.

◆ Draw() [2/3]

Long64_t TChain::Draw ( const char * varexp,
const TCut & selection,
Option_t * option = "",
Long64_t nentries = kMaxEntries,
Long64_t firstentry = 0 )
overridevirtual

Draw expression varexp for selected entries.

Returns -1 in case of error or number of selected events in case of success.

This function accepts TCut objects as arguments. Useful to use the string operator +, example:

ntuple.Draw("x",cut1+cut2+cut3);

Reimplemented from TTree.

Definition at line 803 of file TChain.cxx.

◆ Draw() [3/3]

void TChain::Draw ( Option_t * option)
inlineoverridevirtual

Default Draw method for all objects.

Reimplemented from TObject.

Definition at line 94 of file TChain.h.

◆ DrawClass()

void TObject::DrawClass ( ) const
virtualinherited

Draw class inheritance tree of the class to which this object belongs.

If a class B inherits from a class A, description of B is drawn on the right side of description of A. Member functions overridden by B are shown in class A with a blue line crossing-out the corresponding member function. The following picture is the class inheritance tree of class TPaveLabel:

Reimplemented in TGFrame, TSystemDirectory, and TSystemFile.

Definition at line 308 of file TObject.cxx.

◆ DrawClone()

TObject * TObject::DrawClone ( Option_t * option = "") const
virtualinherited

Draw a clone of this object in the current selected pad with: gROOT->SetSelectedPad(c1).

If pad was not selected - gPad will be used.

Note
For histograms, use the more specialised TH1::DrawCopy().

Reimplemented in TAxis, TCanvas, TGFrame, TSystemDirectory, and TSystemFile.

Definition at line 319 of file TObject.cxx.

◆ DropBaskets()

void TTree::DropBaskets ( )
virtualinherited

Remove some baskets from memory.

Definition at line 4568 of file TTree.cxx.

◆ DropBranchFromCache() [1/2]

Int_t TTree::DropBranchFromCache ( const char * bname,
bool subbranches = false )
virtualinherited

Remove the branch with name 'bname' from the Tree cache.

If bname="*" all branches are removed from the cache. if subbranches is true all the branches of the subbranches are also removed from the cache.

Returns:

  • 0 branch dropped or not in cache
  • -1 on error

Definition at line 1169 of file TTree.cxx.

◆ DropBranchFromCache() [2/2]

Int_t TTree::DropBranchFromCache ( TBranch * b,
bool subbranches = false )
virtualinherited

Remove the branch b from the Tree cache.

if subbranches is true all the branches of the subbranches are also removed from the cache.

Returns:

  • 0 branch dropped or not in cache
  • -1 on error

Definition at line 1208 of file TTree.cxx.

◆ DropBuffers()

void TTree::DropBuffers ( Int_t nbytes)
virtualinherited

Drop branch buffers to accommodate nbytes below MaxVirtualsize.

Definition at line 4581 of file TTree.cxx.

◆ Dump()

void TObject::Dump ( ) const
virtualinherited

Dump contents of object on stdout.

Using the information in the object dictionary (class TClass) each data member is interpreted. If a data member is a pointer, the pointer value is printed

The following output is the Dump of a TArrow object:

fAngle 0 Arrow opening angle (degrees)
fArrowSize 0.2 Arrow Size
fOption.*fData
fX1 0.1 X of 1st point
fY1 0.15 Y of 1st point
fX2 0.67 X of 2nd point
fY2 0.83 Y of 2nd point
fUniqueID 0 object unique identifier
fBits 50331648 bit field status word
fFillColor 19 fill area color
fFillStyle 1001 fill area style
#define X(type, name)
Style_t fFillStyle
Fill area style.
Definition TAttFill.h:25
Color_t fFillColor
Fill area color.
Definition TAttFill.h:24
Width_t fLineWidth
Line width.
Definition TAttLine.h:26
Style_t fLineStyle
Line style.
Definition TAttLine.h:25
Color_t fLineColor
Line color.
Definition TAttLine.h:24
UInt_t fUniqueID
object unique identifier
Definition TObject.h:46
UInt_t fBits
bit field status word
Definition TObject.h:47
TLine * line
TCanvas * style()
Definition style.C:1

Reimplemented in TClass, TCollection, TGFrame, TGPack, and TSystemFile.

Definition at line 367 of file TObject.cxx.

◆ EnableCache()

bool TTree::EnableCache ( )
inherited

Enable the TTreeCache unless explicitly disabled for this TTree by a prior call to SetCacheSize(0).

If the environment variable ROOT_TTREECACHE_SIZE or the rootrc config TTreeCache.Size has been set to zero, this call will over-ride them with a value of 1.0 (i.e. use a cache size to hold 1 cluster)

Return true if there is a cache attached to the TTree (either pre-exisiting or created as part of this call)

Definition at line 2715 of file TTree.cxx.

◆ Error()

void TObject::Error ( const char * location,
const char * fmt,
... ) const
virtualinherited

Issue error message.

Use "location" to specify the method where the error occurred. Accepts standard printf formatting arguments.

Reimplemented in TFitResult.

Definition at line 1098 of file TObject.cxx.

◆ Execute() [1/2]

void TObject::Execute ( const char * method,
const char * params,
Int_t * error = nullptr )
virtualinherited

Execute method on this object with the given parameter string, e.g.

"3.14,1,\"text\"".

Reimplemented in ROOT::R::TRInterface, TCling, TContextMenu, TInterpreter, and TMethodCall.

Definition at line 378 of file TObject.cxx.

◆ Execute() [2/2]

void TObject::Execute ( TMethod * method,
TObjArray * params,
Int_t * error = nullptr )
virtualinherited

Execute method on this object with parameters stored in the TObjArray.

The TObjArray should contain an argv vector like:

argv[0] ... argv[n] = the list of TObjString parameters
Collectable string class.
Definition TObjString.h:28
const Int_t n
Definition legend1.C:16

Reimplemented in ROOT::R::TRInterface, TCling, TContextMenu, TInterpreter, and TMethodCall.

Definition at line 398 of file TObject.cxx.

◆ ExecuteEvent()

◆ Fatal()

void TObject::Fatal ( const char * location,
const char * fmt,
... ) const
virtualinherited

Issue fatal error message.

Use "location" to specify the method where the fatal error occurred. Accepts standard printf formatting arguments.

Definition at line 1126 of file TObject.cxx.

◆ Fill()

Int_t TChain::Fill ( )
inlineoverridevirtual

Fill all branches.

This function loops on all the branches of this tree. For each branch, it copies to the branch buffer (basket) the current values of the leaves data types. If a leaf is a simple data type, a simple conversion to a machine independent format has to be done.

This machine independent version of the data is copied into a basket (each branch has its own basket). When a basket is full (32k worth of data by default), it is then optionally compressed and written to disk (this operation is also called committing or 'flushing' the basket). The committed baskets are then immediately removed from memory.

The function returns the number of bytes committed to the individual branches.

If a write error occurs, the number of bytes returned is -1.

If no data are written, because, e.g., the branch is disabled, the number of bytes returned is 0.

The baskets are flushed and the Tree header saved at regular intervals

At regular intervals, when the amount of data written so far is greater than fAutoFlush (see SetAutoFlush) all the baskets are flushed to disk. This makes future reading faster as it guarantees that baskets belonging to nearby entries will be on the same disk region. When the first call to flush the baskets happen, we also take this opportunity to optimize the baskets buffers. We also check if the amount of data written is greater than fAutoSave (see SetAutoSave). In this case we also write the Tree header. This makes the Tree recoverable up to this point in case the program writing the Tree crashes. The decisions to FlushBaskets and Auto Save can be made based either on the number of bytes written (fAutoFlush and fAutoSave negative) or on the number of entries written (fAutoFlush and fAutoSave positive). Note that the user can decide to call FlushBaskets and AutoSave in her event loop base on the number of events written instead of the number of bytes written.

Note
Calling TTree::FlushBaskets too often increases the IO time.
Calling TTree::AutoSave too often increases the IO time and also the file size.
This method calls TTree::ChangeFile when the tree reaches a size greater than TTree::fgMaxTreeSize. This doesn't happen if the tree is attached to a TMemFile or derivate.

Reimplemented from TTree.

Definition at line 95 of file TChain.h.

◆ FillBuffer()

void TNamed::FillBuffer ( char *& buffer)
virtualinherited

Encode TNamed into output buffer.

Reimplemented in TDirectoryFile, TFile, TKey, TKeySQL, TKeyXML, TSQLFile, and TXMLFile.

Definition at line 103 of file TNamed.cxx.

◆ FindBranch()

TBranch * TChain::FindBranch ( const char * name)
overridevirtual

See TTree::GetReadEntry().

Reimplemented from TTree.

Definition at line 825 of file TChain.cxx.

◆ FindLeaf()

TLeaf * TChain::FindLeaf ( const char * name)
overridevirtual

See TTree::GetReadEntry().

Reimplemented from TTree.

Definition at line 859 of file TChain.cxx.

◆ FindObject() [1/2]

TObject * TObject::FindObject ( const char * name) const
virtualinherited

Must be redefined in derived classes.

This function is typically used with TCollections, but can also be used to find an object by name inside this object.

Reimplemented in RooAbsCollection, RooLinkedList, TBtree, TCollection, TDirectory, TFolder, TGeometry, TGraph2D, TGraph, TH1, THashList, THashTable, THbookFile, TList, TListOfDataMembers, TListOfEnums, TListOfEnumsWithLock, TListOfFunctions, TListOfFunctionTemplates, TListOfTypes, TMap, TObjArray, TPad, TROOT, TViewPubDataMembers, and TViewPubFunctions.

Definition at line 425 of file TObject.cxx.

◆ FindObject() [2/2]

TObject * TObject::FindObject ( const TObject * obj) const
virtualinherited

Must be redefined in derived classes.

This function is typically used with TCollections, but can also be used to find an object inside this object.

Reimplemented in RooAbsCollection, RooLinkedList, TBtree, TCollection, TDirectory, TFolder, TGeometry, TGraph2D, TGraph, TH1, THashList, THashTable, THbookFile, TList, TListOfDataMembers, TListOfEnums, TListOfEnumsWithLock, TListOfFunctions, TListOfFunctionTemplates, TListOfTypes, TMap, TObjArray, TPad, TROOT, TViewPubDataMembers, and TViewPubFunctions.

Definition at line 435 of file TObject.cxx.

◆ Fit()

Int_t TTree::Fit ( const char * funcname,
const char * varexp,
const char * selection = "",
Option_t * option = "",
Option_t * goption = "",
Long64_t nentries = kMaxEntries,
Long64_t firstentry = 0 )
virtualinherited

Fit a projected item(s) from a tree.

funcname is a TF1 function.

See TTree::Draw() for explanations of the other parameters.

By default the temporary histogram created is called htemp. If varexp contains >>hnew , the new histogram created is called hnew and it is kept in the current directory.

The function returns the number of selected entries.

Example:

tree.Fit(pol4,"sqrt(x)>>hsqrt","y>0")

will fit sqrt(x) and save the histogram as "hsqrt" in the current directory.

See also TTree::UnbinnedFit

Return status

The function returns the status of the histogram fit (see TH1::Fit) If no entries were selected, the function returns -1; (i.e. fitResult is null if the fit is OK)

Definition at line 5128 of file TTree.cxx.

◆ FlushBaskets()

Int_t TTree::FlushBaskets ( bool create_cluster = true) const
virtualinherited

Write to disk all the basket that have not yet been individually written and create an event cluster boundary (by default).

If the caller wishes to flush the baskets but not create an event cluster, then set create_cluster to false.

If ROOT has IMT-mode enabled, this will launch multiple TBB tasks in parallel via TThreadExecutor to do this operation; one per basket compression. If the caller utilizes TBB also, care must be taken to prevent deadlocks.

For example, let's say the caller holds mutex A and calls FlushBaskets; while TBB is waiting for the ROOT compression tasks to complete, it may decide to run another one of the user's tasks in this thread. If the second user task tries to acquire A, then a deadlock will occur. The example call sequence looks like this:

  • User acquires mutex A
  • User calls FlushBaskets.
  • ROOT launches N tasks and calls wait.
  • TBB schedules another user task, T2.
  • T2 tries to acquire mutex A.

At this point, the thread will deadlock: the code may function with IMT-mode disabled if the user assumed the legacy code never would run their own TBB tasks.

SO: users of TBB who want to enable IMT-mode should carefully review their locking patterns and make sure they hold no coarse-grained application locks when they invoke ROOT.

Return the number of bytes written or -1 in case of write error.

Definition at line 5178 of file TTree.cxx.

◆ FlushBasketsImpl()

Int_t TTree::FlushBasketsImpl ( ) const
privateinherited

Internal implementation of the FlushBaskets algorithm.

Unlike the public interface, this does NOT create an explicit event cluster boundary; it is up to the (internal) caller to determine whether that should done.

Otherwise, the comments for FlushBaskets applies.

Definition at line 5195 of file TTree.cxx.

◆ GetAlias()

const char * TChain::GetAlias ( const char * aliasName) const
overridevirtual

Returns the expanded value of the alias. Search in the friends if any.

Reimplemented from TTree.

Definition at line 893 of file TChain.cxx.

◆ GetAllocationCount()

UInt_t TTree::GetAllocationCount ( ) const
inlineinherited

Definition at line 490 of file TTree.h.

◆ GetAutoFlush()

virtual Long64_t TTree::GetAutoFlush ( ) const
inlinevirtualinherited

Definition at line 494 of file TTree.h.

◆ GetAutoSave()

virtual Long64_t TTree::GetAutoSave ( ) const
inlinevirtualinherited

Definition at line 495 of file TTree.h.

◆ GetBranch()

TBranch * TChain::GetBranch ( const char * name)
overridevirtual

Return pointer to the branch name in the current tree.

Reimplemented from TTree.

Definition at line 912 of file TChain.cxx.

◆ GetBranchFromFriends()

TBranch * TTree::GetBranchFromFriends ( const char * branchName)
protectedinherited

Returns a pointer to the branch with the given name, if it can be found in the list of friends of this tree.

Otherwise, returns nullptr.

Definition at line 5378 of file TTree.cxx.

◆ GetBranchFromSelf()

TBranch * TTree::GetBranchFromSelf ( const char * branchName)
protectedinherited

Returns a pointer to the branch with the given name, if it can be found in this tree.

Otherwise, returns nullptr.

Definition at line 5342 of file TTree.cxx.

◆ GetBranchRef()

virtual TBranchRef * TTree::GetBranchRef ( ) const
inlinevirtualinherited

Definition at line 497 of file TTree.h.

◆ GetBranchStatus()

bool TChain::GetBranchStatus ( const char * branchname) const
overridevirtual

See TTree::GetReadEntry().

Reimplemented from TTree.

Definition at line 927 of file TChain.cxx.

◆ GetBranchStyle()

Int_t TTree::GetBranchStyle ( )
staticinherited

Static function returning the current branch style.

  • style = 0 old Branch
  • style = 1 new Bronch

Definition at line 5471 of file TTree.cxx.

◆ GetCacheAutoSize()

Long64_t TTree::GetCacheAutoSize ( bool withDefault = false)
protectedinherited

Used for automatic sizing of the cache.

Estimates a suitable size in bytes for the tree cache based on AutoFlush. A cache sizing factor is taken from the configuration. If this yields zero and withDefault is true the historical algorithm for default size is used.

Definition at line 5483 of file TTree.cxx.

◆ GetCacheSize()

Long64_t TChain::GetCacheSize ( ) const
inlineoverridevirtual

Reimplemented from TTree.

Definition at line 100 of file TChain.h.

◆ GetChainEntryNumber()

Long64_t TChain::GetChainEntryNumber ( Long64_t entry) const
overridevirtual

Return absolute entry number in the chain.

The input parameter entry is the entry number in the current tree of this chain.

Reimplemented from TTree.

Definition at line 948 of file TChain.cxx.

◆ GetChainOffset()

virtual Long64_t TTree::GetChainOffset ( ) const
inlinevirtualinherited

Definition at line 503 of file TTree.h.

◆ GetClusterIterator()

TTree::TClusterIterator TChain::GetClusterIterator ( Long64_t firstentry)
overridevirtual

Return an iterator over the cluster of baskets starting at firstentry.

This iterator is not yet supported for TChain object.

Reimplemented from TTree.

Definition at line 937 of file TChain.cxx.

◆ GetClusterPrefetch()

virtual bool TTree::GetClusterPrefetch ( ) const
inlinevirtualinherited

Definition at line 504 of file TTree.h.

◆ GetCurrentFile()

TFile * TTree::GetCurrentFile ( ) const
inherited

Return pointer to the current file.

Definition at line 5555 of file TTree.cxx.

◆ GetDebugMax()

Long64_t TTree::GetDebugMax ( ) const
inlineinherited

Definition at line 507 of file TTree.h.

◆ GetDebugMin()

Long64_t TTree::GetDebugMin ( ) const
inlineinherited

Definition at line 508 of file TTree.h.

◆ GetDefaultEntryOffsetLen()

Int_t TTree::GetDefaultEntryOffsetLen ( ) const
inlineinherited

Definition at line 506 of file TTree.h.

◆ GetDirectory()

TDirectory * TTree::GetDirectory ( ) const
inlineinherited

Definition at line 509 of file TTree.h.

◆ GetDrawOption()

Option_t * TObject::GetDrawOption ( ) const
virtualinherited

Get option used by the graphics system to draw this object.

Note that before calling object.GetDrawOption(), you must have called object.Draw(..) before in the current pad.

Reimplemented in TBrowser, TFitEditor, TGedFrame, TGFileBrowser, TRootBrowser, and TRootBrowserLite.

Definition at line 445 of file TObject.cxx.

◆ GetDtorOnly()

Longptr_t TObject::GetDtorOnly ( )
staticinherited

Return destructor only flag.

Definition at line 1196 of file TObject.cxx.

◆ GetEntries() [1/2]

Long64_t TChain::GetEntries ( ) const
overridevirtual

Return the total number of entries in the chain.

In case the number of entries in each tree is not yet known, the offset table is computed.

Reimplemented from TTree.

Definition at line 958 of file TChain.cxx.

◆ GetEntries() [2/2]

Long64_t TChain::GetEntries ( const char * selection)
inlineoverridevirtual

Return the number of entries matching the selection.

Return -1 in case of errors.

If the selection uses any arrays or containers, we return the number of entries where at least one element match the selection. GetEntries is implemented using the selector class TSelectorEntries, which can be used directly (see code in TTreePlayer::GetEntries) for additional option. If SetEventList was used on the TTree or TChain, only that subset of entries will be considered.

Reimplemented from TTree.

Definition at line 105 of file TChain.h.

◆ GetEntriesFast()

virtual Long64_t TTree::GetEntriesFast ( ) const
inlinevirtualinherited

Return a number greater or equal to the total number of entries in the dataset.

Note
If you are interested in the total number of entries in a TChain, this function will give that number once the last file of the chain is opened. In general, using this instead of GetEntries will avoid opening all files in the chain which could be very costly for very large number of files stored at a remote location.

The logic depends on whether the dataset is a TTree or a TChain. In the first case, it simply returns the total number of entries in the tree. In the latter case, it depends on which point of the processing of the chain this function is called. During most of the chain processing, this function will return TTree::kMaxEntries. When the chain arrives at the last file, then the function will return the accumulated total number of entries in the whole chain. A notable use case where this function becomes quite useful is when writing the following for loop to traverse the entries in the dataset:

for(Long64_t ievent = 0; ievent < dataset.GetEntriesFast(); ievent++) {
// Do something with the event in the dataset
}
long long Long64_t
Portable signed long integer 8 bytes.
Definition RtypesCore.h:83

In the example above, independently on whether the dataset is a TTree or a TChain, the GetEntriesFast call will provide the correct stopping condition for the loop (i.e. the total number of entries). In the TChain case, calling GetEntries instead would open all the files in the chain upfront which could be costly.

The functionality offered by this method can also be seen when used in conjunction with LoadTree. For a call like LoadTree(ievent) , the condition ievent < dataset.GetEntriesFast() is only satisfied if ievent is strictly smaller than the total number of entries in the dataset. In fact, even when the dataset is a TChain, the first time LoadTree is called with an entry number that belongs to the last file of the chain, this will update the internal data member of the class so that the next call to GetEntriesFast returns the total number of entries in the dataset.

Reimplemented in TTreeSQL.

Definition at line 552 of file TTree.h.

◆ GetEntriesFriend()

Long64_t TTree::GetEntriesFriend ( ) const
virtualinherited

Returns a number corresponding to:

  • The number of entries in this tree, if greater than zero
  • The number of entries in the first friend tree, if there are any friends
  • 0 otherwise

Definition at line 5590 of file TTree.cxx.

◆ GetEntry()

Int_t TChain::GetEntry ( Long64_t entry = 0,
Int_t getall = 0 )
overridevirtual

Get entry from the file to memory.

  • getall = 0 : get only active branches
  • getall = 1 : get all branches

Return the total number of bytes read, 0 bytes read indicates a failure.

Reimplemented from TTree.

Definition at line 996 of file TChain.cxx.

◆ GetEntryList()

TEntryList * TTree::GetEntryList ( )
virtualinherited

Returns the entry list assigned to this tree.

Definition at line 5934 of file TTree.cxx.

◆ GetEntryNumber()

Long64_t TChain::GetEntryNumber ( Long64_t entry) const
overridevirtual

Return entry number corresponding to entry.

if no TEntryList set returns entry else returns entry #entry from this entry list and also computes the global entry number (loads all tree headers)

Reimplemented from TTree.

Definition at line 1015 of file TChain.cxx.

◆ GetEntryNumberWithBestIndex()

Long64_t TTree::GetEntryNumberWithBestIndex ( Long64_t major,
Long64_t minor = 0 ) const
virtualinherited

Return entry number corresponding to major and minor number.

Note that this function returns only the entry number, not the data To read the data corresponding to an entry number, use TTree::GetEntryWithIndex the BuildIndex function has created a table of Long64_t* of sorted values corresponding to val = major<<31 + minor; The function performs binary search in this sorted table. If it finds a pair that matches val, it returns directly the index in the table. If an entry corresponding to major and minor is not found, the function returns the index of the major,minor pair immediately lower than the requested value, ie it will return -1 if the pair is lower than the first entry in the index.

See also GetEntryNumberWithIndex

Definition at line 5970 of file TTree.cxx.

◆ GetEntryNumberWithIndex()

Long64_t TTree::GetEntryNumberWithIndex ( Long64_t major,
Long64_t minor = 0 ) const
virtualinherited

Return entry number corresponding to major and minor number.

Note that this function returns only the entry number, not the data To read the data corresponding to an entry number, use TTree::GetEntryWithIndex the BuildIndex function has created a table of Long64_t* of sorted values corresponding to val = major<<31 + minor; The function performs binary search in this sorted table. If it finds a pair that matches val, it returns directly the index in the table, otherwise it returns -1.

See also GetEntryNumberWithBestIndex

Definition at line 5990 of file TTree.cxx.

◆ GetEntryWithIndex()

Int_t TChain::GetEntryWithIndex ( Long64_t major,
Long64_t minor = 0 )
overridevirtual

Return entry corresponding to major and minor number.

The function returns the total number of bytes read; -1 if entry not found. If the Tree has friend trees, the corresponding entry with the index values (major,minor) is read. Note that the master Tree and its friend may have different entry serial numbers corresponding to (major,minor).

Note
See TTreeIndex::GetEntryNumberWithIndex for information about the maximum values accepted for major and minor

Reimplemented from TTree.

Definition at line 1049 of file TChain.cxx.

◆ GetEstimate()

virtual Long64_t TTree::GetEstimate ( ) const
inlinevirtualinherited

Definition at line 554 of file TTree.h.

◆ GetEvent()

Int_t TTree::GetEvent ( Long64_t entry,
Int_t getall = 0 )
inlineinherited

Definition at line 556 of file TTree.h.

◆ GetEventList()

TEventList * TTree::GetEventList ( ) const
inlineinherited

Definition at line 560 of file TTree.h.

◆ GetFile()

TFile * TChain::GetFile ( ) const

Return a pointer to the current file.

If no file is connected, the first file is automatically loaded.

Definition at line 1060 of file TChain.cxx.

◆ GetFileNumber()

virtual Int_t TTree::GetFileNumber ( ) const
inlinevirtualinherited

Definition at line 563 of file TTree.h.

◆ GetFillColor()

virtual Color_t TAttFill::GetFillColor ( ) const
inlinevirtualinherited

Return the fill area color.

Reimplemented in TGraphMultiErrors, TGWin32, TGWin32VirtualXProxy, and TGX11.

Definition at line 32 of file TAttFill.h.

◆ GetFillStyle()

virtual Style_t TAttFill::GetFillStyle ( ) const
inlinevirtualinherited

Return the fill area style.

Reimplemented in TGraphMultiErrors, TGWin32, TGWin32VirtualXProxy, and TGX11.

Definition at line 33 of file TAttFill.h.

◆ GetFriend()

TTree * TTree::GetFriend ( const char * friendname) const
virtualinherited

Return a pointer to the TTree friend whose name or alias is friendname.

Definition at line 6056 of file TTree.cxx.

◆ GetFriendAlias()

const char * TTree::GetFriendAlias ( TTree * tree) const
virtualinherited

If the 'tree' is a friend, this method returns its alias name.

This alias is an alternate name for the tree.

It can be used in conjunction with a branch or leaf name in a TTreeFormula, to specify in which particular tree the branch or leaf can be found if the friend trees have branches or leaves with the same name as the master tree.

It can also be used in conjunction with an alias created using TTree::SetAlias in a TTreeFormula, e.g.:

maintree->Draw("treealias.fPx - treealias.myAlias");

where fPx is a branch of the friend tree aliased as 'treealias' and 'myAlias' was created using TTree::SetAlias on the friend tree.

However, note that 'treealias.myAlias' will be expanded literally, without remembering that it comes from the aliased friend and thus the branch name might not be disambiguated properly, which means that you may not be able to take advantage of this feature.

Definition at line 6113 of file TTree.cxx.

◆ GetHistogram()

TH1 * TTree::GetHistogram ( )
inlineinherited

Definition at line 566 of file TTree.h.

◆ GetIconName()

const char * TObject::GetIconName ( ) const
virtualinherited

Returns mime type name of object.

Used by the TBrowser (via TGMimeTypes class). Override for class of which you would like to have different icons for objects of the same class.

Reimplemented in ROOT::Experimental::XRooFit::xRooNode, TASImage, TBranch, TBranchElement, TGeoVolume, TGMainFrame, TKey, TMethodBrowsable, TSystemFile, and TVirtualBranchBrowsable.

Definition at line 472 of file TObject.cxx.

◆ GetImplicitMT()

virtual bool TTree::GetImplicitMT ( )
inlinevirtualinherited

Definition at line 567 of file TTree.h.

◆ GetIndex()

virtual Int_t * TTree::GetIndex ( )
inlinevirtualinherited

Definition at line 568 of file TTree.h.

◆ GetIndexValues()

virtual Double_t * TTree::GetIndexValues ( )
inlinevirtualinherited

Definition at line 569 of file TTree.h.

◆ GetIOFeatures()

ROOT::TIOFeatures TTree::GetIOFeatures ( ) const
inherited

Returns the current set of IO settings.

Definition at line 6185 of file TTree.cxx.

◆ GetIteratorOnAllLeaves()

TIterator * TTree::GetIteratorOnAllLeaves ( bool dir = kIterForward)
virtualinherited

Creates a new iterator that will go through all the leaves on the tree itself and its friend.

Definition at line 6193 of file TTree.cxx.

◆ GetLeaf() [1/2]

TLeaf * TChain::GetLeaf ( const char * branchname,
const char * leafname )
overridevirtual

Return a pointer to the leaf name in the current tree.

Reimplemented from TTree.

Definition at line 1073 of file TChain.cxx.

◆ GetLeaf() [2/2]

TLeaf * TChain::GetLeaf ( const char * name)
overridevirtual

Return a pointer to the leaf name in the current tree.

Reimplemented from TTree.

Definition at line 1088 of file TChain.cxx.

◆ GetLeafImpl()

TLeaf * TTree::GetLeafImpl ( const char * branchname,
const char * leafname )
protectedvirtualinherited

Return pointer to the 1st Leaf named name in any Branch of this Tree or any branch in the list of friend trees.

The leaf name can contain the name of a friend tree with the syntax: friend_dir_and_tree.full_leaf_name the friend_dir_and_tree can be of the form:

TDirectoryName/TreeName

Definition at line 6209 of file TTree.cxx.

◆ GetLineColor()

virtual Color_t TAttLine::GetLineColor ( ) const
inlinevirtualinherited

Return the line color.

Reimplemented in TGraphMultiErrors, and TGWin32VirtualXProxy.

Definition at line 36 of file TAttLine.h.

◆ GetLineStyle()

virtual Style_t TAttLine::GetLineStyle ( ) const
inlinevirtualinherited

Return the line style.

Reimplemented in TGraphMultiErrors, TGWin32, TGWin32VirtualXProxy, and TGX11.

Definition at line 37 of file TAttLine.h.

◆ GetLineWidth()

virtual Width_t TAttLine::GetLineWidth ( ) const
inlinevirtualinherited

Return the line width.

Reimplemented in TGraphMultiErrors, TGWin32, TGWin32VirtualXProxy, and TGX11.

Definition at line 38 of file TAttLine.h.

◆ GetListOfAliases()

virtual TList * TTree::GetListOfAliases ( ) const
inlinevirtualinherited

Definition at line 578 of file TTree.h.

◆ GetListOfBranches()

TObjArray * TChain::GetListOfBranches ( )
overridevirtual

Return a pointer to the list of branches of the current tree.

Warning: If there is no current TTree yet, this routine will open the first in the chain.

Returns 0 on failure.

Reimplemented from TTree.

Definition at line 1108 of file TChain.cxx.

◆ GetListOfClones()

virtual TList * TTree::GetListOfClones ( )
inlinevirtualinherited

Definition at line 574 of file TTree.h.

◆ GetListOfFiles()

TObjArray * TChain::GetListOfFiles ( ) const
inline

Definition at line 115 of file TChain.h.

◆ GetListOfFriends()

virtual TList * TTree::GetListOfFriends ( ) const
inlinevirtualinherited

Definition at line 577 of file TTree.h.

◆ GetListOfLeaves()

TObjArray * TChain::GetListOfLeaves ( )
overridevirtual

Return a pointer to the list of leaves of the current tree.

Warning: May set the current tree!

Reimplemented from TTree.

Definition at line 1125 of file TChain.cxx.

◆ GetMakeClass()

Int_t TTree::GetMakeClass ( ) const
inlineinherited

Definition at line 582 of file TTree.h.

◆ GetMarkerColor()

virtual Color_t TAttMarker::GetMarkerColor ( ) const
inlinevirtualinherited

Return the marker color.

Reimplemented in TGWin32VirtualXProxy.

Definition at line 33 of file TAttMarker.h.

◆ GetMarkerLineWidth()

Width_t TAttMarker::GetMarkerLineWidth ( Style_t style)
staticinherited

◆ GetMarkerSize()

virtual Size_t TAttMarker::GetMarkerSize ( ) const
inlinevirtualinherited

Return the marker size.

Reimplemented in TGWin32VirtualXProxy.

Definition at line 35 of file TAttMarker.h.

◆ GetMarkerStyle()

virtual Style_t TAttMarker::GetMarkerStyle ( ) const
inlinevirtualinherited

Return the marker style.

Reimplemented in TGWin32VirtualXProxy.

Definition at line 34 of file TAttMarker.h.

◆ GetMarkerStyleBase()

Style_t TAttMarker::GetMarkerStyleBase ( Style_t style)
staticinherited

◆ GetMaxEntryLoop()

virtual Long64_t TTree::GetMaxEntryLoop ( ) const
inlinevirtualinherited

Definition at line 584 of file TTree.h.

◆ GetMaximum()

Double_t TChain::GetMaximum ( const char * columname)
overridevirtual

Return maximum of column with name columname.

Reimplemented from TTree.

Definition at line 1140 of file TChain.cxx.

◆ GetMaxTreeSize()

Long64_t TTree::GetMaxTreeSize ( )
staticinherited

Static function which returns the tree file size limit in bytes.

Definition at line 6376 of file TTree.cxx.

◆ GetMaxVirtualSize()

virtual Long64_t TTree::GetMaxVirtualSize ( ) const
inlinevirtualinherited

Definition at line 587 of file TTree.h.

◆ GetMedianClusterSize()

Long64_t TTree::GetMedianClusterSize ( )
privateinherited

Estimate the median cluster size for the TTree.

This value provides e.g. a reasonable cache size default if other heuristics fail. Clusters with size 0 and the very last cluster range, that might not have been committed to fClusterSize yet, are ignored for the purposes of the calculation.

Definition at line 8504 of file TTree.cxx.

◆ GetMinimum()

Double_t TChain::GetMinimum ( const char * columname)
overridevirtual

Return minimum of column with name columname.

Reimplemented from TTree.

Definition at line 1175 of file TChain.cxx.

◆ GetName()

const char * TNamed::GetName ( ) const
inlineoverridevirtualinherited

Returns name of object.

This default method returns the class name. Classes that give objects a name should override this method.

Reimplemented from TObject.

Definition at line 49 of file TNamed.h.

◆ GetNbranches()

Int_t TChain::GetNbranches ( )
overridevirtual

Return the number of branches of the current tree.

Warning: May set the current tree!

Reimplemented from TTree.

Definition at line 1212 of file TChain.cxx.

◆ GetNewlineValue()

char TTree::GetNewlineValue ( std::istream & inputStream)
protectedinherited

Determine which newline this file is using.

Return '\r' for Windows '\r\n' as that already terminates.

Definition at line 7781 of file TTree.cxx.

◆ GetNotify()

TObject * TTree::GetNotify ( ) const
inlineinherited

Definition at line 590 of file TTree.h.

◆ GetNtrees()

Int_t TChain::GetNtrees ( ) const
inline

Definition at line 103 of file TChain.h.

◆ GetObjectInfo()

char * TObject::GetObjectInfo ( Int_t px,
Int_t py ) const
virtualinherited

Returns string containing info about the object at position (px,py).

This method is typically overridden by classes of which the objects can report peculiarities for different positions. Returned string will be re-used (lock in MT environment).

Reimplemented in TASImage, TAxis3D, TColorWheel, TF1, TF2, TFileDrawMap, TGeoNode, TGeoTrack, TGeoVolume, TGL5DDataSet, TGLHistPainter, TGLParametricEquation, TGLTH3Composition, TGraph, TH1, THistPainter, TNode, TPaletteAxis, TParallelCoordVar, and TVirtualHistPainter.

Definition at line 491 of file TObject.cxx.

◆ GetObjectStat()

Bool_t TObject::GetObjectStat ( )
staticinherited

Get status of object stat flag.

Definition at line 1181 of file TObject.cxx.

◆ GetOption()

virtual Option_t * TObject::GetOption ( ) const
inlinevirtualinherited

◆ GetPacketSize()

virtual Int_t TTree::GetPacketSize ( ) const
inlinevirtualinherited

Definition at line 592 of file TTree.h.

◆ GetPerfStats()

virtual TVirtualPerfStats * TTree::GetPerfStats ( ) const
inlinevirtualinherited

Definition at line 593 of file TTree.h.

◆ GetPlayer()

TVirtualTreePlayer * TTree::GetPlayer ( )
inherited

Load the TTreePlayer (if not already done).

Definition at line 6416 of file TTree.cxx.

◆ GetReadCache() [1/2]

TTreeCache * TTree::GetReadCache ( TFile * file) const
inherited

Find and return the TTreeCache registered with the file and which may contain branches for us.

Definition at line 6429 of file TTree.cxx.

◆ GetReadCache() [2/2]

TTreeCache * TTree::GetReadCache ( TFile * file,
bool create )
inherited

Find and return the TTreeCache registered with the file and which may contain branches for us.

If create is true and there is no cache a new cache is created with default size.

Definition at line 6442 of file TTree.cxx.

◆ GetReadEntry()

Long64_t TChain::GetReadEntry ( ) const
overridevirtual

See TTree::GetReadEntry().

Reimplemented from TTree.

Definition at line 1227 of file TChain.cxx.

◆ GetReadEvent()

virtual Long64_t TTree::GetReadEvent ( ) const
inlinevirtualinherited

Definition at line 597 of file TTree.h.

◆ GetScanField()

virtual Int_t TTree::GetScanField ( ) const
inlinevirtualinherited

Definition at line 598 of file TTree.h.

◆ GetSelect()

TTreeFormula * TTree::GetSelect ( )
inlineinherited

Definition at line 599 of file TTree.h.

◆ GetSelectedRows()

virtual Long64_t TTree::GetSelectedRows ( )
inlinevirtualinherited

Definition at line 600 of file TTree.h.

◆ GetStatus()

TList * TChain::GetStatus ( ) const
inline

Definition at line 122 of file TChain.h.

◆ GetTargetMemoryRatio()

Float_t TTree::GetTargetMemoryRatio ( ) const
inlineinherited

Definition at line 607 of file TTree.h.

◆ GetTimerInterval()

virtual Int_t TTree::GetTimerInterval ( ) const
inlinevirtualinherited

Definition at line 601 of file TTree.h.

◆ GetTitle()

const char * TNamed::GetTitle ( ) const
inlineoverridevirtualinherited

Returns title of object.

This default method returns the class title (i.e. description). Classes that give objects a title should override this method.

Reimplemented from TObject.

Definition at line 50 of file TNamed.h.

◆ GetTotBytes()

virtual Long64_t TTree::GetTotBytes ( ) const
inlinevirtualinherited

Definition at line 603 of file TTree.h.

◆ GetTransientBuffer()

TBuffer * TTree::GetTransientBuffer ( Int_t size)
inherited

Returns the transient buffer currently used by this TTree for reading/writing baskets.

Definition at line 1064 of file TTree.cxx.

◆ GetTree()

TTree * TChain::GetTree ( ) const
inlineoverridevirtual

Reimplemented from TTree.

Definition at line 123 of file TChain.h.

◆ GetTreeIndex()

virtual TVirtualIndex * TTree::GetTreeIndex ( ) const
inlinevirtualinherited

Definition at line 605 of file TTree.h.

◆ GetTreeNumber()

Int_t TChain::GetTreeNumber ( ) const
inlineoverridevirtual

Reimplemented from TTree.

Definition at line 124 of file TChain.h.

◆ GetTreeOffset()

Long64_t * TChain::GetTreeOffset ( ) const
inline

Definition at line 125 of file TChain.h.

◆ GetTreeOffsetLen()

Int_t TChain::GetTreeOffsetLen ( ) const
inline

Definition at line 126 of file TChain.h.

◆ GetUniqueID()

UInt_t TObject::GetUniqueID ( ) const
virtualinherited

Return the unique object id.

Definition at line 480 of file TObject.cxx.

◆ GetUpdate()

virtual Int_t TTree::GetUpdate ( ) const
inlinevirtualinherited

Definition at line 608 of file TTree.h.

◆ GetUserInfo()

TList * TTree::GetUserInfo ( )
virtualinherited

Return a pointer to the list containing user objects associated to this tree.

The list is automatically created if it does not exist.

WARNING: By default the TTree destructor will delete all objects added to this list. If you do not want these objects to be deleted, call:

mytree->GetUserInfo()->Clear();

before deleting the tree.

Definition at line 6467 of file TTree.cxx.

◆ GetV1()

virtual Double_t * TTree::GetV1 ( )
inlinevirtualinherited

Definition at line 623 of file TTree.h.

◆ GetV2()

virtual Double_t * TTree::GetV2 ( )
inlinevirtualinherited

Definition at line 625 of file TTree.h.

◆ GetV3()

virtual Double_t * TTree::GetV3 ( )
inlinevirtualinherited

Definition at line 627 of file TTree.h.

◆ GetV4()

virtual Double_t * TTree::GetV4 ( )
inlinevirtualinherited

Definition at line 629 of file TTree.h.

◆ GetVal()

virtual Double_t * TTree::GetVal ( Int_t i)
inlinevirtualinherited

Definition at line 621 of file TTree.h.

◆ GetVar()

TTreeFormula * TTree::GetVar ( Int_t i)
inlineinherited

Definition at line 611 of file TTree.h.

◆ GetVar1()

TTreeFormula * TTree::GetVar1 ( )
inlineinherited

Definition at line 613 of file TTree.h.

◆ GetVar2()

TTreeFormula * TTree::GetVar2 ( )
inlineinherited

Definition at line 615 of file TTree.h.

◆ GetVar3()

TTreeFormula * TTree::GetVar3 ( )
inlineinherited

Definition at line 617 of file TTree.h.

◆ GetVar4()

TTreeFormula * TTree::GetVar4 ( )
inlineinherited

Definition at line 619 of file TTree.h.

◆ GetW()

virtual Double_t * TTree::GetW ( )
inlinevirtualinherited

Definition at line 630 of file TTree.h.

◆ GetWeight()

Double_t TChain::GetWeight ( ) const
overridevirtual

Return the chain weight.

By default the weight is the weight of the current tree. However, if the weight has been set in TChain::SetWeight() with the option "global", then that weight will be returned.

Warning: May set the current tree!

Reimplemented from TTree.

Definition at line 1241 of file TChain.cxx.

◆ GetZipBytes()

virtual Long64_t TTree::GetZipBytes ( ) const
inlinevirtualinherited

Definition at line 632 of file TTree.h.

◆ HandleTimer()

Bool_t TObject::HandleTimer ( TTimer * timer)
virtualinherited

Execute action in response of a timer timing out.

This method must be overridden if an object has to react to timers.

Reimplemented in TGCommandPlugin, TGDNDManager, TGFileContainer, TGHtml, TGLEventHandler, TGPopupMenu, TGraphTime, TGScrollBar, TGShutter, TGTextEdit, TGTextEditor, TGTextEntry, TGTextView, TGToolTip, TGuiBldDragManager, TGWindow, and TTreeViewer.

Definition at line 516 of file TObject.cxx.

◆ Hash()

ULong_t TNamed::Hash ( ) const
inlineoverridevirtualinherited

Return hash value for this object.

Note: If this routine is overloaded in a derived class, this derived class should also add

void CallRecursiveRemoveIfNeeded(TObject &obj)
call RecursiveRemove for obj if gROOT is valid and obj.TestBit(kMustCleanup) is true.
Definition TROOT.h:406

Otherwise, when RecursiveRemove is called (by ~TObject or example) for this type of object, the transversal of THashList and THashTable containers will will have to be done without call Hash (and hence be linear rather than logarithmic complexity). You will also see warnings like

Error in <ROOT::Internal::TCheckHashRecursiveRemoveConsistency::CheckRecursiveRemove>: The class SomeName overrides
TObject::Hash but does not call TROOT::RecursiveRemove in its destructor.
ULong_t Hash() const override
Return hash value for this object.
Definition TNamed.h:51
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition TObject.cxx:1098
void RecursiveRemove(TObject *obj) override
Recursively remove this object from the list of Cleanups.
Definition TROOT.cxx:2651

Reimplemented from TObject.

Definition at line 51 of file TNamed.h.

◆ HasInconsistentHash()

Bool_t TObject::HasInconsistentHash ( ) const
inlineinherited

Return true is the type of this object is known to have an inconsistent setup for Hash and RecursiveRemove (i.e.

missing call to RecursiveRemove in destructor).

Note: Since the consistency is only tested for during inserts, this routine will return true for object that have never been inserted whether or not they have a consistent setup. This has no negative side-effect as searching for the object with the right or wrong Hash will always yield a not-found answer (Since anyway no hash can be guaranteed unique, there is always a check)

Definition at line 366 of file TObject.h.

◆ ImportClusterRanges()

void TTree::ImportClusterRanges ( TTree * fromtree)
protectedinherited

Appends the cluster range information stored in 'fromtree' to this tree, including the value of fAutoFlush.

This is used when doing a fast cloning (by TTreeCloner). See also fAutoFlush and fAutoSave if needed.

Definition at line 6483 of file TTree.cxx.

◆ IncrementTotalBuffers()

virtual void TTree::IncrementTotalBuffers ( Int_t nbytes)
inlinevirtualinherited

Definition at line 633 of file TTree.h.

◆ Info()

void TObject::Info ( const char * location,
const char * fmt,
... ) const
virtualinherited

Issue info message.

Use "location" to specify the method where the warning occurred. Accepts standard printf formatting arguments.

Definition at line 1072 of file TObject.cxx.

◆ InheritsFrom() [1/2]

Bool_t TObject::InheritsFrom ( const char * classname) const
virtualinherited

Returns kTRUE if object inherits from class "classname".

Reimplemented in TClass.

Definition at line 549 of file TObject.cxx.

◆ InheritsFrom() [2/2]

Bool_t TObject::InheritsFrom ( const TClass * cl) const
virtualinherited

Returns kTRUE if object inherits from TClass cl.

Reimplemented in TClass.

Definition at line 557 of file TObject.cxx.

◆ InitializeBranchLists()

void TTree::InitializeBranchLists ( bool checkLeafCount)
privateinherited

Divides the top-level branches into two vectors: (i) branches to be processed sequentially and (ii) branches to be processed in parallel.

Even if IMT is on, some branches might need to be processed first and in a sequential fashion: in the parallelization of GetEntry, those are the branches that store the size of another branch for every entry (e.g. the size of an array branch). If such branches were processed in parallel with the rest, there could be two threads invoking TBranch::GetEntry on one of them at the same time, since a branch that depends on a size (or count) branch will also invoke GetEntry on the latter. This method can be invoked several times during the event loop if the TTree is being written, for example when adding new branches. In these cases, the checkLeafCount parameter is false.

Parameters
[in]checkLeafCountTrue if we need to check whether some branches are count leaves.

Definition at line 5861 of file TTree.cxx.

◆ InPlaceClone()

bool TChain::InPlaceClone ( TDirectory * newdirectory,
const char * options = "" )
overridevirtual

Move content to a new file. (NOT IMPLEMENTED for TChain).

Reimplemented from TTree.

Definition at line 1259 of file TChain.cxx.

◆ Inspect()

void TObject::Inspect ( ) const
virtualinherited

Dump contents of this object in a graphics canvas.

Same action as Dump but in a graphical form. In addition pointers to other objects can be followed.

The following picture is the Inspect of a histogram object:

Reimplemented in ROOT::Experimental::XRooFit::xRooNode, TGFrame, TInspectorObject, and TSystemFile.

Definition at line 570 of file TObject.cxx.

◆ InvalidateCurrentTree()

void TChain::InvalidateCurrentTree ( )
protected

Set the TTree to be reloaded as soon as possible.

In particular this is needed when adding a Friend.

If the tree has clones, copy them into the chain clone list so we can change their branch addresses when necessary.

This is to support the syntax:

TTree* clone = chain->GetTree()->CloneTree(0);

Definition at line 1278 of file TChain.cxx.

◆ InvertBit()

void TObject::InvertBit ( UInt_t f)
inlineinherited

Definition at line 206 of file TObject.h.

◆ IsA()

TClass * TChain::IsA ( ) const
inlineoverridevirtual
Returns
TClass describing current object

Reimplemented from TObject.

Definition at line 175 of file TChain.h.

◆ IsDestructed()

Bool_t TObject::IsDestructed ( ) const
inlineinherited

IsDestructed.

Note
This function must be non-virtual as it can be used on destructed (but not yet modified) memory. This is used for example in TClonesArray to record the element that have been destructed but not deleted and thus are ready for re-use (by operator new with placement).
Returns
true if this object's destructor has been run.

Definition at line 186 of file TObject.h.

◆ IsEqual()

Bool_t TObject::IsEqual ( const TObject * obj) const
virtualinherited

Default equal comparison (objects are equal if they have the same address in memory).

More complicated classes might want to override this function.

Reimplemented in TGObject, TObjString, TPair, and TQCommand.

Definition at line 589 of file TObject.cxx.

◆ IsFolder()

bool TTree::IsFolder ( ) const
inlineoverridevirtualinherited

Returns kTRUE in case object contains browsable objects (like containers or lists of other objects).

Reimplemented from TObject.

Definition at line 634 of file TTree.h.

◆ IsOnHeap()

Bool_t TObject::IsOnHeap ( ) const
inlineinherited

Definition at line 160 of file TObject.h.

◆ IsSortable()

Bool_t TNamed::IsSortable ( ) const
inlineoverridevirtualinherited

Reimplemented from TObject.

Reimplemented in TStructNodeProperty.

Definition at line 52 of file TNamed.h.

◆ IsTransparent()

Bool_t TAttFill::IsTransparent ( ) const
inlinevirtualinherited

Reimplemented in TGWin32VirtualXProxy.

Definition at line 49 of file TAttFill.h.

◆ IsZombie()

Bool_t TObject::IsZombie ( ) const
inlineinherited

Definition at line 161 of file TObject.h.

◆ KeepCircular()

void TTree::KeepCircular ( )
protectedvirtualinherited

Keep a maximum of fMaxEntries in memory.

Definition at line 6526 of file TTree.cxx.

◆ LoadBaskets()

Int_t TChain::LoadBaskets ( Long64_t maxmemory)
overridevirtual

Dummy function.

It could be implemented and load all baskets of all trees in the chain. For the time being use TChain::Merge and TTree::LoadBasket on the resulting tree.

Reimplemented from TTree.

Definition at line 1296 of file TChain.cxx.

◆ LoadTree()

Long64_t TChain::LoadTree ( Long64_t entry)
overridevirtual

Find the tree which contains entry, and set it as the current tree.

Returns the entry number in that tree.

The input argument entry is the entry serial number in the whole chain.

In case of error, LoadTree returns a negative number:

  • -1: The chain is empty.
  • -2: The requested entry number is less than zero or too large for the chain.
  • -3: The file corresponding to the entry could not be correctly opened
  • -4: The TChainElement corresponding to the entry is missing or the TTree is missing from the file.
  • -5: Internal error, please report the circumstance when this happen as a ROOT issue.
  • -6: An error occurred within the notify callback.

Calls fNotify->Notify() (if fNotify is not null) when starting the processing of a new sub-tree. See TNotifyLink for more information on the notification mechanism.

Note
This is the only routine which sets the value of fTree to a non-zero pointer.

Reimplemented from TTree.

Definition at line 1416 of file TChain.cxx.

◆ LoadTreeFriend()

Long64_t TTree::LoadTreeFriend ( Long64_t entry,
TTree * masterTree )
virtualinherited

Load entry on behalf of our master tree, we may use an index.

Called by LoadTree() when the masterTree looks for the entry number in a friend tree (us) corresponding to the passed entry number in the masterTree.

If we have no index, our entry number and the masterTree entry number are the same.

If we do have an index, we must find the (major, minor) value pair in masterTree to locate our corresponding entry.

Definition at line 6676 of file TTree.cxx.

◆ Lookup()

void TChain::Lookup ( bool force = false)

Check / locate the files in the chain.

By default only the files not yet looked up are checked. Use force = true to check / re-check every file.

Definition at line 1808 of file TChain.cxx.

◆ ls()

void TChain::ls ( Option_t * option = "") const
overridevirtual

List the chain.

Reimplemented from TObject.

Definition at line 1878 of file TChain.cxx.

◆ MakeClass()

Int_t TTree::MakeClass ( const char * classname = nullptr,
Option_t * option = "" )
virtualinherited

Generate a skeleton analysis class for this tree.

The following files are produced: classname.h and classname.C. If classname is 0, classname will be called "nameoftree".

The generated code in classname.h includes the following:

  • Identification of the original tree and the input file name.
  • Definition of an analysis class (data members and member functions).
  • The following member functions:
    • constructor (by default opening the tree file),
    • GetEntry(Long64_t entry),
    • Init(TTree* tree) to initialize a new TTree,
    • Show(Long64_t entry) to read and dump entry.

The generated code in classname.C includes only the main analysis function Loop.

To use this function:

  • Open your tree file (eg: TFile f("myfile.root");)
  • T->MakeClass("MyClass");

where T is the name of the TTree in file myfile.root, and MyClass.h, MyClass.C the name of the files created by this function. In a ROOT session, you can do:

root > .L MyClass.C
root > MyClass* t = new MyClass;
root > t->GetEntry(12); // Fill data members of t with entry number 12.
root > t->Show(); // Show values of entry 12.
root > t->Show(16); // Read and show values of entry 16.
root > t->Loop(); // Loop on all entries.

NOTE: Do not use the code generated for a single TTree which is part of a TChain to process that entire TChain. The maximum dimensions calculated for arrays on the basis of a single TTree from the TChain might be (will be!) too small when processing all of the TTrees in the TChain. You must use myChain.MakeClass() to generate the code, not myTree.MakeClass(...).

Definition at line 6726 of file TTree.cxx.

◆ MakeCode()

Int_t TTree::MakeCode ( const char * filename = nullptr)
virtualinherited

Generate a skeleton function for this tree.

The function code is written on filename. If filename is 0, filename will be called nameoftree.C

The generated code includes the following:

  • Identification of the original Tree and Input file name,
  • Opening the Tree file,
  • Declaration of Tree variables,
  • Setting of branches addresses,
  • A skeleton for the entry loop.

To use this function:

  • Open your Tree file (eg: TFile f("myfile.root");)
  • T->MakeCode("MyAnalysis.C");

where T is the name of the TTree in file myfile.root and MyAnalysis.C the name of the file created by this function.

NOTE: Since the implementation of this function, a new and better function TTree::MakeClass() has been developed.

Definition at line 6759 of file TTree.cxx.

◆ MakeProxy()

Int_t TTree::MakeProxy ( const char * proxyClassname,
const char * macrofilename = nullptr,
const char * cutfilename = nullptr,
const char * option = nullptr,
Int_t maxUnrolling = 3 )
virtualinherited

Generate a skeleton analysis class for this Tree using TBranchProxy.

TBranchProxy is the base of a class hierarchy implementing an indirect access to the content of the branches of a TTree.

"proxyClassname" is expected to be of the form:

[path/]fileprefix

The skeleton will then be generated in the file:

fileprefix.h

located in the current directory or in 'path/' if it is specified. The class generated will be named 'fileprefix'

"macrofilename" and optionally "cutfilename" are expected to point to source files which will be included by the generated skeleton. Method of the same name as the file(minus the extension and path) will be called by the generated skeleton's Process method as follow:

[if (cutfilename())] htemp->Fill(macrofilename());

"option" can be used select some of the optional features during the code generation. The possible options are:

  • nohist : indicates that the generated ProcessFill should not fill the histogram.

'maxUnrolling' controls how deep in the class hierarchy does the system 'unroll' classes that are not split. Unrolling a class allows direct access to its data members (this emulates the behavior of TTreeFormula).

The main features of this skeleton are:

  • on-demand loading of branches
  • ability to use the 'branchname' as if it was a data member
  • protection against array out-of-bounds errors
  • ability to use the branch data as an object (when the user code is available)

For example with Event.root, if

Double_t somePx = fTracks.fPx[2];
double Double_t
Double 8 bytes.
Definition RtypesCore.h:73

is executed by one of the method of the skeleton, somePx will updated with the current value of fPx of the 3rd track.

Both macrofilename and the optional cutfilename are expected to be the name of source files which contain at least a free standing function with the signature:

x_t macrofilename(); // i.e function with the same name as the file

and

y_t cutfilename(); // i.e function with the same name as the file

x_t and y_t needs to be types that can convert respectively to a double and a bool (because the skeleton uses:

if (cutfilename()) htemp->Fill(macrofilename());

These two functions are run in a context such that the branch names are available as local variables of the correct (read-only) type.

Note that if you use the same 'variable' twice, it is more efficient to 'cache' the value. For example:

Int_t n = fEventNumber; // Read fEventNumber
if (n<10 || n>10) { ... }

is more efficient than

if (fEventNumber<10 || fEventNumber>10)

Also, optionally, the generated selector will also call methods named macrofilename_methodname in each of 6 main selector methods if the method macrofilename_methodname exist (Where macrofilename is stripped of its extension).

Concretely, with the script named h1analysisProxy.C,

  • The method calls the method (if it exist)
  • Begin -> void h1analysisProxy_Begin(TTree*);
  • SlaveBegin -> void h1analysisProxy_SlaveBegin(TTree*);
  • Notify -> bool h1analysisProxy_Notify();
  • Process -> bool h1analysisProxy_Process(Long64_t);
  • SlaveTerminate -> void h1analysisProxy_SlaveTerminate();
  • Terminate -> void h1analysisProxy_Terminate();

If a file name macrofilename.h (or .hh, .hpp, .hxx, .hPP, .hXX) exist it is included before the declaration of the proxy class. This can be used in particular to insure that the include files needed by the macro file are properly loaded.

The default histogram is accessible via the variable named 'htemp'.

If the library of the classes describing the data in the branch is loaded, the skeleton will add the needed include statements and give the ability to access the object stored in the branches.

To draw px using the file hsimple.root (generated by the hsimple.C tutorial), we need a file named hsimple.cxx:

double hsimple() {
return px;
}

MakeProxy can then be used indirectly via the TTree::Draw interface as follow:

new TFile("hsimple.root")
ntuple->Draw("hsimple.cxx");
Long64_t Draw(const char *varexp, const TCut &selection, Option_t *option="", Long64_t nentries=kMaxEntries, Long64_t firstentry=0) override
Draw expression varexp for selected entries.
Definition TChain.cxx:803

A more complete example is available in the tutorials directory: h1analysisProxy.cxx , h1analysProxy.h and h1analysisProxyCut.C which reimplement the selector found in h1analysis.C

Definition at line 6887 of file TTree.cxx.

◆ MakeSelector()

Int_t TTree::MakeSelector ( const char * selector = nullptr,
Option_t * option = "" )
virtualinherited

Generate skeleton selector class for this tree.

The following files are produced: selector.h and selector.C. If selector is 0, the selector will be called "nameoftree". The option can be used to specify the branches that will have a data member.

  • If option is "=legacy", a pre-ROOT6 selector will be generated (data members and branch pointers instead of TTreeReaders).
  • If option is empty, readers will be generated for each leaf.
  • If option is "@", readers will be generated for the topmost branches.
  • Individual branches can also be picked by their name:
    • "X" generates readers for leaves of X.
    • "@X" generates a reader for X as a whole.
    • "@X;Y" generates a reader for X as a whole and also readers for the leaves of Y.
  • For further examples see the figure below.

The generated code in selector.h includes the following:

  • Identification of the original Tree and Input file name
  • Definition of selector class (data and functions)
  • The following class functions:
    • constructor and destructor
    • void Begin(TTree *tree)
    • void SlaveBegin(TTree *tree)
    • void Init(TTree *tree)
    • bool Notify()
    • bool Process(Long64_t entry)
    • void Terminate()
    • void SlaveTerminate()

The class selector derives from TSelector. The generated code in selector.C includes empty functions defined above.

To use this function:

  • connect your Tree file (eg: TFile f("myfile.root");)
  • T->MakeSelector("myselect");

where T is the name of the Tree in file myfile.root and myselect.h, myselect.C the name of the files created by this function. In a ROOT session, you can do:

root > T->Process("myselect.C")

Definition at line 6941 of file TTree.cxx.

◆ MakeZombie()

void TObject::MakeZombie ( )
inlineprotectedinherited

Definition at line 55 of file TObject.h.

◆ MarkEventCluster()

void TTree::MarkEventCluster ( )
privateinherited

Mark the previous event as being at the end of the event cluster.

So, if fEntries is set to 10 (and this is the first cluster) when MarkEventCluster is called, then the first cluster has 9 events.

Definition at line 8465 of file TTree.cxx.

◆ MayNotUse()

void TObject::MayNotUse ( const char * method) const
inherited

Use this method to signal that a method (defined in a base class) may not be called in a derived class (in principle against good design since a child class should not provide less functionality than its parent, however, sometimes it is necessary).

Definition at line 1160 of file TObject.cxx.

◆ MemoryFull()

bool TTree::MemoryFull ( Int_t nbytes)
inherited

Check if adding nbytes to memory we are still below MaxVirtualsize.

Definition at line 6956 of file TTree.cxx.

◆ Merge() [1/4]

Long64_t TChain::Merge ( const char * name,
Option_t * option = "" )
virtual

Merge all the entries in the chain into a new tree in a new file.

See important note in the following function Merge().

If the chain is expecting the input tree inside a directory, this directory is NOT created by this routine.

So in a case where we have:

TChain ch("mydir/mytree");
ch.Merge("newfile.root");

The resulting file will have not subdirectory. To recreate the directory structure do:

TFile* file = TFile::Open("newfile.root", "RECREATE");
file->mkdir("mydir")->cd();
ch.Merge(file, 0);
TDirectory * mkdir(const char *name, const char *title="", Bool_t returnExistingDirectory=kFALSE) override
Create a sub-directory "a" or a hierarchy of sub-directories "a/b/c/...".
virtual Bool_t cd()
Change current directory to "this" directory.
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
Create / open a file.
Definition TFile.cxx:3787

Definition at line 1911 of file TChain.cxx.

◆ Merge() [2/4]

Long64_t TChain::Merge ( TCollection * list,
Option_t * option = "" )
overridevirtual

Merge all chains in the collection. (NOT IMPLEMENTED).

Reimplemented from TTree.

Definition at line 1920 of file TChain.cxx.

◆ Merge() [3/4]

Long64_t TChain::Merge ( TCollection * list,
TFileMergeInfo * info )
overridevirtual

Merge all chains in the collection. (NOT IMPLEMENTED).

Reimplemented from TTree.

Definition at line 1929 of file TChain.cxx.

◆ Merge() [4/4]

Long64_t TChain::Merge ( TFile * file,
Int_t basketsize,
Option_t * option = "" )
virtual

Merge all the entries in the chain into a new tree in the current file.

Note: The "file" parameter is not the file where the new tree will be inserted. The new tree is inserted into gDirectory, which is usually the most recently opened file, or the directory most recently cd()'d to.

If option = "C" is given, the compression level for all branches in the new Tree is set to the file compression level. By default, the compression level of all branches is the original compression level in the old trees.

If basketsize > 1000, the basket size for all branches of the new tree will be set to basketsize.

Example using the file generated in $ROOTSYS/test/Event merge two copies of Event.root

gSystem.Load("libEvent");
TChain ch("T");
ch.Add("Event1.root");
ch.Add("Event2.root");
ch.Merge("all.root");

If the chain is expecting the input tree inside a directory, this directory is NOT created by this routine.

So if you do:

TChain ch("mydir/mytree");
ch.Merge("newfile.root");

The resulting file will not have subdirectories. In order to preserve the directory structure do the following instead:

TFile* file = TFile::Open("newfile.root", "RECREATE");
file->mkdir("mydir")->cd();
ch.Merge(file, 0);

If 'option' contains the word 'fast' the merge will be done without unzipping or unstreaming the baskets (i.e., a direct copy of the raw bytes on disk).

When 'fast' is specified, 'option' can also contains a sorting order for the baskets in the output file.

There is currently 3 supported sorting order:

SortBasketsByOffset (the default)
SortBasketsByBranch
SortBasketsByEntry

When using SortBasketsByOffset the baskets are written in the output file in the same order as in the original file (i.e. the basket are sorted on their offset in the original file; Usually this also means that the baskets are sorted on the index/number of the last entry they contain)

When using SortBasketsByBranch all the baskets of each individual branches are stored contiguously. This tends to optimize reading speed when reading a small number (1->5) of branches, since all their baskets will be clustered together instead of being spread across the file. However it might decrease the performance when reading more branches (or the full entry).

When using SortBasketsByEntry the baskets with the lowest starting entry are written first. (i.e. the baskets are sorted on the index/number of the first entry they contain). This means that on the file the baskets will be in the order in which they will be needed when reading the whole tree sequentially.

IMPORTANT Note 1: AUTOMATIC FILE OVERFLOW

When merging many files, it may happen that the resulting file reaches a size > TTree::fgMaxTreeSize (default = 100 GBytes). In this case the current file is automatically closed and a new file started. If the name of the merged file was "merged.root", the subsequent files will be named "merged_1.root", "merged_2.root", etc. fgMaxTreeSize may be modified via the static function TTree::SetMaxTreeSize. When in fast mode, the check and switch is only done in between each input file.

IMPORTANT Note 2: The output file is automatically closed and deleted.

This is required because in general the automatic file overflow described above may happen during the merge. If only the current file is produced (the file passed as first argument), one can instruct Merge to not close and delete the file by specifying the option "keep".

The function returns the total number of files produced. To check that all files have been merged use something like:

if (newchain->GetEntries()!=oldchain->GetEntries()) {
... not all the file have been copied ...
}

Definition at line 2037 of file TChain.cxx.

◆ MergeTrees()

TTree * TTree::MergeTrees ( TList * li,
Option_t * options = "" )
staticinherited

Static function merging the trees in the TList into a new tree.

Trees in the list can be memory or disk-resident trees. The new tree is created in the current directory (memory if gROOT). Trees with no branches will be skipped, the branch structure will be taken from the first non-zero-branch Tree of {li}

Definition at line 6972 of file TTree.cxx.

◆ Modify() [1/3]

virtual void TAttFill::Modify ( )
virtualinherited

◆ Modify() [2/3]

virtual void TAttLine::Modify ( )
virtualinherited

◆ Modify() [3/3]

virtual void TAttMarker::Modify ( )
virtualinherited

◆ ModifyOn() [1/3]

virtual void TAttFill::ModifyOn ( TVirtualPad & pad)
virtualinherited

◆ ModifyOn() [2/3]

virtual void TAttLine::ModifyOn ( TVirtualPad & pad)
virtualinherited

◆ ModifyOn() [3/3]

virtual void TAttMarker::ModifyOn ( TVirtualPad & pad)
virtualinherited

◆ MoveReadCache()

void TTree::MoveReadCache ( TFile * src,
TDirectory * dir )
protectedinherited

Move a cache from a file to the current file in dir.

if src is null no operation is done, if dir is null or there is no current file the cache is deleted.

Definition at line 7178 of file TTree.cxx.

◆ Notify()

bool TTree::Notify ( )
overridevirtualinherited

Function called when loading a new class library.

Reimplemented from TObject.

Definition at line 7228 of file TTree.cxx.

◆ Obsolete()

void TObject::Obsolete ( const char * method,
const char * asOfVers,
const char * removedFromVers ) const
inherited

Use this method to declare a method obsolete.

Specify as of which version the method is obsolete and as from which version it will be removed.

Definition at line 1169 of file TObject.cxx.

◆ operator delete() [1/3]

void TObject::operator delete ( void * ptr,
size_t size )
inherited

Operator delete for sized deallocation.

Definition at line 1234 of file TObject.cxx.

◆ operator delete() [2/3]

void TObject::operator delete ( void * ptr)
inherited

Operator delete.

Definition at line 1212 of file TObject.cxx.

◆ operator delete() [3/3]

void TObject::operator delete ( void * ptr,
void * vp )
inherited

Only called by placement new when throwing an exception.

Definition at line 1266 of file TObject.cxx.

◆ operator delete[]() [1/3]

void TObject::operator delete[] ( void * ptr,
size_t size )
inherited

Operator delete [] for sized deallocation.

Definition at line 1245 of file TObject.cxx.

◆ operator delete[]() [2/3]

void TObject::operator delete[] ( void * ptr)
inherited

Operator delete [].

Definition at line 1223 of file TObject.cxx.

◆ operator delete[]() [3/3]

void TObject::operator delete[] ( void * ptr,
void * vp )
inherited

Only called by placement new[] when throwing an exception.

Definition at line 1274 of file TObject.cxx.

◆ operator new() [1/2]

void * TObject::operator new ( size_t sz)
inlineinherited

Definition at line 189 of file TObject.h.

◆ operator new() [2/2]

void * TObject::operator new ( size_t sz,
void * vp )
inlineinherited

Definition at line 191 of file TObject.h.

◆ operator new[]() [1/2]

void * TObject::operator new[] ( size_t sz)
inlineinherited

Definition at line 190 of file TObject.h.

◆ operator new[]() [2/2]

void * TObject::operator new[] ( size_t sz,
void * vp )
inlineinherited

Definition at line 192 of file TObject.h.

◆ operator=()

TChain & TChain::operator= ( const TChain & )
private

◆ OptimizeBaskets()

void TTree::OptimizeBaskets ( ULong64_t maxMemory = 10000000,
Float_t minComp = 1.1,
Option_t * option = "" )
virtualinherited

This function may be called after having filled some entries in a Tree.

Using the information in the existing branch buffers, it will reassign new branch buffer sizes to optimize time and memory.

The function computes the best values for branch buffer sizes such that the total buffer sizes is less than maxMemory and nearby entries written at the same time. In case the branch compression factor for the data written so far is less than compMin, the compression is disabled.

if option ="d" an analysis report is printed.

Definition at line 7252 of file TTree.cxx.

◆ Paint()

void TObject::Paint ( Option_t * option = "")
virtualinherited

This method must be overridden if a class wants to paint itself.

The difference between Paint() and Draw() is that when a object draws itself it is added to the display list of the pad in which it is drawn (and automatically redrawn whenever the pad is redrawn). While paint just draws the object without adding it to the pad display list.

Reimplemented in ROOT::Experimental::RTreeMapPainter, ROOT::RGeoPainter, TAnnotation, TArrow, TASImage, TASPaletteEditor::LimitLine, TASPaletteEditor::PaintPalette, TAxis3D, TBits, TBox, TButton, TCanvas, TClassTree, TCollection, TColorWheel, TCrown, TDiamond, TDirectory, TEfficiency, TEllipse, TEveArrow, TEveCaloViz, TEveDigitSet, TEveGeoShape, TEveGeoTopNode, TEvePlot3D, TEvePointSet, TEveProjectionAxes, TEveScene, TEveShape, TEveStraightLineSet, TEveText, TEveTriangleSet, TExec, TF1, TF2, TF3, TFile, TFileDrawMap, TFrame, TGaxis, TGenerator, TGeoBoolNode, TGeoIntersection, TGeoNode, TGeoOverlap, TGeoPainter, TGeoPhysicalNode, TGeoShape, TGeoSubtraction, TGeoTrack, TGeoUnion, TGeoVGShape, TGeoVolume, TGL5DDataSet, TGLHistPainter, TGLParametricEquation, TGLTH3Composition, TGraph2D, TGraph2DPainter, TGraph, TGraphEdge, TGraphNode, TGraphPolargram, TGraphTime, TH1, THistPainter, THStack, TLatex, TLegend, TLine, TMacro, TMarker3DBox, TMarker, TMathText, TMultiGraph, TNode, TNodeDiv, TPad, TPaletteAxis, TParallelCoord, TParallelCoordRange, TParallelCoordVar, TParticle, TPave, TPaveLabel, TPaveStats, TPavesText, TPaveText, TPie, TPolyLine3D, TPolyLine, TPolyMarker3D, TPolyMarker, TPrimary, TRatioPlot, TScatter2D, TScatter, TShape, TSpectrum2Painter, TSpider, TSpline, TSQLFile, TStyle, TText, TTreePerfStats, TVirtualGeoPainter, TVirtualGeoTrack, TVirtualHistPainter, TVirtualPad, TWbox, and TXMLFile.

Definition at line 631 of file TObject.cxx.

◆ ParseTreeFilename()

void TChain::ParseTreeFilename ( const char * name,
TString & filename,
TString & treename,
TString & query,
TString & suffix ) const
private

Get the tree url or filename and other information from the name.

A treename and a url's query section is split off from name. The splitting depends on whether the resulting filename is to be subsequently treated for wildcards or not, since the question mark is both the url query identifier and a wildcard. Wildcard matching is not done in this method itself.

[xxx://host]/a/path/file_name[?query[#treename]]

The following way to specify the treename is still supported with the constrain that the file name contains the sub-string '.root'. This is now deprecated and will be removed in future versions.

[xxx://host]/a/path/file.root[.oext][/treename]
[xxx://host]/a/path/file.root[.oext][/treename][?query]

Note that in a case like this

[xxx://host]/a/path/file#treename

i.e. anchor but no options (query), the filename will be the full path, as the anchor may be the internal file name of an archive. Use '?#treename' to pass the treename if the query field is empty.

Parameters
[in]nameis the original name
[out]filenamethe url or filename to be opened or matched
[out]treenamethe treename, which may be found in a url fragment section as a trailing part of the name (deprecated). If not found this will be empty. Exception: a fragment containing the '=' character is not interpreted as a treename
[out]queryis the url query section, including the leading question mark. If not found or the query section is only followed by a fragment this will be empty.
[out]suffixthe portion of name which was removed to from filename.

Definition at line 2176 of file TChain.cxx.

◆ Pop()

void TObject::Pop ( )
virtualinherited

Pop on object drawn in a pad to the top of the display list.

I.e. it will be drawn last and on top of all other primitives.

Reimplemented in TFrame, TPad, and TVirtualPad.

Definition at line 640 of file TObject.cxx.

◆ Principal()

TPrincipal * TTree::Principal ( const char * varexp = "",
const char * selection = "",
Option_t * option = "np",
Long64_t nentries = kMaxEntries,
Long64_t firstentry = 0 )
inherited

Interface to the Principal Components Analysis class.

Create an instance of TPrincipal

Fill it with the selected variables

  • if option "n" is specified, the TPrincipal object is filled with normalized variables.
  • If option "p" is specified, compute the principal components
  • If option "p" and "d" print results of analysis
  • If option "p" and "h" generate standard histograms
  • If option "p" and "c" generate code of conversion functions
  • return a pointer to the TPrincipal object. It is the user responsibility
  • to delete this object.
  • The option default value is "np"

see TTree::Draw for explanation of the other parameters.

The created object is named "principal" and a reference to it is added to the list of specials Root objects. you can retrieve a pointer to the created object via:

TPrincipal *principal =
(TPrincipal*)gROOT->GetListOfSpecials()->FindObject("principal");
#define gROOT
Definition TROOT.h:417

Definition at line 7395 of file TTree.cxx.

◆ Print()

void TChain::Print ( Option_t * option = "") const
overridevirtual

Print the header information of each tree in the chain.

See TTree::Print for a list of options.

Reimplemented from TObject.

Definition at line 2246 of file TChain.cxx.

◆ PrintCacheStats()

void TTree::PrintCacheStats ( Option_t * option = "") const
virtualinherited

Print statistics about the TreeCache for this tree.

Like:

******TreeCache statistics for file: cms2.root ******
Reading 73921562 bytes in 716 transactions
Average transaction = 103.242405 Kbytes
Number of blocks in current cache: 202, total size : 6001193
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
static unsigned int total

if option = "a" the list of blocks in the cache is printed

Definition at line 7566 of file TTree.cxx.

◆ Process() [1/2]

Long64_t TChain::Process ( const char * filename,
Option_t * option = "",
Long64_t nentries = kMaxEntries,
Long64_t firstentry = 0 )
overridevirtual

Process all entries in this chain, calling functions in filename.

The return value is -1 in case of error and TSelector::GetStatus() in in case of success. See TTree::Process.

Reimplemented from TTree.

Definition at line 2269 of file TChain.cxx.

◆ Process() [2/2]

Long64_t TChain::Process ( TSelector * selector,
Option_t * option = "",
Long64_t nentries = kMaxEntries,
Long64_t firstentry = 0 )
overridevirtual

Process this chain executing the code in selector.

The return value is -1 in case of error and TSelector::GetStatus() in in case of success.

Reimplemented from TTree.

Definition at line 2282 of file TChain.cxx.

◆ Project()

Long64_t TTree::Project ( const char * hname,
const char * varexp,
const char * selection = "",
Option_t * option = "",
Long64_t nentries = kMaxEntries,
Long64_t firstentry = 0 )
virtualinherited

Make a projection of a tree using selections.

Depending on the value of varexp (described in Draw) a 1-D, 2-D, etc., projection of the tree will be filled in histogram hname. Note that the dimension of hname must match with the dimension of varexp.

Definition at line 7690 of file TTree.cxx.

◆ Query()

TSQLResult * TTree::Query ( const char * varexp = "",
const char * selection = "",
Option_t * option = "",
Long64_t nentries = kMaxEntries,
Long64_t firstentry = 0 )
virtualinherited

Loop over entries and return a TSQLResult object containing entries following selection.

Definition at line 7705 of file TTree.cxx.

◆ Read()

Int_t TObject::Read ( const char * name)
virtualinherited

Read contents of object with specified name from the current directory.

First the key with the given name is searched in the current directory, next the key buffer is deserialized into the object. The object must have been created before via the default constructor. See TObject::Write().

Reimplemented in TBuffer, TKey, TKeySQL, and TKeyXML.

Definition at line 673 of file TObject.cxx.

◆ ReadFile()

Long64_t TTree::ReadFile ( const char * filename,
const char * branchDescriptor = "",
char delimiter = ' ' )
virtualinherited

Create or simply read branches from filename.

if branchDescriptor = "" (default), it is assumed that the Tree descriptor is given in the first line of the file with a syntax like

A/D:Table[2]/F:Ntracks/I:astring/C
#define F(x, y, z)
#define I(x, y, z)

otherwise branchDescriptor must be specified with the above syntax. See all available datatypes here.

  • If the type of the first variable is not specified, it is assumed to be "/F"
  • If the type of any other variable is not specified, the type of the previous variable is assumed. eg
    • x:y:z (all variables are assumed of type "F")
    • x/D:y:z (all variables are of type "D")
    • x:y/D:z (x is type "F", y and z of type "D")

delimiter allows for the use of another delimiter besides whitespace. This provides support for direct import of common data file formats like csv. If delimiter != ' ' and branchDescriptor == "", then the branch description is taken from the first line in the file, but delimiter is used for the branch names tokenization rather than ':'. Note however that if the values in the first line do not use the /[type] syntax, all variables are assumed to be of type "F". If the filename ends with extensions .csv or .CSV and a delimiter is not specified (besides ' '), the delimiter is automatically set to ','.

Lines in the input file starting with "#" are ignored. Leading whitespace for each column data is skipped. Empty lines are skipped.

A TBranch object is created for each variable in the expression. The total number of rows read from the file is returned.

FILLING a TTree WITH MULTIPLE INPUT TEXT FILES

To fill a TTree with multiple input text files, proceed as indicated above for the first input file and omit the second argument for subsequent calls

T.ReadFile("file1.dat","branch descriptor");
T.ReadFile("file2.dat");

Definition at line 7757 of file TTree.cxx.

◆ ReadStream()

Long64_t TTree::ReadStream ( std::istream & inputStream,
const char * branchDescriptor = "",
char delimiter = ' ' )
virtualinherited

Create or simply read branches from an input stream.

See also
TTree::ReadFile

Reimplemented in TNtuple, and TNtupleD.

Definition at line 7808 of file TTree.cxx.

◆ RecursiveRemove()

void TChain::RecursiveRemove ( TObject * obj)
overridevirtual

Make sure that obj (which is being deleted or will soon be) is no longer referenced by this TTree.

Reimplemented from TObject.

Definition at line 2291 of file TChain.cxx.

◆ Refresh()

void TTree::Refresh ( )
virtualinherited

Refresh contents of this tree and its branches from the current status on disk.

One can call this function in case the tree file is being updated by another process.

Reimplemented in TTreeSQL.

Definition at line 8109 of file TTree.cxx.

◆ RefreshFriendAddresses()

Long64_t TChain::RefreshFriendAddresses ( )
private

Refresh branch/leaf addresses of friend trees.

The method acts only on the current tree in the chain (fTree), but it may be called in two different scenarios: when there are friends of the chain or when there are friends of fTree itself.

Definition at line 1308 of file TChain.cxx.

◆ RegisterBranchFullName()

void TTree::RegisterBranchFullName ( std::pair< std::string, TBranch * > && kv)
inlineprivateinherited

Definition at line 182 of file TTree.h.

◆ RegisterExternalFriend()

void TTree::RegisterExternalFriend ( TFriendElement * fe)
virtualinherited

Record a TFriendElement that we need to warn when the chain switches to a new file (typically this is because this chain is a friend of another TChain).

Definition at line 8150 of file TTree.cxx.

◆ RemoveExternalFriend()

void TTree::RemoveExternalFriend ( TFriendElement * fe)
virtualinherited

Removes external friend.

Definition at line 8161 of file TTree.cxx.

◆ RemoveFriend()

void TChain::RemoveFriend ( TTree * oldFriend)
overridevirtual

Remove a friend from the list of friends.

Reimplemented from TTree.

Definition at line 2310 of file TChain.cxx.

◆ Reset()

void TChain::Reset ( Option_t * option = "")
overridevirtual

Resets the state of this chain.

Reimplemented from TTree.

Definition at line 2329 of file TChain.cxx.

◆ ResetAfterMerge()

void TChain::ResetAfterMerge ( TFileMergeInfo * info)
overridevirtual

Resets the state of this chain after a merge (keep the customization but forget the data).

Reimplemented from TTree.

Definition at line 2351 of file TChain.cxx.

◆ ResetAttFill()

virtual void TAttFill::ResetAttFill ( Option_t * option = "")
virtualinherited

Reimplemented in TGWin32VirtualXProxy.

◆ ResetAttLine()

virtual void TAttLine::ResetAttLine ( Option_t * option = "")
virtualinherited

Reimplemented in TGWin32VirtualXProxy.

◆ ResetAttMarker()

virtual void TAttMarker::ResetAttMarker ( Option_t * toption = "")
virtualinherited

Reimplemented in TGWin32VirtualXProxy.

◆ ResetBit()

void TObject::ResetBit ( UInt_t f)
inlineinherited

Definition at line 203 of file TObject.h.

◆ ResetBranchAddress()

void TChain::ResetBranchAddress ( TBranch * branch)
overridevirtual

Reset the addresses of the branch.

Reimplemented from TTree.

Definition at line 2474 of file TChain.cxx.

◆ ResetBranchAddresses()

void TChain::ResetBranchAddresses ( )
overridevirtual

Reset the addresses of the branches.

Reimplemented from TTree.

Definition at line 2488 of file TChain.cxx.

◆ SaveAs()

void TObject::SaveAs ( const char * filename = "",
Option_t * option = "" ) const
virtualinherited

Save this object in the file specified by filename.

  • if "filename" contains ".root" the object is saved in filename as root binary file.
  • if "filename" contains ".xml" the object is saved in filename as a xml ascii file.
  • if "filename" contains ".cc" the object is saved in filename as C code independent from ROOT. The code is generated via SavePrimitive(). Specific code should be implemented in each object to handle this option. Like in TF1::SavePrimitive().
  • otherwise the object is written to filename as a CINT/C++ script. The C++ code to rebuild this object is generated via SavePrimitive(). The "option" parameter is passed to SavePrimitive. By default it is an empty string. It can be used to specify the Draw option in the code generated by SavePrimitive.

    The function is available via the object context menu.

Reimplemented in ROOT::Experimental::XRooFit::xRooNode, TClassTree, TFolder, TGeoVolume, TGObject, TGraph, TH1, TPad, TPaveClass, TSpline3, TSpline5, TSpline, TTreePerfStats, and TVirtualPad.

Definition at line 708 of file TObject.cxx.

◆ SaveFillAttributes()

virtual void TAttFill::SaveFillAttributes ( std::ostream & out,
const char * name,
Int_t coldef = 1,
Int_t stydef = 1001 )
virtualinherited

◆ SaveLineAttributes()

virtual void TAttLine::SaveLineAttributes ( std::ostream & out,
const char * name,
Int_t coldef = 1,
Int_t stydef = 1,
Int_t widdef = 1 )
virtualinherited

◆ SaveMarkerAttributes()

virtual void TAttMarker::SaveMarkerAttributes ( std::ostream & out,
const char * name,
Int_t coldef = 1,
Int_t stydef = 1,
Int_t sizdef = 1 )
virtualinherited

◆ SavePrimitive()

void TChain::SavePrimitive ( std::ostream & out,
Option_t * option = "" )
overridevirtual

Save TChain as a C++ statements on output stream out.

With the option "friend" save the description of all the TChain's friend trees or chains as well.

Reimplemented from TObject.

Definition at line 2368 of file TChain.cxx.

◆ SavePrimitiveConstructor()

void TObject::SavePrimitiveConstructor ( std::ostream & out,
TClass * cl,
const char * variable_name,
const char * constructor_agrs = "",
Bool_t empty_line = kTRUE )
staticprotectedinherited

Save object constructor in the output stream "out".

Can be used as first statement when implementing SavePrimitive() method for the object

Definition at line 777 of file TObject.cxx.

◆ SavePrimitiveDraw()

void TObject::SavePrimitiveDraw ( std::ostream & out,
const char * variable_name,
Option_t * option = nullptr )
staticprotectedinherited

Save invocation of primitive Draw() method Skipped if option contains "nodraw" string.

Definition at line 845 of file TObject.cxx.

◆ SavePrimitiveNameTitle()

void TNamed::SavePrimitiveNameTitle ( std::ostream & out,
const char * variable_name )
protectedinherited

Save object name and title into the output stream "out".

Definition at line 135 of file TNamed.cxx.

◆ SavePrimitiveVector()

TString TObject::SavePrimitiveVector ( std::ostream & out,
const char * prefix,
Int_t len,
Double_t * arr,
Int_t flag = 0 )
staticprotectedinherited

Save array in the output stream "out" as vector.

Create unique variable name based on prefix value Returns name of vector which can be used in constructor or in other places of C++ code If flag === kTRUE, just add empty line If flag === 111, check if array is empty and return nullptr or <vectorname>.data()

Definition at line 796 of file TObject.cxx.

◆ Scan()

Long64_t TChain::Scan ( const char * varexp = "",
const char * selection = "",
Option_t * option = "",
Long64_t nentries = kMaxEntries,
Long64_t firstentry = 0 )
overridevirtual

Loop on tree and print entries passing selection.

  • If varexp is 0 (or "") then print only first 8 columns.
  • If varexp = "*" print all columns.
  • Otherwise a columns selection can be made using "var1:var2:var3". See TTreePlayer::Scan for more information.

Reimplemented from TTree.

Definition at line 2425 of file TChain.cxx.

◆ SetAlias()

bool TTree::SetAlias ( const char * aliasName,
const char * aliasFormula )
virtualinherited

Set a tree variable alias.

Set an alias for an expression/formula based on the tree 'variables'.

The content of 'aliasName' can be used in TTreeFormula (i.e. TTree::Draw, TTree::Scan, TTreeViewer) and will be evaluated as the content of 'aliasFormula'.

If the content of 'aliasFormula' only contains symbol names, periods and array index specification (for example event.fTracks[3]), then the content of 'aliasName' can be used as the start of symbol.

If the alias 'aliasName' already existed, it is replaced by the new value.

When being used, the alias can be preceded by an eventual 'Friend Alias' (see TTree::GetFriendAlias)

Return true if it was added properly.

For example:

tree->SetAlias("x1","(tdc1[1]-tdc1[0])/49");
tree->SetAlias("y1","(tdc1[3]-tdc1[2])/47");
tree->SetAlias("x2","(tdc2[1]-tdc2[0])/49");
tree->SetAlias("y2","(tdc2[3]-tdc2[2])/47");
tree->Draw("y2-y1:x2-x1");
tree->SetAlias("theGoodTrack","event.fTracks[3]");
tree->Draw("theGoodTrack.fPx"); // same as "event.fTracks[3].fPx"

Definition at line 8348 of file TTree.cxx.

◆ SetAutoDelete()

void TChain::SetAutoDelete ( bool autodelete = true)
virtual

Set the global branch kAutoDelete bit.

When LoadTree loads a new Tree, the branches for which the address is set will have the option AutoDelete set For more details on AutoDelete, see TBranch::SetAutoDelete.

Definition at line 2440 of file TChain.cxx.

◆ SetAutoFlush()

void TTree::SetAutoFlush ( Long64_t autof = -30000000)
virtualinherited

This function may be called at the start of a program to change the default value for fAutoFlush.

CASE 1 : autof > 0

autof is the number of consecutive entries after which TTree::Fill will flush all branch buffers to disk.

CASE 2 : autof < 0

When filling the Tree the branch buffers will be flushed to disk when more than autof bytes have been written to the file. At the first FlushBaskets TTree::Fill will replace fAutoFlush by the current value of fEntries.

Calling this function with autof<0 is interesting when it is hard to estimate the size of one entry. This value is also independent of the Tree.

The Tree is initialized with fAutoFlush=-30000000, ie that, by default, the first AutoFlush will be done when 30 MBytes of data are written to the file.

CASE 3 : autof = 0

The AutoFlush mechanism is disabled.

Flushing the buffers at regular intervals optimize the location of consecutive entries on the disk by creating clusters of baskets.

A cluster of baskets is a set of baskets that contains all the data for a (consecutive) set of entries and that is stored consecutively on the disk. When reading all the branches, this is the minimum set of baskets that the TTreeCache will read.

Definition at line 8403 of file TTree.cxx.

◆ SetAutoSave()

void TTree::SetAutoSave ( Long64_t autos = -300000000)
virtualinherited

In case of a program crash, it will be possible to recover the data in the tree up to the last AutoSave point.

This function may be called before filling a TTree to specify when the branch buffers and TTree header are flushed to disk as part of TTree::Fill(). The default is -300000000, ie the TTree will write data to disk once it exceeds 300 MBytes. CASE 1: If fAutoSave is positive the watermark is reached when a multiple of fAutoSave entries have been filled. CASE 2: If fAutoSave is negative the watermark is reached when -fAutoSave bytes can be written to the file. CASE 3: If fAutoSave is 0, AutoSave() will never be called automatically as part of TTree::Fill().

Definition at line 8549 of file TTree.cxx.

◆ SetBasketSize()

void TTree::SetBasketSize ( const char * bname,
Int_t bufsize = 16000 )
virtualinherited

Set a branch's basket size.

bname is the name of a branch.

  • if bname="*", apply to all branches.
  • if bname="xxx*", apply to all branches with name starting with xxx

see TRegexp for wildcarding options bufsize = branch basket size

Definition at line 8565 of file TTree.cxx.

◆ SetBit() [1/2]

void TObject::SetBit ( UInt_t f)
inlineinherited

Definition at line 202 of file TObject.h.

◆ SetBit() [2/2]

void TObject::SetBit ( UInt_t f,
Bool_t set )
inherited

Set or unset the user status bits as specified in f.

Definition at line 888 of file TObject.cxx.

◆ SetBranchAddress() [1/6]

template<class T>
Int_t TChain::SetBranchAddress ( const char * bname,
T ** add,
TBranch ** ptr = nullptr )
inline

Definition at line 152 of file TChain.h.

◆ SetBranchAddress() [2/6]

template<class T>
Int_t TChain::SetBranchAddress ( const char * bname,
T * add,
TBranch ** ptr = nullptr )
inline

Definition at line 158 of file TChain.h.

◆ SetBranchAddress() [3/6]

Int_t TChain::SetBranchAddress ( const char * bname,
void * add,
TBranch ** ptr,
TClass * realClass,
EDataType datatype,
bool isptr )
overridevirtual

Check if bname is already in the status list, and if not, create a TChainElement object and set its address.

See TTree::CheckBranchAddressType for the semantic of the return value.

Note: See the comments in TBranchElement::SetAddress() for a more detailed discussion of the meaning of the add parameter.

Reimplemented from TTree.

Definition at line 2621 of file TChain.cxx.

◆ SetBranchAddress() [4/6]

Int_t TChain::SetBranchAddress ( const char * bname,
void * add,
TBranch ** ptr,
TClass * realClass,
EDataType datatype,
bool isptr,
bool suppressMissingBranchError )
overrideprotectedvirtual

Reimplemented from TTree.

Definition at line 3069 of file TChain.cxx.

◆ SetBranchAddress() [5/6]

Int_t TChain::SetBranchAddress ( const char * bname,
void * add,
TBranch ** ptr = nullptr )
overridevirtual

Set branch address.

Parameters
[in]bnameis the name of a branch.
[in]addis the address of the branch.
[in]ptr

Note: See the comments in TBranchElement::SetAddress() for a more detailed discussion of the meaning of the add parameter.

IMPORTANT REMARK:

In case TChain::SetBranchStatus is called, it must be called BEFORE calling this function.

See TTree::CheckBranchAddressType for the semantic of the return value.

Reimplemented from TTree.

Definition at line 2531 of file TChain.cxx.

◆ SetBranchAddress() [6/6]

Int_t TChain::SetBranchAddress ( const char * bname,
void * add,
TClass * realClass,
EDataType datatype,
bool isptr )
overridevirtual

Check if bname is already in the status list, and if not, create a TChainElement object and set its address.

See TTree::CheckBranchAddressType for the semantic of the return value.

Note: See the comments in TBranchElement::SetAddress() for a more detailed discussion of the meaning of the add parameter.

Reimplemented from TTree.

Definition at line 2609 of file TChain.cxx.

◆ SetBranchAddressImp() [1/2]

Int_t TTree::SetBranchAddressImp ( const char * bname,
void * add,
TBranch ** ptr,
TClass * realClass,
EDataType datatype,
bool isptr )
privateinherited

Definition at line 8615 of file TTree.cxx.

◆ SetBranchAddressImp() [2/2]

Int_t TTree::SetBranchAddressImp ( TBranch * branch,
void * addr,
TBranch ** ptr )
protectedinherited

Change branch address, dealing with clone trees properly.

See TTree::CheckBranchAddressType for the semantic of the return value.

Note: See the comments in TBranchElement::SetAddress() for the meaning of the addr parameter and the object ownership policy.

Definition at line 8690 of file TTree.cxx.

◆ SetBranchStatus()

void TChain::SetBranchStatus ( const char * bname,
bool status = true,
UInt_t * found = nullptr )
overridevirtual

Set branch status to Process or DoNotProcess.

Parameters
[in]bnameis the name of a branch. if bname="*", apply to all branches.
[in]status= 1 branch will be processed, = 0 branch will not be processed
[out]found

See IMPORTANT REMARKS in TTree::SetBranchStatus and TChain::SetBranchAddress

If found is not 0, the number of branch(es) found matching the regular expression is returned in *found AND the error message 'unknown branch' is suppressed.

Reimplemented from TTree.

Definition at line 2652 of file TChain.cxx.

◆ SetBranchStyle()

void TTree::SetBranchStyle ( Int_t style = 1)
staticinherited

Set the current branch style.

(static function)

  • style = 0 old Branch
  • style = 1 new Bronch

Definition at line 8910 of file TTree.cxx.

◆ SetCacheEntryRange()

Int_t TTree::SetCacheEntryRange ( Long64_t first,
Long64_t last )
virtualinherited

interface to TTreeCache to set the cache entry range

Returns:

  • 0 entry range set
  • -1 on error

Definition at line 9085 of file TTree.cxx.

◆ SetCacheLearnEntries()

void TTree::SetCacheLearnEntries ( Int_t n = 10)
virtualinherited

Interface to TTreeCache to set the number of entries for the learning phase.

Definition at line 9119 of file TTree.cxx.

◆ SetCacheSize()

Int_t TChain::SetCacheSize ( Long64_t cacheSize = -1)
overridevirtual

Set maximum size of the file cache (TTreeCache) in bytes.

  • if cachesize = 0 the existing cache (if any) is disabled (deleted if any).
  • if cachesize > 0, the cache is enabled or extended, if necessary
  • if cachesize = -1 (default) it is set to the AutoFlush value when writing the Tree (default is 30 MBytes).

The cacheSize might be clamped, see TFileCacheRead::SetBufferSize

TTreeCache's 'real' job is to actually prefetch (early grab from disk) the compressed data. The cachesize controls the size of the read bytes from disk.

Returns:

  • 0 size set, cache was created if possible
  • -1 on error

Reimplemented from TTree.

Definition at line 2449 of file TChain.cxx.

◆ SetCacheSizeAux()

Int_t TTree::SetCacheSizeAux ( bool autocache = true,
Long64_t cacheSize = 0 )
protectedinherited

Set the maximum size of the file cache (TTreeCache) in bytes and create it if possible.

If autocache is true: this may be an autocreated cache, possibly enlarging an existing autocreated cache. The size is calculated. The value passed in cacheSize:

  • cacheSize = 0 make cache if default cache creation is enabled.
  • cachesize > 0 the cache is enabled or extended, if necessary
  • cacheSize = -1 make a default sized cache in any case

If autocache is false: this is a user requested cache. cacheSize is used to size the cache. This cache should never be automatically adjusted. If cachesize is 0, the cache is disabled (deleted if any).

The cacheSize might be clamped, see TFileCacheRead::SetBufferSize

TTreeCache's 'real' job is to actually prefetch (early grab from disk) the compressed data. The cachesize controls the size of the read bytes from disk.

Returns:

  • 0 size set, or existing autosized cache almost large enough. (cache was created if possible)
  • -1 on error

Definition at line 8965 of file TTree.cxx.

◆ SetChainOffset()

virtual void TTree::SetChainOffset ( Long64_t offset = 0)
inlinevirtualinherited

Definition at line 696 of file TTree.h.

◆ SetCircular()

void TTree::SetCircular ( Long64_t maxEntries)
virtualinherited

Enable/Disable circularity for this tree.

if maxEntries > 0 a maximum of maxEntries is kept in one buffer/basket per branch in memory. Note that when this function is called (maxEntries>0) the Tree must be empty or having only one basket per branch. if maxEntries <= 0 the tree circularity is disabled.

NOTE 1:

Circular Trees are interesting in online real time environments to store the results of the last maxEntries events.

NOTE 2:

Calling SetCircular with maxEntries <= 0 is necessary before merging circular Trees that have been saved on files.

NOTE 3:

SetCircular with maxEntries <= 0 is automatically called by TChain::Merge

NOTE 4:

A circular Tree can still be saved in a file. When read back, it is still a circular Tree and can be filled again.

Definition at line 9146 of file TTree.cxx.

◆ SetClusterPrefetch()

virtual void TTree::SetClusterPrefetch ( bool enabled)
inlinevirtualinherited

Enables (or disables) the early decompression of the baskets of the current cluster (whose compressed data is already in memory if used in conjunction with the TTreeCache).

This affects performance only in conjunction with non-sequential use/load/read of the entries, ie within a cluster you can have cheap random access to the entries (instead of having to decompress again and again).

Note
This setting is totally different from SetCacheSize and from TFile.AsyncPrefetching, which save read calls

Definition at line 703 of file TTree.h.

◆ SetDebug()

void TTree::SetDebug ( Int_t level = 1,
Long64_t min = 0,
Long64_t max = 9999999 )
virtualinherited

Set the debug level and the debug range.

For entries in the debug range, the functions TBranchElement::Fill and TBranchElement::GetEntry will print the number of bytes filled or read for each branch.

Definition at line 9182 of file TTree.cxx.

◆ SetDefaultEntryOffsetLen()

void TTree::SetDefaultEntryOffsetLen ( Int_t newdefault,
bool updateExisting = false )
virtualinherited

Update the default value for the branch's fEntryOffsetLen.

If updateExisting is true, also update all the existing branches. If newdefault is less than 10, the new default value will be 10.

Definition at line 9194 of file TTree.cxx.

◆ SetDirectory()

void TChain::SetDirectory ( TDirectory * dir)
overridevirtual

Remove reference to this chain from current directory and add reference to new directory dir.

dir can be 0 in which case the chain does not belong to any directory.

Reimplemented from TTree.

Definition at line 2679 of file TChain.cxx.

◆ SetDrawOption()

void TObject::SetDrawOption ( Option_t * option = "")
virtualinherited

Set drawing option for object.

This option only affects the drawing style and is stored in the option field of the TObjOptLink supporting a TPad's primitive list (TList). Note that it does not make sense to call object.SetDrawOption(option) before having called object.Draw().

Reimplemented in RooPlot, TAxis, TBrowser, TGedFrame, TGFrame, TPad, TPaveStats, TRootBrowserLite, TSystemDirectory, and TSystemFile.

Definition at line 871 of file TObject.cxx.

◆ SetDtorOnly()

void TObject::SetDtorOnly ( void * obj)
staticinherited

Set destructor only flag.

Definition at line 1204 of file TObject.cxx.

◆ SetEntries()

Long64_t TTree::SetEntries ( Long64_t n = -1)
virtualinherited

Change number of entries in the tree.

If n >= 0, set number of entries in the tree = n.

If n < 0, set number of entries in the tree to match the number of entries in each branch. (default for n is -1)

This function should be called only when one fills each branch independently via TBranch::Fill without calling TTree::Fill. Calling TTree::SetEntries() make sense only if the number of entries in each branch is identical, a warning is issued otherwise. The function returns the number of entries.

Reimplemented in THbookTree.

Definition at line 9265 of file TTree.cxx.

◆ SetEntryList()

void TChain::SetEntryList ( TEntryList * elist,
Option_t * opt = "" )
overridevirtual

Set the input entry list (processing the entries of the chain will then be limited to the entries in the list).

Parameters
[in]elistThe entry list to be assigned to this chain.
[in]optAn option string. Possible values are:
  • "" (default): both the file names of the chain elements and the file names of the TEntryList sublists are expanded to full path name.
  • "ne": the file names are taken as they are and not expanded
  • "sync": the TChain will go through the TEntryList in lockstep with the trees in the chain rather than performing a lookup based on treename and filename. This is mostly useful when the TEntryList has multiple sublists for the same tree and filename.
Exceptions
std::runtime_errorIf option "sync" was chosen and either:
  • elist doesn't have sub entry lists.
  • the number of sub entry lists in elist is different than the number of trees in the chain.
  • any of the sub entry lists in elist doesn't correspond to the tree of the chain with the same index (i.e. it doesn't share the same tree name and file name).

This function finds correspondence between the sub-lists of the TEntryList and the trees of the TChain.

Reimplemented from TTree.

Definition at line 2716 of file TChain.cxx.

◆ SetEntryListFile()

void TChain::SetEntryListFile ( const char * filename = "",
Option_t * opt = "" )
virtual

Set the input entry list (processing the entries of the chain will then be limited to the entries in the list).

This function creates a special kind of entry list (TEntryListFromFile object) that loads lists, corresponding to the chain elements, one by one, so that only one list is in memory at a time.

If there is an error opening one of the files, this file is skipped and the next file is loaded

File naming convention:

  • by default, filename_elist.root is used, where filename is the name of the chain element
  • xxx$xxx.root - $ sign is replaced by the name of the chain element

If the list name is not specified (by passing filename_elist.root/listname to the TChain::SetEntryList() function, the first object of class TEntryList in the file is taken.

It is assumed, that there are as many list files, as there are elements in the chain and they are in the same order

Definition at line 2854 of file TChain.cxx.

◆ SetEstimate()

void TTree::SetEstimate ( Long64_t n = 1000000)
virtualinherited

Set number of entries to estimate variable limits.

If n is -1, the estimate is set to be the current maximum for the tree (i.e. GetEntries() + 1) If n is less than -1, the behavior is undefined.

Definition at line 9364 of file TTree.cxx.

◆ SetEventList()

void TChain::SetEventList ( TEventList * evlist)
overridevirtual

This function transfroms the given TEventList into a TEntryList.

NOTE, that this function loads all tree headers, because the entry numbers in the TEventList are global and have to be recomputed, taking into account the number of entries in each tree.

The new TEntryList is owned by the TChain and gets deleted when the chain is deleted. This TEntryList is returned by GetEntryList() function, and after GetEntryList() function is called, the TEntryList is not owned by the chain any more and will not be deleted with it.

Reimplemented from TTree.

Definition at line 2900 of file TChain.cxx.

◆ SetFileNumber()

void TTree::SetFileNumber ( Int_t number = 0)
virtualinherited

Set fFileNumber to number.

fFileNumber is used by TTree::Fill to set the file name for a new file to be created when the current file exceeds fgTreeMaxSize. (see TTree::ChangeFile) if fFileNumber=10, the new file name will have a suffix "_11", ie, fFileNumber is incremented before setting the file name

Definition at line 9407 of file TTree.cxx.

◆ SetFillAttributes()

virtual void TAttFill::SetFillAttributes ( )
virtualinherited

Reimplemented in TGWin32VirtualXProxy.

◆ SetFillColor() [1/2]

virtual void TAttFill::SetFillColor ( Color_t fcolor)
inlinevirtualinherited

Set the fill area color.

Reimplemented in TGQuartz, TGraphMultiErrors, TGWin32, TGWin32VirtualXProxy, TGX11, TPDF, TPostScript, TSpider, TSVG, TTeXDump, and TVirtualX.

Definition at line 40 of file TAttFill.h.

◆ SetFillColor() [2/2]

void TAttFill::SetFillColor ( TColorNumber )
inherited

◆ SetFillColorAlpha()

virtual void TAttFill::SetFillColorAlpha ( Color_t fcolor,
Float_t falpha )
virtualinherited

Reimplemented in TGraphMultiErrors.

◆ SetFillStyle()

virtual void TAttFill::SetFillStyle ( Style_t fstyle)
inlinevirtualinherited

Set the fill area style.

Reimplemented in TGQuartz, TGraphMultiErrors, TGWin32, TGWin32VirtualXProxy, TGX11, TPad, TSpider, and TVirtualX.

Definition at line 42 of file TAttFill.h.

◆ SetImplicitMT()

virtual void TTree::SetImplicitMT ( bool enabled)
inlinevirtualinherited

Definition at line 713 of file TTree.h.

◆ SetIOFeatures()

ROOT::TIOFeatures TTree::SetIOFeatures ( const ROOT::TIOFeatures & features)
inherited

Provide the end-user with the ability to enable/disable various experimental IO features for this TTree.

Returns all the newly-set IO settings.

Definition at line 9384 of file TTree.cxx.

◆ SetLineAttributes()

virtual void TAttLine::SetLineAttributes ( )
virtualinherited

Reimplemented in TGWin32VirtualXProxy.

◆ SetLineColor() [1/2]

◆ SetLineColor() [2/2]

void TAttLine::SetLineColor ( TColorNumber lcolor)
inherited

◆ SetLineColorAlpha()

virtual void TAttLine::SetLineColorAlpha ( Color_t lcolor,
Float_t lalpha )
virtualinherited

Reimplemented in TGraphMultiErrors.

◆ SetLineStyle()

virtual void TAttLine::SetLineStyle ( Style_t lstyle)
inlinevirtualinherited

◆ SetLineWidth()

virtual void TAttLine::SetLineWidth ( Width_t lwidth)
inlinevirtualinherited

◆ SetMakeClass()

void TChain::SetMakeClass ( Int_t make)
inlineoverridevirtual

Set all the branches in this TTree to be in decomposed object mode (also known as MakeClass mode).

For MakeClass mode 0, the TTree expects the address where the data is stored to be set by either the user or the TTree to the address of a full object through the top level branch. For MakeClass mode 1, this address is expected to point to a numerical type or C-style array (variable or not) of numerical type, representing the primitive data members. The function's primary purpose is to allow the user to access the data directly with numerical type variable rather than having to have the original set of classes (or a reproduction thereof). In other words, SetMakeClass sets the branch(es) into a mode that allow its reading via a set of independent variables (see the result of running TTree::MakeClass on your TTree) by changing the interpretation of the address passed to SetAddress from being the beginning of the object containing the data to being the exact location where the data should be loaded. If you have the shared library corresponding to your object, it is better if you do MyClass *objp = 0; tree->SetBranchAddress("toplevel",&objp);, whereas if you do not have the shared library but know your branch data type, e.g. Int_t* ptr = new Int_t[10];, then: tree->SetMakeClass(1); tree->GetBranch("x")->SetAddress(ptr) is the way to go.

Reimplemented from TTree.

Definition at line 169 of file TChain.h.

◆ SetMarkerAttributes()

virtual void TAttMarker::SetMarkerAttributes ( )
virtualinherited

Reimplemented in TGWin32VirtualXProxy.

◆ SetMarkerColor() [1/2]

virtual void TAttMarker::SetMarkerColor ( Color_t mcolor = 1)
inlinevirtualinherited

◆ SetMarkerColor() [2/2]

void TAttMarker::SetMarkerColor ( TColorNumber lcolor)
inherited

◆ SetMarkerColorAlpha()

virtual void TAttMarker::SetMarkerColorAlpha ( Color_t mcolor,
Float_t malpha )
virtualinherited

◆ SetMarkerSize()

virtual void TAttMarker::SetMarkerSize ( Size_t msize = 1)
inlinevirtualinherited

Set the marker size.

Note that the marker styles number 1 6 and 7 (the dots), cannot be scaled. They are meant to be very fast to draw and are always drawn with the same number of pixels; therefore this method does not apply on them.

Reimplemented in ROOT::Experimental::REvePointSet, ROOT::Experimental::REvePointSetArray, ROOT::Experimental::REveTrackList, TEvePointSet, TEvePointSetArray, TEveTrackList, TGQuartz, TGWin32, TGWin32VirtualXProxy, TGX11, TTeXDump, and TVirtualX.

Definition at line 48 of file TAttMarker.h.

◆ SetMarkerStyle()

virtual void TAttMarker::SetMarkerStyle ( Style_t mstyle = 1)
inlinevirtualinherited

◆ SetMaxEntryLoop()

virtual void TTree::SetMaxEntryLoop ( Long64_t maxev = kMaxEntries)
inlinevirtualinherited

Definition at line 715 of file TTree.h.

◆ SetMaxTreeSize()

void TTree::SetMaxTreeSize ( Long64_t maxsize = 100000000000LL)
staticinherited

Set the maximum size in bytes of a Tree file (static function).

The default size is 100000000000LL, ie 100 Gigabytes.

In TTree::Fill, when the file has a size > fgMaxTreeSize, the function closes the current file and starts writing into a new file with a name of the style "file_1.root" if the original requested file name was "file.root".

Definition at line 9462 of file TTree.cxx.

◆ SetMaxVirtualSize()

virtual void TTree::SetMaxVirtualSize ( Long64_t size = 0)
inlinevirtualinherited

Definition at line 717 of file TTree.h.

◆ SetName()

void TChain::SetName ( const char * name)
overridevirtual

Change the name of this TChain.

Reimplemented from TNamed.

Definition at line 2958 of file TChain.cxx.

◆ SetNameTitle()

void TNamed::SetNameTitle ( const char * name,
const char * title )
virtualinherited

Set all the TNamed parameters (name and title).

WARNING: if the name is changed and the object is a member of a THashTable or THashList container the container must be Rehash()'ed after SetName(). For example the list of objects in the current directory is a THashList.

Reimplemented in RooAbsArg, RooAbsData, RooDataHist, RooDataSet, RooFitResult, RooPlot, TContextMenu, TGraph2D, TGraph, TH1, and TNode.

Definition at line 163 of file TNamed.cxx.

◆ SetNotify()

void TTree::SetNotify ( TObject * obj)
virtualinherited

Sets the address of the object to be notified when the tree is loaded.

The method TObject::Notify is called for the given object when the tree is loaded. Specifically this occurs in the TTree::LoadTree method. To remove the notification call this method with nullptr:

tree->SetNotify(nullptr);

If this is a TChain, obj is most often going to be a TNotifyLink.

Parameters
[in]objPointer to a TObject to be notified.

Definition at line 9496 of file TTree.cxx.

◆ SetObject()

void TTree::SetObject ( const char * name,
const char * title )
virtualinherited

Change the name and title of this tree.

Definition at line 9525 of file TTree.cxx.

◆ SetObjectStat()

void TObject::SetObjectStat ( Bool_t stat)
staticinherited

Turn on/off tracking of objects in the TObjectTable.

Definition at line 1188 of file TObject.cxx.

◆ SetPacketSize()

void TChain::SetPacketSize ( Int_t size = 100)
virtual

Set number of entries per packet for parallel root.

Definition at line 2980 of file TChain.cxx.

◆ SetParallelUnzip()

void TTree::SetParallelUnzip ( bool opt = true,
Float_t RelSize = -1 )
virtualinherited

Enable or disable parallel unzipping of Tree buffers.

Definition at line 9556 of file TTree.cxx.

◆ SetPerfStats()

void TTree::SetPerfStats ( TVirtualPerfStats * perf)
virtualinherited

Set perf stats.

Definition at line 9594 of file TTree.cxx.

◆ SetScanField()

virtual void TTree::SetScanField ( Int_t n = 50)
inlinevirtualinherited

Sets the default maximum number of lines to be shown before <CR> when calling Scan().

Parameters
nthe maximum number of lines. Default=50, if 0, all entries of the Tree are shown and there is no need to press <CR> or q to exit the function.
Note
See TTreePlayer::Scan for more details on how to redirect the output to an ASCII file

Definition at line 743 of file TTree.h.

◆ SetTargetMemoryRatio()

void TTree::SetTargetMemoryRatio ( Float_t ratio)
inlineinherited

Definition at line 744 of file TTree.h.

◆ SetTimerInterval()

virtual void TTree::SetTimerInterval ( Int_t msec = 333)
inlinevirtualinherited

Definition at line 745 of file TTree.h.

◆ SetTitle()

void TNamed::SetTitle ( const char * title = "")
virtualinherited

◆ SetTreeIndex()

void TTree::SetTreeIndex ( TVirtualIndex * index)
virtualinherited

The current TreeIndex is replaced by the new index.

Note that this function does not delete the previous index. This gives the possibility to play with more than one index, e.g.,

TVirtualIndex* oldIndex = tree.GetTreeIndex();
tree.SetTreeIndex(newIndex);
tree.Draw();
tree.SetTreeIndex(oldIndex);
tree.Draw(); etc
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
Definition TObject.cxx:293
Abstract interface for Tree Index.

Definition at line 9611 of file TTree.cxx.

◆ SetUniqueID()

void TObject::SetUniqueID ( UInt_t uid)
virtualinherited

Set the unique object id.

Definition at line 899 of file TObject.cxx.

◆ SetUpdate()

virtual void TTree::SetUpdate ( Int_t freq = 0)
inlinevirtualinherited

Definition at line 748 of file TTree.h.

◆ SetWeight()

void TChain::SetWeight ( Double_t w = 1,
Option_t * option = "" )
overridevirtual

Set chain weight.

The weight is used by TTree::Draw to automatically weight each selected entry in the resulting histogram. For example the equivalent of

chain.Draw("x","w")

is

chain.SetWeight(w,"global");
chain.Draw("x");

By default the weight used will be the weight of each Tree in the TChain. However, one can force the individual weights to be ignored by specifying the option "global". In this case, the TChain global weight will be used for all Trees.

Reimplemented from TTree.

Definition at line 3009 of file TChain.cxx.

◆ Show()

void TTree::Show ( Long64_t entry = -1,
Int_t lenmax = 20 )
virtualinherited

Print values of all active leaves for entry.

  • if entry==-1, print current entry (default)
  • if a leaf is an array, a maximum of lenmax elements is printed.

Definition at line 9650 of file TTree.cxx.

◆ Sizeof()

Int_t TNamed::Sizeof ( ) const
virtualinherited

Return size of the TNamed part of the TObject.

Reimplemented in TDirectory, TDirectoryFile, TFile, TKey, TSQLFile, and TXMLFile.

Definition at line 182 of file TNamed.cxx.

◆ SortBranchesByTime()

void TTree::SortBranchesByTime ( )
privateinherited

Sorts top-level branches by the last average task time recorded per branch.

Definition at line 5914 of file TTree.cxx.

◆ StartViewer()

void TTree::StartViewer ( )
virtualinherited

Start the TTreeViewer on this tree.

  • ww is the width of the canvas in pixels
  • wh is the height of the canvas in pixels

Definition at line 9724 of file TTree.cxx.

◆ StopCacheLearningPhase()

Int_t TTree::StopCacheLearningPhase ( )
virtualinherited

Stop the cache learning phase.

Returns:

  • 0 learning phase stopped or not active
  • -1 on error

Definition at line 9739 of file TTree.cxx.

◆ Streamer()

void TChain::Streamer ( TBuffer & b)
overridevirtual

Stream a class object.

Reimplemented from TObject.

Definition at line 3023 of file TChain.cxx.

◆ StreamerNVirtual()

void TChain::StreamerNVirtual ( TBuffer & ClassDef_StreamerNVirtual_b)
inline

Definition at line 175 of file TChain.h.

◆ SysError()

void TObject::SysError ( const char * location,
const char * fmt,
... ) const
virtualinherited

Issue system error message.

Use "location" to specify the method where the system error occurred. Accepts standard printf formatting arguments.

Definition at line 1112 of file TObject.cxx.

◆ TestBit()

Bool_t TObject::TestBit ( UInt_t f) const
inlineinherited

Definition at line 204 of file TObject.h.

◆ TestBits()

Int_t TObject::TestBits ( UInt_t f) const
inlineinherited

Definition at line 205 of file TObject.h.

◆ UnbinnedFit()

Int_t TTree::UnbinnedFit ( const char * funcname,
const char * varexp,
const char * selection = "",
Option_t * option = "",
Long64_t nentries = kMaxEntries,
Long64_t firstentry = 0 )
virtualinherited

Unbinned fit of one or more variable(s) from a tree.

funcname is a TF1 function.

Note
see TTree::Draw for explanations of the other parameters.

Fit the variable varexp using the function funcname using the selection cuts given by selection.

The list of fit options is given in parameter option.

  • option = "Q" Quiet mode (minimum printing)
  • option = "V" Verbose mode (default is between Q and V)
  • option = "E" Perform better Errors estimation using Minos technique
  • option = "M" More. Improve fit results

You can specify boundary limits for some or all parameters via

func->SetParLimits(p_number, parmin, parmax);

if parmin>=parmax, the parameter is fixed

Note that you are not forced to fix the limits for all parameters. For example, if you fit a function with 6 parameters, you can do:

func->SetParameters(0,3.1,1.e-6,0.1,-8,100);
func->SetParLimits(4,-10,-4);
func->SetParLimits(5, 1,1);

With this setup:

  • Parameters 0->3 can vary freely
  • Parameter 4 has boundaries [-10,-4] with initial value -8
  • Parameter 5 is fixed to 100.

For the fit to be meaningful, the function must be self-normalized.

i.e. It must have the same integral regardless of the parameter settings. Otherwise the fit will effectively just maximize the area.

It is mandatory to have a normalization variable which is fixed for the fit. e.g.

TF1* f1 = new TF1("f1", "gaus(0)/sqrt(2*3.14159)/[2]", 0, 5);
f1->SetParameters(1, 3.1, 0.01);
f1->SetParLimits(0, 1, 1); // fix the normalization parameter to 1
data->UnbinnedFit("f1", "jpsimass", "jpsipt>3.0");
Definition TF1.h:182
TF1 * f1
Definition legend1.C:11

1, 2 and 3 Dimensional fits are supported. See also TTree::Fit

Return status:

  • The function return the status of the fit in the following form fitResult = migradResult + 10*minosResult + 100*hesseResult + 1000*improveResult
  • The fitResult is 0 is the fit is OK.
  • The fitResult is negative in case of an error not connected with the fit.
  • The number of entries used in the fit can be obtained via mytree.GetSelectedRows();
  • If the number of selected entries is null the function returns -1

Definition at line 9970 of file TTree.cxx.

◆ UseCache()

void TChain::UseCache ( Int_t maxCacheSize = 10,
Int_t pageSize = 0 )
virtual

Dummy function kept for back compatibility.

The cache is now activated automatically when processing TTrees/TChain.

Definition at line 3065 of file TChain.cxx.

◆ UseCurrentStyle()

void TTree::UseCurrentStyle ( )
overridevirtualinherited

Replace current attributes by current style.

Reimplemented from TObject.

Definition at line 9982 of file TTree.cxx.

◆ Warning()

void TObject::Warning ( const char * location,
const char * fmt,
... ) const
virtualinherited

Issue warning message.

Use "location" to specify the method where the warning occurred. Accepts standard printf formatting arguments.

Definition at line 1084 of file TObject.cxx.

◆ Write() [1/2]

Int_t TTree::Write ( const char * name = nullptr,
Int_t option = 0,
Int_t bufsize = 0 ) const
overridevirtualinherited

Write this object to the current directory.

For more see TObject::Write If option & kFlushBasket, call FlushBasket before writing the tree.

Reimplemented from TObject.

Definition at line 10009 of file TTree.cxx.

◆ Write() [2/2]

Int_t TTree::Write ( const char * name = nullptr,
Int_t option = 0,
Int_t bufsize = 0 )
overridevirtualinherited

Write this object to the current directory.

For more see TObject::Write If option & kFlushBasket, call FlushBasket before writing the tree.

Reimplemented from TObject.

Definition at line 10021 of file TTree.cxx.

Member Data Documentation

◆ fAliases

TList* TTree::fAliases
protectedinherited

List of aliases for expressions based on the tree branches.

Definition at line 134 of file TTree.h.

◆ fAllocationCount

std::atomic<UInt_t> TTree::fAllocationCount {0}
mutableprotectedinherited

memory churn.

! Number of reallocations basket memory buffers.

Definition at line 162 of file TTree.h.

◆ fAutoFlush

Long64_t TTree::fAutoFlush
protectedinherited

Auto-flush tree when fAutoFlush entries written or -fAutoFlush (compressed) bytes produced.

Definition at line 111 of file TTree.h.

◆ fAutoSave

Long64_t TTree::fAutoSave
protectedinherited

Autosave tree when fAutoSave entries written or -fAutoSave (compressed) bytes produced.

Definition at line 110 of file TTree.h.

◆ fBits

UInt_t TObject::fBits
privateinherited

bit field status word

Definition at line 47 of file TObject.h.

◆ fBranches

TObjArray TTree::fBranches
protectedinherited

List of Branches.

Definition at line 132 of file TTree.h.

◆ fBranchRef

TBranchRef* TTree::fBranchRef
protectedinherited

Branch supporting the TRefTable (if any).

Definition at line 146 of file TTree.h.

◆ fCacheDoAutoInit

bool TTree::fCacheDoAutoInit
protectedinherited

! true if cache auto creation or resize check is needed

Definition at line 149 of file TTree.h.

◆ fCacheDoClusterPrefetch

bool TTree::fCacheDoClusterPrefetch
protectedinherited

! true if cache is prefetching whole clusters

Definition at line 150 of file TTree.h.

◆ fCacheSize

Long64_t TTree::fCacheSize
protectedinherited

! Maximum size of file buffers

Definition at line 115 of file TTree.h.

◆ fCacheUserSet

bool TTree::fCacheUserSet
protectedinherited

! true if the cache setting was explicitly given by user

Definition at line 151 of file TTree.h.

◆ fCanDeleteRefs

bool TChain::fCanDeleteRefs
protected

! If true, TProcessIDs are deleted when closing a file

Definition at line 40 of file TChain.h.

◆ fChainOffset

Long64_t TTree::fChainOffset
protectedinherited

! Offset of 1st entry of this Tree in a TChain

Definition at line 116 of file TTree.h.

◆ fClones

TList* TTree::fClones
protectedinherited

! List of cloned trees which share our addresses

Definition at line 145 of file TTree.h.

◆ fClusterRangeEnd

Long64_t* TTree::fClusterRangeEnd
protectedinherited

[fNClusterRange] Last entry of a cluster range.

Definition at line 113 of file TTree.h.

◆ fClusterSize

Long64_t* TTree::fClusterSize
protectedinherited

[fNClusterRange] Number of entries in each cluster for a given range.

Definition at line 114 of file TTree.h.

◆ fDebug

Int_t TTree::fDebug
protectedinherited

! Debug level

Definition at line 121 of file TTree.h.

◆ fDebugMax

Long64_t TTree::fDebugMax
protectedinherited

! Last entry number to debug

Definition at line 123 of file TTree.h.

◆ fDebugMin

Long64_t TTree::fDebugMin
protectedinherited

! First entry number to debug

Definition at line 122 of file TTree.h.

◆ fDefaultEntryOffsetLen

Int_t TTree::fDefaultEntryOffsetLen
protectedinherited

Initial Length of fEntryOffset table in the basket buffers.

Definition at line 104 of file TTree.h.

◆ fDirectory

TDirectory* TTree::fDirectory
protectedinherited

! Pointer to directory holding this tree

Definition at line 131 of file TTree.h.

◆ fEntries

Long64_t TTree::fEntries
protectedinherited

Number of entries.

Definition at line 94 of file TTree.h.

◆ fEntryList

TEntryList* TTree::fEntryList
protectedinherited

! Pointer to event selection list (if one)

Definition at line 136 of file TTree.h.

◆ fEstimate

Long64_t TTree::fEstimate
protectedinherited

Number of entries to estimate histogram limits.

Definition at line 112 of file TTree.h.

◆ fEventList

TEventList* TTree::fEventList
protectedinherited

! Pointer to event selection list (if one)

Definition at line 135 of file TTree.h.

◆ fExternalFriends

TList* TTree::fExternalFriends
protectedinherited

! List of TFriendsElement pointing to us and need to be notified of LoadTree. Content not owned.

Definition at line 141 of file TTree.h.

◆ fFile

TFile* TChain::fFile
protected

! Pointer to current file (We own the file).

Definition at line 42 of file TChain.h.

◆ fFileNumber

Int_t TTree::fFileNumber
protectedinherited

!

current file number (if file extensions)

Definition at line 126 of file TTree.h.

◆ fFiles

TObjArray* TChain::fFiles
protected

-> List of file names containing the trees (TChainElement, owned)

Definition at line 43 of file TChain.h.

◆ fFillColor

Color_t TAttFill::fFillColor
protectedinherited

Fill area color.

Definition at line 24 of file TAttFill.h.

◆ fFillStyle

Style_t TAttFill::fFillStyle
protectedinherited

Fill area style.

Definition at line 25 of file TAttFill.h.

◆ fFlushedBytes

Long64_t TTree::fFlushedBytes
protectedinherited

Number of auto-flushed bytes.

Definition at line 99 of file TTree.h.

◆ fFriendLockStatus

UInt_t TTree::fFriendLockStatus
protectedinherited

! Record which method is locking the friend recursion

Definition at line 147 of file TTree.h.

◆ fFriends

TList* TTree::fFriends
protectedinherited

pointer to list of friend elements

Definition at line 140 of file TTree.h.

◆ fgBranchStyle

Int_t TTree::fgBranchStyle = 1
staticprotectedinherited

Old/New branch style.

Definition at line 164 of file TTree.h.

◆ fgDtorOnly

Longptr_t TObject::fgDtorOnly = 0
staticprivateinherited

object for which to call dtor only (i.e. no delete)

Definition at line 49 of file TObject.h.

◆ fGlobalRegistration

bool TChain::fGlobalRegistration
protected

! if true, bypass use of global lists

Definition at line 45 of file TChain.h.

◆ fgMaxTreeSize

Long64_t TTree::fgMaxTreeSize = 100000000000LL
staticprotectedinherited

Maximum size of a file containing a Tree.

Definition at line 165 of file TTree.h.

◆ fgObjectStat

Bool_t TObject::fgObjectStat = kTRUE
staticprivateinherited

if true keep track of objects in TObjectTable

Definition at line 50 of file TObject.h.

◆ fIMTEnabled

bool TTree::fIMTEnabled
protectedinherited

! true if implicit multi-threading is enabled for this tree

Definition at line 152 of file TTree.h.

◆ fIMTFlush

bool TTree::fIMTFlush {false}
mutableprivateinherited

! True if we are doing a multithreaded flush.

Definition at line 169 of file TTree.h.

◆ fIMTTotBytes

std::atomic<Long64_t> TTree::fIMTTotBytes
mutableprivateinherited

! Total bytes for the IMT flush baskets

Definition at line 170 of file TTree.h.

◆ fIMTZipBytes

std::atomic<Long64_t> TTree::fIMTZipBytes
mutableprivateinherited

! Zip bytes for the IMT flush baskets.

Definition at line 171 of file TTree.h.

◆ fIndex

TArrayI TTree::fIndex
protectedinherited

Index of sorted values.

Definition at line 138 of file TTree.h.

◆ fIndexValues

TArrayD TTree::fIndexValues
protectedinherited

Sorted index values.

Definition at line 137 of file TTree.h.

◆ fIOFeatures

TIOFeatures TTree::fIOFeatures {0}
protectedinherited

IO features to define for newly-written baskets and branches.

Definition at line 124 of file TTree.h.

◆ fLeaves

TObjArray TTree::fLeaves
protectedinherited

Direct pointers to individual branch leaves.

Definition at line 133 of file TTree.h.

◆ fLineColor

Color_t TAttLine::fLineColor
protectedinherited

Line color.

Definition at line 24 of file TAttLine.h.

◆ fLineStyle

Style_t TAttLine::fLineStyle
protectedinherited

Line style.

Definition at line 25 of file TAttLine.h.

◆ fLineWidth

Width_t TAttLine::fLineWidth
protectedinherited

Line width.

Definition at line 26 of file TAttLine.h.

◆ fMakeClass

Int_t TTree::fMakeClass
protectedinherited

! not zero when processing code generated by MakeClass

Definition at line 125 of file TTree.h.

◆ fMarkerColor

Color_t TAttMarker::fMarkerColor
protectedinherited

Marker color.

Definition at line 24 of file TAttMarker.h.

◆ fMarkerSize

Size_t TAttMarker::fMarkerSize
protectedinherited

Marker size.

Definition at line 26 of file TAttMarker.h.

◆ fMarkerStyle

Style_t TAttMarker::fMarkerStyle
protectedinherited

Marker style.

Definition at line 25 of file TAttMarker.h.

◆ fMaxClusterRange

Int_t TTree::fMaxClusterRange
protectedinherited

! Memory allocated for the cluster range.

Definition at line 106 of file TTree.h.

◆ fMaxEntries

Long64_t TTree::fMaxEntries
protectedinherited

Maximum number of entries in case of circular buffers.

Definition at line 107 of file TTree.h.

◆ fMaxEntryLoop

Long64_t TTree::fMaxEntryLoop
protectedinherited

Maximum number of entries to process.

Definition at line 108 of file TTree.h.

◆ fMaxVirtualSize

Long64_t TTree::fMaxVirtualSize
protectedinherited

Maximum total size of buffers kept in memory.

Definition at line 109 of file TTree.h.

◆ fName

TString TNamed::fName
protectedinherited

Definition at line 32 of file TNamed.h.

◆ fNamesToBranches

std::unordered_map<std::string, TBranch *> TTree::fNamesToBranches
privateinherited

! maps names to their branches, useful when retrieving branches by name

Definition at line 174 of file TTree.h.

◆ fNClusterRange

Int_t TTree::fNClusterRange
protectedinherited

Number of Cluster range in addition to the one defined by 'AutoFlush'.

Definition at line 105 of file TTree.h.

◆ fNEntriesSinceSorting

UInt_t TTree::fNEntriesSinceSorting
protectedinherited

! Number of entries processed since the last re-sorting of branches

Definition at line 153 of file TTree.h.

◆ fNfill

Int_t TTree::fNfill
protectedinherited

! Local for EntryLoop

Definition at line 120 of file TTree.h.

◆ fNotify

TObject* TTree::fNotify
protectedinherited

Object to be notified when loading a Tree.

TTree::LoadTree() and TChain::LoadTree() will call fNotify->Notify(). Usually points to a TNotifyLink if this is a TChain. !

Definition at line 130 of file TTree.h.

◆ fNtrees

Int_t TChain::fNtrees
protected

Number of trees.

Definition at line 37 of file TChain.h.

◆ fPacketSize

Int_t TTree::fPacketSize
protectedinherited

! Number of entries in one packet for parallel root

Definition at line 119 of file TTree.h.

◆ fPerfStats

TVirtualPerfStats* TTree::fPerfStats
protectedinherited

! pointer to the current perf stats object

Definition at line 142 of file TTree.h.

◆ fPlayer

TVirtualTreePlayer* TTree::fPlayer
protectedinherited

! Pointer to current Tree player

Definition at line 144 of file TTree.h.

◆ fReadEntry

Long64_t TTree::fReadEntry
protectedinherited

! Number of the entry being processed

Definition at line 117 of file TTree.h.

◆ fSavedBytes

Long64_t TTree::fSavedBytes
protectedinherited

Number of autosaved bytes.

Definition at line 98 of file TTree.h.

◆ fScanField

Int_t TTree::fScanField
protectedinherited

Number of runs before prompting in Scan.

Definition at line 102 of file TTree.h.

◆ fSeqBranches

std::vector<TBranch*> TTree::fSeqBranches
protectedinherited

! Branches to be processed sequentially when IMT is on

Definition at line 155 of file TTree.h.

◆ fSortedBranches

std::vector<std::pair<Long64_t,TBranch*> > TTree::fSortedBranches
protectedinherited

! Branches to be processed in parallel when IMT is on, sorted by average task time

Definition at line 154 of file TTree.h.

◆ fStatus

TList* TChain::fStatus
protected

-> List of active/inactive branches (TChainElement, owned)

Definition at line 44 of file TChain.h.

◆ fTargetMemoryRatio

Float_t TTree::fTargetMemoryRatio {1.1f}
protectedinherited

!

Ratio for memory usage in uncompressed buffers versus actual occupancy. 1.0 indicates basket should be resized to exact memory usage, but causes significant

Definition at line 156 of file TTree.h.

◆ fTimerInterval

Int_t TTree::fTimerInterval
protectedinherited

Timer interval in milliseconds.

Definition at line 101 of file TTree.h.

◆ fTitle

TString TNamed::fTitle
protectedinherited

Definition at line 33 of file TNamed.h.

◆ fTotalBuffers

std::atomic<Long64_t> TTree::fTotalBuffers
protectedinherited

! Total number of bytes in branch buffers

Definition at line 118 of file TTree.h.

◆ fTotBytes

Long64_t TTree::fTotBytes
protectedinherited

Total number of bytes in all branches before compression.

Definition at line 96 of file TTree.h.

◆ fTransientBuffer

TBuffer* TTree::fTransientBuffer
protectedinherited

! Pointer to the current transient buffer.

Definition at line 148 of file TTree.h.

◆ fTree

TTree* TChain::fTree
protected

! Pointer to current tree (Note: We do not own this tree.)

Definition at line 41 of file TChain.h.

◆ fTreeIndex

TVirtualIndex* TTree::fTreeIndex
protectedinherited

Pointer to the tree Index (if any).

Definition at line 139 of file TTree.h.

◆ fTreeNumber

Int_t TChain::fTreeNumber
protected

! Current Tree number in fTreeOffset table

Definition at line 38 of file TChain.h.

◆ fTreeOffset

Long64_t* TChain::fTreeOffset
protected

[fTreeOffsetLen] Array of variables

Definition at line 39 of file TChain.h.

◆ fTreeOffsetLen

Int_t TChain::fTreeOffsetLen
protected

Current size of fTreeOffset array.

Definition at line 36 of file TChain.h.

◆ fUniqueID

UInt_t TObject::fUniqueID
privateinherited

object unique identifier

Definition at line 46 of file TObject.h.

◆ fUpdate

Int_t TTree::fUpdate
protectedinherited

Update frequency for EntryLoop.

Definition at line 103 of file TTree.h.

◆ fUserInfo

TList* TTree::fUserInfo
protectedinherited

pointer to a list of user objects associated to this Tree

Definition at line 143 of file TTree.h.

◆ fWeight

Double_t TTree::fWeight
protectedinherited

Tree weight (see TTree::SetWeight).

Definition at line 100 of file TTree.h.

◆ fZipBytes

Long64_t TTree::fZipBytes
protectedinherited

Total number of bytes in all branches after compression.

Definition at line 97 of file TTree.h.

◆ kBigNumber

auto TChain::kBigNumber = TTree::kMaxEntries
staticconstexpr

Definition at line 71 of file TChain.h.

◆ kMaxEntries

Long64_t TTree::kMaxEntries = TVirtualTreePlayer::kMaxEntries
staticconstexprinherited

Used as the max value for any TTree range operation.

The maximum number of entries allowed in a TTree is strictly smaller than this value (maxTreeEntries<= kMaxEntries-1), ie the last entry index is at maximum kMaxEntries-2.

Definition at line 273 of file TTree.h.


The documentation for this class was generated from the following files: