diff --git a/Database/APR/RootStorageSvc/src/RootDatabase.cpp b/Database/APR/RootStorageSvc/src/RootDatabase.cpp index e1dc0f7ae305df055005d230c7fff35a1958f976..62fbeedc0b40b77e3fead4b7580fb3043aaff015 100644 --- a/Database/APR/RootStorageSvc/src/RootDatabase.cpp +++ b/Database/APR/RootStorageSvc/src/RootDatabase.cpp @@ -45,7 +45,7 @@ RootDatabase::RootDatabase() : m_defBufferSize(16*1024), m_defWritePolicy(TObject::kOverwrite), // On write create new versions m_branchOffsetTabLen(0), - m_defTreeCacheLearnEvents(100), + m_defTreeCacheLearnEvents(-1), m_fileMgr(nullptr) { m_version = "1.1"; @@ -670,7 +670,14 @@ DbStatus RootDatabase::setOption(const DbOption& opt) { else log << DbPrintLvl::Debug << "Got tree " << tr->GetName() << " read entry " << tr->GetReadEntry() << DbPrint::endmsg; tr->SetCacheSize(cacheSize); - TTreeCache::SetLearnEntries(m_defTreeCacheLearnEvents); + if (m_defTreeCacheLearnEvents < 0) { + long long int autoFlush = tr->GetAutoFlush(); + if (autoFlush > 0) { // Tree was written flushing on number of events + TTreeCache::SetLearnEntries(-m_defTreeCacheLearnEvents * autoFlush); + } + } else { + TTreeCache::SetLearnEntries(m_defTreeCacheLearnEvents); + } TTreeCache* cache = (TTreeCache*)m_file->GetCacheRead(); if (cache) { cache->SetEntryRange(0, tr->GetEntries()); diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/python/ReadAthenaPool.py b/Database/AthenaPOOL/AthenaPoolCnvSvc/python/ReadAthenaPool.py index 4d3640170db97b503b54d8d99ca8a14a99f27955..c52cd8dd49277d0dba632f7b8c8aadc838da9a2b 100644 --- a/Database/AthenaPOOL/AthenaPoolCnvSvc/python/ReadAthenaPool.py +++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/python/ReadAthenaPool.py @@ -32,6 +32,9 @@ def _configureReadAthenaPool(): # Load the basic services import AthenaPoolCnvSvc.AthenaPool + # Switch on TTreeCache for CollectionTree + svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "DatabaseName = '*'; ContainerName = 'CollectionTree'; TREE_CACHE = '-1'" ] + # Load ProxyProviderSvc if not hasattr (svcMgr, 'ProxyProviderSvc'): svcMgr += CfgMgr.ProxyProviderSvc()