File tree Expand file tree Collapse file tree 2 files changed +21
-6
lines changed
Expand file tree Collapse file tree 2 files changed +21
-6
lines changed Original file line number Diff line number Diff line change @@ -222,21 +222,36 @@ struct RNTupleObjectReadingCapability : o2::framework::RootObjectReadingCapabili
222222 {
223223 auto context = new ImplementationContext;
224224
225- return new RootObjectReadingCapability{
225+ return new RootObjectReadingCapability
226+ {
226227 .name = " rntuple" ,
227- .lfn2objectPath = [](std::string s) {
228+ .lfn2objectPath = [](std::string s) -> std::string {
228229 std::replace (s.begin ()+1 , s.end (), ' /' , ' -' );
230+ #if __has_include(<ROOT/RFieldBase.hxx>)
231+ if (s.starts_with (" /" )) {
232+ return std::string (s.begin () + 1 , s.end ());
233+ } else {
234+ return s;
235+ } },
236+ #else
229237 if (s.starts_with (" /" )) {
230238 return s;
231239 } else {
232240 return " /" + s;
233241 } },
242+ #endif
243+ #if __has_include(<ROOT/RFieldBase.hxx>)
244+ .getHandle = getHandleByClass (" ROOT::RNTuple" ),
245+ .checkSupport = matchClassByName (" ROOT::RNTuple" ),
246+ #else
234247 .getHandle = getHandleByClass (" ROOT::Experimental::RNTuple" ),
235248 .checkSupport = matchClassByName (" ROOT::Experimental::RNTuple" ),
249+ #endif
236250 .factory = [context]() -> RootArrowFactory& {
237251 lazyLoadFactory (context->implementations , " O2FrameworkAnalysisRNTupleSupport:RNTupleObjectReadingImplementation" );
238252 return context->implementations .back ();
239- }};
253+ }
254+ };
240255 }
241256};
242257
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ TEST_CASE("RootTree2Fragment")
7373 // / A directory holding a tree
7474
7575 // / Create a simple TTree
76- TBufferFile * file = new TBufferFile (TBuffer::kWrite );
76+ auto * file = new TBufferFile (TBuffer::kWrite );
7777
7878 TTree t1 (" t1" , " a simple Tree with simple variables" );
7979 Float_t xyz[3 ];
@@ -519,7 +519,7 @@ TEST_CASE("RootTree2Dataset")
519519 validateContents (batch);
520520 }
521521
522- arrow::fs::FileLocator rnTupleLocator{outFs, " / rntuple" };
522+ arrow::fs::FileLocator rnTupleLocator{outFs, " rntuple" };
523523 // We write an RNTuple in the same TMemFile, using /rntuple as a location
524524 auto rntupleDestination = std::dynamic_pointer_cast<TDirectoryFileOutputStream>(*destination);
525525
@@ -530,7 +530,7 @@ TEST_CASE("RootTree2Dataset")
530530 }
531531
532532 // And now we can read back the RNTuple into a RecordBatch
533- arrow::dataset::FileSource writtenRntupleSource (" / rntuple" , outFs);
533+ arrow::dataset::FileSource writtenRntupleSource (" rntuple" , outFs);
534534
535535 REQUIRE (rNtupleFormat->IsSupported (writtenRntupleSource) == true );
536536
You can’t perform that action at this time.
0 commit comments