library: libTree
#include "TTreeCache.h"

TTreeCache


class description - header file - source file - inheritance tree (.pdf)

class TTreeCache : public TFileCacheRead

Inheritance Chart:
TObject
<-
TFileCacheRead
<-
TTreeCache

    protected:
TTreeCache(const TTreeCache&) TTreeCache& operator=(const TTreeCache&) public:
TTreeCache() TTreeCache(TTree* tree, Int_t buffersize = 0) virtual ~TTreeCache() void AddBranch(TBranch* b) static TClass* Class() Bool_t FillBuffer() static Int_t GetLearnEntries() TTree* GetTree() const virtual TClass* IsA() const Bool_t IsLearning() const virtual Int_t ReadBuffer(char* buf, Long64_t pos, Int_t len) void SetEntryRange(Long64_t emin, Long64_t emax) static void SetLearnEntries(Int_t n = 100) virtual void ShowMembers(TMemberInspector& insp, char* parent) virtual void Streamer(TBuffer& b) void StreamerNVirtual(TBuffer& b) void UpdateBranches(TTree* tree)

Data Members


    protected:
Long64_t fEntryMin ! first entry in the cache Long64_t fEntryMax ! last entry in the cache Long64_t fEntryNext ! next entry number where cache must be filled Long64_t fZipBytes ! Total compressed size of branches in cache Int_t fNbranches ! Number of branches in the cache TBranch** fBranches ! [fNbranches] List of branches to be stored in the cache TList* fBrNames ! list of branch names in the cache TTree* fOwner ! pointer to the owner Tree/chain TTree* fTree ! pointer to the current Tree Bool_t fIsLearning ! true if cache is in learning mode static Int_t fgLearnEntries Number of entries used for learning mode

Class Description

                                                                      
 TTreeCache                                                           
                                                                      
  A specialized TFileCacheRead object for a TTree                     
  This class acts as a file cache, registering automatically the      
  baskets from the branches being processed (TTree::Draw or           
  TTree::Process and TSelectors) when in the learning phase.          
  The learning phase is by default 100 entries.                       
  It can be changed via TTreeCache::SetLearnEntries.                  
                                                                      
  This cache speeds-up considerably the performance, in particular    
  when the Tree is accessed remotely via a high latency network.      
                                                                      
  The default cache size (10 Mbytes) may be changed via the function  
      TTreeCache::SetCacheSize                                        
                                                                      
  Only the baskets for the requested entry range are put in the cache 
                                                                      
  For each Tree being processed a TTreeCache object is created.       
  This object is automatically deleted when the Tree is deleted or    
  when the file is deleted.                                           
                                                                      
  -Special case of a TChain                                           
   Once the training is done on the first Tree, the list of branches  
   in the cache is kept for the following files.                      
                                                                      
  -Special case of a TEventlist                                       
   if the Tree or TChain has a TEventlist, only the buffers           
   referenced by the list are put in the cache.                       
                                                                      

TTreeCache()
 Default Constructor.
TTreeCache(TTree *tree, Int_t buffersize)
 Constructor.
TTreeCache(const TTreeCache &pf)
 Copy Constructor.
~TTreeCache()
 destructor. (in general called by the TFile destructor
TTreeCache& operator=(const TTreeCache& pf)
 Assignment.
void AddBranch(TBranch *b)
add a branch to the list of branches to be stored in the cache
this function is called by TBranch::GetBasket
Bool_t FillBuffer()
Fill the cache buffer with the branchse in the cache
Int_t GetLearnEntries()
static function returning the number of entries used to train the cache
see SetLearnEntries
TTree * GetTree()
return Tree in the cache
Int_t ReadBuffer(char *buf, Long64_t pos, Int_t len)
 Read buffer at position pos.
 If pos is in the list of prefetched blocks read from fBuffer,
 then try to fill the cache from the list of selected branches,
 otherwise normal read from file. Returns -1 in case of read
 failure, 0 in case not in cache and 1 in case read from cache.
 This function overloads TFileCacheRead::ReadBuffer.
void SetEntryRange(Long64_t emin, Long64_t emax)
 Set the minimum and maximum entry number to be processed
 this information helps to optimize the number of baskets to read
 when prefetching the branch buffers.
void SetLearnEntries(Int_t n)
 Static function to set the number of entries to be used in learning mode
 The default value for n is 10. n must be >= 1
void UpdateBranches(TTree *tree)
update pointer to current Tree and recompute pointers to the branches in the cache
Bool_t IsLearning()

Author: Rene Brun 04/06/2006
Last update: root/tree:$Name: $:$Id: TTreeCache.cxx,v 1.3 2006/07/04 12:58:09 brun Exp $
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *


ROOT page - Class index - Class Hierarchy - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.