library: libTree
#include "TTreeCache.h"

TTreeCache


class description - header file - source file
viewCVS header - viewCVS source

class TTreeCache: public TFileCacheRead

Inheritance Inherited Members Includes Libraries
Class Charts

Function Members (Methods)

Display options:
Show inherited
Show non-public
public:
TTreeCache()
TTreeCache(TTree* tree, Int_t buffersize = 0)
virtual~TTreeCache()
voidTObject::AbstractMethod(const char* method) const
voidAddBranch(TBranch* b)
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTObject::Clear(Option_t* = "")
virtual TObject*TObject::Clone(const char* newname = "") const
virtual Int_tTObject::Compare(const TObject* obj) const
virtual voidTObject::Copy(TObject& object) const
virtual voidTObject::Delete(Option_t* option = "")
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() const
virtual TObject*TObject::DrawClone(Option_t* option = "") const
virtual voidTObject::Dump() const
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
Bool_tFillBuffer()
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
Double_tGetEfficiency()
Double_tGetEfficiencyRel()
virtual const char*TObject::GetIconName() const
static Int_tGetLearnEntries()
virtual const char*TObject::GetName() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
virtual const char*TObject::GetTitle() const
TTree*GetTree() const
virtual UInt_tTObject::GetUniqueID() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTObject::Hash() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidTObject::Inspect() const
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tIsLearning() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tTObject::IsSortable() const
Bool_tTObject::IsZombie() const
virtual voidTObject::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
virtual Bool_tTObject::Notify()
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidTFileCacheRead::Prefetch(Long64_t pos, Int_t len)
virtual voidTFileCacheRead::Print(Option_t* option = "") const
virtual Int_tTObject::Read(const char* name)
virtual Int_tReadBuffer(char* buf, Long64_t pos, Int_t len)
virtual voidTObject::RecursiveRemove(TObject* obj)
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") const
virtual voidTObject::SavePrimitive(ostream& out, Option_t* option = "")
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
virtual voidTObject::SetDrawOption(Option_t* option = "")
static voidTObject::SetDtorOnly(void* obj)
voidSetEntryRange(Long64_t emin, Long64_t emax)
virtual voidTFileCacheRead::SetFile(TFile* file)
static voidSetLearnEntries(Int_t n = 100)
static voidTObject::SetObjectStat(Bool_t stat)
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidShowMembers(TMemberInspector& insp, char* parent)
virtual voidTFileCacheRead::Sort()
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
voidUpdateBranches(TTree* tree)
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = "0", Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = "0", Int_t option = 0, Int_t bufsize = 0) const
protected:
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidTObject::MakeZombie()
private:
TTreeCache(const TTreeCache&)
TTreeCache&operator=(const TTreeCache&)

Data Members

public:
enum TObject::EStatusBits { kCanDelete
kMustCleanup
kObjInCanvas
kIsReferenced
kHasUUID
kCannotPick
kNoContextMenu
kInvalidObject
};
enum TObject::[unnamed] { kIsOnHeap
kNotDeleted
kZombie
kBitMask
kSingleKey
kOverwrite
kWriteDelete
};
protected:
Long64_tfEntryMin! first entry in the cache
Long64_tfEntryMax! last entry in the cache
Long64_tfEntryNext! next entry number where cache must be filled
Long64_tfZipBytes! Total compressed size of branches in cache
Int_tfNbranches! Number of branches in the cache
Int_tfNReadOkNumber of blocks read and found in the cache
Int_tfNReadMissNumber of blocks read and not found in the chache
Int_tfNReadPrefNumber of blocks that were prefetched
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_tfIsLearning! true if cache is in learning mode
static Int_tfgLearnEntriesNumber of entries used for learning mode
Int_tTFileCacheRead::fBufferSizeMinOriginal size of fBuffer
Int_tTFileCacheRead::fBufferSizeAllocated size of fBuffer (at a given time)
Int_tTFileCacheRead::fBufferLenCurrent buffer length (<= fBufferSize)
Int_tTFileCacheRead::fNseekNumber of blocks to be prefetched
Int_tTFileCacheRead::fNtotTotal size of prefetched blocks
Int_tTFileCacheRead::fNbNumber of long buffers
Int_tTFileCacheRead::fSeekSizeAllocated size of fSeek
Long64_t*TFileCacheRead::fSeek[fNseek] Position on file of buffers to be prefetched
Long64_t*TFileCacheRead::fSeekIndex[fNseek] sorted index table of fSeek
Long64_t*TFileCacheRead::fSeekSort[fNseek] Position on file of buffers to be prefetched (sorted)
Long64_t*TFileCacheRead::fPos[fNb] start of long buffers
Int_t*TFileCacheRead::fSeekLen[fNseek] Length of buffers to be prefetched
Int_t*TFileCacheRead::fSeekSortLen[fNseek] Length of buffers to be prefetched (sorted)
Int_t*TFileCacheRead::fSeekPos[fNseek] Position of sorted blocks in fBuffer
Int_t*TFileCacheRead::fLen[fNb] Length of long buffers
TFile*TFileCacheRead::fFilePointer to file
char*TFileCacheRead::fBuffer[fBufferSize] buffer of contiguous prefetched blocks
Bool_tTFileCacheRead::fIsSortedTrue if fSeek array is sorted

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()
 destructor. (in general called by the TFile destructor
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 branches in the cache
Double_t GetEfficiency()
 Give the total efficiency of the cache... defined as the ratio
 of blocks found in the cache vs. the number of blocks prefetched
 ( it could be more than 1 if we read the same block from the cache more
   than once )
 Note: This should eb used at the end of the processing or we will
       get uncomplete stats
Double_t GetEfficiencyRel()
 This will indicate a sort of relative efficiency... a ratio of the
 reads found in the cache to the number of reads so far
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
TTreeCache(const TTreeCache &)
TTreeCache& operator=(const TTreeCache &)
Bool_t IsLearning()
{return fIsLearning;}

Author: Rene Brun 04/06/2006
Last update: root/tree:$Name: $:$Id: TTreeCache.cxx,v 1.11 2006/10/19 19:35:52 pcanal 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.