RDataFrame Snapshot with a Float_t array branch


ROOT Version: 6.28/06
Platform: Ubuntu 20.04
Compiler: GCC 9.4.0 (LCG 104a)


Greetings,

I’m currently trying to load a file to an RDF, do some operations and then save the file via Snapshot. The original file has its branches types as “Float_t”, whether for arrays or single values.

I’d like to save my new columns following the files “convention”, so when using a custom function to define an array I’d have something like Float_t* function(RVecF, RVecF); and then call it inside Define(). This seems to work properly before Snapshot(), but after I call it I get

Error in <TTree::Branch>: The pointer specified for CustomColumn is not of a class known to ROOT
RDataFrame::Run: event loop was interrupted

.

Is it possible for me to have Float_t type custom branches after Snapshotting, or am I forced to use either STL vector or RVec? These two options do work properly, e.g. std::vector<Float_t> function(RVecF, RVecF); is fine.

I’m using PyRoot with gInterpreter for the custom operations.

Thanks,
Nico

I guess @vpadulan can help.

Dear @toicca ,

Thanks for reaching out to the forum!

As a general remark, I believe for every Float_t * branch it would be useful to have its size branch also stored in the TTree, I guess this is already the case with your input data but I don’t see it specified in your post.

In any case, could you send us a simple reproducer for further testing?

Cheers,
Vincenzo

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.