void testTreeCache() { // Open file auto f = TFile::Open("http://root.cern.ch/files/h1/dstarmb.root"); // Get the tree auto t = (TTree *) f->Get("h42"); // Check the cache Printf("(TFileCacheRead *) %p", f->GetCacheRead()); // Set the cache t->SetCacheSize(30000000); // Use it t->Draw("aplan"); // Check the cache Printf("(TFileCacheRead *) %p", f->GetCacheRead()); // And its content if (f->GetCacheRead()) f->GetCacheRead()->Print(); // Reset the cache t->SetCacheSize(0); // Check the cache Printf("(TFileCacheRead *) %p", f->GetCacheRead()); }