Skip to content

[DF] EnableImplicitMT() prevents reading TTree in sub-directory from XrootD file #10216

@eguiraud

Description

@eguiraud

Reproducer:

#include <ROOT/RDataFrame.hxx>
#include <iostream>

int main()
{
   ROOT::EnableImplicitMT();

   const auto fpath = "root://eosuser.cern.ch//eos/user/e/eguiraud/scratch/test.root";
   ROOT::RDataFrame(10).Define("e", "rdfentry_").Snapshot("testd/testt", fpath);

   auto *f = TFile::Open(fpath);
   auto *td = f->Get<TTree>("testd/testt");
   auto rdftd = ROOT::RDataFrame(*td);
   auto htd = rdftd.Histo1D<ULong64_t>("e");
   std::cout << htd->GetMean() << '\n';
}

yields:

terminate called after throwing an instance of 'std::runtime_error'
  what():  TTreeProcessorMT::Process: an error occurred while getting tree "//eosuser.cern.ch//eos/user/e/eguiraud/scratch/test.root:/testd/testt" from file "root://eosuser.cern.ch//eos/user/e/eguiraud/scratch/test.root"

i.e. TTreeProcessorMT gets the name of the TTree wrong.

All 3 ingredients are needed (multi-threading, xrootd, and the sub-directory) for the problem to occur.

First reported at https://root-forum.cern.ch/t/enableimplicitmt-prevents-reading-nested-ttree-from-xrootd-file-with-rdataframe/49327 , it's a similar problem to https://sft.its.cern.ch/jira/browse/ROOT-9948 .

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions