Dear all,
I am having some issues with the option Take in RDataFrame.
I have an action (two filters and a Take) to repeat on multiple columns with similar names of the same dataframe, so I implemented some for loops:
auto d1 = ROOT::RDataFrame("Events", "./../trees/tree_general_cut.root");
for (int k = -120; k <= 120; k += 20)
{
if (k == 0)
continue;
std::string_view data_name = "nominal_z==" + std::to_string(k);
for (int j = 0; j < 20; j++)
{
std::string_view filter_name = "rdfentry_ % 20 ==" + std::to_string(j);
auto data = new Double_t[n];
for (int i = 1; i < 27; i++)
{
std::string_view column_name = "numclusterod" + std::to_string(i);
auto v1 = Mean(d1.Filter(data_name)
.Filter(filter_name)
.Take<double, ROOT::VecOps::RVec<double>>(column_name)
.GetValue());
}
}
}
Executing the macro, it seems that the method Take has some problems with the string I passed to it.
libc++abi.dylib: terminating with uncaught exception of type std::runtime_error: Failed to tokenize expression:
numclusterod1
It seems strange that I don’t have problem passing a filter defining a string, but I cannot make the same operation with the action Take().
Does anyone have an idea of what this might be?
Thanks a lot.
_ROOT Version: 6.26/06
_Platform: macOS 10.15.7
_Compiler: clang-1200.0.32.29