Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RNTupleView.cxx
Go to the documentation of this file.
1/// \file RNTupleView.cxx
2/// \ingroup NTuple
3/// \author Jakob Blomer <jblomer@cern.ch>
4/// \date 2024-10-28
5
6/*************************************************************************
7 * Copyright (C) 1995-2024, Rene Brun and Fons Rademakers. *
8 * All rights reserved. *
9 * *
10 * For the licensing terms see $ROOTSYS/LICENSE. *
11 * For the list of contributors see $ROOTSYS/README/CREDITS. *
12 *************************************************************************/
13
14#include <ROOT/RError.hxx>
15#include <ROOT/RFieldBase.hxx>
17#include <ROOT/RNTupleView.hxx>
18#include <ROOT/RPageStorage.hxx>
19
20#include <deque>
21
24{
25 const auto &desc = pageSource.GetSharedDescriptorGuard().GetRef();
26
29 auto columnIterable = desc.GetColumnIterable(fieldId);
30 return (columnIterable.size() > 0) ? columnIterable.begin()->GetPhysicalId() : ROOT::kInvalidDescriptorId;
31 };
32
33 auto columnId = fnGetPrincipalColumnId(field.GetOnDiskId());
35 // We need to iterate the field descriptor tree, not the sub fields of `field`, because in the presence of
36 // read rules, the in-memory sub fields may be artificial and not have valid on-disk IDs.
37 const auto &linkIds = desc.GetFieldDescriptor(field.GetOnDiskId()).GetLinkIds();
38 std::deque<ROOT::DescriptorId_t> subFields(linkIds.begin(), linkIds.end());
39 while (!subFields.empty()) {
40 auto subFieldId = subFields.front();
41 subFields.pop_front();
44 break;
45
46 const auto &subLinkIds = desc.GetFieldDescriptor(subFieldId).GetLinkIds();
48 }
49 }
50
53 }
54
55 auto arraySize = std::max(std::uint64_t(1), desc.GetFieldDescriptor(field.GetOnDiskId()).GetNRepetitions());
56 return ROOT::RNTupleGlobalRange(0, desc.GetNElements(columnId) / arraySize);
57}
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
#define R__ASSERT(e)
Checks condition e and reports a fatal error if it's false.
Definition TError.h:125
Abstract interface to read data from an ntuple.
A field translates read and write calls from/to underlying columns to/from tree values.
Used to loop over indexes (entries or collections) between start and end.
const_iterator begin() const
const_iterator end() const
ROOT::RNTupleGlobalRange GetFieldRange(const ROOT::RFieldBase &field, const ROOT::Internal::RPageSource &pageSource)
Helper to get the iteration space of the given field that needs to be connected to the given page sou...
std::uint64_t DescriptorId_t
Distriniguishes elements of the same type within a descriptor, e.g. different fields.
constexpr NTupleSize_t kInvalidNTupleIndex
constexpr DescriptorId_t kInvalidDescriptorId