diff --git a/tutorials/io/ntuple/index.md b/tutorials/io/ntuple/index.md index 3269cfb2405f3..08a5586531534 100644 --- a/tutorials/io/ntuple/index.md +++ b/tutorials/io/ntuple/index.md @@ -21,3 +21,4 @@ RNTuple is the evolution of TTree, offering better performance and new, more rob | ntpl016_streaming_vector.C | A special purpose container that reads large vectors piece-wise | | ntpl017_shared_reader.C | Efficient multi-threaded reading when multiple threads share a single reader | | ntpl018_low_precision_floats.C | Creating low-precision floating point fields | +| ntpl019_attributes.C | Write and read metadata via the Attributes interface (experimental) | diff --git a/tutorials/io/ntuple/ntpl019_attributes.C b/tutorials/io/ntuple/ntpl019_attributes.C index be66e96857fc8..bdec290b3aaa1 100644 --- a/tutorials/io/ntuple/ntpl019_attributes.C +++ b/tutorials/io/ntuple/ntpl019_attributes.C @@ -74,11 +74,10 @@ static void Write() // fields in the attribute model; all the main RNTuple data you filled in before committing the range // will have those values as metadata associated to it. // - // Beginning an attribute range is done like this (note that attrEntry is an REntry, so filling - // in the attribute values uses the same interface of the regular values): + // Beginning an attribute range is done like this: auto attrRange = attrSet->BeginRange(); - // Here you can assign values to your attributes. In this case we only have 1 attribute (the string "myAttr"), + // Here you can assign values to your attributes. In this case we only have 1 attribute (the integer "runNumber"), // so we only fill that. // Note that attribute values can be assigned anywhere between BeginRange() and CommitRange(), so we could do // this step even after the main data filling. @@ -135,7 +134,7 @@ static void Read() std::cout << "\nOpened attribute set '" << attrSet->GetDescriptor().GetName() << "' with description: \"" << attrSet->GetDescriptor().GetDescription() << "\"\n"; - // Loop over the main entries and, for each, print its associated attribute "myAttr" + // Loop over the main entries and, for each, print its associated run number for (auto mainIdx : reader->GetEntryRange()) { // There are various ways to access attributes from a main entry index (see the RNTupleAttrSetReader's // documentation). Here we use GetAttributes to get all attributes associated to the main entry `mainIdx`: