This tutorial shows how the content of an RDataFrame can be converted to an RTensor object.
void tmva002_RDataFrameAsTensor()
{
auto df2 = df.Define("x", "1.f*rdfentry_").Define("y", "-1.f*rdfentry_");
std::cout <<
"RTensor from an RDataFrame:\n" <<
x <<
"\n\n";
std::cout << "RTensor from a single column of the RDataFrame:\n" << x2 << "\n\n";
}
ROOT's RDataFrame offers a modern, high-level interface for analysis of data stored in TTree ,...
RTensor< T > AsTensor(U &dataframe, std::vector< std::string > columns={}, MemoryLayout layout=MemoryLayout::RowMajor)
Convert the content of an RDataFrame to an RTensor.
RTensor from an RDataFrame:
{ { 0, -0 } { 1, -1 } { 2, -2 } { 3, -3 } { 4, -4 } }
RTensor from a single column of the RDataFrame:
{ { 0 } { 1 } { 2 } { 3 } { 4 } }
- Date
- December 2018
- Author
- Stefan Wunsch
Definition in file tmva002_RDataFrameAsTensor.C.