Dear experts,
I have a very basic question related to RDataFrame:
I would like to create branches and fill them in a loop within my c++ code.
Just like we used to do with TTrees.
what do I need to import in order to create a RDataFrame object?
How can I translate this code in an RDataFrame: Sign in to CERN
RDataFrame is an interface for data analysis and it is not a data format like TTree. I suggest you read the thorough documentation and try out a couple of tutorials. There is one in particular which might give you insights on creation of jagged arrays.
As an extremely simple kickstarter, consider
import ROOT
# Need this here because the type std::vector<std::vector<std::uint32_t>>
# is not automatically generated by ROOT. In general this may not be needed
ROOT.gInterpreter.GenerateDictionary(
"std::vector<std::vector<std::uint32_t>>","vector")
df = ROOT.RDataFrame(10)
snapdf = (
df.Define("myvec",
"std::vector<std::vector<std::uint32_t>>{{1,2,3}, {4,5,6}}")
.Snapshot("mytree", "myfile.root")
)