Unable to call particular methods on an RNTupleReader object

Hello all,
I am trying to load a file containing an RNTuple, but I seem to be unable to do much with it.
My code looks like:

using ROOT::Experimental::RNTupleReader;
auto ntuple = RNTupleReader::Open("EventData","my_rntuple_file.pool.root");

This does return a pointer to something, and I am able to do ntuple->GetNEntries(); to get the total number of entries in the RNTuple.

However, when I try to do any one of these commands:

ntuple->PrintInfo();
//Or
ntuple->LoadEntry(0);

I get this error:

Error in <TRint::HandleTermInput()>: ROOT::RException caught: unknown type: SG::sgkey_t (unchecked RResult access!) (unchecked RResult access!) (unchecked RResult access!) (unchecked RResult access!) (unchecked RResult access!)
At:
  ROOT::Experimental::RFieldBase::Create(const std::string&, const std::string&, const ROOT::Experimental::RCreateFieldOptions&, const ROOT::Experimental::RNTupleDescriptor*, ROOT::DescriptorId_t)::<lambda(const std::string&, ROOT::Experimental::RInvalidField::RCategory)> [/build/jenkins/workspace/lcg_nightly_pipeline/build/projects/ROOT-HEAD/src/ROOT/HEAD/tree/ntuple/v7/src/RFieldBase.cxx:311]
  static ROOT::RResult<std::unique_ptr<ROOT::Experimental::RFieldBase> > ROOT::Experimental::RFieldBase::Create(const std::string&, const std::string&, const ROOT::Experimental::RCreateFieldOptions&, const ROOT::Experimental::RNTupleDescriptor*, ROOT::DescriptorId_t) [/build/jenkins/workspace/lcg_nightly_pipeline/build/projects/ROOT-HEAD/src/ROOT/HEAD/tree/ntuple/v7/src/RFieldBase.cxx:610]
  static ROOT::RResult<std::unique_ptr<ROOT::Experimental::RFieldBase> > ROOT::Experimental::RFieldBase::Create(const std::string&, const std::string&) [/build/jenkins/workspace/lcg_nightly_pipeline/build/projects/ROOT-HEAD/src/ROOT/HEAD/tree/ntuple/v7/src/RFieldBase.cxx:266]
  static ROOT::RResult<std::unique_ptr<ROOT::Experimental::RFieldBase> > ROOT::Experimental::RFieldBase::Create(const std::string&, const std::string&) [/build/jenkins/workspace/lcg_nightly_pipeline/build/projects/ROOT-HEAD/src/ROOT/HEAD/tree/ntuple/v7/src/RFieldBase.cxx:266]
  static ROOT::RResult<std::unique_ptr<ROOT::Experimental::RFieldBase> > ROOT::Experimental::RFieldBase::Create(const std::string&, const std::string&) [/build/jenkins/workspace/lcg_nightly_pipeline/build/projects/ROOT-HEAD/src/ROOT/HEAD/tree/ntuple/v7/src/RFieldBase.cxx:266]

Any suggestions on how I can fix this?
Mads


ROOT Version: 6.35.01
Platform: Not Provided
Compiler: Not Provided


Dear @madslh,

welcome to the ROOT forum!

If I understand correctly, you get the same error with both ntuple->PrintInfo(); or ntuple->LoadEntry(0);, is it correct? Could you please provide an example ntuple to reproduce your error?

Cheers,
Monica

Yes I get the same errors with both ntuple->PrintInfo(); and ntuple->LoadEntry(0);

I have tried with multiple files with RNTuples and I seem to get the same errors (although when I create my own RNTuple and read from that I do not seem to get any errors)

One of the files I tried can be accessed here, where I read the EventData RNTuple:
https://we.tl/t-RvDoTHALfB

Thanks,
Mads

In my case, only ntuple->LoadEntry(0) raises the exception, which looks like an IO error, while ntuple->PrintInfo() works smoothly. Let me add in the loop @pcanal.

Can you also share how you create this RNTuple? Thanks.

I did not create the RNTuple, but I got it from here:
https://atlas-art-data.web.cern.ch/atlas-art-data/grid-output/main--dev3LCG/Athena/x86_64-el9-gcc13-opt/

I have also later tried with ROOT version 6.34, with this asetup:
asetup Athena,main,latest,gcc13

The one I used before, where I got the errors, was this (where the ROOT version is 6.35.01):
asetup Athena,main--dev3LCG,latest,gcc13

Hi @madslh!

It looks like your issue might be related to improper typename normalization by the RNTuple internals, for which a fix was merged recently (see [ntuple] fix type name normalization by jblomer · Pull Request #17637 · root-project/root · GitHub). The RNTuple you sent us was created prior to this merge. Could you try with a file that was produced using a more recent version of the ROOT master branch (after Feb 14, to be specific)?

Best,
Florine

Hello, I tried with a new file (from the 20th of February) containing RNTuple MetaData:
https://we.tl/t-tliYVCE0RT

But I still seem to get the same error

Hi @madslh,

Thanks for checking, I indeed still observe the error as well. This will require some more investigation on our side, I will let you know once we understand the issue better.

Best,
Florine

Hi @madslh,

The issue you reported is related to the way RNTuple internally resolves type names, and a fix has been provided by @hahnjo. The reproducer you provided now works for me without errors, using the latest ROOT nightly (i.e., using asetup Athena,main--dev3LCG,latest,gcc13). Could you check if for you it now also works as expected?

Cheers,
Florine

Hi @florine,
It does seem to work as expected now with the latest nightly.
Thanks for that

Cheers,
Mads

(note that I believe the fix that matters here is [ntuple] Fix RClassField not resolving context-dependent typedefs by silverweed · Pull Request #17783 · root-project/root · GitHub by @silverweed; my [ntuple] Remove blanks between angle brackets earlier by hahnjo · Pull Request #17829 · root-project/root · GitHub is relevant for field emulation in case you are trying to read an RNTuple without dictionaries and will only appear in today’s nightlies)