ROOT
master
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](
ROOT::DescriptorId_t
fieldId
) ->
ROOT::DescriptorId_t
{
28
auto
columnIterable
= desc.GetColumnIterable(
fieldId
);
29
return
(
columnIterable
.size() > 0) ?
columnIterable
.
begin
()->GetPhysicalId() :
ROOT::kInvalidDescriptorId
;
30
};
31
32
auto
columnId
=
fnGetPrincipalColumnId
(
field
.GetOnDiskId());
33
if
(
columnId
==
ROOT::kInvalidDescriptorId
) {
34
for
(
const
auto
&
f
:
field
) {
35
columnId
=
fnGetPrincipalColumnId
(
f
.GetOnDiskId());
36
if
(
columnId
!=
ROOT::kInvalidDescriptorId
)
37
break
;
38
}
39
}
40
41
if
(
columnId
==
ROOT::kInvalidDescriptorId
) {
42
return
RNTupleGlobalRange
(
ROOT::kInvalidNTupleIndex
,
ROOT::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
TRangeDynCast
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Definition
TCollection.h:358
ROOT::Detail::TRangeCast
Definition
TCollection.h:311
ROOT::Experimental::Internal::RPageSource
Abstract interface to read data from an ntuple.
Definition
RPageStorage.hxx:563
ROOT::Experimental::RFieldBase
A field translates read and write calls from/to underlying columns to/from tree values.
Definition
RFieldBase.hxx:75
ROOT::Experimental::RNTupleGlobalRange
Used to loop over indexes (entries or collections) between start and end.
Definition
RNTupleRange.hxx:31
ROOT::RRangeCast::begin
const_iterator begin() const
Definition
RRangeCast.hxx:104
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::DescriptorId_t
std::uint64_t DescriptorId_t
Distriniguishes elements of the same type within a descriptor, e.g. different fields.
Definition
RNTupleUtil.hxx:128
ROOT::kInvalidNTupleIndex
constexpr NTupleSize_t kInvalidNTupleIndex
Definition
RNTupleUtil.hxx:125
ROOT::kInvalidDescriptorId
constexpr DescriptorId_t kInvalidDescriptorId
Definition
RNTupleUtil.hxx:129
tree
ntuple
v7
src
RNTupleView.cxx
ROOT master - Reference Guide Generated on Tue Mar 4 2025 05:16:00 (GVA Time) using Doxygen 1.10.0