You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Subfields that have been registered through RNTupleModel::RegisterModel cannot be accessed through the RNTupleProcessor when it has been created with such a model. To enable this, the subfield's RFieldContext will need to be somehow linked to that of its parent, so its fieldId can be properly retrieved in the processor's ConnectField method.
Reproducer
using ROOT::Experimental::RFieldBase;
using ROOT::Experimental::RNTupleModel;
using ROOT::Experimental::RNTupleOpenSpec;
using ROOT::Experimental::RNTupleProcessor;
using ROOT::Experimental::RNTupleWriter;
structMyStruct {
float a;
};
voidntuple_proc_subfields() {
{
auto model = RNTupleModel::Create();
auto myStruct = model->MakeField<MyStruct>("struct");
auto ntuple = RNTupleWriter::Recreate(std::move(model), "ntuple",
"ntuple_proc_subfields1.root");
*myStruct = MyStruct{1.f};
ntuple->Fill();
}
{
auto model = RNTupleModel::Create();
auto myStruct = model->MakeField<MyStruct>("struct", MyStruct{2.f});
auto ntuple = RNTupleWriter::Recreate(std::move(model), "ntuple",
"ntuple_proc_subfields2.root");
*myStruct = MyStruct{2.f};
ntuple->Fill();
}
auto model = RNTupleModel::Create();
auto structField = RFieldBase::Create("struct", "MyStruct").Unwrap();
model->AddField(std::move(structField));
model->RegisterSubfield("struct.a");
std::vector<RNTupleOpenSpec> ntuples = {{"ntuple", "ntuple_proc_subfields1.root"},
{"ntuple", "ntuple_proc_subfields2.root"}};
auto proc = RNTupleProcessor::CreateChain(ntuples, std::move(model));
for (constauto &entry : *proc) {
std::cout << entry.GetPtr<float>("struct.a") << std::endl;
}
}
Currently this throws an RException with the message field "a" not found in current RNTuple. It should run and print the values instead.
ROOT version
any
Installation method
any
Operating system
any
Additional context
No response
The text was updated successfully, but these errors were encountered:
Check duplicate issues.
Description
Subfields that have been registered through
RNTupleModel::RegisterModel
cannot be accessed through theRNTupleProcessor
when it has been created with such a model. To enable this, the subfield'sRFieldContext
will need to be somehow linked to that of its parent, so its fieldId can be properly retrieved in the processor'sConnectField
method.Reproducer
Currently this throws an
RException
with the messagefield "a" not found in current RNTuple
. It should run and print the values instead.ROOT version
any
Installation method
any
Operating system
any
Additional context
No response
The text was updated successfully, but these errors were encountered: