@@ -35,14 +35,11 @@ namespace edm::rntuple_temp {
3535 RootRNTuple::RootRNTuple (std::shared_ptr<InputFile> filePtr,
3636 BranchType const & branchType,
3737 unsigned int nIndexes,
38- unsigned int learningEntries,
39- bool enablePrefetching,
4038 bool promptRead,
4139 InputType inputType)
4240 : filePtr_(filePtr),
4341 branchType_ (branchType),
4442 entryNumberForIndex_(std::make_unique<std::vector<EntryNumber>>(nIndexes, IndexIntoFile::invalidEntry)),
45- enablePrefetching_(enablePrefetching),
4643 promptRead_(promptRead),
4744 rootDelayedReader_(makeRootDelayedReader(*this , filePtr, inputType, nIndexes, promptRead)) {}
4845
@@ -51,11 +48,9 @@ namespace edm::rntuple_temp {
5148 BranchType const & branchType,
5249 unsigned int nIndexes,
5350 Options const & options,
54- unsigned int learningEntries,
5551 InputType inputType)
56- : RootRNTuple(
57- filePtr, branchType, nIndexes, learningEntries, options.enablePrefetching, options.promptReading, inputType) {
58- init (BranchTypeToProductTreeName (branchType), options.treeMaxVirtualSize , options.treeCacheSize );
52+ : RootRNTuple(filePtr, branchType, nIndexes, options.promptReading, inputType) {
53+ init (BranchTypeToProductTreeName (branchType), options);
5954 auxDesc_ = getAuxiliaryFieldId (*reader_, branchType_);
6055 }
6156
@@ -65,19 +60,20 @@ namespace edm::rntuple_temp {
6560 std::string const & processName,
6661 unsigned int nIndexes,
6762 Options const & options,
68- unsigned int learningEntries,
6963 InputType inputType)
70- : RootRNTuple(
71- filePtr, branchType, nIndexes, learningEntries, options.enablePrefetching, options.promptReading, inputType) {
64+ : RootRNTuple(filePtr, branchType, nIndexes, options.promptReading, inputType) {
7265 processName_ = processName;
73- init (BranchTypeToProductTreeName (branchType, processName), options. treeMaxVirtualSize , options. treeCacheSize );
66+ init (BranchTypeToProductTreeName (branchType, processName), options);
7467 }
7568
76- void RootRNTuple::init (std::string const & productTreeName, unsigned int maxVirtualSize, unsigned int cacheSize ) {
69+ void RootRNTuple::init (std::string const & productTreeName, Options const & options ) {
7770 if (filePtr_.get () != nullptr ) {
7871 auto tuple = filePtr_->Get <ROOT::RNTuple>(productTreeName.c_str ());
7972 if (tuple != nullptr ) {
80- reader_ = ROOT::RNTupleReader::Open (*tuple);
73+ ROOT::RNTupleReadOptions rntupleOptions;
74+ rntupleOptions.SetClusterCache (options.useClusterCache ? ROOT::RNTupleReadOptions::EClusterCache::kOn
75+ : ROOT::RNTupleReadOptions::EClusterCache::kOff );
76+ reader_ = ROOT::RNTupleReader::Open (*tuple, rntupleOptions);
8177 }
8278 }
8379 if (not reader_) {
@@ -86,9 +82,6 @@ namespace edm::rntuple_temp {
8682 << " \n This is either not an edm ROOT file or is one that has been corrupted." ;
8783 }
8884 entries_ = reader_->GetNEntries ();
89-
90- setTreeMaxVirtualSize (maxVirtualSize);
91- setCacheSize (cacheSize);
9285 }
9386
9487 RootRNTuple::~RootRNTuple () {}
0 commit comments