ROOT
v6-34
Reference Guide
Loading...
Searching...
No Matches
RNTupleView.cxx
Go to the documentation of this file.
1
/// \file RNTupleView.cxx
2
/// \ingroup NTuple ROOT7
3
/// \author Jakob Blomer <jblomer@cern.ch>
4
/// \date 2024-10-28
5
/// \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback
6
/// is welcome!
7
8
/*************************************************************************
9
* Copyright (C) 1995-2024, Rene Brun and Fons Rademakers. *
10
* All rights reserved. *
11
* *
12
* For the licensing terms see $ROOTSYS/LICENSE. *
13
* For the list of contributors see $ROOTSYS/README/CREDITS. *
14
*************************************************************************/
15
16
#include <
ROOT/RError.hxx
>
17
#include <
ROOT/RFieldBase.hxx
>
18
#include <
ROOT/RNTupleDescriptor.hxx
>
19
#include <
ROOT/RNTupleView.hxx
>
20
#include <
ROOT/RPageStorage.hxx
>
21
22
ROOT::Experimental::RNTupleGlobalRange
23
ROOT::Experimental::Internal::GetFieldRange
(
const
RFieldBase
&field,
const
RPageSource
&pageSource)
24
{
25
const
auto
&desc = pageSource.
GetSharedDescriptorGuard
().
GetRef
();
26
27
auto
fnGetPrincipalColumnId = [&desc](
DescriptorId_t
fieldId) ->
DescriptorId_t
{
28
auto
columnIterable = desc.
GetColumnIterable
(fieldId);
29
return
(columnIterable.size() > 0) ? columnIterable.
begin
()->
GetPhysicalId
() :
kInvalidDescriptorId
;
30
};
31
32
auto
columnId = fnGetPrincipalColumnId(field.
GetOnDiskId
());
33
if
(columnId ==
kInvalidDescriptorId
) {
34
for
(
const
auto
&
f
: field) {
35
columnId = fnGetPrincipalColumnId(
f
.GetOnDiskId());
36
if
(columnId !=
kInvalidDescriptorId
)
37
break
;
38
}
39
}
40
41
if
(columnId ==
kInvalidDescriptorId
) {
42
return
RNTupleGlobalRange
(
kInvalidNTupleIndex
,
kInvalidNTupleIndex
);
43
}
44
45
auto
arraySize = std::max(std::uint64_t(1), desc.GetFieldDescriptor(field.
GetOnDiskId
()).GetNRepetitions());
46
return
RNTupleGlobalRange
(0, desc.GetNElements(columnId) / arraySize);
47
}
RError.hxx
RFieldBase.hxx
RNTupleDescriptor.hxx
RNTupleView.hxx
RPageStorage.hxx
f
#define f(i)
Definition
RSha256.hxx:104
ROOT::Experimental::Internal::RPageSource::RSharedDescriptorGuard::GetRef
const RNTupleDescriptor & GetRef() const
Definition
RPageStorage.hxx:577
ROOT::Experimental::Internal::RPageSource
Abstract interface to read data from an ntuple.
Definition
RPageStorage.hxx:550
ROOT::Experimental::Internal::RPageSource::GetSharedDescriptorGuard
const RSharedDescriptorGuard GetSharedDescriptorGuard() const
Takes the read lock for the descriptor.
Definition
RPageStorage.hxx:738
ROOT::Experimental::RColumnDescriptor::GetPhysicalId
DescriptorId_t GetPhysicalId() const
Definition
RNTupleDescriptor.hxx:204
ROOT::Experimental::RFieldBase
A field translates read and write calls from/to underlying columns to/from tree values.
Definition
RFieldBase.hxx:67
ROOT::Experimental::RFieldBase::GetOnDiskId
DescriptorId_t GetOnDiskId() const
Definition
RFieldBase.hxx:525
ROOT::Experimental::RNTupleDescriptor::RColumnDescriptorIterable::begin
RIterator begin()
Definition
RNTupleDescriptor.hxx:744
ROOT::Experimental::RNTupleDescriptor::GetColumnIterable
RColumnDescriptorIterable GetColumnIterable() const
Definition
RNTupleDescriptor.cxx:1200
ROOT::Experimental::RNTupleGlobalRange
Used to loop over indexes (entries or collections) between start and end.
Definition
RNTupleView.hxx:41
ROOT::Experimental::Internal::GetFieldRange
RNTupleGlobalRange GetFieldRange(const RFieldBase &field, const RPageSource &pageSource)
Helper to get the iteration space of the given field that needs to be connected to the given page sou...
Definition
RNTupleView.cxx:23
ROOT::Experimental::DescriptorId_t
std::uint64_t DescriptorId_t
Distriniguishes elements of the same type within a descriptor, e.g. different fields.
Definition
RNTupleUtil.hxx:168
ROOT::Experimental::kInvalidNTupleIndex
constexpr NTupleSize_t kInvalidNTupleIndex
Definition
RNTupleUtil.hxx:118
ROOT::Experimental::kInvalidDescriptorId
constexpr DescriptorId_t kInvalidDescriptorId
Definition
RNTupleUtil.hxx:169
tree
ntuple
v7
src
RNTupleView.cxx
ROOT v6-34 - Reference Guide Generated on Sun Dec 15 2024 03:24:20 (GVA Time) using Doxygen 1.9.8