12 #ifndef ROOT_TTreeCache
13 #define ROOT_TTreeCache
24 #ifndef ROOT_TFileCacheRead
27 #ifndef ROOT_TObjArray
Long64_t fEntryMax
first entry in the cache
Bool_t IsAutoCreated() const
Int_t fNReadOk
Number of branches in the cache.
const TObjArray * GetCachedBranches() const
A cache when reading files over the network.
Bool_t fOneTime
true if first buffer is used for prefetching
virtual void SetLearnPrefill(EPrefillType type=kNoPrefill)
Set whether the learning period is started with a prefilling of the cache and which type of prefillin...
A specialized TFileCacheRead object for a TTree.
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
virtual void StopLearningPhase()
This is the counterpart of StartLearningPhase() and can be used to stop the learning phase...
virtual void LearnPrefill()
Perform an initial prefetch, attempting to read as much of the learning phase baskets for all branche...
void SetAutoCreated(Bool_t val)
void StartLearningPhase()
The name should be enough to explain the method.
virtual Int_t AddBranch(TBranch *b, Bool_t subgbranches=kFALSE)
Add a branch to the list of branches to be stored in the cache this function is called by TBranch::Ge...
virtual void Print(Option_t *option="") const
Print cache statistics.
virtual Int_t ReadBufferNormal(char *buf, Long64_t pos, Int_t len)
Old method ReadBuffer before the addition of the prefetch mechanism.
#define ClassDef(name, id)
virtual EPrefillType GetLearnPrefill() const
virtual Bool_t IsEnabled() const
EPrefillType GetConfiguredPrefillType() const
Return the desired prefill type from the environment or resource variable.
virtual Bool_t IsLearning() const
virtual Int_t ReadBuffer(char *buf, Long64_t pos, Int_t len)
Read buffer at position pos if the request is in the list of prefetched blocks read from fBuffer...
virtual void ResetCache()
This will simply clear the cache.
Bool_t fEnabled
read direction established
TTree * fTree
list of branch names in the cache
Double_t GetEfficiency() const
Give the total efficiency of the cache...
virtual void SetEntryRange(Long64_t emin, Long64_t emax)
Set the minimum and maximum entry number to be processed this information helps to optimize the numbe...
virtual Int_t DropBranch(TBranch *b, Bool_t subbranches=kFALSE)
Remove a branch to the list of branches to be stored in the cache this function is called by TBranch:...
virtual Int_t ReadBufferPrefetch(char *buf, Long64_t pos, Int_t len)
Used to read a chunk from a block previously fetched.
virtual ~TTreeCache()
Destructor. (in general called by the TFile destructor)
Bool_t fReadDirectionSet
save the value of the first entry
TTreeCache & operator=(const TTreeCache &)
static void SetLearnEntries(Int_t n=10)
Static function to set the number of entries to be used in learning mode The default value for n is 1...
virtual Bool_t FillBuffer()
Fill the cache buffer with the branches in the cache.
Bool_t fReverseRead
used in the learning phase
Bool_t fFirstTime
how many times we can fill the current buffer
Long64_t fEntryCurrent
last entry in the cache
Bool_t fIsLearning
pointer to the current Tree
virtual void SetFile(TFile *file, TFile::ECacheAction action=TFile::kDisconnect)
Overload to make sure that the object specific.
EPrefillType fPrefillType
cache enabled for cached reading
Int_t fFillTimes
reading in reverse mode
virtual Int_t GetEntryMin() const
virtual Int_t SetBufferSize(Int_t buffersize)
Change the underlying buffer size of the cache.
Int_t fNbranches
next entry number where cache must be filled
Long64_t fFirstEntry
save the fact that we processes the first entry
TList * fBrNames
List of branches to be stored in the cache.
Bool_t fFirstBuffer
true if cache is StopLearningPhase was used
static Int_t fgLearnEntries
A TTree object has a header with a name and a title.
Bool_t fIsManual
true if cache is in learning mode
A TTree is a list of TBranches.
Long64_t fEntryNext
current lowest entry number in the cache
Double_t GetEfficiencyRel() const
This will indicate a sort of relative efficiency...
virtual void UpdateBranches(TTree *tree)
Update pointer to current Tree and recompute pointers to the branches in the cache.
virtual Int_t GetEntryMax() const
static Int_t GetLearnEntries()
Static function returning the number of entries used to train the cache see SetLearnEntries.
ECacheAction
TTreeCache flushing semantics.