I’m trying to use RDataFrame’s Fill action to fill a ttree instead of snapshot so I can save defined branches as c-style arrays. So the custom class looks something like:
where nPassingJets and passingJetPt are defined by Define statements earlier, but I’m getting the error
/usr/include/root/ROOT/RDF/RVariedAction.hxx:119:75: error: cannot pass object of non-trivial type 'ROOT::VecOps::RVec<float>' through variadic method; call will abort at runtime [-Wnon-pod-varargs]
Is what I’m attempting here not possible? I tried taking out the RVec branch and just filled a tree with ints but even then when I saved the tree to a file all the results were nonsense. If I can’t do this, is there any way to achieve what I’m attempting, and save defined branches as arrays?
ROOT Version: Not Provided Platform: Not Provided Compiler: Not Provided
In principle what you are trying to do should work, let’s try to understand why it doesn’t. First, can I ask you to share a full reproducer of the problem, at least with the code that calls RDataFrame::Fill ?
Then, looking at your code above, my first suggestion is converting that TTree * data mamber to a std::unique_ptr or at least std::shared_ptr, currently you are creating the TTree with new but never deleteing it. Also, the Signature of the Fill method should take the vector by const ref as in const ROOT::RVecF &, to avoid an extra copy.
/builddir/build/BUILD/root-6.28.08/x86_64-redhat-linux-gnu/include/ROOT/RDF/RAction.hxx:105:53: error: cannot pass object of non-trivial type 'ROOT::VecOps::RVec<float>' through variadic method; call will abort at runtime [-Wnon-pod-varargs]
fHelper.Exec(slot, fValues[slot][S]->template Get<ColTypes>(entry)...);
^