// @(#)root/io:$Id$
// Author: Rene Brun   18/05/2006

/*************************************************************************
 * 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.             *
 *************************************************************************/

//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TFileCacheRead : a cache when reading files over the network         //
//                                                                      //
// A caching system to speed up network I/O, i.e. when there is         //
// no operating system caching support (like the buffer cache for       //
// local disk I/O). The cache makes sure that every I/O is done with    //
// a (large) fixed length buffer thereby avoiding many small I/O's.     //
// Currently the read cache system is used by the classes TNetFile,     //
// TXNetFile and TWebFile (via TFile::ReadBuffers()).                   //
//                                                                      //
// When processing TTree, TChain, a specialized class TTreeCache that   //
// derives from this class is automatically created.                    //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#include "TEnv.h"
#include "TFile.h"
#include "TFileCacheRead.h"
#include "TFileCacheWrite.h"
#include "TFilePrefetch.h"
#include "TMath.h"

ClassImp(TFileCacheRead)

//______________________________________________________________________________
TFileCacheRead::TFileCacheRead() : TObject()
{
   // Default Constructor.

   fBufferSizeMin = 0;
   fBufferSize  = 0;
   fBufferLen   = 0;
   fBytesRead   = 0;
   fNoCacheBytesRead = 0;
   fBytesReadExtra = 0;
   fReadCalls   = 0;
   fNoCacheReadCalls = 0;
   fNseek       = 0;
   fNtot        = 0;
   fNb          = 0;
   fSeekSize    = 0;
   fSeek        = 0;
   fSeekIndex   = 0;
   fSeekSort    = 0;
   fPos         = 0;
   fSeekLen     = 0;
   fSeekSortLen = 0;
   fSeekPos     = 0;
   fLen         = 0;
   fFile        = 0;
   fBuffer      = 0;
   fIsSorted    = kFALSE;
   fIsTransferred = kFALSE;

   //values for the second prefetched block
   fBNseek       = 0;
   fBNtot        = 0;
   fBNb          = 0;
   fBSeekSize    = 0;
   fBSeek        = 0;
   fBSeekSort    = 0;
   fBSeekIndex   = 0;
   fBPos         = 0;
   fBSeekLen     = 0;
   fBSeekSortLen = 0;
   fBSeekPos     = 0;
   fBLen         = 0;
   fBIsSorted    = kFALSE;
   fBIsTransferred=kFALSE;

   fAsyncReading = kFALSE;
   fEnablePrefetching = kFALSE;
   fPrefetch        = 0;
   fPrefetchedBlocks= 0;
}

//_____________________________________________________________________________
TFileCacheRead::TFileCacheRead(TFile *file, Int_t buffersize, TObject *tree)
           : TObject()
{
   // Creates a TFileCacheRead data structure.

   if (buffersize <=10000) fBufferSize = 100000;
   else fBufferSize = buffersize;

   fBufferSizeMin = fBufferSize;
   fBufferLen   = 0;
   fBytesRead   = 0;
   fNoCacheBytesRead = 0;
   fBytesReadExtra = 0;
   fReadCalls   = 0;
   fNoCacheReadCalls = 0;
   fNseek       = 0;
   fNtot        = 0;
   fNb          = 0;
   fSeekSize    = 10000;
   fSeek        = new Long64_t[fSeekSize];
   fSeekIndex   = new Int_t[fSeekSize];
   fSeekSort    = new Long64_t[fSeekSize];
   fPos         = new Long64_t[fSeekSize];
   fSeekLen     = new Int_t[fSeekSize];
   fSeekSortLen = new Int_t[fSeekSize];
   fSeekPos     = new Int_t[fSeekSize];
   fLen         = new Int_t[fSeekSize];
   fFile        = file;

   //initialisation for the second block
   fBNseek       = 0;
   fBNtot        = 0;
   fBNb          = 0;
   fBSeekSize    = 10000;
   fBSeek        = new Long64_t[fBSeekSize];
   fBSeekIndex   = new Int_t[fBSeekSize];
   fBSeekSort    = new Long64_t[fBSeekSize];
   fBPos         = new Long64_t[fBSeekSize];
   fBSeekLen     = new Int_t[fBSeekSize];
   fBSeekSortLen = new Int_t[fBSeekSize];
   fBSeekPos     = new Int_t[fBSeekSize];
   fBLen         = new Int_t[fBSeekSize];

   fBuffer = 0;
   fPrefetch = 0;
   fPrefetchedBlocks = 0;

   //initialise the prefetch object and set the cache directory
   // start the thread only if the file is not local
   fEnablePrefetching = gEnv->GetValue("TFile.AsyncPrefetching", 0);

   if (fEnablePrefetching && strcmp(file->GetEndpointUrl()->GetProtocol(), "file")){
      SetEnablePrefetchingImpl(true);
   }
   else { //disable the async pref for local files
      SetEnablePrefetchingImpl(false);
   }

   fIsSorted       = kFALSE;
   fIsTransferred  = kFALSE;
   fBIsSorted      = kFALSE;
   fBIsTransferred = kFALSE;

   if (file) file->SetCacheRead(this, tree);
}

//_____________________________________________________________________________
TFileCacheRead::~TFileCacheRead()
{
   // Destructor.

   SafeDelete(fPrefetch);
   delete [] fSeek;
   delete [] fSeekIndex;
   delete [] fSeekSort;
   delete [] fPos;
   delete [] fSeekLen;
   delete [] fSeekSortLen;
   delete [] fSeekPos;
   delete [] fLen;
   if (fBuffer)
      delete [] fBuffer;
   delete [] fBSeek;
   delete [] fBSeekIndex;
   delete [] fBSeekSort;
   delete [] fBPos;
   delete [] fBSeekLen;
   delete [] fBSeekSortLen;
   delete [] fBSeekPos;
   delete [] fBLen;
}

//_____________________________________________________________________________
void TFileCacheRead::Close(Option_t * /* opt = "" */)
{
   // Close out any threads or asynchronous fetches used by the underlying
   // implementation.
   // This is called by TFile::Close to prevent usage of the file handles
   // after the closing of the file.

   if (fPrefetch) {
      delete fPrefetch;
      fPrefetch = 0;
   }

}

//_____________________________________________________________________________
void TFileCacheRead::Prefetch(Long64_t pos, Int_t len)
{
   // Add block of length len at position pos in the list of blocks to
   // be prefetched. If pos <= 0 the current blocks (if any) are reset.

   fIsSorted = kFALSE;
   fIsTransferred = kFALSE;
   if (pos <= 0) {
      fNseek = 0;
      fNtot  = 0;
      return;
   }
   if (fNseek >= fSeekSize) {
      //reallocate buffers
      fSeekSize *= 2;
      Long64_t *aSeek        = new Long64_t[fSeekSize];
      Int_t    *aSeekIndex   = new Int_t[fSeekSize];
      Long64_t *aSeekSort    = new Long64_t[fSeekSize];
      Long64_t *aPos         = new Long64_t[fSeekSize];
      Int_t    *aSeekLen     = new Int_t[fSeekSize];
      Int_t    *aSeekSortLen = new Int_t[fSeekSize];
      Int_t    *aSeekPos     = new Int_t[fSeekSize];
      Int_t    *aLen         = new Int_t[fSeekSize];
      for (Int_t i=0;i<fNseek;i++) {
         aSeek[i]        = fSeek[i];
         aSeekIndex[i]   = fSeekIndex[i];
         aSeekSort[i]    = fSeekSort[i];
         aPos[i]         = fPos[i];
         aSeekLen[i]     = fSeekLen[i];
         aSeekSortLen[i] = fSeekSortLen[i];
         aSeekPos[i]     = fSeekPos[i];
         aLen[i]         = fLen[i];
      }
      delete [] fSeek;
      delete [] fSeekIndex;
      delete [] fSeekSort;
      delete [] fPos;
      delete [] fSeekLen;
      delete [] fSeekSortLen;
      delete [] fSeekPos;
      delete [] fLen;
      fSeek        = aSeek;
      fSeekIndex   = aSeekIndex;
      fSeekSort    = aSeekSort;
      fPos         = aPos;
      fSeekLen     = aSeekLen;
      fSeekSortLen = aSeekSortLen;
      fSeekPos     = aSeekPos;
      fLen         = aLen;
   }

   fSeek[fNseek] = pos;
   fSeekLen[fNseek] = len;
   fNseek++;
   fNtot += len;
}


//____________________________________________________________________________
void TFileCacheRead::SecondPrefetch(Long64_t pos, Int_t len){

   //add a new element and increase the size if necessary
   fBIsSorted = kFALSE;
   if (pos <= 0) {
      fBNseek = 0;
      fBNtot  = 0;
      return;
   }
   if (fBNseek >= fBSeekSize) {
      //reallocate buffers
      fBSeekSize *= 2;
      Long64_t *aSeek        = new Long64_t[fBSeekSize];
      Int_t    *aSeekIndex   = new Int_t[fBSeekSize];
      Long64_t *aSeekSort    = new Long64_t[fBSeekSize];
      Long64_t *aPos         = new Long64_t[fBSeekSize];
      Int_t    *aSeekLen     = new Int_t[fBSeekSize];
      Int_t    *aSeekSortLen = new Int_t[fBSeekSize];
      Int_t    *aSeekPos     = new Int_t[fBSeekSize];
      Int_t    *aLen         = new Int_t[fBSeekSize];
      for (Int_t i=0;i<fBNseek;i++) {
         aSeek[i]        = fBSeek[i];
         aSeekIndex[i]   = fBSeekIndex[i];
         aSeekSort[i]    = fBSeekSort[i];
         aPos[i]         = fBPos[i];
         aSeekLen[i]     = fBSeekLen[i];
         aSeekSortLen[i] = fBSeekSortLen[i];
         aSeekPos[i]     = fBSeekPos[i];
         aLen[i]         = fBLen[i];
      }
      delete [] fBSeek;
      delete [] fBSeekIndex;
      delete [] fBSeekSort;
      delete [] fBPos;
      delete [] fBSeekLen;
      delete [] fBSeekSortLen;
      delete [] fBSeekPos;
      delete [] fBLen;
      fBSeek        = aSeek;
      fBSeekIndex   = aSeekIndex;
      fBSeekSort    = aSeekSort;
      fBPos         = aPos;
      fBSeekLen     = aSeekLen;
      fBSeekSortLen = aSeekSortLen;
      fBSeekPos     = aSeekPos;
      fBLen         = aLen;
   }

   fBSeek[fBNseek] = pos;
   fBSeekLen[fBNseek] = len;
   fBNseek++;
   fBNtot += len;
}


//_____________________________________________________________________________
void TFileCacheRead::Print(Option_t *option) const
{
   // Print cache statistics, like
   //   ******TreeCache statistics for file: cms2.root ******
   //   Reading............................: 72761843 bytes in 7 transactions
   //   Readahead..........................: 256000 bytes with overhead = 0 bytes
   //   Average transaction................: 10394.549000 Kbytes
   //   Number of blocks in current cache..: 210, total size: 6280352
   //
   // if option = "a" the list of blocks in the cache is printed
   // NB: this function is automatically called by TTreeCache::Print

   TString opt = option;
   opt.ToLower();
   printf("Cached Reading.....................: %lld bytes in %d transactions\n",this->GetBytesRead(), this->GetReadCalls());
   printf("Reading............................: %lld bytes in %d uncached transactions\n",this->GetNoCacheBytesRead(), this->GetNoCacheReadCalls());
   printf("Readahead..........................: %d bytes with overhead = %lld bytes\n",TFile::GetReadaheadSize(),this->GetBytesReadExtra());
   printf("Average transaction................: %f Kbytes\n",0.001*Double_t(this->GetBytesRead())/Double_t(this->GetReadCalls()));
   printf("Number of blocks in current cache..: %d, total size: %d\n",fNseek,fNtot);
   if (fPrefetch){
     printf("Prefetching .......................: %lli blocks\n", fPrefetchedBlocks);
     printf("Prefetching Wait Time..............: %f seconds\n", fPrefetch->GetWaitTime() / 1e+6);
   }

   if (!opt.Contains("a")) return;
   for (Int_t i=0;i<fNseek;i++) {
      if (fIsSorted && !opt.Contains("s")) {
         printf("block: %5d, from: %lld to %lld, len = %d bytes\n",i,fSeekSort[i],fSeekSort[i]+fSeekSortLen[i],fSeekSortLen[i]);
      } else {
         printf("block: %5d, from: %lld to %lld, len = %d bytes\n",i,fSeek[i],fSeek[i]+fSeekLen[i],fSeekLen[i]);
      }
   }
   printf ("Number of long buffers = %d\n",fNb);
   for (Int_t j=0;j<fNb;j++) {
      printf("fPos[%d] = %lld, fLen = %d\n",j,fPos[j],fLen[j]);
   }
}

//_____________________________________________________________________________
Int_t TFileCacheRead::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,
   // otherwise need to make a normal read from file. Returns -1 in case of
   // read error, 0 in case not in cache, 1 in case read from cache.

   Long64_t fileBytesRead0 = fFile->GetBytesRead();
   Long64_t fileBytesReadExtra0 = fFile->GetBytesReadExtra();
   Int_t fileReadCalls0 = fFile->GetReadCalls();

   Int_t loc = -1;
   Int_t rc = ReadBufferExt(buf, pos, len, loc);

   fBytesRead += fFile->GetBytesRead() - fileBytesRead0;
   fBytesReadExtra += fFile->GetBytesReadExtra() - fileBytesReadExtra0;
   fReadCalls += fFile->GetReadCalls() - fileReadCalls0;

   return rc;
}

//_____________________________________________________________________________
Int_t TFileCacheRead::ReadBufferExt(char *buf, Long64_t pos, Int_t len, Int_t &loc)
{
   if (fEnablePrefetching)
      return ReadBufferExtPrefetch(buf, pos, len, loc);
   else
      return ReadBufferExtNormal(buf, pos, len, loc);
}


//_____________________________________________________________________________
Int_t TFileCacheRead::ReadBufferExtPrefetch(char *buf, Long64_t pos, Int_t len, Int_t &loc)
{
   //prefetch the first block
   if (fNseek > 0 && !fIsSorted) {
      Sort();
      loc = -1;
      fPrefetch->ReadBlock(fPos, fLen, fNb);
      fPrefetchedBlocks++;
      fIsTransferred = kTRUE;
   }

   //try to prefetch the second block
   if (fBNseek > 0 && !fBIsSorted) {
      SecondSort();
      loc = -1;
      fPrefetch->ReadBlock(fBPos, fBLen, fBNb);
      fPrefetchedBlocks++;
   }

   // in case we are writing and reading to/from this file, we must check
   // if this buffer is in the write cache (not yet written to the file)
   if (TFileCacheWrite *cachew = fFile->GetCacheWrite()) {
      if (cachew->ReadBuffer(buf,pos,len) == 0) {
         fFile->SetOffset(pos+len);
         return 1;
      }
   }

   // try to prefetch from the first block
   if (loc < 0) {
      loc = (Int_t)TMath::BinarySearch(fNseek,fSeekSort,pos);
   }

   if (loc >= 0 && loc < fNseek && pos == fSeekSort[loc]) {
      if (buf && fPrefetch){
         // prefetch with the new method
         fPrefetch->ReadBuffer(buf, pos, len);
         return 1;
      }
   }
   else if (buf && fPrefetch){
      // try to preferch from the second block
      loc = (Int_t)TMath::BinarySearch(fBNseek, fBSeekSort, pos);

      if (loc >= 0 && loc < fBNseek && pos == fBSeekSort[loc]){
         if (fPrefetch->ReadBuffer(buf, pos, len)) {
           return 1;
        }
      }
   }

   return 0;
}


//_____________________________________________________________________________
Int_t TFileCacheRead::ReadBufferExtNormal(char *buf, Long64_t pos, Int_t len, Int_t &loc)
{
   // Base function for ReadBuffer. Also gives out the position
   // of the block in the internal buffer. This helps TTreeCacheUnzip to avoid
   // doing twice the binary search

   if (fNseek > 0 && !fIsSorted) {
      Sort();
      loc = -1;

      // If ReadBufferAsync is not supported by this implementation...
      if (!fAsyncReading) {
         // Then we use the vectored read to read everything now
         if (fFile->ReadBuffers(fBuffer,fPos,fLen,fNb)) {
            return -1;
         }
         fIsTransferred = kTRUE;
      } else {
         // In any case, we'll start to request the chunks.
         // This implementation simply reads all the chunks in advance
         // in the async way.

         // Use the async readv instead of single reads
         fFile->ReadBuffers(0, 0, 0, 0); //Clear the XrdClient cache
         if (fFile->ReadBuffers(0,fPos,fLen,fNb)) {
            return -1;
         }
         fIsTransferred = kTRUE;
      }
   }

   // in case we are writing and reading to/from this file, we much check
   // if this buffer is in the write cache (not yet written to the file)
   if (TFileCacheWrite *cachew = fFile->GetCacheWrite()) {
      if (cachew->ReadBuffer(buf,pos,len) == 0) {
         fFile->SetOffset(pos+len);
         return 1;
      }
   }

   // If asynchronous reading is supported by this implementation...
   if (fAsyncReading) {

         // Now we dont have to look for it in the local buffer
         // if it's async, we expect that the communication library
         // will handle it more efficiently than we can do here

      Int_t retval;
      if (loc < 0)
         loc = (Int_t)TMath::BinarySearch(fNseek,fSeekSort,pos);

      // We use the internal list just to notify if the list is to be reconstructed
      if (loc >= 0 && loc < fNseek && pos == fSeekSort[loc]) {
         // Block found, the caller will get it

         if (buf) {
            // disable cache to avoid infinite recursion
            if (fFile->ReadBuffer(buf, pos, len)) {
               return -1;
            }
            fFile->SetOffset(pos+len);
         }

         retval = 1;
      } else {
         // Block not found in the list, we report it as a miss
         retval = 0;
      }

      if (gDebug > 0)
         Info("ReadBuffer","pos=%lld, len=%d, retval=%d, loc=%d, "
              "fseekSort[loc]=%lld, fSeekLen[loc]=%d",
              pos, len, retval, loc, fSeekSort[loc], fSeekLen[loc]);

      return retval;
   } else {

      if (loc < 0)
         loc = (Int_t)TMath::BinarySearch(fNseek, fSeekSort, pos);

      if (loc >= 0 && loc <fNseek && pos == fSeekSort[loc]) {
         if (buf) {
            memcpy(buf,&fBuffer[fSeekPos[loc]],len);
            fFile->SetOffset(pos+len);
         }
         return 1;
      }
   }

   return 0;
}

//_____________________________________________________________________________
void TFileCacheRead::SetFile(TFile *file, TFile::ECacheAction action)
{
   // Set the file using this cache and reset the current blocks (if any).

   fFile = file;

   if (fAsyncReading) {
      // If asynchronous reading is not supported by this TFile specialization
      // we use sync primitives, hence we need the local buffer
      if (file && file->ReadBufferAsync(0, 0)) {
         fAsyncReading = kFALSE;
         fBuffer       = new char[fBufferSize];
      }
   }

   if (action == TFile::kDisconnect)
      Prefetch(0,0);

   if (fPrefetch) {
      if (action == TFile::kDisconnect)
         SecondPrefetch(0, 0);
      fPrefetch->SetFile(file);
   }
}

//_____________________________________________________________________________
void TFileCacheRead::Sort()
{
   // Sort buffers to be prefetched in increasing order of positions.
   // Merge consecutive blocks if necessary.

   if (!fNseek) return;
   TMath::Sort(fNseek,fSeek,fSeekIndex,kFALSE);
   Int_t i;
   Int_t nb = 0;
   Int_t effectiveNseek = 0;
   for (i=0;i<fNseek;i++) {
      // Skip duplicates
      Int_t ind = fSeekIndex[i];
      if (effectiveNseek!=0 && fSeek[ind]==fSeekSort[effectiveNseek-1])
      {
         if (fSeekSortLen[effectiveNseek-1] < fSeekLen[ind]) {
            fSeekSortLen[effectiveNseek-1] = fSeekLen[ind];
         }
         continue;
      }
      fSeekSort[effectiveNseek] = fSeek[ind];
      fSeekSortLen[effectiveNseek] = fSeekLen[ind];
      ++effectiveNseek;
   }
   fNseek = effectiveNseek;
   if (fNtot > fBufferSizeMin) {
      fBufferSize = fNtot + 100;
      delete [] fBuffer;
      fBuffer = 0;
      // If ReadBufferAsync is not supported by this implementation
      // it means that we are using sync primitives, hence we need the local buffer
      if (!fAsyncReading)
         fBuffer = new char[fBufferSize];
   }
   fPos[0]  = fSeekSort[0];
   fLen[0]  = fSeekSortLen[0];
   fSeekPos[0] = 0;
   for (i=1;i<fNseek;i++) {
      fSeekPos[i] = fSeekPos[i-1] + fSeekSortLen[i-1];
      //in the test below 16 MBytes is pure empirirical and may depend on the file system.
      //increasing this number must be done with care, as it may increase
      //the job real time (mismatch with OS buffers)
      if ((fSeekSort[i] != fSeekSort[i-1]+fSeekSortLen[i-1]) ||
          (fLen[nb] > 16000000)) {
         nb++;
         fPos[nb] = fSeekSort[i];
         fLen[nb] = fSeekSortLen[i];
      } else {
         fLen[nb] += fSeekSortLen[i];
      }
   }
   fNb = nb+1;
   fIsSorted = kTRUE;
}


//_____________________________________________________________________________
void TFileCacheRead::SecondSort()
{
   // Sort buffers to be prefetched in increasing order of positions.
   // Merge consecutive blocks if necessary.
   // Sort buffers to be prefetched in increasing order of positions.
   // Merge consecutive blocks if necessary.

   if (!fBNseek) return;
   TMath::Sort(fBNseek,fBSeek,fBSeekIndex,kFALSE);
   Int_t i;
   Int_t nb = 0;
   Int_t effectiveNseek = 0;
   for (i=0;i<fBNseek;i++) {
      // Skip duplicates
      Int_t ind = fBSeekIndex[i];
      if (effectiveNseek!=0 && fBSeek[ind]==fBSeekSort[effectiveNseek-1])
      {
         if (fBSeekSortLen[effectiveNseek-1] < fBSeekLen[ind]) {
            fBSeekSortLen[effectiveNseek-1] = fBSeekLen[ind];
         }
         continue;
      }
      fBSeekSort[effectiveNseek] = fBSeek[ind];
      fBSeekSortLen[effectiveNseek] = fBSeekLen[ind];
      ++effectiveNseek;
   }
   fBNseek = effectiveNseek;
   if (fBNtot > fBufferSizeMin) {
      fBufferSize = fBNtot + 100;
      delete [] fBuffer;
      fBuffer = 0;
      // If ReadBufferAsync is not supported by this implementation
      // it means that we are using sync primitives, hence we need the local buffer
      if (!fAsyncReading)
         fBuffer = new char[fBufferSize];
   }
   fBPos[0]  = fBSeekSort[0];
   fBLen[0]  = fBSeekSortLen[0];
   fBSeekPos[0] = 0;
   for (i=1;i<fBNseek;i++) {
      fBSeekPos[i] = fBSeekPos[i-1] + fBSeekSortLen[i-1];
      //in the test below 16 MBytes is pure empirirical and may depend on the file system.
      //increasing this number must be done with care, as it may increase
      //the job real time (mismatch with OS buffers)
      if ((fBSeekSort[i] != fBSeekSort[i-1]+fBSeekSortLen[i-1]) ||
         (fBLen[nb] > 16000000)) {
         nb++;
         fBPos[nb] = fBSeekSort[i];
         fBLen[nb] = fBSeekSortLen[i];
      } else {
         fBLen[nb] += fBSeekSortLen[i];
      }
   }
   fBNb = nb+1;
   fBIsSorted = kTRUE;
}

//______________________________________________________________________________
TFilePrefetch* TFileCacheRead::GetPrefetchObj(){

   return this->fPrefetch;
}


//_____________________________________________________________________________
void TFileCacheRead::WaitFinishPrefetch()
{
   if ( fEnablePrefetching && fPrefetch ) {
      fPrefetch->WaitFinishPrefetch();
   }
}


//______________________________________________________________________________
void TFileCacheRead::SetEnablePrefetching(Bool_t setPrefetching)
{
   // Set the prefetching mode of this file.
   // if 'setPrefetching', enable the asynchronous prefetching
   // (using TFilePrefetch) and if the gEnv and rootrc
   // variable Cache.Directory is set, also enable the local
   // caching of the prefetched blocks.
   // if 'setPrefetching', the old prefetcher is enabled is
   // the gEnv and rootrc variable is TFile.AsyncReading

   SetEnablePrefetchingImpl(setPrefetching);
}

//______________________________________________________________________________
void TFileCacheRead::SetEnablePrefetchingImpl(Bool_t setPrefetching)
{
   // TFileCacheRead implementation of SetEnablePrefetching.
   //
   // This function is called from the constructor and should not be virtual.

   fEnablePrefetching = setPrefetching;

   if (!fPrefetch && fEnablePrefetching) {
      fPrefetch = new TFilePrefetch(fFile);
      const char* cacheDir = gEnv->GetValue("Cache.Directory", "");
      if (strcmp(cacheDir, ""))
        if (!fPrefetch->SetCache((char*) cacheDir))
           fprintf(stderr, "Error while trying to set the cache directory: %s.\n", cacheDir);
      if (fPrefetch->ThreadStart()){
         fprintf(stderr,"Error stating prefetching thread. Disabling prefetching.\n");
         fEnablePrefetching = 0;
      }
   } else if (fPrefetch && !fEnablePrefetching) {
       SafeDelete(fPrefetch);
       fPrefetch = NULL;
   }

   //environment variable used to switch to the new method of reading asynchronously
   if (fEnablePrefetching) {
      fAsyncReading = kFALSE;
   }
   else {
      fAsyncReading = gEnv->GetValue("TFile.AsyncReading", 0);
      if (fAsyncReading) {
         // Check if asynchronous reading is supported by this TFile specialization
         fAsyncReading = kFALSE;
         if (fFile && !(fFile->ReadBufferAsync(0, 0)))
            fAsyncReading = kTRUE;
         }
      if (!fAsyncReading && fBuffer == 0) {
         // we use sync primitives, hence we need the local buffer
         fBuffer = new char[fBufferSize];
      }
   }
}

 TFileCacheRead.cxx:1
 TFileCacheRead.cxx:2
 TFileCacheRead.cxx:3
 TFileCacheRead.cxx:4
 TFileCacheRead.cxx:5
 TFileCacheRead.cxx:6
 TFileCacheRead.cxx:7
 TFileCacheRead.cxx:8
 TFileCacheRead.cxx:9
 TFileCacheRead.cxx:10
 TFileCacheRead.cxx:11
 TFileCacheRead.cxx:12
 TFileCacheRead.cxx:13
 TFileCacheRead.cxx:14
 TFileCacheRead.cxx:15
 TFileCacheRead.cxx:16
 TFileCacheRead.cxx:17
 TFileCacheRead.cxx:18
 TFileCacheRead.cxx:19
 TFileCacheRead.cxx:20
 TFileCacheRead.cxx:21
 TFileCacheRead.cxx:22
 TFileCacheRead.cxx:23
 TFileCacheRead.cxx:24
 TFileCacheRead.cxx:25
 TFileCacheRead.cxx:26
 TFileCacheRead.cxx:27
 TFileCacheRead.cxx:28
 TFileCacheRead.cxx:29
 TFileCacheRead.cxx:30
 TFileCacheRead.cxx:31
 TFileCacheRead.cxx:32
 TFileCacheRead.cxx:33
 TFileCacheRead.cxx:34
 TFileCacheRead.cxx:35
 TFileCacheRead.cxx:36
 TFileCacheRead.cxx:37
 TFileCacheRead.cxx:38
 TFileCacheRead.cxx:39
 TFileCacheRead.cxx:40
 TFileCacheRead.cxx:41
 TFileCacheRead.cxx:42
 TFileCacheRead.cxx:43
 TFileCacheRead.cxx:44
 TFileCacheRead.cxx:45
 TFileCacheRead.cxx:46
 TFileCacheRead.cxx:47
 TFileCacheRead.cxx:48
 TFileCacheRead.cxx:49
 TFileCacheRead.cxx:50
 TFileCacheRead.cxx:51
 TFileCacheRead.cxx:52
 TFileCacheRead.cxx:53
 TFileCacheRead.cxx:54
 TFileCacheRead.cxx:55
 TFileCacheRead.cxx:56
 TFileCacheRead.cxx:57
 TFileCacheRead.cxx:58
 TFileCacheRead.cxx:59
 TFileCacheRead.cxx:60
 TFileCacheRead.cxx:61
 TFileCacheRead.cxx:62
 TFileCacheRead.cxx:63
 TFileCacheRead.cxx:64
 TFileCacheRead.cxx:65
 TFileCacheRead.cxx:66
 TFileCacheRead.cxx:67
 TFileCacheRead.cxx:68
 TFileCacheRead.cxx:69
 TFileCacheRead.cxx:70
 TFileCacheRead.cxx:71
 TFileCacheRead.cxx:72
 TFileCacheRead.cxx:73
 TFileCacheRead.cxx:74
 TFileCacheRead.cxx:75
 TFileCacheRead.cxx:76
 TFileCacheRead.cxx:77
 TFileCacheRead.cxx:78
 TFileCacheRead.cxx:79
 TFileCacheRead.cxx:80
 TFileCacheRead.cxx:81
 TFileCacheRead.cxx:82
 TFileCacheRead.cxx:83
 TFileCacheRead.cxx:84
 TFileCacheRead.cxx:85
 TFileCacheRead.cxx:86
 TFileCacheRead.cxx:87
 TFileCacheRead.cxx:88
 TFileCacheRead.cxx:89
 TFileCacheRead.cxx:90
 TFileCacheRead.cxx:91
 TFileCacheRead.cxx:92
 TFileCacheRead.cxx:93
 TFileCacheRead.cxx:94
 TFileCacheRead.cxx:95
 TFileCacheRead.cxx:96
 TFileCacheRead.cxx:97
 TFileCacheRead.cxx:98
 TFileCacheRead.cxx:99
 TFileCacheRead.cxx:100
 TFileCacheRead.cxx:101
 TFileCacheRead.cxx:102
 TFileCacheRead.cxx:103
 TFileCacheRead.cxx:104
 TFileCacheRead.cxx:105
 TFileCacheRead.cxx:106
 TFileCacheRead.cxx:107
 TFileCacheRead.cxx:108
 TFileCacheRead.cxx:109
 TFileCacheRead.cxx:110
 TFileCacheRead.cxx:111
 TFileCacheRead.cxx:112
 TFileCacheRead.cxx:113
 TFileCacheRead.cxx:114
 TFileCacheRead.cxx:115
 TFileCacheRead.cxx:116
 TFileCacheRead.cxx:117
 TFileCacheRead.cxx:118
 TFileCacheRead.cxx:119
 TFileCacheRead.cxx:120
 TFileCacheRead.cxx:121
 TFileCacheRead.cxx:122
 TFileCacheRead.cxx:123
 TFileCacheRead.cxx:124
 TFileCacheRead.cxx:125
 TFileCacheRead.cxx:126
 TFileCacheRead.cxx:127
 TFileCacheRead.cxx:128
 TFileCacheRead.cxx:129
 TFileCacheRead.cxx:130
 TFileCacheRead.cxx:131
 TFileCacheRead.cxx:132
 TFileCacheRead.cxx:133
 TFileCacheRead.cxx:134
 TFileCacheRead.cxx:135
 TFileCacheRead.cxx:136
 TFileCacheRead.cxx:137
 TFileCacheRead.cxx:138
 TFileCacheRead.cxx:139
 TFileCacheRead.cxx:140
 TFileCacheRead.cxx:141
 TFileCacheRead.cxx:142
 TFileCacheRead.cxx:143
 TFileCacheRead.cxx:144
 TFileCacheRead.cxx:145
 TFileCacheRead.cxx:146
 TFileCacheRead.cxx:147
 TFileCacheRead.cxx:148
 TFileCacheRead.cxx:149
 TFileCacheRead.cxx:150
 TFileCacheRead.cxx:151
 TFileCacheRead.cxx:152
 TFileCacheRead.cxx:153
 TFileCacheRead.cxx:154
 TFileCacheRead.cxx:155
 TFileCacheRead.cxx:156
 TFileCacheRead.cxx:157
 TFileCacheRead.cxx:158
 TFileCacheRead.cxx:159
 TFileCacheRead.cxx:160
 TFileCacheRead.cxx:161
 TFileCacheRead.cxx:162
 TFileCacheRead.cxx:163
 TFileCacheRead.cxx:164
 TFileCacheRead.cxx:165
 TFileCacheRead.cxx:166
 TFileCacheRead.cxx:167
 TFileCacheRead.cxx:168
 TFileCacheRead.cxx:169
 TFileCacheRead.cxx:170
 TFileCacheRead.cxx:171
 TFileCacheRead.cxx:172
 TFileCacheRead.cxx:173
 TFileCacheRead.cxx:174
 TFileCacheRead.cxx:175
 TFileCacheRead.cxx:176
 TFileCacheRead.cxx:177
 TFileCacheRead.cxx:178
 TFileCacheRead.cxx:179
 TFileCacheRead.cxx:180
 TFileCacheRead.cxx:181
 TFileCacheRead.cxx:182
 TFileCacheRead.cxx:183
 TFileCacheRead.cxx:184
 TFileCacheRead.cxx:185
 TFileCacheRead.cxx:186
 TFileCacheRead.cxx:187
 TFileCacheRead.cxx:188
 TFileCacheRead.cxx:189
 TFileCacheRead.cxx:190
 TFileCacheRead.cxx:191
 TFileCacheRead.cxx:192
 TFileCacheRead.cxx:193
 TFileCacheRead.cxx:194
 TFileCacheRead.cxx:195
 TFileCacheRead.cxx:196
 TFileCacheRead.cxx:197
 TFileCacheRead.cxx:198
 TFileCacheRead.cxx:199
 TFileCacheRead.cxx:200
 TFileCacheRead.cxx:201
 TFileCacheRead.cxx:202
 TFileCacheRead.cxx:203
 TFileCacheRead.cxx:204
 TFileCacheRead.cxx:205
 TFileCacheRead.cxx:206
 TFileCacheRead.cxx:207
 TFileCacheRead.cxx:208
 TFileCacheRead.cxx:209
 TFileCacheRead.cxx:210
 TFileCacheRead.cxx:211
 TFileCacheRead.cxx:212
 TFileCacheRead.cxx:213
 TFileCacheRead.cxx:214
 TFileCacheRead.cxx:215
 TFileCacheRead.cxx:216
 TFileCacheRead.cxx:217
 TFileCacheRead.cxx:218
 TFileCacheRead.cxx:219
 TFileCacheRead.cxx:220
 TFileCacheRead.cxx:221
 TFileCacheRead.cxx:222
 TFileCacheRead.cxx:223
 TFileCacheRead.cxx:224
 TFileCacheRead.cxx:225
 TFileCacheRead.cxx:226
 TFileCacheRead.cxx:227
 TFileCacheRead.cxx:228
 TFileCacheRead.cxx:229
 TFileCacheRead.cxx:230
 TFileCacheRead.cxx:231
 TFileCacheRead.cxx:232
 TFileCacheRead.cxx:233
 TFileCacheRead.cxx:234
 TFileCacheRead.cxx:235
 TFileCacheRead.cxx:236
 TFileCacheRead.cxx:237
 TFileCacheRead.cxx:238
 TFileCacheRead.cxx:239
 TFileCacheRead.cxx:240
 TFileCacheRead.cxx:241
 TFileCacheRead.cxx:242
 TFileCacheRead.cxx:243
 TFileCacheRead.cxx:244
 TFileCacheRead.cxx:245
 TFileCacheRead.cxx:246
 TFileCacheRead.cxx:247
 TFileCacheRead.cxx:248
 TFileCacheRead.cxx:249
 TFileCacheRead.cxx:250
 TFileCacheRead.cxx:251
 TFileCacheRead.cxx:252
 TFileCacheRead.cxx:253
 TFileCacheRead.cxx:254
 TFileCacheRead.cxx:255
 TFileCacheRead.cxx:256
 TFileCacheRead.cxx:257
 TFileCacheRead.cxx:258
 TFileCacheRead.cxx:259
 TFileCacheRead.cxx:260
 TFileCacheRead.cxx:261
 TFileCacheRead.cxx:262
 TFileCacheRead.cxx:263
 TFileCacheRead.cxx:264
 TFileCacheRead.cxx:265
 TFileCacheRead.cxx:266
 TFileCacheRead.cxx:267
 TFileCacheRead.cxx:268
 TFileCacheRead.cxx:269
 TFileCacheRead.cxx:270
 TFileCacheRead.cxx:271
 TFileCacheRead.cxx:272
 TFileCacheRead.cxx:273
 TFileCacheRead.cxx:274
 TFileCacheRead.cxx:275
 TFileCacheRead.cxx:276
 TFileCacheRead.cxx:277
 TFileCacheRead.cxx:278
 TFileCacheRead.cxx:279
 TFileCacheRead.cxx:280
 TFileCacheRead.cxx:281
 TFileCacheRead.cxx:282
 TFileCacheRead.cxx:283
 TFileCacheRead.cxx:284
 TFileCacheRead.cxx:285
 TFileCacheRead.cxx:286
 TFileCacheRead.cxx:287
 TFileCacheRead.cxx:288
 TFileCacheRead.cxx:289
 TFileCacheRead.cxx:290
 TFileCacheRead.cxx:291
 TFileCacheRead.cxx:292
 TFileCacheRead.cxx:293
 TFileCacheRead.cxx:294
 TFileCacheRead.cxx:295
 TFileCacheRead.cxx:296
 TFileCacheRead.cxx:297
 TFileCacheRead.cxx:298
 TFileCacheRead.cxx:299
 TFileCacheRead.cxx:300
 TFileCacheRead.cxx:301
 TFileCacheRead.cxx:302
 TFileCacheRead.cxx:303
 TFileCacheRead.cxx:304
 TFileCacheRead.cxx:305
 TFileCacheRead.cxx:306
 TFileCacheRead.cxx:307
 TFileCacheRead.cxx:308
 TFileCacheRead.cxx:309
 TFileCacheRead.cxx:310
 TFileCacheRead.cxx:311
 TFileCacheRead.cxx:312
 TFileCacheRead.cxx:313
 TFileCacheRead.cxx:314
 TFileCacheRead.cxx:315
 TFileCacheRead.cxx:316
 TFileCacheRead.cxx:317
 TFileCacheRead.cxx:318
 TFileCacheRead.cxx:319
 TFileCacheRead.cxx:320
 TFileCacheRead.cxx:321
 TFileCacheRead.cxx:322
 TFileCacheRead.cxx:323
 TFileCacheRead.cxx:324
 TFileCacheRead.cxx:325
 TFileCacheRead.cxx:326
 TFileCacheRead.cxx:327
 TFileCacheRead.cxx:328
 TFileCacheRead.cxx:329
 TFileCacheRead.cxx:330
 TFileCacheRead.cxx:331
 TFileCacheRead.cxx:332
 TFileCacheRead.cxx:333
 TFileCacheRead.cxx:334
 TFileCacheRead.cxx:335
 TFileCacheRead.cxx:336
 TFileCacheRead.cxx:337
 TFileCacheRead.cxx:338
 TFileCacheRead.cxx:339
 TFileCacheRead.cxx:340
 TFileCacheRead.cxx:341
 TFileCacheRead.cxx:342
 TFileCacheRead.cxx:343
 TFileCacheRead.cxx:344
 TFileCacheRead.cxx:345
 TFileCacheRead.cxx:346
 TFileCacheRead.cxx:347
 TFileCacheRead.cxx:348
 TFileCacheRead.cxx:349
 TFileCacheRead.cxx:350
 TFileCacheRead.cxx:351
 TFileCacheRead.cxx:352
 TFileCacheRead.cxx:353
 TFileCacheRead.cxx:354
 TFileCacheRead.cxx:355
 TFileCacheRead.cxx:356
 TFileCacheRead.cxx:357
 TFileCacheRead.cxx:358
 TFileCacheRead.cxx:359
 TFileCacheRead.cxx:360
 TFileCacheRead.cxx:361
 TFileCacheRead.cxx:362
 TFileCacheRead.cxx:363
 TFileCacheRead.cxx:364
 TFileCacheRead.cxx:365
 TFileCacheRead.cxx:366
 TFileCacheRead.cxx:367
 TFileCacheRead.cxx:368
 TFileCacheRead.cxx:369
 TFileCacheRead.cxx:370
 TFileCacheRead.cxx:371
 TFileCacheRead.cxx:372
 TFileCacheRead.cxx:373
 TFileCacheRead.cxx:374
 TFileCacheRead.cxx:375
 TFileCacheRead.cxx:376
 TFileCacheRead.cxx:377
 TFileCacheRead.cxx:378
 TFileCacheRead.cxx:379
 TFileCacheRead.cxx:380
 TFileCacheRead.cxx:381
 TFileCacheRead.cxx:382
 TFileCacheRead.cxx:383
 TFileCacheRead.cxx:384
 TFileCacheRead.cxx:385
 TFileCacheRead.cxx:386
 TFileCacheRead.cxx:387
 TFileCacheRead.cxx:388
 TFileCacheRead.cxx:389
 TFileCacheRead.cxx:390
 TFileCacheRead.cxx:391
 TFileCacheRead.cxx:392
 TFileCacheRead.cxx:393
 TFileCacheRead.cxx:394
 TFileCacheRead.cxx:395
 TFileCacheRead.cxx:396
 TFileCacheRead.cxx:397
 TFileCacheRead.cxx:398
 TFileCacheRead.cxx:399
 TFileCacheRead.cxx:400
 TFileCacheRead.cxx:401
 TFileCacheRead.cxx:402
 TFileCacheRead.cxx:403
 TFileCacheRead.cxx:404
 TFileCacheRead.cxx:405
 TFileCacheRead.cxx:406
 TFileCacheRead.cxx:407
 TFileCacheRead.cxx:408
 TFileCacheRead.cxx:409
 TFileCacheRead.cxx:410
 TFileCacheRead.cxx:411
 TFileCacheRead.cxx:412
 TFileCacheRead.cxx:413
 TFileCacheRead.cxx:414
 TFileCacheRead.cxx:415
 TFileCacheRead.cxx:416
 TFileCacheRead.cxx:417
 TFileCacheRead.cxx:418
 TFileCacheRead.cxx:419
 TFileCacheRead.cxx:420
 TFileCacheRead.cxx:421
 TFileCacheRead.cxx:422
 TFileCacheRead.cxx:423
 TFileCacheRead.cxx:424
 TFileCacheRead.cxx:425
 TFileCacheRead.cxx:426
 TFileCacheRead.cxx:427
 TFileCacheRead.cxx:428
 TFileCacheRead.cxx:429
 TFileCacheRead.cxx:430
 TFileCacheRead.cxx:431
 TFileCacheRead.cxx:432
 TFileCacheRead.cxx:433
 TFileCacheRead.cxx:434
 TFileCacheRead.cxx:435
 TFileCacheRead.cxx:436
 TFileCacheRead.cxx:437
 TFileCacheRead.cxx:438
 TFileCacheRead.cxx:439
 TFileCacheRead.cxx:440
 TFileCacheRead.cxx:441
 TFileCacheRead.cxx:442
 TFileCacheRead.cxx:443
 TFileCacheRead.cxx:444
 TFileCacheRead.cxx:445
 TFileCacheRead.cxx:446
 TFileCacheRead.cxx:447
 TFileCacheRead.cxx:448
 TFileCacheRead.cxx:449
 TFileCacheRead.cxx:450
 TFileCacheRead.cxx:451
 TFileCacheRead.cxx:452
 TFileCacheRead.cxx:453
 TFileCacheRead.cxx:454
 TFileCacheRead.cxx:455
 TFileCacheRead.cxx:456
 TFileCacheRead.cxx:457
 TFileCacheRead.cxx:458
 TFileCacheRead.cxx:459
 TFileCacheRead.cxx:460
 TFileCacheRead.cxx:461
 TFileCacheRead.cxx:462
 TFileCacheRead.cxx:463
 TFileCacheRead.cxx:464
 TFileCacheRead.cxx:465
 TFileCacheRead.cxx:466
 TFileCacheRead.cxx:467
 TFileCacheRead.cxx:468
 TFileCacheRead.cxx:469
 TFileCacheRead.cxx:470
 TFileCacheRead.cxx:471
 TFileCacheRead.cxx:472
 TFileCacheRead.cxx:473
 TFileCacheRead.cxx:474
 TFileCacheRead.cxx:475
 TFileCacheRead.cxx:476
 TFileCacheRead.cxx:477
 TFileCacheRead.cxx:478
 TFileCacheRead.cxx:479
 TFileCacheRead.cxx:480
 TFileCacheRead.cxx:481
 TFileCacheRead.cxx:482
 TFileCacheRead.cxx:483
 TFileCacheRead.cxx:484
 TFileCacheRead.cxx:485
 TFileCacheRead.cxx:486
 TFileCacheRead.cxx:487
 TFileCacheRead.cxx:488
 TFileCacheRead.cxx:489
 TFileCacheRead.cxx:490
 TFileCacheRead.cxx:491
 TFileCacheRead.cxx:492
 TFileCacheRead.cxx:493
 TFileCacheRead.cxx:494
 TFileCacheRead.cxx:495
 TFileCacheRead.cxx:496
 TFileCacheRead.cxx:497
 TFileCacheRead.cxx:498
 TFileCacheRead.cxx:499
 TFileCacheRead.cxx:500
 TFileCacheRead.cxx:501
 TFileCacheRead.cxx:502
 TFileCacheRead.cxx:503
 TFileCacheRead.cxx:504
 TFileCacheRead.cxx:505
 TFileCacheRead.cxx:506
 TFileCacheRead.cxx:507
 TFileCacheRead.cxx:508
 TFileCacheRead.cxx:509
 TFileCacheRead.cxx:510
 TFileCacheRead.cxx:511
 TFileCacheRead.cxx:512
 TFileCacheRead.cxx:513
 TFileCacheRead.cxx:514
 TFileCacheRead.cxx:515
 TFileCacheRead.cxx:516
 TFileCacheRead.cxx:517
 TFileCacheRead.cxx:518
 TFileCacheRead.cxx:519
 TFileCacheRead.cxx:520
 TFileCacheRead.cxx:521
 TFileCacheRead.cxx:522
 TFileCacheRead.cxx:523
 TFileCacheRead.cxx:524
 TFileCacheRead.cxx:525
 TFileCacheRead.cxx:526
 TFileCacheRead.cxx:527
 TFileCacheRead.cxx:528
 TFileCacheRead.cxx:529
 TFileCacheRead.cxx:530
 TFileCacheRead.cxx:531
 TFileCacheRead.cxx:532
 TFileCacheRead.cxx:533
 TFileCacheRead.cxx:534
 TFileCacheRead.cxx:535
 TFileCacheRead.cxx:536
 TFileCacheRead.cxx:537
 TFileCacheRead.cxx:538
 TFileCacheRead.cxx:539
 TFileCacheRead.cxx:540
 TFileCacheRead.cxx:541
 TFileCacheRead.cxx:542
 TFileCacheRead.cxx:543
 TFileCacheRead.cxx:544
 TFileCacheRead.cxx:545
 TFileCacheRead.cxx:546
 TFileCacheRead.cxx:547
 TFileCacheRead.cxx:548
 TFileCacheRead.cxx:549
 TFileCacheRead.cxx:550
 TFileCacheRead.cxx:551
 TFileCacheRead.cxx:552
 TFileCacheRead.cxx:553
 TFileCacheRead.cxx:554
 TFileCacheRead.cxx:555
 TFileCacheRead.cxx:556
 TFileCacheRead.cxx:557
 TFileCacheRead.cxx:558
 TFileCacheRead.cxx:559
 TFileCacheRead.cxx:560
 TFileCacheRead.cxx:561
 TFileCacheRead.cxx:562
 TFileCacheRead.cxx:563
 TFileCacheRead.cxx:564
 TFileCacheRead.cxx:565
 TFileCacheRead.cxx:566
 TFileCacheRead.cxx:567
 TFileCacheRead.cxx:568
 TFileCacheRead.cxx:569
 TFileCacheRead.cxx:570
 TFileCacheRead.cxx:571
 TFileCacheRead.cxx:572
 TFileCacheRead.cxx:573
 TFileCacheRead.cxx:574
 TFileCacheRead.cxx:575
 TFileCacheRead.cxx:576
 TFileCacheRead.cxx:577
 TFileCacheRead.cxx:578
 TFileCacheRead.cxx:579
 TFileCacheRead.cxx:580
 TFileCacheRead.cxx:581
 TFileCacheRead.cxx:582
 TFileCacheRead.cxx:583
 TFileCacheRead.cxx:584
 TFileCacheRead.cxx:585
 TFileCacheRead.cxx:586
 TFileCacheRead.cxx:587
 TFileCacheRead.cxx:588
 TFileCacheRead.cxx:589
 TFileCacheRead.cxx:590
 TFileCacheRead.cxx:591
 TFileCacheRead.cxx:592
 TFileCacheRead.cxx:593
 TFileCacheRead.cxx:594
 TFileCacheRead.cxx:595
 TFileCacheRead.cxx:596
 TFileCacheRead.cxx:597
 TFileCacheRead.cxx:598
 TFileCacheRead.cxx:599
 TFileCacheRead.cxx:600
 TFileCacheRead.cxx:601
 TFileCacheRead.cxx:602
 TFileCacheRead.cxx:603
 TFileCacheRead.cxx:604
 TFileCacheRead.cxx:605
 TFileCacheRead.cxx:606
 TFileCacheRead.cxx:607
 TFileCacheRead.cxx:608
 TFileCacheRead.cxx:609
 TFileCacheRead.cxx:610
 TFileCacheRead.cxx:611
 TFileCacheRead.cxx:612
 TFileCacheRead.cxx:613
 TFileCacheRead.cxx:614
 TFileCacheRead.cxx:615
 TFileCacheRead.cxx:616
 TFileCacheRead.cxx:617
 TFileCacheRead.cxx:618
 TFileCacheRead.cxx:619
 TFileCacheRead.cxx:620
 TFileCacheRead.cxx:621
 TFileCacheRead.cxx:622
 TFileCacheRead.cxx:623
 TFileCacheRead.cxx:624
 TFileCacheRead.cxx:625
 TFileCacheRead.cxx:626
 TFileCacheRead.cxx:627
 TFileCacheRead.cxx:628
 TFileCacheRead.cxx:629
 TFileCacheRead.cxx:630
 TFileCacheRead.cxx:631
 TFileCacheRead.cxx:632
 TFileCacheRead.cxx:633
 TFileCacheRead.cxx:634
 TFileCacheRead.cxx:635
 TFileCacheRead.cxx:636
 TFileCacheRead.cxx:637
 TFileCacheRead.cxx:638
 TFileCacheRead.cxx:639
 TFileCacheRead.cxx:640
 TFileCacheRead.cxx:641
 TFileCacheRead.cxx:642
 TFileCacheRead.cxx:643
 TFileCacheRead.cxx:644
 TFileCacheRead.cxx:645
 TFileCacheRead.cxx:646
 TFileCacheRead.cxx:647
 TFileCacheRead.cxx:648
 TFileCacheRead.cxx:649
 TFileCacheRead.cxx:650
 TFileCacheRead.cxx:651
 TFileCacheRead.cxx:652
 TFileCacheRead.cxx:653
 TFileCacheRead.cxx:654
 TFileCacheRead.cxx:655
 TFileCacheRead.cxx:656
 TFileCacheRead.cxx:657
 TFileCacheRead.cxx:658
 TFileCacheRead.cxx:659
 TFileCacheRead.cxx:660
 TFileCacheRead.cxx:661
 TFileCacheRead.cxx:662
 TFileCacheRead.cxx:663
 TFileCacheRead.cxx:664
 TFileCacheRead.cxx:665
 TFileCacheRead.cxx:666
 TFileCacheRead.cxx:667
 TFileCacheRead.cxx:668
 TFileCacheRead.cxx:669
 TFileCacheRead.cxx:670
 TFileCacheRead.cxx:671
 TFileCacheRead.cxx:672
 TFileCacheRead.cxx:673
 TFileCacheRead.cxx:674
 TFileCacheRead.cxx:675
 TFileCacheRead.cxx:676
 TFileCacheRead.cxx:677
 TFileCacheRead.cxx:678
 TFileCacheRead.cxx:679
 TFileCacheRead.cxx:680
 TFileCacheRead.cxx:681
 TFileCacheRead.cxx:682
 TFileCacheRead.cxx:683
 TFileCacheRead.cxx:684
 TFileCacheRead.cxx:685
 TFileCacheRead.cxx:686
 TFileCacheRead.cxx:687
 TFileCacheRead.cxx:688
 TFileCacheRead.cxx:689
 TFileCacheRead.cxx:690
 TFileCacheRead.cxx:691
 TFileCacheRead.cxx:692
 TFileCacheRead.cxx:693
 TFileCacheRead.cxx:694
 TFileCacheRead.cxx:695
 TFileCacheRead.cxx:696
 TFileCacheRead.cxx:697
 TFileCacheRead.cxx:698
 TFileCacheRead.cxx:699
 TFileCacheRead.cxx:700
 TFileCacheRead.cxx:701
 TFileCacheRead.cxx:702
 TFileCacheRead.cxx:703
 TFileCacheRead.cxx:704
 TFileCacheRead.cxx:705
 TFileCacheRead.cxx:706
 TFileCacheRead.cxx:707
 TFileCacheRead.cxx:708
 TFileCacheRead.cxx:709
 TFileCacheRead.cxx:710
 TFileCacheRead.cxx:711
 TFileCacheRead.cxx:712
 TFileCacheRead.cxx:713
 TFileCacheRead.cxx:714
 TFileCacheRead.cxx:715
 TFileCacheRead.cxx:716
 TFileCacheRead.cxx:717
 TFileCacheRead.cxx:718
 TFileCacheRead.cxx:719
 TFileCacheRead.cxx:720
 TFileCacheRead.cxx:721
 TFileCacheRead.cxx:722
 TFileCacheRead.cxx:723
 TFileCacheRead.cxx:724
 TFileCacheRead.cxx:725
 TFileCacheRead.cxx:726
 TFileCacheRead.cxx:727
 TFileCacheRead.cxx:728
 TFileCacheRead.cxx:729
 TFileCacheRead.cxx:730
 TFileCacheRead.cxx:731
 TFileCacheRead.cxx:732
 TFileCacheRead.cxx:733
 TFileCacheRead.cxx:734
 TFileCacheRead.cxx:735
 TFileCacheRead.cxx:736
 TFileCacheRead.cxx:737
 TFileCacheRead.cxx:738
 TFileCacheRead.cxx:739
 TFileCacheRead.cxx:740
 TFileCacheRead.cxx:741
 TFileCacheRead.cxx:742
 TFileCacheRead.cxx:743
 TFileCacheRead.cxx:744
 TFileCacheRead.cxx:745