@@ -61,19 +61,16 @@ namespace Internal {
61
61
// / This field owns the collection offset field but instead of exposing the collection offsets it exposes
62
62
// / the collection sizes (offset(N+1) - offset(N)). For the time being, we offer this functionality only in RDataFrame.
63
63
// / TODO(jblomer): consider providing a general set of useful virtual fields as part of RNTuple.
64
- class RRDFCardinalityField final : public ROOT::Experimental:: RFieldBase {
64
+ class RRDFCardinalityField final : public ROOT::RFieldBase {
65
65
protected:
66
- std::unique_ptr<ROOT::Experimental:: RFieldBase> CloneImpl (std::string_view /* newName */ ) const final
66
+ std::unique_ptr<ROOT::RFieldBase> CloneImpl (std::string_view /* newName */ ) const final
67
67
{
68
68
return std::make_unique<RRDFCardinalityField>();
69
69
}
70
70
void ConstructValue (void *where) const final { *static_cast <std::size_t *>(where) = 0 ; }
71
71
72
72
public:
73
- RRDFCardinalityField ()
74
- : ROOT::Experimental::RFieldBase(" " , " std::size_t" , ROOT::ENTupleStructure::kLeaf , false /* isSimple */ )
75
- {
76
- }
73
+ RRDFCardinalityField () : ROOT::RFieldBase(" " , " std::size_t" , ROOT::ENTupleStructure::kLeaf , false /* isSimple */ ) {}
77
74
RRDFCardinalityField (RRDFCardinalityField &&other) = default ;
78
75
RRDFCardinalityField &operator =(RRDFCardinalityField &&other) = default ;
79
76
~RRDFCardinalityField () = default ;
@@ -122,11 +119,11 @@ class RRDFCardinalityField final : public ROOT::Experimental::RFieldBase {
122
119
* This is the implementation of `R_rdf_sizeof_column` in case `column` contains
123
120
* fixed-size arrays on disk.
124
121
*/
125
- class RArraySizeField final : public ROOT::Experimental:: RFieldBase {
122
+ class RArraySizeField final : public ROOT::RFieldBase {
126
123
private:
127
124
std::size_t fArrayLength ;
128
125
129
- std::unique_ptr<ROOT::Experimental:: RFieldBase> CloneImpl (std::string_view) const final
126
+ std::unique_ptr<ROOT::RFieldBase> CloneImpl (std::string_view) const final
130
127
{
131
128
return std::make_unique<RArraySizeField>(fArrayLength );
132
129
}
@@ -143,7 +140,7 @@ class RArraySizeField final : public ROOT::Experimental::RFieldBase {
143
140
144
141
public:
145
142
RArraySizeField (std::size_t arrayLength)
146
- : ROOT::Experimental:: RFieldBase(" " , " std::size_t" , ROOT::ENTupleStructure::kLeaf , false /* isSimple */ ),
143
+ : ROOT::RFieldBase(" " , " std::size_t" , ROOT::ENTupleStructure::kLeaf , false /* isSimple */ ),
147
144
fArrayLength (arrayLength)
148
145
{
149
146
}
@@ -160,7 +157,7 @@ class RArraySizeField final : public ROOT::Experimental::RFieldBase {
160
157
161
158
// / Every RDF column is represented by exactly one RNTuple field
162
159
class RNTupleColumnReader : public ROOT ::Detail::RDF::RColumnReaderBase {
163
- using RFieldBase = ROOT::Experimental:: RFieldBase;
160
+ using RFieldBase = ROOT::RFieldBase;
164
161
using RPageSource = ROOT::Experimental::Internal::RPageSource;
165
162
166
163
RNTupleDS *fDataSource ; // /< The data source that owns this column reader
@@ -199,7 +196,7 @@ class RNTupleColumnReader : public ROOT::Detail::RDF::RColumnReaderBase {
199
196
}
200
197
201
198
try {
202
- ROOT::Experimental:: Internal::CallConnectPageSourceOnField (*fField , source);
199
+ ROOT::Internal::CallConnectPageSourceOnField (*fField , source);
203
200
} catch (const ROOT::RException &err) {
204
201
auto onDiskType = source.GetSharedDescriptorGuard ()->GetFieldDescriptor (fField ->GetOnDiskId ()).GetTypeName ();
205
202
std::string msg = " RNTupleDS: invalid type \" " + fField ->GetTypeName () + " \" for column \" " +
@@ -314,15 +311,15 @@ void RNTupleDS::AddField(const RNTupleDescriptor &desc, std::string_view colName
314
311
315
312
// The fieldID could be the root field or the class of fieldId might not be loaded.
316
313
// In these cases, only the inner fields are exposed as RDF columns.
317
- auto fieldOrException = RFieldBase::Create (fieldDesc.GetFieldName (), fieldDesc.GetTypeName ());
314
+ auto fieldOrException = ROOT:: RFieldBase::Create (fieldDesc.GetFieldName (), fieldDesc.GetTypeName ());
318
315
if (!fieldOrException)
319
316
return ;
320
317
auto valueField = fieldOrException.Unwrap ();
321
318
valueField->SetOnDiskId (fieldId);
322
319
for (auto &f : *valueField) {
323
320
f.SetOnDiskId (desc.FindFieldId (f.GetFieldName (), f.GetParent ()->GetOnDiskId ()));
324
321
}
325
- std::unique_ptr<RFieldBase> cardinalityField;
322
+ std::unique_ptr<ROOT:: RFieldBase> cardinalityField;
326
323
// Collections get the additional "number of" RDF column (e.g. "R_rdf_sizeof_tracks")
327
324
if (!fieldInfos.empty ()) {
328
325
const auto &info = fieldInfos.back ();
@@ -339,16 +336,15 @@ void RNTupleDS::AddField(const RNTupleDescriptor &desc, std::string_view colName
339
336
340
337
if (fieldInfo.fNRepetitions > 0 ) {
341
338
// Fixed-size array, read it as ROOT::RVec in memory
342
- valueField =
343
- std::make_unique<ROOT::Experimental::RArrayAsRVecField>(" " , std::move (valueField), fieldInfo.fNRepetitions );
339
+ valueField = std::make_unique<ROOT::RArrayAsRVecField>(" " , std::move (valueField), fieldInfo.fNRepetitions );
344
340
} else {
345
341
// Actual collection. A std::vector or ROOT::RVec gets added as a ROOT::RVec. All other collection types keep
346
342
// their original type.
347
343
if (convertToRVec) {
348
- valueField = std::make_unique<ROOT::Experimental:: RRVecField>(" " , std::move (valueField));
344
+ valueField = std::make_unique<ROOT::RRVecField>(" " , std::move (valueField));
349
345
} else {
350
346
auto outerFieldType = desc.GetFieldDescriptor (fieldInfo.fFieldId ).GetTypeName ();
351
- valueField = RFieldBase::Create (" " , outerFieldType).Unwrap ();
347
+ valueField = ROOT:: RFieldBase::Create (" " , outerFieldType).Unwrap ();
352
348
}
353
349
}
354
350
@@ -359,11 +355,11 @@ void RNTupleDS::AddField(const RNTupleDescriptor &desc, std::string_view colName
359
355
if (i != fieldInfos.rbegin ()) {
360
356
if (fieldInfo.fNRepetitions > 0 ) {
361
357
// This collection level refers to a fixed-size array
362
- cardinalityField = std::make_unique<ROOT::Experimental::RArrayAsRVecField>( " " , std::move (cardinalityField),
363
- fieldInfo.fNRepetitions );
358
+ cardinalityField =
359
+ std::make_unique<ROOT::RArrayAsRVecField>( " " , std::move (cardinalityField), fieldInfo.fNRepetitions );
364
360
} else {
365
361
// This collection level refers to an RVec
366
- cardinalityField = std::make_unique<ROOT::Experimental:: RRVecField>(" " , std::move (cardinalityField));
362
+ cardinalityField = std::make_unique<ROOT::RRVecField>(" " , std::move (cardinalityField));
367
363
}
368
364
369
365
cardinalityField->SetOnDiskId (fieldInfo.fFieldId );
@@ -450,19 +446,20 @@ RNTupleDS::GetColumnReaders(unsigned int slot, std::string_view name, const std:
450
446
const auto index = std::distance (fColumnNames .begin (), std::find (fColumnNames .begin (), fColumnNames .end (), name));
451
447
const auto requestedType = ROOT::Internal::GetRenormalizedTypeName (ROOT::Internal::RDF::TypeID2TypeName (tid));
452
448
453
- RFieldBase *field;
449
+ ROOT:: RFieldBase *field;
454
450
// If the field corresponding to the provided name is not a cardinality column and the requested type is different
455
451
// from the proto field that was created when the data source was constructed, we first have to create an
456
452
// alternative proto field for the column reader. Otherwise, we can directly use the existing proto field.
457
453
if (name.substr (0 , 13 ) != " R_rdf_sizeof_" && requestedType != fColumnTypes [index ]) {
458
454
auto &altProtoFields = fAlternativeProtoFields [index ];
459
- auto altProtoField = std::find_if (
460
- altProtoFields.begin (), altProtoFields.end (),
461
- [&requestedType](const std::unique_ptr<RFieldBase> &fld) { return fld->GetTypeName () == requestedType; });
455
+ auto altProtoField = std::find_if (altProtoFields.begin (), altProtoFields.end (),
456
+ [&requestedType](const std::unique_ptr<ROOT::RFieldBase> &fld) {
457
+ return fld->GetTypeName () == requestedType;
458
+ });
462
459
if (altProtoField != altProtoFields.end ()) {
463
460
field = altProtoField->get ();
464
461
} else {
465
- auto newAltProtoFieldOrException = RFieldBase::Create (std::string (name), requestedType);
462
+ auto newAltProtoFieldOrException = ROOT:: RFieldBase::Create (std::string (name), requestedType);
466
463
if (!newAltProtoFieldOrException) {
467
464
throw std::runtime_error (" RNTupleDS: Could not create field with type \" " + requestedType +
468
465
" \" for column \" " + std::string (name));
0 commit comments