64 std::unique_ptr<RFieldBase::RValue>
fValue;
91 auto iReal =
fField->begin();
92 for (; iReal !=
fField->end(); ++iProto, ++iReal) {
105 std::string msg =
"RNTupleDS: invalid type \"" +
fField->GetTypeName() +
"\" for column \"" +
108 throw std::runtime_error(msg);
118 fValue = std::make_unique<RFieldBase::RValue>(
fField->CreateValue());
124 if (
fValue && keepValue) {
138 return fValue->GetPtr<
void>().get();
185 fieldInfos.emplace_back(fieldId, nRepetitions);
192 bool representableAsRVec =
193 convertToRVec && (fieldDesc.GetTypeName().substr(0, 19) ==
"ROOT::VecOps::RVec<" ||
194 fieldDesc.GetTypeName().substr(0, 12) ==
"std::vector<" || fieldDesc.GetTypeName() ==
"");
196 AddField(desc, colName,
f.GetId(), fieldInfos, representableAsRVec);
202 }
else if (nRepetitions > 0) {
205 AddField(desc, colName,
f.GetId(), fieldInfos);
210 auto innerName = colName.empty() ?
f.GetFieldName() : (std::string(colName) +
"." +
f.GetFieldName());
212 AddField(desc, innerName,
f.GetId(), fieldInfos);
219 if (!fieldOrException)
221 auto valueField = fieldOrException.Unwrap();
224 if (cardinalityField->As32Bit()) {
226 std::make_unique<ROOT::Internal::RDF::RRDFCardinalityField<std::uint32_t>>(fieldDesc.GetFieldName());
227 }
else if (cardinalityField->As64Bit()) {
229 std::make_unique<ROOT::Internal::RDF::RRDFCardinalityField<std::uint64_t>>(fieldDesc.GetFieldName());
231 R__ASSERT(
false &&
"cardinality field stored with an unexpected integer type");
234 valueField->SetOnDiskId(fieldId);
235 for (
auto &
f : *valueField) {
236 f.SetOnDiskId(desc.
FindFieldId(
f.GetFieldName(),
f.GetParent()->GetOnDiskId()));
238 std::unique_ptr<ROOT::RFieldBase> cardinalityField;
240 if (!fieldInfos.empty()) {
241 const auto &info = fieldInfos.back();
243 if (info.fNRepetitions > 0) {
244 cardinalityField = std::make_unique<ROOT::Internal::RDF::RArraySizeField>(
name, info.fNRepetitions);
246 cardinalityField = std::make_unique<ROOT::Internal::RDF::RRDFCardinalityField<std::size_t>>(
name);
248 cardinalityField->SetOnDiskId(info.fFieldId);
251 for (
auto i = fieldInfos.rbegin(); i != fieldInfos.rend(); ++i) {
252 const auto &fieldInfo = *i;
254 const auto valueFieldName = valueField->GetFieldName();
256 if (fieldInfo.fNRepetitions > 0) {
259 std::make_unique<ROOT::RArrayAsRVecField>(valueFieldName, valueField->Clone(
"_0"), fieldInfo.fNRepetitions);
264 valueField = std::make_unique<ROOT::RRVecField>(valueFieldName, valueField->Clone(
"_0"));
271 valueField->SetOnDiskId(fieldInfo.fFieldId);
275 if (i != fieldInfos.rbegin()) {
276 const auto cardinalityFieldName = cardinalityField->GetFieldName();
277 if (fieldInfo.fNRepetitions > 0) {
279 cardinalityField = std::make_unique<ROOT::RArrayAsRVecField>(
280 cardinalityFieldName, cardinalityField->Clone(
"_0"), fieldInfo.fNRepetitions);
283 cardinalityField = std::make_unique<ROOT::RRVecField>(cardinalityFieldName, cardinalityField->Clone(
"_0"));
286 cardinalityField->SetOnDiskId(fieldInfo.fFieldId);
290 if (cardinalityField) {
291 fColumnNames.emplace_back(
"R_rdf_sizeof_" + std::string(colName));
292 fColumnTypes.emplace_back(cardinalityField->GetTypeName());
296 fieldInfos.emplace_back(fieldId, nRepetitions);
304 pageSource->Attach();
305 fPrincipalDescriptor = pageSource->GetSharedDescriptorGuard()->Clone();
306 fStagingArea.emplace_back(std::move(pageSource));
308 AddField(fPrincipalDescriptor,
"", fPrincipalDescriptor.GetFieldZeroId(),
309 std::vector<ROOT::RDF::RNTupleDS::RFieldInfo>());
311 auto topLevelFields = fPrincipalDescriptor.GetTopLevelFields();
312 const auto nTopLevelFields = std::distance(topLevelFields.begin(), topLevelFields.end());
313 fTopLevelFieldNames.reserve(nTopLevelFields);
314 for (
const auto &field : topLevelFields)
315 fTopLevelFieldNames.push_back(field.GetFieldName());
326 static std::once_flag flag;
327 std::call_once(flag, []() {
328 if (
auto env =
gSystem->
Getenv(
"ROOT_RNTUPLE_CLUSTERBUNCHSIZE"); env !=
nullptr && strlen(env) > 0) {
329 std::string envStr{env};
330 auto envNum{std::stoul(envStr)};
331 envNum = envNum == 0 ? 1 : envNum;
338std::unique_ptr<ROOT::Internal::RPageSource> CreatePageSource(std::string_view ntupleName, std::string_view fileName)
345 :
RNTupleDS(CreatePageSource(ntupleName, fileName))
348 fFileNames = std::vector<std::string>{std::string{fileName}};
352 :
RNTupleDS(CreatePageSource(ntupleName, fileNames[0]))
360 const std::pair<ULong64_t, ULong64_t> &range)
377 std::distance(fColumnNames.begin(), std::find(fColumnNames.begin(), fColumnNames.end(), fieldName));
382 return fProtoFields[
index].get();
391 if (requestedType != fColumnTypes[
index]) {
392 auto &altProtoFields = fAlternativeProtoFields[
index];
395 if (
auto altProtoField = std::find_if(altProtoFields.begin(), altProtoFields.end(),
396 [&requestedType](
const std::unique_ptr<ROOT::RFieldBase> &fld) {
397 return fld->GetTypeName() == requestedType;
399 altProtoField != altProtoFields.end()) {
400 return altProtoField->get();
404 std::unique_ptr<RFieldBase> newAltProtoField;
405 const std::string strName = std::string(fieldName);
407 if (requestedType ==
"bool") {
408 newAltProtoField = std::make_unique<ROOT::Internal::RDF::RRDFCardinalityField<bool>>(strName);
409 }
else if (requestedType ==
"char") {
410 newAltProtoField = std::make_unique<ROOT::Internal::RDF::RRDFCardinalityField<char>>(strName);
411 }
else if (requestedType ==
"std::int8_t") {
412 newAltProtoField = std::make_unique<ROOT::Internal::RDF::RRDFCardinalityField<std::int8_t>>(strName);
413 }
else if (requestedType ==
"std::uint8_t") {
414 newAltProtoField = std::make_unique<ROOT::Internal::RDF::RRDFCardinalityField<std::uint8_t>>(strName);
415 }
else if (requestedType ==
"std::int16_t") {
416 newAltProtoField = std::make_unique<ROOT::Internal::RDF::RRDFCardinalityField<std::int16_t>>(strName);
417 }
else if (requestedType ==
"std::uint16_t") {
418 newAltProtoField = std::make_unique<ROOT::Internal::RDF::RRDFCardinalityField<std::uint16_t>>(strName);
419 }
else if (requestedType ==
"std::int32_t") {
420 newAltProtoField = std::make_unique<ROOT::Internal::RDF::RRDFCardinalityField<std::int32_t>>(strName);
421 }
else if (requestedType ==
"std::uint32_t") {
422 newAltProtoField = std::make_unique<ROOT::Internal::RDF::RRDFCardinalityField<std::uint32_t>>(strName);
423 }
else if (requestedType ==
"std::int64_t") {
424 newAltProtoField = std::make_unique<ROOT::Internal::RDF::RRDFCardinalityField<std::int64_t>>(strName);
425 }
else if (requestedType ==
"std::uint64_t") {
426 newAltProtoField = std::make_unique<ROOT::Internal::RDF::RRDFCardinalityField<std::uint64_t>>(strName);
428 throw std::runtime_error(
"RNTupleDS: Could not create field with type \"" + requestedType +
429 "\" for column \"" + std::string(fieldName) +
"\"");
433 if (!newAltProtoFieldOrException) {
434 throw std::runtime_error(
"RNTupleDS: Could not create field with type \"" + requestedType +
435 "\" for column \"" + std::string(fieldName) +
"\"");
437 newAltProtoField = newAltProtoFieldOrException.Unwrap();
439 newAltProtoField->SetOnDiskId(fProtoFields[
index]->GetOnDiskId());
440 auto *newField = newAltProtoField.get();
441 altProtoFields.emplace_back(std::move(newAltProtoField));
446 return fProtoFields[
index].get();
449std::unique_ptr<ROOT::Detail::RDF::RColumnReaderBase>
453 assert(field !=
nullptr);
457 fFieldId2QualifiedName[field->
GetOnDiskId()] = fPrincipalDescriptor.GetQualifiedFieldName(field->
GetOnDiskId());
458 for (
const auto &s : *field) {
459 fFieldId2QualifiedName[s.GetOnDiskId()] = fPrincipalDescriptor.GetQualifiedFieldName(s.GetOnDiskId());
462 auto reader = std::make_unique<ROOT::Internal::RDF::RNTupleColumnReader>(
this, field);
463 fActiveColumnReaders[slot].emplace_back(reader.get());
471 std::unique_lock lock(fMutexStaging);
472 fCvStaging.wait(lock, [
this] {
return fIsReadyForStaging || fStagingThreadShouldTerminate; });
473 if (fStagingThreadShouldTerminate)
476 assert(!fHasNextSources);
478 fHasNextSources =
true;
479 fIsReadyForStaging =
false;
482 fCvStaging.notify_one();
488 const auto nFiles = fFileNames.empty() ? 1 : fFileNames.size();
490 for (
auto i = fNextFileIndex; (i < nFiles) && ((i - fNextFileIndex) < fNSlots); ++i) {
492 if (fStagingThreadShouldTerminate)
495 if (fStagingArea[i]) {
499 fStagingArea[i] = CreatePageSource(fNTupleName, fFileNames[i]);
500 fStagingArea[i]->LoadStructure();
507 assert(fNextRanges.empty());
509 auto nFiles = fFileNames.empty() ? 1 : fFileNames.size();
510 auto nRemainingFiles = nFiles - fNextFileIndex;
512 if (nRemainingFiles == 0)
517 if ((nRemainingFiles >= fNSlots) || (fGlobalEntryRange.has_value())) {
518 while ((fNextRanges.size() < fNSlots) && (fNextFileIndex < nFiles)) {
521 std::swap(fStagingArea[fNextFileIndex], range.
fSource);
526 range.
fSource = CreatePageSource(fNTupleName, fFileNames[fNextFileIndex]);
528 range.
fFileName = fFileNames[fNextFileIndex];
531 auto nEntries = range.
fSource->GetNEntries();
536 fNextRanges.emplace_back(std::move(range));
544 unsigned int nSlotsPerFile = fNSlots / nRemainingFiles;
545 for (std::size_t i = 0; (fNextRanges.size() < fNSlots) && (fNextFileIndex < nFiles); ++i) {
546 std::unique_ptr<ROOT::Internal::RPageSource> source;
548 const auto &sourceFileName = fFileNames[fNextFileIndex];
549 std::swap(fStagingArea[fNextFileIndex], source);
552 source = CreatePageSource(fNTupleName, fFileNames[fNextFileIndex]);
555 source->LoadAllPageLists();
558 auto nEntries = source->GetNEntries();
563 if (i == (nRemainingFiles - 1))
564 nSlotsPerFile = fNSlots - fNextRanges.size();
566 const auto rangesByCluster = [&source]() {
568 auto descGuard = source->GetSharedDescriptorGuard();
572 const unsigned int nRangesByCluster = rangesByCluster.size();
575 const auto nClustersPerSlot = nRangesByCluster / nSlotsPerFile;
576 const auto remainder = nRangesByCluster % nSlotsPerFile;
577 std::size_t iRange = 0;
578 unsigned int iSlot = 0;
579 const unsigned int N = std::min(nSlotsPerFile, nRangesByCluster);
580 for (; iSlot <
N; ++iSlot) {
581 auto start = rangesByCluster[iRange].fFirstEntry;
582 iRange += nClustersPerSlot +
static_cast<int>(iSlot < remainder);
584 auto end = rangesByCluster[iRange - 1].fLastEntryPlusOne;
589 if (iSlot ==
N - 1) {
590 range.
fSource = std::move(source);
592 range.
fSource = source->Clone();
594 range.
fSource->SetEntryRange({start, end - start});
597 fNextRanges.emplace_back(std::move(range));
604 std::vector<std::pair<ULong64_t, ULong64_t>> ranges;
613 for (
auto r : fActiveColumnReaders[0]) {
614 r->Disconnect(
true );
620 if (fCurrentRanges.empty() || fSeenEntriesNoGlobalRange > 0) {
624 std::unique_lock lock(fMutexStaging);
625 fCvStaging.wait(lock, [
this] {
return fHasNextSources; });
628 if (fNextRanges.empty()) {
633 assert(fNextRanges.size() <= fNSlots);
635 fCurrentRanges.clear();
636 std::swap(fCurrentRanges, fNextRanges);
641 std::lock_guard
_(fMutexStaging);
642 fIsReadyForStaging =
true;
643 fHasNextSources =
false;
645 fCvStaging.notify_one();
652 fFirstEntry2RangeIdx.clear();
653 fOriginalRanges.clear();
657 for (std::size_t i = 0; i < fCurrentRanges.size(); ++i) {
661 if (fCurrentRanges[i].fFirstEntry == 0) {
663 fSeenEntriesNoGlobalRange += nEntriesPerSource;
664 nEntriesPerSource = 0;
667 auto start = fCurrentRanges[i].fFirstEntry + fSeenEntriesNoGlobalRange;
668 auto end = fCurrentRanges[i].fLastEntry + fSeenEntriesNoGlobalRange;
670 nEntriesPerSource += end - start;
672 if (fGlobalEntryRange.has_value()) {
690 if (fGlobalEntryRange->first >= start && fGlobalEntryRange->second <= end) {
691 fOriginalRanges.emplace_back(start, end);
692 fFirstEntry2RangeIdx[fGlobalEntryRange->first] = i;
693 ranges.emplace_back(fGlobalEntryRange->first, fGlobalEntryRange->second);
698 else if (fGlobalEntryRange->second > end && fGlobalEntryRange->first < end) {
699 fOriginalRanges.emplace_back(start, end);
700 fFirstEntry2RangeIdx[fGlobalEntryRange->first] = i;
701 ranges.emplace_back(fGlobalEntryRange->first, end);
702 std::optional<std::pair<ULong64_t, ULong64_t>> newvalues({end, fGlobalEntryRange->second});
703 fGlobalEntryRange.swap(newvalues);
706 else if (fGlobalEntryRange->second < start) {
711 else if (fGlobalEntryRange->first >= end) {
712 fOriginalRanges.emplace_back(start, end);
713 fFirstEntry2RangeIdx[start] = i;
714 ranges.emplace_back(start, start);
719 fFirstEntry2RangeIdx[start] = i;
720 fOriginalRanges.emplace_back(start, end);
721 ranges.emplace_back(start, end);
725 fSeenEntriesNoGlobalRange += nEntriesPerSource;
727 if ((fNSlots == 1) && (fCurrentRanges[0].fSource)) {
728 for (
auto r : fActiveColumnReaders[0]) {
729 r->Connect(*fCurrentRanges[0].fSource, fOriginalRanges[0].first);
740 fSlotsToRangeIdxs[0] = 0;
748 auto idxRange = fFirstEntry2RangeIdx.at(firstEntry);
751 fSlotsToRangeIdxs[slot * ROOT::Internal::RDF::CacheLineStep<std::size_t>()] = idxRange;
753 for (
auto r : fActiveColumnReaders[slot]) {
754 r->Connect(*fCurrentRanges[idxRange].fSource,
755 fOriginalRanges[idxRange].first - fCurrentRanges[idxRange].fFirstEntry);
764 for (
auto r : fActiveColumnReaders[slot]) {
765 r->Disconnect(
true );
771 auto colNamePos = std::find(fColumnNames.begin(), fColumnNames.end(), colName);
773 if (colNamePos == fColumnNames.end()) {
774 auto msg = std::string(
"RNTupleDS: There is no column with name \"") + std::string(colName) +
"\"";
775 throw std::runtime_error(msg);
778 const auto index = std::distance(fColumnNames.begin(), colNamePos);
779 return fColumnTypes[
index];
784 return std::find(fColumnNames.begin(), fColumnNames.end(), colName) != fColumnNames.end();
789 fSeenEntriesNoGlobalRange = 0;
791 fIsReadyForStaging = fHasNextSources = fStagingThreadShouldTerminate =
false;
792 fThreadStaging = std::thread(&RNTupleDS::ExecStaging,
this);
793 assert(fNextRanges.empty());
795 if (fCurrentRanges.empty() || (fFileNames.size() > fNSlots)) {
798 std::lock_guard
_(fMutexStaging);
799 fIsReadyForStaging =
true;
801 fCvStaging.notify_one();
805 fNextFileIndex = std::max(fFileNames.size(), std::size_t(1));
811 for (
unsigned int i = 0; i < fNSlots; ++i) {
812 for (
auto r : fActiveColumnReaders[i]) {
813 r->Disconnect(
false );
817 std::lock_guard
_(fMutexStaging);
818 fStagingThreadShouldTerminate =
true;
820 fCvStaging.notify_one();
821 fThreadStaging.join();
824 if (fFileNames.size() > fNSlots) {
825 fCurrentRanges.clear();
827 fStagingArea.clear();
828 fStagingArea.resize(fFileNames.size());
834 assert(fNSlots == 0);
837 fActiveColumnReaders.resize(fNSlots);
838 fSlotsToRangeIdxs.resize(fNSlots * ROOT::Internal::RDF::CacheLineStep<std::size_t>());
843 return ROOT::RDataFrame(std::make_unique<ROOT::RDF::RNTupleDS>(ntupleName, fileName));
848 return ROOT::RDataFrame(std::make_unique<ROOT::RDF::RNTupleDS>(ntupleName, fileNames));
852 unsigned int slot,
const std::unordered_map<std::string, ROOT::RDF::Experimental::RSample *> &sampleMap)
const
859 const auto &rangeIdx = fSlotsToRangeIdxs.at(slot * ROOT::Internal::RDF::CacheLineStep<std::size_t>());
862 if (!fCurrentRanges[rangeIdx].fSource)
865 const auto &ntupleName = fCurrentRanges[rangeIdx].fSource->GetNTupleName();
866 const auto &ntuplePath = fCurrentRanges[rangeIdx].fFileName;
867 const auto ntupleID = std::string(ntuplePath) +
'/' + ntupleName;
869 if (sampleMap.empty())
871 ntupleID, std::make_pair(fCurrentRanges[rangeIdx].fFirstEntry, fCurrentRanges[rangeIdx].fLastEntry),
nullptr,
872 fPrincipalDescriptor.GetNEntries());
874 if (sampleMap.find(ntupleID) == sampleMap.end())
875 throw std::runtime_error(
"Full sample identifier '" + ntupleID +
"' cannot be found in the available samples.");
878 ntupleID, std::make_pair(fCurrentRanges[rangeIdx].fFirstEntry, fCurrentRanges[rangeIdx].fLastEntry),
879 sampleMap.at(ntupleID), fPrincipalDescriptor.GetNEntries());
884 const std::pair<ULong64_t, ULong64_t> &range)
886 std::unique_ptr<ROOT::RDF::RNTupleDS> ds{
new ROOT::RDF::RNTupleDS(ntupleName, fileNames, range)};
896 source->LoadAllPageLists();
897 auto descGuard = source->GetSharedDescriptorGuard();
long long Long64_t
Portable signed long integer 8 bytes.
unsigned long long ULong64_t
Portable unsigned long integer 8 bytes.
#define R__ASSERT(e)
Checks condition e and reports a fatal error if it's false.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
R__EXTERN TSystem * gSystem
Every RDF column is represented by exactly one RNTuple field.
void * GetImpl(Long64_t entry) final
void Connect(RPageSource &source, Long64_t entryOffset)
Connect the field and its subfields to the page source.
RNTupleColumnReader(RNTupleDS *ds, RFieldBase *protoField)
std::unique_ptr< RFieldBase::RValue > fValue
The memory location used to read from fField.
std::unique_ptr< RFieldBase > fField
The field backing the RDF column.
Long64_t fEntryOffset
For chains, the logical entry and the physical entry in any particular file can be different.
std::shared_ptr< void > fValuePtr
Used to reuse the object created by fValue when reconnecting sources.
RNTupleDS * fDataSource
The data source that owns this column reader.
~RNTupleColumnReader() override=default
RFieldBase * fProtoField
The prototype field from which fField is cloned.
Long64_t fLastEntry
Last entry number that was read.
void Disconnect(bool keepValue)
Base for an artificial field that transforms an RNTuple column containing the offset of collections i...
static void SetClusterBunchSize(RNTupleReadOptions &options, unsigned int val)
Abstract interface to read data from an ntuple.
RSharedDescriptorGuard GetSharedDescriptorGuard() const
Takes the read lock for the descriptor.
static std::unique_ptr< RPageSource > Create(std::string_view ntupleName, std::string_view location, const ROOT::RNTupleReadOptions &options=ROOT::RNTupleReadOptions())
Guess the concrete derived page source from the file name (location)
An artificial field that transforms an RNTuple column that contains the offset of collections into co...
std::vector< void * > Record_t
std::optional< std::pair< ULong64_t, ULong64_t > > fGlobalEntryRange
The RDataSource implementation for RNTuple.
void AddField(const ROOT::RNTupleDescriptor &desc, std::string_view colName, ROOT::DescriptorId_t fieldId, std::vector< RFieldInfo > fieldInfos, bool convertToRVec=true)
Provides the RDF column "colName" given the field identified by fieldID.
std::vector< std::pair< ULong64_t, ULong64_t > > GetEntryRanges() final
Return ranges of entries to distribute to tasks.
void ExecStaging()
The main function of the fThreadStaging background thread.
std::vector< std::unique_ptr< ROOT::Internal::RPageSource > > fStagingArea
The staging area is relevant for chains of files, i.e.
std::unique_ptr< ROOT::Detail::RDF::RColumnReaderBase > GetColumnReaders(unsigned int, std::string_view, const std::type_info &) final
If the other GetColumnReaders overload returns an empty vector, this overload will be called instead.
std::vector< std::unique_ptr< ROOT::RFieldBase > > fProtoFields
We prepare a prototype field for every column.
void SetNSlots(unsigned int nSlots) final
Inform RDataSource of the number of processing slots (i.e.
ROOT::RFieldBase * GetFieldWithTypeChecks(std::string_view fieldName, const std::type_info &tid)
std::vector< std::string > fFileNames
void InitSlot(unsigned int slot, ULong64_t firstEntry) final
Convenience method called at the start of the data processing associated to a slot.
RNTupleDS(std::unique_ptr< ROOT::Internal::RPageSource > pageSource)
std::string GetTypeName(std::string_view colName) const final
Type of a column as a string, e.g.
std::unordered_map< ROOT::DescriptorId_t, std::string > fFieldId2QualifiedName
Connects the IDs of active proto fields and their subfields to their fully qualified name (a....
std::string fNTupleName
The data source may be constructed with an ntuple name and a list of files.
void PrepareNextRanges()
Populates fNextRanges with the next set of entry ranges.
void StageNextSources()
Starting from fNextFileIndex, opens the next fNSlots files.
void Finalize() final
Convenience method called after concluding an event-loop.
std::vector< std::string > fColumnTypes
void Initialize() final
Convenience method called before starting an event-loop.
std::vector< std::string > fColumnNames
bool HasColumn(std::string_view colName) const final
Checks if the dataset has a certain column.
Record_t GetColumnReadersImpl(std::string_view name, const std::type_info &) final
type-erased vector of pointers to pointers to column values - one per slot
void FinalizeSlot(unsigned int slot) final
Convenience method called at the end of the data processing associated to a slot.
This type represents a sample identifier, to be used in conjunction with RDataFrame features such as ...
ROOT's RDataFrame offers a modern, high-level interface for analysis of data stored in TTree ,...
Base class for all ROOT issued exceptions.
A field translates read and write calls from/to underlying columns to/from tree values.
RConstSchemaIterator cbegin() const
const std::string & GetFieldName() const
static RResult< std::unique_ptr< RFieldBase > > Create(const std::string &fieldName, const std::string &typeName, const ROOT::RCreateFieldOptions &options, const ROOT::RNTupleDescriptor *desc, ROOT::DescriptorId_t fieldId)
Factory method to resurrect a field from the stored on-disk type information.
ROOT::DescriptorId_t GetOnDiskId() const
std::unique_ptr< RFieldBase > Clone(std::string_view newName) const
Copies the field and its subfields using a possibly new name and a new, unconnected set of columns.
std::uint64_t GetNRepetitions() const
const std::string & GetFieldName() const
const std::string & GetTypeName() const
The container field for an ntuple model, which itself has no physical representation.
std::vector< std::unique_ptr< RFieldBase > > ReleaseSubfields()
Moves all subfields into the returned vector.
void Attach(std::unique_ptr< RFieldBase > child)
A public version of the Attach method that allows piece-wise construction of the zero field.
The on-storage metadata of an RNTuple.
RFieldDescriptorIterable GetFieldIterable(const RFieldDescriptor &fieldDesc) const
const RFieldDescriptor & GetFieldDescriptor(ROOT::DescriptorId_t fieldId) const
ROOT::DescriptorId_t FindFieldId(std::string_view fieldName, ROOT::DescriptorId_t parentId) const
Common user-tunable settings for reading RNTuples.
virtual const char * Getenv(const char *env)
Get environment variable.
std::string TypeID2TypeName(const std::type_info &id)
Returns the name of a type starting from its type_info An empty string is returned in case of failure...
ROOT::RDataFrame FromRNTuple(std::string_view ntupleName, const std::vector< std::string > &fileNames, const std::pair< ULong64_t, ULong64_t > &range)
Internal overload of the function that allows passing a range of entries.
std::pair< std::vector< ROOT::Internal::RNTupleClusterBoundaries >, ROOT::NTupleSize_t > GetClustersAndEntries(std::string_view ntupleName, std::string_view location)
Retrieves the cluster boundaries and the number of entries for the input RNTuple.
void SetAllowFieldSubstitutions(RFieldZero &fieldZero, bool val)
void CallConnectPageSourceOnField(RFieldBase &, ROOT::Internal::RPageSource &)
std::vector< ROOT::Internal::RNTupleClusterBoundaries > GetClusterBoundaries(const RNTupleDescriptor &desc)
Return the cluster boundaries for each cluster in this RNTuple.
std::string GetRenormalizedTypeName(const std::string &metaNormalizedName)
Given a type name normalized by ROOT meta, renormalize it for RNTuple. E.g., insert std::prefix.
RDataFrame FromRNTuple(std::string_view ntupleName, std::string_view fileName)
std::vector< std::string > ColumnNames_t
std::uint64_t DescriptorId_t
Distriniguishes elements of the same type within a descriptor, e.g. different fields.
std::uint64_t NTupleSize_t
Integer type long enough to hold the maximum number of entries in a column.
Tag to let data sources use the native data type when creating a column reader.
The PrepareNextRanges() method populates the fNextRanges list with REntryRangeDS records.
std::string_view fFileName
Storage location of the current RNTuple.
ULong64_t fLastEntry
End entry index in fSource, e.g. the number of entries in the range is fLastEntry - fFirstEntry.
std::unique_ptr< ROOT::Internal::RPageSource > fSource
ULong64_t fFirstEntry
First entry index in fSource.