// @(#)root/tree:$Id$ // Author: Rene Brun 12/01/96 /************************************************************************* * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * * All rights reserved. * * * * For the licensing terms see $ROOTSYS/LICENSE. * * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ #ifndef ROOT_TBranch #define ROOT_TBranch ////////////////////////////////////////////////////////////////////////// // // // TBranch // // // // A TTree object is a list of TBranchs. // // A TBranch describes the branch data structure and supports : // // the list of TBaskets (branch buffers) associated to this branch. // // the list of TLeaves (branch description) // ////////////////////////////////////////////////////////////////////////// #include "TNamed.h" #include "TAttFill.h" #include "TObjArray.h" #include "TBranchCacheInfo.h" #include "TDataType.h" #include "Compression.h" #include "ROOT/TIOFeatures.hxx" class TTree; class TBasket; class TBranchElement; class TLeaf; class TBrowser; class TDirectory; class TFile; class TClonesArray; class TTreeCloner; class TTreeCache; namespace ROOT { namespace Experimental { namespace Internal { class TBulkBranchRead; } } namespace Internal { class TBranchIMTHelper; ///< A helper class for managing IMT work during TTree:Fill operations. } } const Int_t kDoNotProcess = BIT(10); // Active bit for branches const Int_t kIsClone = BIT(11); // to indicate a TBranchClones const Int_t kBranchObject = BIT(12); // branch is a TObject* const Int_t kBranchAny = BIT(17); // branch is an object* const Int_t kMapObject = kBranchObject | kBranchAny; namespace ROOT { namespace Experimental { namespace Internal { ///\class TBulkBranchRead /// Helper class for reading many branch entries at once to optimize throughput. class TBulkBranchRead { friend class ::TBranch; public: /// See TBranch::GetBulkEntries(Long64_t evt, TBuffer &user_buf); Int_t GetBulkEntries(Long64_t evt, TBuffer &user_buf); /// See TBranch::GetEntriesSerialized(Long64_t evt, TBuffer &user_buf); Int_t GetEntriesSerialized(Long64_t evt, TBuffer &user_buf); /// See TBranch::GetEntriesSerialized(Long64_t evt, TBuffer &user_buf, TBuffer *count_buf); Int_t GetEntriesSerialized(Long64_t evt, TBuffer &user_buf, TBuffer *count_buf); /// Return true if the branch can be read through the bulk interfaces. Bool_t SupportsBulkRead() const; private: TBulkBranchRead(TBranch &parent) : fParent(parent) {} TBranch &fParent; }; } } } class TBranch : public TNamed, public TAttFill { using TIOFeatures = ROOT::TIOFeatures; protected: friend class TTreeCache; friend class TTreeCloner; friend class TTree; friend class TBranchElement; friend class ROOT::Experimental::Internal::TBulkBranchRead; /// TBranch status bits enum EStatusBits { kDoNotProcess = ::kDoNotProcess, ///< Active bit for branches kIsClone = ::kIsClone, ///< To indicate a TBranchClones kBranchObject = ::kBranchObject, ///< Branch is a TObject* kBranchAny = ::kBranchAny, ///< Branch is an object* // kMapObject = kBranchObject | kBranchAny; kAutoDelete = BIT(15), kDoNotUseBufferMap = BIT(22) ///< If set, at least one of the entry in the branch will use the buffer's map of classname and objects. }; using BulkObj = ROOT::Experimental::Internal::TBulkBranchRead; static Int_t fgCount; /// List of Branches of this branch TObjArray fLeaves; ///< -> List of leaves of this branch TObjArray fBaskets; ///< -> List of baskets of this branch Int_t *fBasketBytes; ///<[fMaxBaskets] Length of baskets on file Long64_t *fBasketEntry; ///<[fMaxBaskets] Table of first entry in each basket Long64_t *fBasketSeek; ///<[fMaxBaskets] Addresses of baskets on file TTree *fTree; ///